Posts

Showing posts from January, 2012

Handling WPF button double-click in MVVM pattern -

i have button in mvvm application hooked command in view model. handler view model command file i/o (particularly calling file.copy create or overwrite existing file). now, seems when double-click on button, command handler gets called twice. since both handlers trying access same file copy/overwrite @ same time, i'm getting ioexception. is there anyway deal situation short of catching ioexception , ignoring it? not seem guaranteed catch although there may unrelated problems rest of system causes happen. use value in the viewmodel protect code running when click occurs. set value like: bool bfileio = false; then in handler function: if (!bfileio) { bfileio = true; //file io here bfileio = false; } something protect multi-clicking trying run multiple times.

java - LinearLayout nesting -

is possible create method inflate layout (or create dynamically), add specific views (in case textviews), retun layout view, (somehow) incorporate in main layout in other class, nesting, dynamic adding of elements? yes possible: ... oncreate() { setcontentview(...); viewgroup mycontainer=(viewgroup)findviewbyid(r.id.mycontainer); view v=inflatemyspecialview(); //=<set layoutparams view if needed mycontainer.addview(v); } public view inflatemyspecialview() { viewgroup viewgroup=(viewgroup ) getlayoutinflater().inflate(r.layout.my_custom_layout, null,false); //do stuff inflated viewgroup. return viewgroup; }

mysql - error: 1045: Access denied for user 'user'@'123.10.123.123' (using password: NO) when trying to connect -

i trying local snapshot of database running command: mysqldump --single-transaction --quick -u user -ppass -h somehost db_name | mysql -u user -ppass -h localhost db_name even though has worked me in past, getting error back: error: 1045: access denied user 'user'@'123.10.123.123' (using password: no) when trying connect i can log in username , password above: mysql -u user -ppass -h localhost and have granted privileges user local database, e.g. grant on db_name.* user; i find strange error message returning user@my_ip_address instead of user@localhost when have specified localhost host. i'm confused why says using password: no, i've provided password. it turns out remote host attempting download had changed. using correct new hostname solved problem.

excel - VBA USERFORM: PREVENT COMBOBOX ESCAPE ON KEYDOWN -

community, there way prevent active combobox losing focus when hitting down arrow (or arrow) when @ end (or start) of list. if there better way (preferably ms standard property) please share. problem: when @ end of list in combobox, if hit down arrow move whatever control physically below active combobox. vice versa being @ top of combobox , hitting arrow. sloppy , counterproductive. ms excel 2013. solution: prevent lost focus, in userform's combobox code can enter following: private sub item1_dropdown_keydown(byval keycode msforms.returninteger, byval shift integer) select case keycode case vbkeydown if item1_dropdown.listindex = item1_dropdown.listcount - 1 item1_dropdown.listindex = item1_dropdown.listindex - 1 'when @ bottom, stay in active combobox else: item1_dropdown.listindex = item1_dropdown.listindex 'if not @ bottom, keep moving down end if case vbkeyup if item1_dropdown.listindex = 0 'when @ to

asp.net mvc 4 - passing model back to controller with checkboxes comes back empty -

trying grasp how pass following data model controller. want consume model , add database afterwards. when submit form controller, model empty. because every thing else null? have pass else hidden fields? how sort out on view before getting controller? my controller deserializes xml file looks view <category> <id>1</id> <description>movies</description> <genre> <genres> <id>1</id> <name>comedy</name> </genres> <genres> <id>2</id> <name>action</name> </genres> <genres> <id>3</id> <name>adventure</name> </genres> <genres> <id>4</id> <name>drama</name> </genres> <genres> <id>5</id> <n

php - Function page syntax error -

i can't find missing curly brace, getting message "parse error: syntax error, unexpected $end in /site/public_html/core/functions/users.php on line 75" for following code.. <?php function activate($email, $email_code) { $email = mysql_real_escape_string($email); $email_code = mysql_real_escape_string($email_code); if (mysql_result(mysql_query("select count(`user_id`) `users` `email` = '$email' , `email_code` = '$email_code' , `active` = 0"), 0) == 1) { mysql_query("update `users` set `active` = 1 `email` = '$email'"); return true; } else { return false; } function change_password ($user_id, $password) { $user_id = (int)$user_id; $password = md5($password); mysql_query("update `users` set `password` = '$password' `user_id` = $user_id"); } function register_user($register_data) { array_walk($register_data, 'array_sanitize');

xcode4.5 - iOS - Can't Build on Device but Simulator on Xcode 4.6 -

Image
i'm using xcode 4.6 cannot build app on device working on simulator. looking lbxml2 , followed solutions given other users adding "${sdk_dir}/usr/include/libxml2" header search paths under build setting , include in link binary libraries under build phases still no luck. before switched xcode 4.6 , building on xcode 4.5 . so, don't know wrong. thanks! edit: i getting error: ld: library not found -lxml2 clang-real++: error: linker command failed exit code 1 (use -v see invocation) command /applications/xcode 4.6/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang++ failed exit code 1 how trying link library in? a "-lxml2" line in build settings? when add dylibs project, way see in screenshot. try , see if works also:

c++ - GLSL(1.2) + VBOs + Textures -

again applying considerable problem. code: float ctex[] = {0.0,0.0, 0.0,1.0, 1.0,1.0, 1.0,0.0}; float data[] = {1.0, 1.0,-5.0, -1.0,-1.0,-5.0, 1.0,-1.0,-5.0, -1.0, 1.0,-5.0}; gluint ind[] = {0,1,2,0,3,1}; loadtexture(); glgenbuffers(1,&trianglevbo); glbindbuffer(gl_array_buffer,trianglevbo); glbufferdata(gl_array_buffer,sizeof(data),data,gl_static_draw); glgenbuffers(1,&triangleind); glbindbuffer(gl_element_array_buffer,triangleind); glbufferdata(gl_element_array_buffer,sizeof(ind),ind,gl_static_draw); glvertexattribpointer(0,3,gl_float,gl_false,0,0); glgenbuffers(1,&trianglet[0]); glbindbuffer(gl_array_buffer,trianglet[0]); glbufferdata(gl_array_buffer,sizeof(ctex),ctex,gl_static_draw); glvertexattribpointer(1,2,gl_float,gl_false,0,0); gluint v,f,p; v = glcreate

Unit testing of DAO -

it first time make unit testing i'm trying find references how make unit testing of dao. can guys make simple example of setupbeforeclass , setup , how test method inserting new data in database using model this . simple example using easy mock. thank consideration the idea of using mock objects perform unit testing strikes me peculiar doing testing mock objects instead of real ones. if think need use mock objects emulate database access entire architecture wrong. build software using 3-tier architecture can have many objects in business layer, 1 object in data access layer. if wanted exchange real database access dummy database access make change? 200+ objects in business layer, or 1 object in data access layer? why should implement mechanism change every object within application when need change one? controllers meant integration tested, not unit tested. testing pyramid prescribes unit level focus should be, people sucked default. assertions should n

Unexpected syntax error from MingW compiling a simple C program -

complete novice alert : #include<stdio.h> int main() { puts("c rocks!"); return 0; } when compiled mingw, shows 2 errors: syntax error near unexpected token ( in beginning and int main () what wrong code? i having issue. check illegal characters in path name such spaces or brackets. code looks correct issue isn't there. if else fails, go basics. make sure you're using "gcc file.c -o file.exe" output correct file. reason, forgot use 'gcc', though had been using mingw on month.

Get a list of all Resources in my Azure Subscription (Powershell Preferably) -

i have azure subscription , i'm trying write powershell script automatically list of resources (vms, storage accounts, databases, etc) have in subscription. there way using azure management rest api or azure cmdlets? i don't think there's 1 function (or ps cmdlet) fetch information. each of these can fetched through both windows azure service management rest api window azure powershell cmdlets . windows azure service management rest api : http://msdn.microsoft.com/en-us/library/windowsazure/ee460799.aspx . example, if want list storage accounts in subscription, use this: http://msdn.microsoft.com/en-us/library/windowsazure/ee460787.aspx windows azure powershell cmdlets : http://msdn.microsoft.com/en-us/library/jj554330.aspx . again, if want list storage accounts in subscription, use this: http://msdn.microsoft.com/en-us/library/dn205168.aspx .

hadoop - Write Reducer output of a Mapreduce job to a single File -

i have written map-reduce job data in hbase. contains multiple mappers , single reducer. reducer method takes in data supplied mapper , analytic on it. after processing complete data in hbase wanted write data file in hdfs through single reducer. presently able write data hdfs every time new 1 unable figure how write final conclusion hdfs @ last. so, if trying write final result single reducer hdfs, can try 1 of approaches below - use hadoop api filesystem's create() function write hdfs reducer. emit single key , value reducer after final calculation override reducers cleanup() function , point (1) there. details on 3: http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/reducer.html#cleanup-org.apache.hadoop.mapreduce.reducer.context- hope helps.

c# - Sorting on Column of datatable as alphabetically..or filter column -

i want sort data of datatable , want sort on column2 alphabetically. dataview dv = new dataview(dt); dv.sort = "column2 asc"; dt.defaultview.sort = "column2 asc"; dataview dv = yourdatatable.defaultview; dv.sort = "column2"; yourdatatable = dv.totable(); you don't need add asc, it's default, unless want desc :) code worked me :)

