Posts

Showing posts from September, 2014

objective c - How to prevent the user from choosing some file types? -

i want prevent user choose file types when opens nsopenpanel. can @ moment preventing him accessing files , allow want allow files except some. nsopenpanel*openpane = [nsopenpanl openpanel]; [openpanel setallowfiletypes(nsarray*)]; but want user choose files except files not choose files out of files. implement delegate panel. nsopenpanel inherits delegate property superclass nssavepanel . in delegate, implement either: - (bool) panel:(id)sender shouldenableurl:(nsurl*)url; or: - (bool) panel:(id)sender validateurl:(nsurl*)url error:(nserror**)outerror; you should use first 1 if can decide whether given url should enabled , efficiently. called frequently. controls whether or not given url selectable in panel. you should use second 1 if decision slow or requires significant cpu or i/o. called when user clicks open button. that's not best user experience. it's better prevent user making bad choice let them make bad choice , reject @ last moment. a

android - What is wrong with the if/else code in Java? its not working -

this question has answer here: how compare strings in java? 23 answers i'm trying programme in android, if/else code not working. basically, quiz application determines whether person's answers correct or not. whatever answer, output output given in 'else'. if(message=="panama canal"){ answer="correct!"; } else { answer="totally wrong"; } in java need compare strings equals method. written comparing if 2 same object.

Inserting data in mysql using vb.net (n-tier) -

there's can me vb.codes? i'm new in vb.net , want know how add data in mysql database using n-tier in vb.net. may current code in adding data: data layer: public function adddata() datatable dim mycommand string = "insert tblitems values (@itemcode, @itemname, @itemdescription, @itemtype, @itempricing, @itemonstock, @itemprice, @datemod)" con.open() dim sda new mysqldataadapter(mycommand, con) dim dt datatable = new datatable sda.fill(dt) return dt end function sorry code. don't know how can use in bll , pl. please me. want learn of guys.. ps: sorry english i'm 14 yr old , want learn programming. did research can't find i'm looking for. in advance. to insert new record in datatable need execute command , provide values sent database table. you need this. public function adddata(itmcode string, itmname string.... omitted other values) integer dim mycommand string = "insert tblitems values "

c# - End Point Not found in WCF Restful Service -

i creating sample wcf service test 1 of client. getting result using soap, rest not working. shows "endpoint not found" error. here web.config wcf service. can tells me what's wrong config file. <?xml version="1.0"?> <configuration> <appsettings> <add key="aspnet:usetaskfriendlysynchronizationcontext" value="true" /> </appsettings> <system.web> <compilation debug="true" targetframework="4.5" /> <httpruntime targetframework="4.5"/> </system.web> <system.servicemodel> <behaviors> <servicebehaviors> <behavior name="web"> <!-- avoid disclosing metadata information, set values below false before deployment --> <servicemetadata httpgetenabled="true" httpsgetenabled="true"/> <!-- receive exception details in faults debugging purposes, set value below true. set f

javascript - How to pass list of objects from spring mvc to jquery using ajax and json? -

