Posts

Showing posts from 2013

java - spring uploading files issue -

java - spring uploading files issue - i'm trying utilize multiple files uploadind upload images, , want store 3 copies of images (origin, thumbnail , mini format). problem happens after commentet //save thumbnail . got exception java.lang.illegalstateexception: file has been moved - cannot transferred again. how can prepare it? @requestmapping(value = "/uploadfiles", method = requestmethod.post) public string uploadfiles( @modelattribute("uploadform") donwloadfiles uploadform, @modelattribute("id") int id, modelmap map) throws illegalstateexception, ioexception { properties properties = new properties(); string savedirectory = "/home/desktop/photos/"; list<multipartfile> files = uploadform.getfiles(); list<string> filenames = new arraylist<string>(); if (null != files && files.size() > 0) { (multipartfile multipartfile :

android - Support multiple aspect ratio in Unity -

android - Support multiple aspect ratio in Unity - i've been trying create unity 2d game supports each , every aspect ratios of devices both android , tablets. there way that's been provided or recommended unity? in case, work create of scale so, back upwards no matter screen are //find screen resolution @ splash or loading screen float scalex = datafactory.screen_width / (float)datafactory.our_fixed_game_screen; float scaley = datafactory.screen_height / (float)datafactory.our_fixed_game_screen; if (scalex >= scaley) datafactory.scale = scalex; else datafactory.scale = scaley; //set size in game @ start private int gamewidth = (int) (1400 * datafactory.scale); private int gameheight = (int) (800 * datafactory.scale); private int startgamex = (int) (300 * datafactory.scale); private int startgamey = (int) (280 * datafactory.scale); private int objectx = (int) (410 * datafactory.scale) + datafactory.begin_x; private int

C++ 11 "class" keyword -

C++ 11 "class" keyword - i've started using c++ 11 little bit more , have few questions on special uses of class keyword. know it's used declare class, there's 2 instances have seen don't understand: method<class t>(); and class class_name *var; why precede typename keyword class in first example, , keyword pointer in sec example? that known elaborated type specifier , necessary when class name "shadowed" or "hidden" , need explicit. class t { }; // love of god don't t t; t t2; if compiler smart, give these warnings: main.cpp:15:5: error: must utilize 'class' tag refer type 't' in scope t t2; ^ class main.cpp:14:7: note: class 't' hidden non-type declaration of 't' here t t; ^ if class not defined, deed forwards declaration. for example: template <typename t> void method() { using type = typename t::value_type; } method&

flash - Move an object in the direction its pointing Actionscript 3 -

flash - Move an object in the direction its pointing Actionscript 3 - i'm messing in actionscript 3 , trying move object, can move on y axis have set object , rotate trying move in direction pointing not restricted move along y or x axis anyone have tips? just basic trigonometry should trick. var speed:number = 10; var angle:number = math.pi/2; obj.x += speed * math.cos(angle); obj.y += speed * math.sin(angle); for more advanced wizardry recommend learning linear algebra. start can made here :) actionscript-3 flash actionscript

ruby on rails - how to add possibilities in a select using f.input :object -

ruby on rails - how to add possibilities in a select using f.input :object - i have form , want user select 1 of object. activeadmin.register promo form |f| f.inputs f.input :user end f.actions end end ok, works, want add together possibility "all" in select this, tried different things f.input :user + "all" f.input :user, as: :select, collection: [:user, "all"] but of course, doesn't work you need collection of objects in :user inject 'all' in it. @user_names = user.pluck(:name) #or whatever want have in select f.input(:user, as: :select, collection: @user_names + ['all']) ruby-on-rails select input collections

Junit, java : Mocking a method -

Junit, java : Mocking a method - i have created java class (a) calling method class (b). other class (b) calling method 3rd class (c). have mocked few methods b class. i'm trying mock method c class . however, not working. test class below: class="lang-java prettyprint-override"> @runwith(mockitojunitrunner.class) public class testa { private a= new a(); @mock private b b; @before public void setup() throws exception { setinternalstate(a, "b", b); } @test public void testmethoda() throws exception { when(b.methodmock(anystring())).thenreturn(myvalue); when(c.methodmockc(anystring()).thenreturn(myvalue2); result=a.methoda("xyz"); assert.assertequals("anyvalue", result.getvalue()); } } classes tested below. public class { public b b=new b(); public string methoda (string value) { string myvalue=b.methodmock(value); string result=b.methodb(myva

node.js - NodeJS: for loop and promises -