php - Why is redirecting to google giving a strange result? -

my code doesn't involve database or session gives perfect results <!doctype html> <?php if(isset($_get["engine"])) { if($_get["engine"]=="google") header("location:http://www.google.com/search?q=".$_get["q"]); elseif($_get["engine"]=="yahoo") header("location:http://search.yahoo.com/search?q=".$_get["q"]); if($_get["engine"]=="bing") header("location:http://www.bing.com/search?q=".$_get["q"]); } ?> <html> <head> <title>fake search</title> </head> <body> <form action="fakesearch.php" method="get"> <input type="text" name="q" value=""/><br/> google <input type="radio" name="engine" value="google"/><br/> yahoo <input type="radio" name="engine" value="yahoo"/>&l

java - spring async can not add "waitForTasksToCompleteOnShutdown" in <task:executor/> -

<task:executor id="activation-2000" pool-size="#[activation_thread_number]" queue-capacity="20000" waitfortaskstocompleteonshutdown="true"/> in example above when add waitfortaskstocompleteonshutdown property. below error since xsd not support. why can not add waitfortaskstocompleteonshutdown in above naming. attribute waitfortaskstocompleteonshutdown not allowed appear in element task:executor . answer using beanpostprocessor below implementation can fix problem @override public object postprocessbeforeinitialization(object object, string arg1) throws beansexception { if(object instanceof threadpooltaskscheduler) ((threadpooltaskscheduler)object).setwaitfortaskstocompleteonshutdown(true); return object; }