can please suggest me, how pass , display list of objects springmvc jsp page jquery using ajax, jquery , json. here controller: @requestmapping(value="/viewuserlist", method=requestmethod.get) public @responsebody list<wizardto> retriveuserlist(@requestparam(value = "role") string role) { wizarddao dao = new wizarddao(); list<wizardto> userlist= dao.getuserlist(role); return userlist; /*string str="returned controller"; return str;*/ // working } and here jquery code (inside jsp file request , response handling ) <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script > function doajax(){ alert("in doajax"); // jquery("#list").jqgrid({ $.ajax({ url: '\viewuserlist', type: 'get', data: "role="+ $("#myrole").val(),

C++ OpenGL flickering Issues -

im having problem, when render 1 cube it's okay, if add multiple cubes of them start flickering.. might because intefering each other im using double dubbers shouldn't that. here code of render method for (std::vector<entity *>::iterator iterator = entityarray->begin(); iterator != entityarray->end(); iterator++) { entity *entity = *iterator; if (entity->getvertexbuffer() != null) { glclear(gl_color_buffer_bit | gl_depth_buffer_bit); gluseprogram(entity->getvertexbuffer()->getshader()->getprogramhandle()); glloadidentity(); glulookat(_currentcamera->getposition().x, _currentcamera->getposition().y, _currentcamera->getposition().z, _currentcamera->geteyevector().x, _currentcamera->geteyevector().y, _currentcamera->geteyevector().z, _currentcamera->getupvector().x, _currentcamera->getupvector().y,

Batch File to archive files based on their name -

i have text files need archive daily , automate it. there 100 user folders , each user folder has 20 subfolders. ex user folder structure: d:\logs\john hayse\01 d:\logs\john hayse\02 d:\logs\john hayse\03 etc... d:\logs\john hayse\20 ex filenames: john.hayes.t01.daily.log.txt john.hayes.t02.daily.log.txt john.hayes.t04.tasks.to.complete.txt billy.gavin.t02.daily.logs.txt i started righting batch file hundreds of if exist statements this: if exist d:\john.hayes.t01* move d:\john.hayes.t01* d:\logs\john hayse\01" if exist d:\john.hayes.t02* move d:\john.hayes.t02* d:\logs\john hayse\02" if create separate text file containing users folders: dir "d\logs" /b /a:d >d:\userfolderlist.txt how use create if exist statement once , loop through of users files , place them in proper user folder , in corresponding subfolder ##? ex. d:\john.hayes.t02.daily.log.txt archive d:\logs\john hayes\02 the users files start firstnam

asp.net mvc 4 - Azure In Role Caching Doesn't start on server with "Not running in a hosted service or the Development Fabric." -

i started use azure in-role caching , works great in azure compute emulator on local machine, not on server. i've dealed problems, lack of msshrtmi.dll on server, can't understand why error: not running in hosted service or development fabric. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.invalidoperationexception: not running in hosted service or development fabric. source error: unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. stack trace: [invalidoperationexception: not running in hosted service or development fabric.] microsoft.windowsazure.diagnostics.diagnosticmonitor.getdefaultstartupinfoforcurrentroleinstance() +535 microsoft.windowsazure.diagnostics.diagnosticmonitortracelistener..ctor

About String object and pass-by-value in Java -

this question has answer here: immutability of strings in java 23 answers i khow java pass-by-value, , when pass object method , change it,it change when out method. can't string object. example: public class text { public void change(string a) { = "ha"; } public static void main(string[] args) { text = new text(); string b = "hi"; a.change(b); system.out.println(b); } } a = "ha"; that statement analogous this: a = new string("ha"); so if string not immutable, you'd have issue pointing a new string object. what happening here "compiler magic" or "syntactic sugar" make easier declare string.

data mining - ID3 algorithm - Which attribute to choose when I have the same gain for all attributes? -

i have 3 attributes temperature, humidity , wind? applying id3 algorithm on data attributes have same information gain of them. attribute should choose continue algorithm? have choose 1 arbitrary or have control of them? you can add level , pick 1 gives maximum gain @ second level. if results in tie, try additional level. guess means have try all.

twitter bootstrap - MVC 4 Styles.Render & Scripts.Render Clarification -

i'm using asp.net mvc 4 bootstrap , i've noticed project little bit different lot of articles , tutorials "building site bootstrap", keep mention use of minified files of javascript , css (bootstrap.min.css, bootstrap.min.js) , have files without min although files in directory. i read these files don't point of it, maybe can clarify use of them , if need add reference them in bundle config ? my code looks : _layout.cshtml: <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@viewbag.title - asp.net application</title> @styles.render("~/content/css") @scripts.render("~/bundles/modernizr") </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header">

jquery autocomplete with ajax complete guide -

can please explain me working example of j-query auto-complete ajax. need put on website have no idea of it.i have tried j-query website explanations not useful. try tutorial: http://www.pontikis.net/blog/jquery-ui-autocomplete-step-by-step in future try google need , after post stackoverflow. googled "jquery autocomplete ajax example" ;-)

smalltalk - pharo creating a global variable like transcript -

i want create variable named mamegap accessible every where. can print words transcript ex. method of class. want mamegap too. i tried mamegap:= myclass new. smalltalk at: #mymap put: mamegap. i want access mamegap this dosomething: avar |x| x:= mamegap getint. ^x*3 you have do: smalltalk at: #mamegap put: myclass new also can put there class object, smalltalk at: #mamegap put: myclass and sen class-side messages

Android java unable to load class -

hi unable load class in android app , can load basic class when initialize context in class not able load it public class main { // initalize context context mcontext; public main(context mcontext){ this.mcontext = mcontext; } public boolean main() { log.d("mylog", "main() called when there context not initialized above"); // code here } } my class loading code try{ final file tmpdir = context.getdir("dex", 0); final dexclassloader classloader = new dexclassloader(libpath, tmpdir.getabsolutepath(), null, this.getclass().getclassloader()); final class<object> classtoload = (class<object>) classloader.loadclass("com.myproject.test.dumy_class"); // package plus main class final object myinstance = classtoload.newinstance(); // throwing exception here } } catch (exception e) { // exception thrown @ statement : final object myinstance = classtoload.newinstance();

javascript - Getting source of a page after it's rendered in a templating engine? -

so i'm doing screen scraping on site js heavy. uses client side templating engine renders content. tried using jquery , worked in console, not on server (nodejs), obviously. i looked @ few libraries python , java, , seem able handle want, prefer js solution works node server. is there way complete source of page after it's rendered, using node? i used jsdom screen scrapping , code goes here... var jsdom = require( 'jsdom' ); jsdom.env( { url: <give_url_of_page_u_want_to_scarpe>, scripts: [ "http://code.jquery.com/jquery.js" ], done: function( error, window ) { var $ = window.$; // required page loaded in $.... //you can write javascript or jquery code ever want } } );

html5 - PHP emails not sending -

been trying working , sending email website emails aren't coming through. it easy. blocked actual sending email (for both areas) thanks help! my php code in index.php <?php $field_name = $_post['name']; $field_email = $_post['email']; $field_message = $_post['message']; ini_set("smtp","ssl://smtp.gmail.com"); ini_set("smtp_port","465"); $mail_to = 'coverupemail@email.com'; $subject = 'message portfolio visitor '.$field_name; $body_message = 'from: '.$field_name."\n"; $body_message .= 'e-mail: '.$field_email."\n"; $body_message .= 'message: '.$field_message; $headers = 'from: '.$email."\r\n"; $headers .= 'reply-to: '.$email."\r\n"; $mail_status = mail($mail_to, $subject, $body_message, $headers); if ($mail_status) { ?> <script language="javascript" type="text/javascript">

php - Define post parameters using annotations - Symfony2 -

i have controller on project built on top of symfony2 , know if there way define post method parameters using method annotations how can method parameters. i'm not talking url parameters - i'm talking naming the payload parameters automatically assigned method parameters. /** * @route("/path/{parameter}") * @method("get") */ public function mymethod($parameter){ } /** * @route("/path/") * @method("post") * @parameter("parameter") <--- this. */ public function mymethod($parameter){ } is feasible sensio bundle or support url parameters? thank you. the automatic injection of route placeholders (not get/post parameters!) done symfony framework, has nothing symfony framework. when parameter name matches route attribute name, it'll injected. doesn't work neither post nor parameters. however, can create own parameter converter (feature of sensioframeworkextrabundle) make yourself.

c# - Text Font and Colors in Visual Studio 2013 - Can't remove white border on the selected area -

Image
this question has answer here: how change background color of active line in visual studio find results window? 4 answers i having tough time trying remove white border in visual studio theme, border on selected area. in playing around font , colors options looks highlight current line (active) item foreground setting 1 need change. going tools --> options --> fonts , colors. this set on dark theme.

Matlab - How to improve efficiency of two port matrix calculations? -

i'm looking way speed simple 2 port matrix calculations. see below code example i'm doing currently. in essence, create [nx1] frequency vector first. loop through frequency vector , create [2x2] matrices h1 , h2 (all functions of f). bit of simple matrix math including matrix left division '\' later, , got result pb [nx1] vector. problem loop - takes long time calculate , i'm looking way improve efficiency of calculations. tried assembling problem using [2x2xn] transfer matrices, mtimes operation cannot handle 3-d multiplications. can please give me idea how can approach such calculation without need looping through f? many thanks: svenr % calculate frequency , wave number vector f = linspace(20,200,400); w = 2.*pi.*f; % calculation each frequency w for i=1:length(w) h1(i,1) = {[1, rho*c*k(i)^2 / (crad*pi); 0,1]}; h2(i,1) = {[1, 1i.*w(i).*mp; 0, 1]}; hzin(i,1) = {h1{i,1}*h2{i,1}}; temp_mat = hzin{i,1}*[1; 0]; zin(i,1) = temp_mat(1,1)/

java - Swing JFrame button action listener not working -

i want move 1 jframe jframe after pressing jbutton named login . attaching both frame code below, if there correction or 1 want give me instruction or guideline can give. import java.awt.dimension; import java.awt.rectangle; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.*; public class login implements actionlistener { private jframe jframe = null; private jpanel jcontentpane = null; private jlabel id = null; private jtextfield userid = null; private jlabel pass = null; private jpasswordfield password = null; private jbutton login = null; private jframe getjframe() { if (jframe == null) { jframe = new jframe(); jframe.setsize(new dimension(346, 301)); jframe.setresizable( false ); jframe.settitle("shree datta digambar"); jframe.setdefaultcloseoperation(jframe.exit_on_close); jframe.setcontentpane(getjcontentpane()); } retur

python - Getting Tkinter text widget to show the latest addition -

this question has answer here: python tkinter text area set cursor end 1 answer my application uses tkinter text widget display user every time calls api. api called numerous times, text displayed goes beyond scope of text area. so, user has go on text area , scroll know present status. there way can text widget scroll little down every time new comes up? the program following every time has say: text.insert(index,'fetching names, authentication tokens , designations...\n') index+=1 root.update_idletasks() i think after see method: text.see(end) % example

peoplesoft - Calculations with PS Output fields using PS Client -

Image
i working peoplesoft client 8.53 , need assistance on working output fields. problem statement: have union query. both selections (query 1, query 2) fetchng count. now, want calculation count selection1 , count selection2. below screenshot of sample data 2 selections showing 1 output field( term ) selection1, there count selection2. kindly me understand if there way calculations output fields, have in oracle. your support appreciated! can share text of ideal sql query? also, note union consolidate counts identical in result single row. select 8 count dual union select 8 dual my first thought might better of join. join allow add 2 sums.

Perl adding array with another array -

i cam across code below online it's trying add 2 array. can explain calculating 14? my @a = (1,2,5)+(8,9); print "@a"; output: 14 output 14 $a[0] 14 => 5+9 + operator imposes scalar context on both lists last elements taken , added, # in scalar context $x assigned last element $x = (1,2,5); print "\$x $x\n"; outputs $x 5 warnings pragma complain, giving hint fishy going on, useless use of constant (8) in void context

Get URL (Link) for facebook post using post ID -

i trying post company facebook page.the link application developed feeds of information applications database uses facebook api. i want create link eg www.facebook.com/{postid} take me specific post.i have tried numerous articles , seem send me 404 page. please help. thanks my application uses facebook api accepts data related facebook page content (i.e posts,photo's,statuses etc).part of api saves actual post id pertaining post e.g. 302961133120433_576487772434433 applications database.as may see post id has 2 parts separated underscore.so needed make url based on post id. solution link is:(2 parts of it,first being page id , second being actual post id) hope helps.

java - Assign a pool to a specific stateless bean in JBoss EAP 6.1 -

i can see how 1 can control size of global pool stateless session beans. however, able have new pool applies 1 type of stateless bean. way, stateless beans 1 pooled usual slsb-strict-max-pool , , 1 bean have own pool. is possible in jboss eap 6.1? use @org.jboss.ejb3.annotation.pool(value="mypoolname") annotation on ejb referencing custom pool defined in standalone.xml : <pools> <bean-instance-pools> <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="minutes" /> <strict-max-pool name="mdb-strict-max-pool" max-pool-size="80" instance-acquisition-timeout="1" instance-acquisition-timeout-unit="minutes" />

javascript - Script tag not seen in html source -

i have angular service called toursevice.js: var service = angular.module('tourtservice', []); service.factory('tournament', function($http) { return { dologin: function(token) { return $http.get('/api/tournament/user/' + token); } }; }); here main app page, holds includes: <!doctype html> <html> <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"> <script src="../bower_components/jquery/dist/jquery.min.js"></script> <script src="../bower_components/angular/angular.min.js"></script> <script src="../bower_components/angular-route/angular-route.min.js"></script> <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="../js/services/loginservice.js"></script> <script src="../js/services/tourservice

c - Preprocessor #define LIBVER {'1','5'} check -

i receiving libraries include files, version described below: #define msif_dmx_libver {'1','5'} //lib version problem want make conditional compilation based on lib version. example there more enums in version 1.5 1.4, use. when tried with: #if (msif_dmx_libver == {'1','5'}) compilation failed following error message: error: token "{" not valid in preprocessor expressions is possible make preprocessor condition on case? don't want modify every header file 3rd party.

How to findout the client machine has installed flash player using javascript? -

cross browser flash detection in javascript i have use flash_detect.js mentioned in above link. works fine in ie8 , chrome 29. not working in ff 25. can please me here resolve issue? else suggest if other better ways this. hope you: detect flash javascript http://www.blangdon.com/writing/about/detect-flash-with-javascript/ or http://www.javascriptkit.com/script/script2/plugindetect.shtml

mysql - HTML Form button in PHP While loop -

i have while loop in php selects data database i want have complete button each row returned which, when pressed run sql query change value of status column of particular row my while loop is: $stmt = $pdo_conn->prepare("select * messages status = :status , (assigned_to = :assigned_to1 or assigned_to = :assigned_to2) "); $stmt->execute(array(':status' => '', ':assigned_to1' => $user_result["sequence"], ':assigned_to2' => '')); $records = $stmt->fetchall(pdo::fetch_assoc); $i=0; if(count($records) > 0) { echo '<tr> <td colspan="7">you have '.count($records).' messages</td> </tr>'; foreach($records $messages) { $i++; echo '<tr> <td>'.adminnamelookup($messages["assigned_to"]).'</td> <td>'.$messages["caller_company"].'</td> &l

Eclipse exported project in Android Studio and add remote dependency in build.gradle -

i have exported android project in eclipse gradle build files, , imported in android studio. i have updated android studio today v0.6.0 built on june 05, 2014. as remote dependency have added appcompat dependencies works fine expected. compile 'com.android.support:appcompat-v7:19.+' but when try add other libraries such smoothprogressbar , actionbarsherlock , nineoldandroids , etc, fails. when run app shows following in gradle build tab: error:a problem occurred configuring root project 'myapp'. > not resolve dependencies configuration ':_debugcompile'. > not find com.github.castorflex.smoothprogressbar:library:0.5.1. required by: :myapp:unspecified and when sync project gradle file, shows following in gradle sync tab: error:com.github.castorflex.smoothprogressbar:library:0.5.1 (double-click here find usages.) i tried empty new project , add remote dependency mentioned libraries(sherlock , etc) worked expected. i gues

Mysql returns array string but want in numbers -

i have table 2 rows uid & ids 1 & 2.3 2 & 5 3 & 4 4 & 1.2 etc write query gruop_concat() query is select * tbltable tableid not in( select tableid `tblbooking` restaurantid = 1 , date(starttime) = date(p_starttime) , time(starttime) >= time(p_starttime) , time(endtime) <= time(p_endtime) ) , noofseats >= p_noofseats it returns "2,3,4,5,1,2" want comma separated values not string 2,3,4,5,1,2 this exact thing substring select substring_index(substring_index(maintable.choices,',',othertable.id),',',-1) choice maintable inner join othertable on (length(choices)>0 , substring_index(substring_index(choices,',',othertable.id),',',-1) <> substring_index(substring_index(choices,',',othertable.id-1),',', -1)); please check link http://www.tero.co.uk/scripts/mysql.php thanks .

c# - Find first record based on start of string or until string is empty -

i have string lets this var number = "02000123456"; and have list of records hold designation/number. mind has gone blank in trying figure out, want find first record match first 5 digits , if none, first 4 digits , if none, 3 digits , on. i tried splitting first 5 digits array , doing query using array up, returning of matches. i hoping doable without using loops. , using linq. is possible write in single line or couple of lines without need write foreach/for loop. basically want able go var record = context.numbers.where(x => x.designation.startswith(number.substring(0,5)).firstordefault(). but being able change length of substring() until record populated or first 5 digits/characters have been exhausted. the pure linq solution is new []{5,4,3,2,1}.select(len => context.numbers.firstordefault(x => x.designation.startswith(number.substring(0, len)))).firstordefault(i => != null); the other base sequence initialization enumerable.r

javascript - Ember.js: How to observe when a value in an input field changes -

i need create simple html input text field in ember.js app. value particular input box not bound specific model. when input text box blurs or loses focus, need able run javascript. in template, have far: {{input valuebinding="pitchersalary" placeholder=0}} i tried observing value of pitchersalary doing following in controller without luck: myapp.optimalcontroller = ember.objectcontroller.extend({ pitchersalaryobserver: function () { var self = this; console.log("changing...."); }.observes('pitchersalary'), }); what's correct way of doing this? you isn't backed model, yet controller saying it's backed model. it's you're confusing ember, wants save model, should backing controller, finds no model. objectcontroller proxies properties to/from controller model, , when has no model, yells misuse. bad: objectcontroller without model http://emberjs.jsbin.com/niyawido/3/edit good: objectcontroller model

com - Declare Function statment VBA to VB.Net and array dimensionality -

i have object wrapper of xll functions in vba object, object trying translate vb.net, com dll add-in. vba declares xll functions so: private declare function externalfunction lib "c:\mylibrary.xll" _ (byval x double, byval y double, byval arr1d() double, _ byval arr2d() double, byval resultarray() double, byval errormssg string) _ long of first 2 array arguments, first one-dimensional , second two-dimensional. because sending 2d array, vb.net forces me change part of declaration from: arr2d() double to arr2d(,) double should work ok in context of com? i've spent long time vetting every single input , still error object disconnected clients. missing something, i"m worried function declare , array rank, happy in vba, might not happy now. (also, on side note, curiously, note arguments declared byval--while function change resultarray , errormessage (those real returns...). how byval declaration works in vba--which does. problem should byref, , vb.net l

html - CSS Set width of an element -

i trying set width of element progress width between 2 other elements. here html code using <span class="current_rank"><?php echo $this->current_rank;?></span> <div class="progress"> <div class="progress-bar" role="progressbar"></div> </div> <span class="next_rank"><?php echo $this->next_rank;?></span> i trying width of progress bar width between 2 <span>'s possible css? update .progress { width: 550px; height: 15px; margin-bottom: 10px; overflow: hidden; background-color: #666; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .progress-bar { width: 0; height: 100%; font-size: 12px; line-height: 15px; color: #333; text-align: center; background-color: #ffd700; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);

Google Script: How to apply Data Validation Rule for Specific Sheet when somone add New Rows -

situation: i have following script, runs when add new rows. script should detect sheet , apply datavalidation or action when specific sheet have new rows. problem: this script run apply datavalidation sheet called "isp1", when add new rows in sheet "isp2" re apply datavalidation in sheet "isp1". some part of script should run every sheets somes part when specific sheet have new rows. function addnew rows: a link script: function initializetrigger(){ // run once create trigger if necessary var sheet = spreadsheetapp.getactive(); scriptapp.newtrigger("datavalidation") .forspreadsheet(sheet) .onchange() .create(); } function datavalidation(e){ logger.log(e.changetype); if(e.changetype=='insert_row'){ // //datavalidation - in column b var cell1 = spreadsheetapp.getactivesheet().getrange('b3:b'); var rule1 = spreadsheetapp.newdatavalidation() .setallowinvalid(false).sethelptext(&q

php - How to retrieve the headers from a SoapFault -

i'm using php's soapclient connect webservice (which out of control). 1 of soapfaults i'm receiving follows (formatted readability): <?xml version="1.0" encoding="utf-8"?> <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:header> <infolog xmlns="infolog" xmlns:i="http://www.w3.org/2001/xmlschema-instance"> <infologmessage xmlns="http://schemas.datacontract.org/2004/07/microsoft.dynamics.ax.framework.services"> <infologmessagetype>error</infologmessagetype> <message>customer 6729 not found.</message> </infologmessage> </infolog> </s:header> <s:body> <s:fault> <faultcode>s:client</faultcode> <faultstring xml:lang="en-us">request failed. see exception log details.</faultstring> <de

c# - Unexpected behaviour with LINQ to Entities, possible bug? -

background log searches in application , want present ratio between different types of searches in statistics view. issue wanted keep efficient , condensed possible in linq still keep clear considering limitations of can use in linq query, attempt this: (please disregard fact i'm not using separate entity search types, has it's reasons) var result = myentities.instance.searchstatistics .groupby(x => x.searchtype) .select(y => new list<string> { { y.key }, { sqlfunctions.stringconvert((decimal)y.count()).trim() } }) .tolist(); return json(new { text = result.first(x => x.elementat(0) == "text").elementat(1), organization = result.first(x => x.elementat(0) == "organization").elementat(1), subject = result.first(x => x.elementat(0) == "subject").elementat(1), }, jsonrequestbehavior.allowget); this behaved in unexpected way though, resulting list in lis

Autoload a view Resolver in rails 4 -

i'm using view resolver override find_templates method in lib/resolvers/activities_resolver.rb . class activitiesresolver < ::actionview::filesystemresolver def initialize super('app/views') end def find_templates(name, prefix, partial, details) super(name, 'activities', partial, details) end end i'm using in controller app/controllers/admin/activities_controller.rb class admin::activitiescontroller < admin::basecontroller layout 'admin/usability_tests', only: :index append_view_path activitiesresolver.new def index @test = usabilitytest.find(params[:usability_test_id]) @activities = @test.activities end end in order autoload resolver, added in config/application.rb : config.autoload_paths += %w(#{config.root}/lib/resolvers) this works perfectly, i'd autoload /lib subdirectories instead of having specify them manually. i'd write in config/application.rb : config.autoload_paths += %w(#{conf