node.js - NodeJS: for loop and promises - asynchronous programming much more hard synchronous programming. using nodejs, trying following: for (var = 0; < 10; i++) { somefunction().then(function() { // stuff }); } but want loop go on when stuff part has completed. any thought how can achieved...? thank you! async programming can confusing, of confusion can eliminated if maintain in mind things callbacks , then run @ later time, after code block they're contained in has finished. promise libraries, async module, attempts more command on program's flow. here good article explaining different approaches, helped me understand things seeing different alternative solutions same problem. a couple of other answers mention q.all() . works well, if have array of promises. if have array of values, or promises, there library makes easier, called bluebird . has method called .map() can utilize start promise chain array. with

android - How to get MimeType from Camera? -

android - How to get MimeType from Camera? - i going on surfaceview photographic camera activty in want mimetye file uri of local path while calling gallery can mimetype content uri while loading photographic camera can't mimetype tried convert localpath file content uri tried below: public static uri getimagecontenturi(context context, file imagefile) { string filepath = imagefile.getabsolutepath(); cursor cursor = context.getcontentresolver().query( mediastore.images.media.external_content_uri, new string[] { mediastore.images.media._id }, mediastore.images.media.data + "=? ", new string[] { filepath }, null); if (cursor != null && cursor.movetofirst()) { int id = cursor.getint(cursor .getcolumnindex(mediastore.mediacolumns._id)); // uri baseuri = uri.parse(stringuri); homecoming uri.withappendedpath(uploadima

r - rotating variable in ddply -

r - rotating variable in ddply - i trying means column in info frame based on unique value. trying mean of column b , column c in exampled based on unique values in column a. thought .(a) create calculate unique value in (it gives unique values of a) gives mean whole column b or c. df2<-data.frame(a=seq(1:5),b=c(1:10), c=c(11:20)) simvars <- c("b", "c") ( var in simvars ){ print(var) dat = ddply(df2, .(a), summarize, mean_val = mean(df2[[var]])) ## script assign(var, dat) } c mean_val 1 15.5 2 15.5 3 15.5 4 15.5 5 15.5 how can have take average column based on unique value column a? thanks you don't need loop. calculate means of b , c within single phone call ddply , means calculated separately each value of a . and, @gregor said, don't need re-specify info frame name within mean() : ddply(df2, .(a), summarise, mean_b=mean(b), mean_c=mean(c)) mean_b mean_c 1 1 3.5 13.5

ios - libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) -

ios - libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) - i'm programming app in swift , when run test app on iphone simulator works, seek swipe right, gesture added go next page(view controller two) crashes , shows error study in console log. 2014-10-18 12:07:34.400 soundtest[17081:818922] *** terminating app due uncaught exception 'nsunknownkeyexception', reason: '[<soundtest.viewcontrollertwo 0x7f92f1f20090> setvalue:forundefinedkey:]: class not key value coding-compliant key sfdfa.' *** first throw phone call stack: ( 0 corefoundation 0x00000001067813f5 __exceptionpreprocess + 165 1 libobjc.a.dylib 0x00000001082afbb7 objc_exception_throw + 45 2 corefoundation 0x0000000106781039 -[nsexception raise] + 9 3 foundation 0x0000000106b984d3 -[nsobject(nskeyvaluecoding) setvalue:forkey:] + 259 4 corefoundatio

How to get all data from easyui datagrid -

How to get all data from easyui datagrid - i had seek utilize getdata e.g. data = $("#dg").datagrid("getdata");` var total = data.total; (total 100)` var rows = data.rows; (rows.length 25)` it can result: total number right 100 records rows homecoming current page rows 25 rows. need of records ( 100 rows). is there missed ? or how can ? please help me. datagrid jquery-easyui

java - Jetty - Jersey and Jar issue -

java - Jetty - Jersey and Jar issue - i'm new in jetty. i works on tomcat project need utilize embedded jetty server. my project construction is: src bundle controller main ... webcontent meta-inf web-inf lib web.xml i created main within package.main this: public class serverlauncher { public static void main(string[] args) throws exception { new serverlauncher().configureserver(); } public void configureserver() throws exception{ server server = new server(8080); webappcontext webapp = new webappcontext(); webapp.setcontextpath("/"); webapp.setwar("webcontent"); server.sethandler(webapp); server.start(); server.join(); } } my problem is: when execute eclipse, correctly works. when export runnablejar file, doesn't find me webcontent: slf4j: version of slf4j requires log4j version 1.2.12 or later. see

c# - Capturing windows form into image -

c# - Capturing windows form into image - i know question has been answered before. none of answers correct. how can capture image of windows form , save it. utilize this: bitmap bmp = new bitmap(this.width, this.height); this.drawtobitmap(bmp, new rectangle(point.empty, bmp.size)); bmp.save(@"c://desktop//sample.png",imageformat.png); but error: a generic error occurred in gdi+ i have read error none of suggestions work me! please help the problem in bmp.save(@"c://desktop//sample.png",imageformat.png); . first must @"c:\desktop\sample.png", don't need escape nil verbatim string. second create sure path corect , have permision write to. third sayse point out dispose bitmap. using(bitmap bmp = new bitmap(this.width, this.height)) { this.drawtobitmap(bmp, new rectangle(point.empty, bmp.size)); bmp.save(@"c:\desktop\sample.png",imageformat.png); // create sure path exists! } c# capture

java - SharedPreference clear() throwing nullpointerexception -

java - SharedPreference clear() throwing nullpointerexception - i'm trying clear list, need clear sharedpreference. on doing so, nullpointerexception. here's code. - mainactivity.savedlogname.edit().clear().commit(); mainactivity.savedlognumber.edit().clear().commit(); mainactivity.savedlogtime.edit().clear().commit(); i've tried using remove(), same error persists. here's code using remove() mainactivity.savedlogname.edit().remove("logname").commit(); mainactivity.savedlognumber.edit().remove("lognumber").commit(); mainactivity.savedlogtime.edit().remove("logtime").commit(); note - savedlogname, savedlognumber , savedlogtime static variables declared in mainactivity. i'm calling them different activity class. from mainactivity - savedlogname = preferencemanager.getdefaultsharedpreferences(this); savedlognumber = preferencemanager.getdefaultsharedpreferences(this); savedlogtime = preferencemanager.g

variables - How to copy executable file of ExePackage to the target machine's specified directory using Wix Burn? -

variables - How to copy executable file of ExePackage to the target machine's specified directory using Wix Burn? - in wix bootstrapper project have 2 exe packages (for 32 , 64 bit) , msi package.i'd install 1 of exe packages , install msi. need executables of both exe packages copied target directory, designed in msi. problem if install them other files in msi: <component id="cmp9a1327054e32" directory="dir088" guid="guid"> <file id="fila60" keypath="yes" source="$(var.pathtofile)\accessdatabaseengine.exe" /> </component> this double size of bundle (2 executables exe packages , 2 msi). question "how can utilize same .exe files both installing exe packages , copying them target machine?" i tried utilize files payload msi , utilize custom action in msi re-create them cache folder <msipackage id="mainpackage" sourcefile="$(var.resources

Certificate-based authentication on Google App Engine -

Certificate-based authentication on Google App Engine - i'm writing j2se client google app engine application communicates gae via rest. i'm using restlet rest handling. client running on remote server. now have doubts authentication implementation; oauth2 seems not selection because there's no user available on remote server side oauth2 challenge. book restlet in action mentions certificate-based authentication. solution needs trust store on server. is certificate-based authentication possible on google app engine? trust store available ssl communication, possible utilize certificate-based authentication google-app-engine authentication digital-certificate client-certificates

Add Flash player to WEBVIEW (android) -

Add Flash player to WEBVIEW (android) - i'm working on new "app" , have problem when i'm trying show videos app (webview) got message: http://i.stack.imgur.com/p1rem.png how solve it?? all! <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pskpartha.droidwebview" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.read_phone_state" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.write

javascript - JSON returned in AJAX call not working -

javascript - JSON returned in AJAX call not working - i trying observe wither database entry has been input sending new inserted id , json variable ajax phone call not working in phonegap, fine in browsers , can see info beingness inserted in db successfully. comments/ help appreciated, thanks. ajax code - function insertqna() { $.ajax({ url: domain + '/result/create', cache: false, type: 'post', contenttype: 'application/json; charset=utf-8', data: '{"q1":"' + q1 + '","q2":"' + q2 + '","q3":"' + q3 + '","q4":"' + q4 + '","q5":"' + q5 + '","q6":"' + q6 + '","q7":"' + q7 + '","q8":"' + q8 + '","q9":"' + q9 + '"

c# - Query to filter contacts with given tags while having many to many relation between entities -

c# - Query to filter contacts with given tags while having many to many relation between entities - i writing simple contact management app. in domain mode have many many relation between contacts , tags. within mvc in need inquire take user selected tags , homecoming contacts have of tags match user supplied tags. for illustration if contact najam has 3 tags - "author", "blogger", "subscriber" , admin chooses "author" , "subscriber" search najam should in results. public class tag { public tag() { createdon = datetime.now; } public int tagid { get; set; } public string name { get; set; } public datetime createdon { get; set; } public virtual icollection<contact> contacts { get; set; } } public class contact { public contact() { isnewslettersubscriber = true; createdon = datetime.now; } public int contactid { get; set; } public string firstn

angularjs - Angularfire $save array -

angularjs - Angularfire $save array - i'm trying save collection of info after have updated entry in array. // edit post $scope.editme = function(message) { if($scope.textboxmessage = "what did today?"){ $scope.textboxmessage = "here can edit post entering new message , pressing edit on affected post" + "\n \n" + "your post:" + "\n" + message.post; } else{ $scope.message.post="hello"; //$scope.newmessage $scope.messages.$save(2); } } ones user have entered text in textfield want replace stored data. overwriting message.data sometext. since read in info this: var list = fbutil.syncarray('posts/'+user.uid); i tried say: message.post = $scope.newmessage; list.$save() neither of these 2 methods work i'm sure it's minor mistake. ed: according angularfire api, visit: https://www.firebase.com/docs/web/libraries/angular/api.html#angularfire-firebasearray-save-re

class - How to add different css classes for every template in joomla -

class - How to add different css classes for every template in joomla - i have site www.kadamjay.kg. using rt template , every language has deifferent templates.therefore when adding particular class changes on 1 template. there no template in path. have tried give class every page. it's lot of pages hence it's not variant. i found solution.we can add together class suffix every module , every page hence takes little bit time it's comfortable in usage. css class templates joomla

Installed different distro in Vagrant. Now can't SSH into MySQL -

Installed different distro in Vagrant. Now can't SSH into MySQL - i using ubuntu precise32 , switched 14.04. utilize jeffrey way's setup (https://github.com/jeffreyway/vagrant-setup) , works. can 'vagrant ssh' , log in, , log root username/password root/root. when seek using sequel pro gui, next error: used command: /usr/bin/ssh -v -n -o controlmaster=no -o exitonforwardfailure=yes -o connecttimeout=10 -o numberofpasswordprompts=3 -i /users/chrisfarrugia/.vagrant.d/insecure_private_key -o tcpkeepalive=no -o serveraliveinterval=60 -o serveralivecountmax=1 -p 2222 vagrant@127.0.0.1 -l 52688/127.0.0.1/3306 -l 52689/127.0.0.1/3306 openssh_6.2p2, osslshim 0.9.8r 8 dec 2011 debug1: reading configuration info /etc/ssh_config debug1: /etc/ssh_config line 20: applying options * debug1: connecting 127.0.0.1 [127.0.0.1] port 2222. debug1: fd 3 clearing o_nonblock debug1: connection established. debug1: identity file /users/chrisfarrugia/.vagrant.d/insecure_priva

c# LINQ to Entities does not recognize the method 'System.String ToString()' method -

c# LINQ to Entities does not recognize the method 'System.String ToString()' method - i want select multiple column in db , store in array maintain getting error linq entities not recognize method 'system.string tostring()' method, , method cannot translated store expression. it should homecoming me "functioncode-activitycode" public override string[] getrolesforuser(string username) { dev_context oe = new dev_context(); string role = oe.userrefs.where(x => x.username == username).firstordefault().rolename; string[] result = oe.rolepermissionrefs .where(x => x.rolename == role && x.statuscode == "a") .select(x => new { functioncode = x.functioncode, activitycode = x.activitycode }.tostring()) .toarray(); homecoming result; } even if work, wouldn't give expected result.you calling tostring on anonymous object. if want concatenate values can try: string[] resu

javascript - Document.write only overwrites the page once -

javascript - Document.write only overwrites the page once - i've been using document.write() replace existing html loaded ajax. if used 1 time per normal load works fine (by normal mean without ajax), if used more once, writes without replacing existing content in other words, first time document.write() called on page1, page1 overwritten (as intended) next time it's called, new content appended page1. why? here's code reproduce issue: global javascript (on pages): function loadxmldoc(name) { var xmlhttp = new xmlhttprequest(); xmlhttp.addeventlistener("load", transfercomplete, false); xmlhttp.open("get", name, true); xmlhttp.send(); function transfercomplete() { document.write(xmlhttp.responsetext); history.replacestate(null, null, name); } } page one: <a href="#" onclick="loadxmldoc('page2.html');">p1</a> page two: <a href="#" oncli

python - Pandas, groupby and finding maximum in groups, returning value and count -

python - Pandas, groupby and finding maximum in groups, returning value and count - i have pandas dataframe log data: host service 0 this.com mail service 1 this.com mail service 2 this.com web 3 that.com mail service 4 other.net mail service 5 other.net web 6 other.net web and want find service on every host gives errors: host service no 0 this.com mail service 2 1 that.com mail service 1 2 other.net web 2 the solution found grouping host , service, , iterating on level 0 of index. can suggest better, shorter version? without iteration? df = df_logfile.groupby(['host','service']).agg({'service':np.size}) df_count = pd.dataframe() df_count['host'] = df_logfile['host'].unique() df_count['service'] = np.nan df_count['no'] = np.nan h,data in df.groupby(level=0): = data.idxmax()[0] service = i[1] no = data.

java - how can I run javaw in windows XP cmd? -

java - how can I run javaw in windows XP cmd? - i made programme using java. i export java project runnable jar file. i tested in windows 7 32bit. it runs perfectly. however, when tested in windows xp 32bit(i'm not sure it's sp version. maybe sp2 or sp3) it shows error message "cannot access c:\my.jar" i did googling, , found that windows 7 , xp have different function load javaw however... don't know exact way run javaw in windows xp how can run it? here code "cannot access" error public void runapplication() { seek { runtime.getruntime().exec("javaw -jar " + program_path + "/client.jar"); } grab (ioexception ioe) { ioe.printstacktrace(); } } and here code. if run this, windows xp doens't show anything. no error, no application. public void runapplication() { seek { runtime.getruntime().exec("start javaw -jar " + program_path + "/client

php - Refactor ternary to if-block programatically -

php - Refactor ternary to if-block programatically - is there way through context menus refactor ternary assignment 1 done if-else block? so, illustration you'd have this: $a = ($b > -32)? "up" : "down"; you'd apply transformation, , phpstorm magically alter into: if ($b > -32) { $a = "up"; } else { $a = "down"; } seems mutual , automated operation, must automated somewhere in labyrinth of menus. phpstorm 8 can alt-enter shortcut. set cursor @ ? operator , key in alt+enter. php phpstorm

java - Deltaspike and @Stateless Bean -

java - Deltaspike and @Stateless Bean - i want secure "stateless" ejb deltaspike-api. @stateless @remote(userserviceremote.class) public class userservice implements userserviceremote at method level have custom annotation "support" @support public void dosomething() {} therefore wrote custom annotation "@support": @retention(value = retentionpolicy.runtime) @target({elementtype.type, elementtype.method }) @documented @securitybindingtype public @interface back upwards { my custom authorizer looks like: @secures @support public boolean doadmincheck(identity identity, identitymanager identitymanager, relationshipmanager relationshipmanager) throws exception { homecoming hasrole(relationshipmanager, identity.getaccount(), getrole(identitymanager, "support")); } in "beans.xml" file included: <interceptors> <class>org.apache.deltaspike.security.impl.extension.securityi

c# - is there a e.ClickedItem for holding event -

c# - is there a e.ClickedItem for holding event - hi in clicked event able details of button clicked this private async void bedgridview_itemclick(object sender, itemclickeventargs e) { commonvariables.patientdetailsdict["bed_number"] = (e.clickeditem bedmodelv2).bed_number; } i wondering if there similar holding event info of selected item. code below not work holdingstate or originalsource. private async void bedgridview_holding(object sender, holdingroutedeventargs e) { commonvariables.patientdetailsdict["bed_number"] = (e.originalsource bedmodelv2).bed_number; } i'm guessing you're using wp8.1 because gridview supported in wp8. to reply question can selecteditem of gridview referencing name or converting sender object in holding event so: <!-- define gridview --> <gridview x:name="mygv" holding="mygv_holding"></gridview> cla

android - How to know if app is authorize by user to use Google Play Game Services -

android - How to know if app is authorize by user to use Google Play Game Services - i'm using gpgs in app achievements. connect gpgs on startup can load , set user achievements. want connect if user before connected clicking connect button in app. use case 1: - user opens app - app not connect gpgs use case 2: - user opens app - clicks button connect gpgs - closes app days later - user opens app - app connects gpgs i used store boolean flag in shared prefs know if app authorized. problem have no way know when user signs out in achievements activity or disconnects app in devices google settings. what like if(mgoogleapiclient.isautorized(){ mgoogleapiclient.connect(); } any ideas how can figure out if app authorized? when phone call mgoogleapiclient.connect() , not visible user unless login successful (and banner appears profile picture). you have phone call result.startresolutionforresult() result onconnectionfailed start user visible

android - Any way to maintain Holo theme while targetting lollipop/v21 of the SDK? -

android - Any way to maintain Holo theme while targetting lollipop/v21 of the SDK? - i've read this question, , guess "no" - still there detailes i'd clear. here result of illustration settings screen before , after upgrading sdk v21 , targetting it: before upgrade (target sdk 19) after upgrade (target sdk 21, on 21-device) after upgrade (target sdk 21, on 19-device) the application using next theme pre-upgrade: <style name="apptheme" parent="theme.appcompat.light.darkactionbar"/> ..and next theme post-upgrade: <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <item name="colorprimary">@color/topbar_background</item> <!--<item name="colorprimarydark">#0f0</item>--> <!-- scheme status bar --> <item name="coloraccent">@color/vg_theme_color</item> </style> so question real

How to determine SQL Server Instance name remotely -

How to determine SQL Server Instance name remotely - if know sql express installed on given computer. have sa password database. not know instance name. (so connection string " data source=[ip address]\????;user id=sa;password=[password] ") without logging box, how can determine instance name? if have sql server tools installed locally, osql -l will output list of available sql servers (including instance names) in current network. sql sql-server

Deep copying Java objects with circular references -

Deep copying Java objects with circular references - how go implementing deep re-create foo ? contains instance of bar , has reference foo . public class foo { bar bar; foo () { bar = new bar(this); } foo (foo oldfoo) { bar = new bar(oldfoo.bar); } public static void main(string[] args) { foo foo = new foo(); foo newfoo = new foo(foo); } class bar { foo foo; bar (foo foo) { this.foo = foo; } bar (bar oldbar) { foo = newfoo(oldbar.foo); } } } as stands, code cause stack overflow due infinite recursion. also, simplistic illustration construct. in practice, object graph larger, multiple instance variables collections. think multiple bar s, multiple foo s, instance. edit: i'm in process of implementing @chiastic-security's method. doing correctly foo? i'm using separate hashmap contain parts of object graph can write

c# - Folder Hash is returning different values every time -

c# - Folder Hash is returning different values every time - for application using function hash whole folder. when running code in visual studio returning same hash value everytime folder created. after created .exe , tried same, returns different hash values each time run it. sure files within folder has no change. have attached code hashing function below. why happening?? new here , not sure if doing correctly, apologize if question isnt clear enough. public static string createmd5forfolder(string path) { // assuming want include nested folders var files = directory.getfiles(path, "*.*", searchoption.alldirectories) .orderby(p => p).tolist(); md5 md5 = md5.create(); (int = 0; < files.count; i++) { string file = files[i]; // hash path string relativepath = file.substring(path.length + 1); byte[] pathbytes = encoding.utf8.getbytes(rel

python - pypi - Server response (503): backend read error -

python - pypi - Server response (503): backend read error - when seek register library in pypi command : python setup.py register i error : running register running check registering simplite https://pypi.python.org/pypi server response (503): backend read error how can prepare it? i had same thing happen me. temporary error. tried 1 time again after few minutes , worked. python python-3.x pypi

order - OpenGL sprite scene, using z-buffer with perspective projection and without distortion. Possible? -

order - OpenGL sprite scene, using z-buffer with perspective projection and without distortion. Possible? - i'm working on sprite based games. z-ordering sprites there alternatives 1) draw in right order - can troublesome batching 2) utilize orthographic projection , depth testing - can troublesome translucency favoring 2) maintain perspective projection allow easy 3d animations. cards beingness flipped in 3d etc. if that, z-buffer differences may/will result in scaling of sprites, since objects @ different distances camera. thought scaling sprites based on distance undo projection. interference 3d animated objects on top of "non-flat" 2d scene. guess sane way is, go orthographic 2d scene , rare 3d animations in sec step "cloned" objects on top of it. maybe has different idea? mikkokoos reply led solution. via additional depth value vertex shader can adjust z coords of vertices in clip space force them different depth layers. real 3d coords can

R issues with merge/rbind/concatenate two data frames -

R issues with merge/rbind/concatenate two data frames - i beginner r apologise in advance if question asked elsewhere. here issue: i have 2 info frames, df1 , df2, different number of rows , columns. 2 frames have 1 variable (column) in mutual called "customer_no". want merged frame match records based on "customer_no" , rows in df2 only.both data.frames have multiple rows each customer_no. i tried following: merged.df <- (df1, df2, by="customer_no",all.y=true) the problem assigns values of df1 df2 instead should empty. questions are: 1) how can tell command leave unmatched columns empty? 2) how can see merged file row came df? guess if resolve above question should easy see empty columns. i missing in command don't know what. if question has been answered somewhere else, still kind plenty rephrase in english language here r beginner? thanks! data example: df1: customer_no country year 10 uk 2001 10

jQuery validation error on IE8 -

jQuery validation error on IE8 - i'm getting 'object doesn't back upwards method or property' error on ie8. line of code referring below: $('#example-advanced-form').ajaxform({ target: '.success', success: function() { $('.success').fadein('fast'); $("#contact_form").toggle("fast"); } }); the reason using because formdata not work below ie10. here screenshot of error: here total script... <script type="text/javascript"> var form = $("#example-advanced-form").show(); $('#role').validate({ // initialize plugin rules: { role: { required: true, } } }); form.steps({ headertag: "h3", bodytag: "fieldset", transitioneffect: "slideleft&q

c# - dynamic linq join groupjoin selectmany generic result -

c# - dynamic linq join groupjoin selectmany generic result - i want able utilize dynamic linq c# queries join, groupjoin, selectmany incorporating defaultifempty() results, , want homecoming typed results, i.e., iqueryable , older select method. i've amalgamated source code several sources , set on blog: http://bradfultonprogramming.blogspot.com/2014/10/dynamic-linq-joins-groupjoin-selectmany.html c# linq generics dynamic left-join

c++ - Is it possible to add two multi-dimensional arrays together to a third multi-dimensional array -

c++ - Is it possible to add two multi-dimensional arrays together to a third multi-dimensional array - i attempting add together 2 multi-dimensional arrays 3rd array without much success.the first 2 arrays created have values , unsure of how add together multi-dimensional array multi-dimensional array b hand have value place in mult-directional array c. below started come up. thanks in advance time , skills. int main() { int a[2] [3] = { { 16, 18, 23 }, { 54, 91, 11 } }; int b[2][3] = { { 14, 52, 77 }, { 16, 19, 59 } }; int c[2][3]; (int rows = 0; rows < 2; rows++) { (int columns = 0; columns < 3; columns++) { c[rows][columns] = b[rows][columns] + a[rows][columns]; } } _getch(); homecoming 0; } one way shorter: flatten pointers , utilize transform . int c[2][3]; std::transform( *a, *std::end(a), *b, *c, std::plus<int>() ); // or plus<> since c++14 c++ arrays multidimensional-array

java Multi query from Mysql using netbeans -

java Multi query from Mysql using netbeans - i have java code retrieve info mysql appropriate code in netbeans.the code below. want multi query such illustration finding total number of products , on.could help me please. in advance import java.sql.*; public class javamysqlselectexample { public static void main(string[] args) { seek { string mydriver = "com.mysql.jdbc.driver"; string myurl = "jdbc:mysql://localhost/sample"; class.forname(mydriver); connection conn = drivermanager.getconnection(myurl, "root", "mypasscode1"); string query = "select * products"; statement st = conn.createstatement(); resultset rs = st.executequery(query); while (rs.next()==true) { int code = rs.getint("code"); string productname = rs.getstring("product_name"); string producttype = rs.getstring("product_type"); system.out.format(" %d, %s, %s\n", code, pr

php - Preventing php_network_getaddresses: getaddrinfo failed: -

php - Preventing php_network_getaddresses: getaddrinfo failed: - i trying phone call url php check if exists , reachable. my initial code was fopen('http://'.$this -> url, 'r'); but throws next errors every time url unreachable: fopen(http://dwzegdzgwedzgew.com): failed open stream: php_network_getaddresses: getaddrinfo failed php_network_getaddresses: getaddrinfo failed: the error operator (@) ignored in case error isn't thrown fopen while resolving asdress. thought should it: @fopen(@'http://'.$this -> url, 'r'); but goes on throwing error. is there non-error-throwing possibility check if url exists within php before opening it? what error message $ressource = @fopen('http://' . $this->url, 'r'); ? <?php $urls = array('kihgkighuhgkig.li', 'google.com', 'adsfafdf.fr'); foreach ($urls $url) { if (gethostbyname($url) != $url) { $ressource = f

html - Make parent div with absolute position take the width of children divs -

html - Make parent div with absolute position take the width of children divs - i have next html structure: <div class="parent"> <div class="child1"></div> <div class="child2"></div> </div> the parent positioned absolutely, child1 , child2 displayed side-by-side using inline-block. need whole thing responsive based on width of 2 children divs. problem is, if increment width of of them, parent's width remains same. changing position relative fixes this, have have in absolute. there anyway responsive? edit: i hoping simple, apparently not much... :( here's actual html: <div class="action_container"> <div class="action_inner"> <div class="action_title">format text</div> <div class="action_body"> <div class="action_args_section"></div> <div class="

performance - resultset.next() with 1 row taking too much time -

performance - resultset.next() with 1 row taking too much time - i have problem performance while querying sybase java program. have placed multiple logs debug , found query taking expected amount of time , , phone call resultset.next() seems taking equal amount of time! query "select count(*) from" , returns 1 row. , java code like. resultset = statement.executequery(); logger.debug("after fetching resultset"); while(resultset.next(){ numberofaccounts = resultset.getint(1); } logger.debug("after looping resultset::" +numberofaccounts) any ideas on why taking on average 200 milliseconds between above 2 logs? confirmed statement.executequery() taking aroud 150 ms. i checked google , seemed talking increasing statement fetchsize() . in case there 1 row. i'm printing query before executing pretty sure returning 1 row only. performance jdbc

ffmpeg command to extract first two minutes of a video -

ffmpeg command to extract first two minutes of a video - what simplest ffmpeg command truncate video first 2 minutes (or nil if video less 2 minutes) ? can pass-through on of initial video settings. $ ffmpeg -i in.mov -ss 0 -t 120 out.mov ffmpeg

javascript - Testing if JS method throws RangeError with QUnit -

javascript - Testing if JS method throws RangeError with QUnit - i made javascript unit tests qunit library, want test if method throws rangeerror. has done in way: qunit.test("resolve slide animation left", function( assert ) { var myowncreator = new myowncreator(); assert.equal(myowncreator.resolveanimationtype("slideside", "show", "left"), "slide-left-in"); assert.equal(myowncreator.resolveanimationtype("slideside", "hide", "left"), "slide-left-out"); assert.throws(myowncreator.resolveanimationtype("slideside", "hide"), new rangeerror(), " if animation type 'slideside', have provide right direction" + "to identify animation properly, direction cannot 'undefined'"); }); first , sec test passed, because animation classes resolved function (,,slide-...") ok. 3rd test died: died on test #3 @ file... bec

python - Why does Django generate migrations for help_text and verbose_name changes? -

python - Why does Django generate migrations for help_text and verbose_name changes? - when alter help_text or verbose_name of model fields , run python manage.py makemigrations , detects these changes , creates new migration, say, 0002_xxxx.py . i using postgresql , think these changes irrelevant database (i wonder if dbms these changes relevant exists @ all). why django generate migrations such changes? alternative ignore them? can apply changes 0002_xxxx.py previous migration ( 0001_initial.py ) manually , safely delete 0002_xxxx.py ? is there way update previous migration automatically? this ticket addressed problem. if have changed help_text & django generates new migration; can apply changes latest migration previous migration , delete latest migration. just alter help_text in previous migration help_text nowadays in latest migration , delete latest migration file. create sure remove corresponding *.pyc file if present. otherwise exception

scala - Obtain the URI of a Controller method call -

scala - Obtain the URI of a Controller method call - i'm writing play 2.3.2 application in scala. in application i'm writing method phone call other controller method following: def addtagtouser = corsaction.async { request => implicit val userrestformat = userformatters.restformatter implicit val inputformat = inputformatters.restformatter implicit val outputwriter = outputformatters.restwriter //update tag of user def updatetagtouserdb(value: jsvalue): future[boolean] = { val holder : wsrequestholder = ws.url("http://localhost:9000/recommendation/ advise") val complexholder = holder.withheaders("content-type" -> "application/json") complexholder.post(value).map(response => response.status match {//handle response case 200 => true case _ => false } ) } val jsondata = request.body.asjson //get json info jsondata match {

r - Sleeping shinyapp on shinyapps.io -

r - Sleeping shinyapp on shinyapps.io - how 'awaken' sleeping shinyapp on shinyapps.io? i have tried terminating , (re)deploying. not work. i think sleeping shinyapp wakes automatically when uses it. r shiny

sql server - selecting random rows in sql -

sql server - selecting random rows in sql - this question has reply here: select n random rows sql server table 13 answers i have list of records in tsql query. in situation want select random 5 rows output result. here snapshot of result- now if see image have many rows coming according query i've written- declare @table1 table ( cnt bigint, vid bigint ) insert @table1(cnt,vid) select count(video_id)as counts,video_views.video_id video_views video_views.is_active='true' grouping video_views.video_id select videos.*,vid @table1 left bring together videos on videos.video_id=vid cnt< '100' order cnt desc in query- managing video site, want implement section videos low views come. here in query table videos , whenever video viewed view lists row in table video_views . have written query in manner recor

.net - Error is not supported when compiling with /clr or /clr:pure -

.net - Error <mutex> is not supported when compiling with /clr or /clr:pure - i have c++ dll phone call dll have used: #include <mutex> dll properties set "no mutual language runtime support" , builds successfully. i have dll b includes dll in references. dll bs properties set to: "common language runtime back upwards (/clr)" includes c++/cli code. when build dll b error: c:\program files (x86)\microsoft visual studio 11.0\vc\include\mutex(8): fatal error c1189: #error : <mutex> not supported when compiling /clr or /clr:pure. i know cannot include in clr supported dll there way can around problem of referencing dll include it? .net c++-cli clr

elasticsearch - Query with values that have special characters -

elasticsearch - Query with values that have special characters - i have document next structure: { "_index": "logstash-2014.10.08", "_type": "iis", "_id": "hrm7lwfbspgo9pus0z1ynw", "_score": 1, "_source": { "@version": "1", "@timestamp": "2014-10-08t12:37:26.000z", "type": "iis", "messageid": "o5puhwouentt0xqxxfnw6l+o6emijtfo7e//t+s/99en4zzonlhqjeklw02zzvrflyvaawa==" } } here mapping: "messageid" : { "type" : "string", "norms" : { "enabled" : false }, "fields" : { "raw" : { "type" : "string", "index" : "not_analyzed", "ignore_above" : 256

yodlee - Why do I get a REFRESH_COMPLETED_WITH_UNCERTAIN_ACCOUNT? -

yodlee - Why do I get a REFRESH_COMPLETED_WITH_UNCERTAIN_ACCOUNT? - it's not clear me why i'm getting error: refresh_completed_with_uncertain_account the authentication workflow went through, can't summaries added site. when add together site , different types of accounts under provided credentials added. - saving, credit card account, loan business relationship etc. when refresh completed there failure in refresh 1 of different types of business relationship nowadays site user because of either info agent or site error status set. hence status has treated same refresh_completed , should able summary details. yodlee