android - How to do smooth transition from one image to another -

i have activity changing imageview periodically, wrote below line of code . imageview.setimageuri(resid); i increasing resource id .it works fine there sudden transition 1 image another. don't want that,i want smooth transition of image view image. how can that? try imageview demoimage = (imageview) findviewbyid(r.id.demoimage); int imagestoshow[] = { r.drawable.image1, r.drawable.image2,r.drawable.image3 }; animate(demoimage, imagestoshow, 0,false); private void animate(final imageview imageview, final int images[], final int imageindex, final boolean forever) { //imageview <-- view displays images //images[] <-- holds r references images display //imageindex <-- index of first image show in images[] //forever <-- if equals true after last image starts on again first image resulting in infinite loop. have been warned. int fadeinduration = 500; // configure time values here int timebetween = 3000; int fadeoutduration =

Xcode, including a external reference folder in a build -

i have folder located on hard drive library of handy classes i've created (file .h , .cpp). want keep them external can reference them consistently multiple ongoing projects. i use add existing files , select folder, adding reference(blue folder)to classes folder in xcode. when attempt access these files project files series of errors because have no idea im doing. steps need take ensure external files included in build? thanks! i have folder located on hard drive library of handy classes i've created (file .h , .cpp). xcode doesn't automagically enumerate directory contents , produce static libraries, folder references might imply. easy way manage create library other projects reference: create new xcode project add static library target (note: possibly library type) add source files new project add .cpp files static library add new project existing app add library app's link phase keep static library in sync files compile that's

php - populate drop down list from database using mysqli prepared statements -

as title says want generated data database , show in dropdown. made code , doesn't show error thing echos code in dropdown. works when echo it. , 1 more thing doesn't show distinct results. here code: <html> <head> <title>filter</title> </head> <body> <?php include 'conn.php';?> <?php $stmt = $con->prepare("select distinct author, book_name, language bk_tst_fltr "); $stmt->execute(); $stmt->bind_result($author,$book_name,$language); $stmt->store_result(); echo "<select name='book'>"; while($row=$stmt->fetch()){?> <p><?php echo '<option value="$row["author"]">"$row["author"]"</option>'; ?></p> <?php } echo "</select>"; ?> </body> </html> is shows $row["author"] in dropdown. can solve problem??? than

asynchronous - Async false in ajax requests using jquery -

i have calendar control on site. fetches availability data server using ajax request. here code - var monthlybookingdetails = getbooking(month, year);//getbooking ajax function //rest of code here in getbooking function if make async: false, works browser blocked till ajax request serviced. so thought of turn around - while(monthlybookingdetails.length <= 0){//busy waiting} but feel not proper way, want understand correct way busy waiting , block following lines execute. there problem code, you're right: while(monthlybookingdetails.length <= 0){//busy waiting} that says "do infinite loop until monthlybookingdetails less or equal 0 ". deliberately introducing infinite loops (even if eventually broken) not sensible move. since, if ajax fails, infinite loop won't broken. the correct way embrace asynchronous way. means callbacks . means supplying function called when asynchronous code complete. so inside getbooking this: functi

How to remove an app from the Facebook App Center? -

i have ios app approved facebook app center. remove app facebook app center. how can without deleting app page? thanks! please goto facebook settings goto account settings , click apps can manage applications subscribe earlier...

node.js - Error: connect EADDRNOTAVAIL while processing big async loop -

i experiencing strange problem. importing big xml-files , store them mongodb. algorythm typical async loop: doloop = function( it, callback_loop ) { if( < no_of_items ) { storetomongo( ..., function( err, result ) { ... doloop( it+1, callback_loop ); }); } else { callback_loop(); } }; doloop( 0, function() { ... }); now (suddenly without remarkable change in code) following error while performing loop: events.js:72 throw er; // unhandled 'error' event ^ error: connect eaddrnotavail @ errnoexception (net.js:901:11) @ connect (net.js:764:19) @ net.js:842:9 @ dns.js:72:18 @ process._tickcallback (node.js:415:13) the error happens after approximately minute. number of items processed in meantime quite same, not exactly. i tried find out connect/net causes error, lost. there not socket-connection in code. have connection redis, o.k. mongodb-connection?

Difference between asInstanceOf[ ] and isInstanceOf[ ] in scala -

what difference between asinstanceof[] , isinstanceof[] ? generally speaking, a.asinstanceof[b] performs actual cast: takes object of type , returns (if possible) object of type b, whereas a.isinstanceof[b] returns boolean indicating whether a has type b or not. strictly speaking isinstanceof[b] looks not if of type b, if has type b in upper side inheritance tree (so if b superclass of a, isinstanceof yield true) , important notice isinstanceof works on actual object type hierarchy rather on reference type.

combobox - Tcl/Tk LstBox width in CombBox -

how can configure listbox component width in combobox, fit longest entry? widget width (the entry component) can short, i'm looking way configure listbox component wider entry... this possible, not without bit of hacking ;) you can find implementation of combobox in combobox.tcl (in case /usr/share/tcltk/tk8.5/ttk/combobox.tcl . there see if have combobox set cb [ttk::combobox .cb -state readonly] and invoke it, creates following internal widget structure: $cb.popdown.f.l popdown toplevel pops down if click combobox, f frame, , l actual listbox contains values. fit longest entry need modify geometry of popdown toplevel. we try binding resize script the buttonpress event on combobox, however, not work because default bindings handled in following order (output of puts [bindtags $cb] ): .cb tcombobox . so first events on widget ( .cb ) handled, events on class ( tcombobox ), , on toplevel ( . ) , events bound widgets. means when click combobox, firs

android - Using Maven to build application for different environments (dev, staging, prod) -

suppose have following properties declared in pom.xml file. <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org /2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> // .... <properties> <dev.url>http://dev.mysite.com</dev.url> <staging.url>http://staging.mysite.com</staging.url> <prod.url>http://prod.mysite.com</prod.url> </properties> </project> what do, have different run configurations, , depending of flag set, read corresponding property. example when building production, read @ runtime prod.url property, when building staging, read staging.url property. here's how solved it: idea store properties in separate resource files. then, using maven resource plugin copy corresponding property file values/environment.xml in project roo

Hide-show like dislike jquery script for each block -

i have many similar blocks , dislike divs: <div class="cal_days com_each_photo"> <img class="littleimage" src="img/calendar/calendar_2.jpg" alt="day"> <div class="com_blur"> <div class="com_link_like" style="cursor:pointer">like!</div> <div class="com_link_dislike" style="cursor:pointer;display:none">dislike</div> </div> <div class="cal_days com_each_photo"> <img class="littleimage" src="img/calendar/calendar_2.jpg" alt="day"> <div class="com_blur"> <div class="com_link_like" style="cursor:pointer">like!</div> <div class="com_link_dislike" style="cursor:pointer;display:none">dislike</div> </div> ... made jquery script: $(document).ready(function(){ $(".com_lin

Google Doc API Single Login -

here trying do: create application can pull down single predefined google document. desired approach: create app automatically logs google drive document owners account. once logged in latest version of document downloaded , presented user through app. this approach means app users can access document without google account. what don't want: i don't want users have login google drive themselves. want people able access document automatically through app. i don't want document public. the problem have hit: all login approaches can find within google documentation require user login through google accounts - oauth style example. can't find anyway of hard coding login single account owner application. other notes creating web app in php. any or different approach suggestions gratefully received. thanks

Dropping element at exact position using JQuery -

i have made ui have created div inside multiple divs or slots(say).these slots generated using knockout.js,i mean these slot binded on slider value.depending on value of slider generate slots dynamically.my concern want drop other outside element on these divs when doing getting droped on last div , again if drop again added upper div of slot.bt want must dropped dropping i.e on same position.it can @ midway of 2 div well.please suggest me.my code follows: <div class="slotsystem"> <div class="slotmachine" data-bind="foreach:slots,style:{height:height()+'px'}"> <div class="slot"> <div class="slot-info drop" data-bind="text:formatedtime,style:{height:height()+'px'}"></div> </div> </div> </div> $(".drop

How to check all parents of the div in jquery -

i have code <div id="parent"> <div> <div id="child"> </div> </div> </div> how can check - there id="child" have parent id="parent" ? if($("#child").closest("#parent").length) { // luke, i'm father } these should do: if($("#parent #child").length) { // noooooooo! } if($("#parent").find("#child").length) { // may force } if($("#parent:has(#child)").length) { // powerful jquery selector has become }

javascript - use id attribute as reference or variable for tooltip -

i using code . however text wish display must in 1 line, , if there apostrophe ( ' ) in text, not work anymore . imgover(this, 'text display') is there way remplace second variable of onmouseover id of div display in div please ? here example of div : <div id ="text1" > <em><img class="floatleft" src="images/f9979.jpg" alt="" /> titre du film : man of steel <br /> <br /> resume : film fantastique américain réalisé par zack snyder avec henry cavill, amy adams, diane lane <br /> <br /> duree : 2h23 <br /> un petit garçon découvre qu'il possède des pouvoirs surnaturels et qu'il n'est pas né sur la terre. plus tard, il s'engage dans un périple afin de comprendre d

c# - Preventing getting to other URL of web service -

i doing web service in .net containing server file (.asmx) , client interface (.aspx). visitors should able visit client aspx site ( urlxxx:portyy/client.aspx) however, when remove "/client.aspx" part url, project directory , should not possible. (so far, running project on localhost.) is there way, how restrict getting other parts of solution? possibility think of creating separate project client aspx site, however, visitor able directory containing site. you should able control explicit access using web.config. have @ example (exclaimer: i've copied straight this ms page ): <configuration> <system.web> <authentication mode="forms" > <forms loginurl="login.aspx" name=".aspnetauth" protection="none" path="/" timeout="20" > </forms> </authentication> <!-- section denies access files in application except have not e

jquery - Slideshow and captions not working in IE -

i'm afraid coding knowledge basic , i'm having trouble working on website client. i'm using slideshow i'm finding works if don't include < doctype ! html > reason. i have added captions , works fine on chrome , firefox, on ie they'll not show @ unless doctype there. slideshow starts scrolling instead! i'm trying find solution can both arrow controlled slideshow , captions works on ie. knowledge of jquery next nothing. please help! did download file? you shure put code? figure { display: block; position: relative; float: left; overflow: hidden; margin: 0 20px 20px 0; } figcaption { position: absolute; background: black; background: rgba(0,0,0,0.75); color: white; padding: 10px 20px; opacity: 0; -webkit-transition: 0.6s ease;<!--this make works in safari/chrome--> -moz-transition: 0.6s ease;<!--this make works in mozila--> -o-transition: 0.6s ease;<!--this make works in opera-->

android - Clearing searchable listview -

i following android hive tutorial make custom list view + searchable listview . tutorials easy follow when added getfilter() in lazyadapter , problem occured. seach editbox can filter listview on clearing textview original data of listview not showing. this code package com.example.androidhive; import java.util.arraylist; import java.util.hashmap; import android.app.activity; import android.content.context; import android.text.textutils; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.baseadapter; import android.widget.imageview; import android.widget.textview; public class lazyadapter extends baseadapter { private activity activity; private arraylist<hashmap<string, string>> data; private static layoutinflater inflater=null; public imageloader imageloader; public lazyadapter(activity a, arraylist<hashmap<string, string>> d) { ac

concurrentmodification - java.util.ConcurrentModificationException upon LinkedHashSet iteration -

please, me understand error getting: private void replayhistory() { synchronized (alarmshistory) { (alarmevent alarmevent : alarmshistory) { log.error("replayhistory " + alarmevent.type + " " + alarmevent.source); sendnotification(alarmevent.type, alarmevent.source, alarmevent.description, alarmevent.clearonotherstations, alarmevent.forceclearonotherstations); } } } and method adds element it private void addtoalarmshistory(alarmevent alarmevent) { synchronized (alarmshistory) { log.error("addtoalarmshistory " + alarmevent.type + " " + alarmevent.source); alarmshistory.add(alarmevent); } } both methods , set private volatile set<alarmevent> alarmshistory = new linkedhashset<alarmevent>(); are defined in jmxgwreloadthread extends thread class which inner class in alarmmanager class that has method private voi

java - How to Spring Inject My Controller layer from Groovy -

i'm trying learn groovy , integrating existing java jar. java code makes use of di cant seem work groovy script. the java application contains data access layer using mybatis. layer consists of number of interfaces (e.g iuser) , controllers e.g. @service public class usercontroller implements iuser the controllers make use of mybatis mapper classes. the whole thing pulled using spring default-autowire="byname"> its set use annotations access mappers within controllers. mybatis configured in spring scan , inject mappers <bean class="org.mybatis.spring.mapper.mapperscannerconfigurer"> <property name="basepackage" value="com.directski.data.mapper" /> <property name="sqlsessionfactory" ref="sqlsessionfactory"></property> </bean> so when run application in java works normally. including mappers have called using @autowired private usermapper usermapper; when tr

c# - SQLCommand not returning anything in Writeline -

i trying set sqlconnection our database return datatypes of columns / rows (this needs done can enter data api). data being placed in datatable , through hashtable type. the problem when program run, no errors occur not return in console writelines have been specified. i'm not overly experienced .net developer i'm not sure i'm missing, guess in order of how sql command / connection opened? static void main(string[] args) { hashtable sqldatatypeholder = new hashtable(); //sql connection string _mysqlurl = "connection correct , works in other test apps"; string _mysqlquery = "query here, works fine in sql management studio"; sqlconnection conn = new sqlconnection(_mysqlurl); sqlcommand comm = new sqlcommand(_mysqlquery, conn); datatable _temptable = new datatable(); using (conn) { sqlcommand command = new sqlcommand(_mysqlquery,conn); conn.open(); sqldatareader reader = co

c# - Assembly loaded from Resources raises Could not load file or assembly -

i writing simple application should create shortcuts. use interop.iwshruntimelibrary add embedded resource. on class init call assembly.load(resources.interop_iwshruntimelibrary); i tried: appdomain.currentdomain.load(resources.interop_iwshruntimelibrary); when build application in visualstudio output window see assembly loaded: loaded "interop.iwshruntimelibrary". but, when try use objects in assembly gives me exception: "could not load file or assembly "interop.iwshruntimelibrary, version=1.0.0.0, culture=neutral, publickeytoken=null". it not simple think , if visualstudio says reference loaded means references of project loaded during build. has nothing tring achieve. the easiest way bind appdomain.assemblyresolve event called when resolution of assembly fails: appdomain currentdomain = appdomain.currentdomain; currentdomain.assemblyresolve += new resolveeventhandler(myresolveeventhandler); then: private assem

jquery - Unable to run animation -

trying run animation through loop, build succeeds fails perform animation on simulator, below code supposed perform animation nsmutablearray *frames = [[nsmutablearray alloc]init]; //supposed loop through file names a0001 a0010 texture file. (int i=1; i<=10; i++) { nsstring *framename = [nsstring stringwithformat:@"a%04i.png",i]; [frames addobject:[[ccspriteframecache sharedspriteframecache] spriteframebyname:framename]]; } // set frame speed ccanimation *a =[ccanimation animationwithspriteframes:frames delay:1.0f/24.0f]; // supposed use restoreoriginalframe method after actionwithanimation since deprecated removed [mole runaction:[ccanimate actionwithanimation:a]]; any highly appreciated, thank you this how accomplish same thing. difference can see if not load images array, instead these textures loaded memory using sprite sheet. nsstring * animatecycle = [nsst

Why does Blackberry java application shows wired dialogs? -

my blackberry 6 java application shows the application has attempted open {0} connection not allowed application's permissions error dialog.the application needs internet connection,save data in persistent storage etc... why application shows such dialog? requires permission? how can set requires permissions application? thanks in advance all blackberry applications need permissions, them on start-up, , can changed relatively in blackberry options. each application should handle situation when user not give them permissions required. unfortunately can not find source explains process. best thing can suggest @ applicationpermissionsdemo comes sample ide. search on blackberry permissions on forum (and others) find issues other people have had process, , solutions have used.

objective c - iOS preload notification items in the app, why not? -

imagine have gmail app installed on iphone , in area bad/unstable 2g internet connection, take phone , see notification new mail gmail app, see subject , few words letter itself, when swipe notification view whole letter can't because @ moment 2g connection lost. pretty annoying actually. so question is: why apps not somehow preload pieces of information they've shown user notification? in case, why gmail doesn't preload letter, i've notified about? ios issue or apps don't that? because that's not design of push notification. can send 256kb data using it. when swipe view notification - network call made receive rest of notification. saves battery life , network costs. imaging if push notification downloads data each notification.. go through battery life quick, while you're not using phone.

Android: How to add a context menu to the item of a gridview? -

i have grid view , it's item formed icon , tow textview. code of item given below. add context menu each item, used in google playstore mentioned image link image <relativelayout android:id="@+id/relativelayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:background="@drawable/round_boutton" android:orientation="vertical" android:padding="5dp"> <imageview android:layout_height="96dp" android:id="@+id/imageview1" android:layout_width="96dp" android:src="@drawable/icon" android:layout_margintop="15dp" android:layout_marginleft="15dp" android:layout_marginright="15dp" android:layout_a

How to create an InputStream of files that have a certain extension in Java? -

i have lot of files in directory want read ones extension (say .txt). want these files added same bufferedinputstream can read them in 1 go. when call read() @ end of file, next 1 should begin. it feels there should obvious answer had no luck finding it. you might want take @ sequenceinputstream : a sequenceinputstream represents logical concatenation of other input streams. starts out ordered collection of input streams , reads first 1 until end of file reached, whereupon reads second one, , on, until end of file reached on last of contained input streams.

Android Studio starts fail with "Exception in thread "main" java.lang.NoClassDefFoundError: javax.swing.UIManager" -

android-studio-bundle-133.970939: java version "1.5.0" gij (gnu libgcj) version 4.8.1 20130909 [gcc-4_8-branch revision 202388] copyright (c) 2007 free software foundation, inc. free software; see source copying conditions. there no warranty; not merchantability or fitness particular purpose. exception in thread "main" java.lang.noclassdeffounderror: javax.swing.uimanager @ java.lang.class.initializeclass(libgcj.so.14) @ javax.swing.uimanager.getui(libgcj.so.14) @ javax.swing.text.jtextcomponent.updateui(libgcj.so.14) @ javax.swing.text.jtextcomponent.<init>(libgcj.so.14) @ javax.swing.jeditorpane.<init>(libgcj.so.14) @ javax.swing.jtextpane.<init>(libgcj.so.14) @ com.intellij.idea.main.showmessage(main.java:216) @ com.intellij.idea.main.showmessage(main.java:203) @ com.intellij.idea.main.main(main.java:86) with opensuse 13.1, x86_64, oracle jdk 7u51 i posted same answer in android studio 135.1339820 l

c# - webservice returning jagged array of ints -

i have created webservice , deployed @ http://reddyincv-001-site1.myasp.net/webservice1.asmx returns jagged array of ints. i trying consume using silverlight, how store retrieved values webservice , store in silverlight jagged array? this code private sampleservice.webservice1soapclient dataservice = new sampleservice.webservice1soapclient(); public mainpage() { initializecomponent(); dataservice.leftclickcompleted += new eventhandler<sampleservice.leftclickcompletedeventargs>(leftclick_completed); dataservice.leftclickasync(); } private void leftclick_completed(object sender, sampleservice.leftclickcompletedeventargs e) { int[][] aaa = new int[14][]; aaa = e.result; } try this aaa= e.result.select(a => a.toarray()).toarray(); or aaa= e.result.yourresulttype.select(a => a.toarray()).toarray(); edit: that means returning string web service,change the return type of web service o

symfony - Define date steps in a form or property -

i have defined property use datetime type: class myclass { /** * @constraints\notnull * @orm\column(type="datetime") */ private $date; ... } i have property added in form: $form = $this->createformbuilder($myclassobject) ->add('date') ->getform(); return $this->render('mytemplate', array('detailsform', $form->createview()); and form used inside mytemplate : <form method="post"> {{ form_widget(detailsform) }} <input type="submit" value="create"> </form> but want display time 5 minutes steps: 00 - 05 - 10 - ... - 50 - 55 is there way define property constraint or field's form definition? the date field type date, have use datetime display minutes , seconds: $form = $this->createformbuilder() ->add('date', 'datetime', array( 'minutes&#

asp.net mvc - Edit URL doesnt contain Id -

i learning mvc https://www.youtube.com/watch?v=itsa19x4ru0&list=pl6n9fhu94yhvm6s8i2xd6nyz2zord7x2v doing basic edit operation..index page shows following data .. emp_id emp_name emp_sal 1 name1 sal1 edit | details | delete ...when click on edit ..url display like "http://localhost/mvcapplication1/employee/edit"` ...but accordng tutorial should http://localhost/mvcapplication1/employee/edit/01 the map route routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "home", action = "index", id = urlparameter.optional } ); i have not create edit actionmethod till . index view code : @model ienumerable<businesslayer.employee> @{ viewbag.title = "index"; } <h2> index</h2> <p> @html.actionlink("create new", "create") &

IOS facebook login using Xcode 5.1 -

i have followed instructions integrate facebook login in ios here . worked , able login started showing blank white screen in safari browser(i'm testing on simulator). have cleared cache , and unblock cookies.please if knows solution. below code used in loginviewcontroller: #import "viewcontroller.h" #import <facebooksdk/facebooksdk.h> @interface viewcontroller () @property (strong, nonatomic) iboutlet fbprofilepictureview *profilepictureview; @property (strong, nonatomic) iboutlet uilabel *namelabel; @property (strong, nonatomic) iboutlet uilabel *statuslabel; @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. fbloginview *loginview = [[fbloginview alloc] initwithreadpermissions:@[@"basic_info", @"email", @"user_likes"]]; loginview.frame = cgrectoffset(loginview.frame, (self.view.center.x - (loginview.frame.size.width / 2)), 5)

How to decrease column size of ajaxified jquery datatable? -

i have 3 columns in datatable, had 4 , made 1 of them hidden using solution here and first column expanded (only on firefox), column contains checkboxes. now want decrease size of first column using function fnsetcolumnvis() ... please help. screenshot : http://postimg.org/image/9s5wfge3j in column definitions can specify column width this: aocolumns': [ { 'mdata': 1, 'swidth': '20%' }, ...

javascript - document ready fires too early? -

it kind of theoretical question can't checked right away. problem possible reasons why jquery code doesn't work, loaded on page now. also, has right after page loaded , copy-paste script code source of loaded page console. <body> <div id="id1">...</div> <div id="id2">some html code goes here... </div> <script> jquery(document).ready(function() { var el = jquery("#id1"); var var1 = el.width(); el.css({'margin-top':'10px','margin-bottom':'20px'}); jquery("#id2").css('margin-top', var1+'px'); }); </script> <div>and here... </div> </body> p.s. jquery library loaded. there no errors in chrome console. script in body tag. p.p.s. can because of #id1 (contains ) loaded site document ready fired earlier? reason? other possible reasons? unfortunately, hard check right away a