Posts

Showing posts from July, 2013

Spring Social Twitter - User Authentication -

i'm new spring social , i'm writing spring mvc application users should use for, let's say, tweet, follow/unfollow users. far can want own credentials (stored in property file) using twittertemplate . i need application same on behalf of other users (authenticating them when registering in application). you want @ this part of spring social reference document entry point. have experienced facebook , linked in , works pretty store connections credentials in database. you want make sure guess not use providersignincontroller highlighted in of code samples designed using social provider authentication infrastructure web application connectcontroller has proved efficient in offline access cases. see section 4 of spring social reference documentation.

VBA Update table/recordset in Access using Loop with values from another table/recordset? -

i need some vba access. i have table "client_table" 100 rows of data. have table "salesrep_table" have 10 distinct sales rep id numbers (such as: aa1111 , , on). my goal run procedure takes first id record "aa1111" , places in appropriate column on clients table named "assignedsalesrepid" first 10 rows, next id number in salesrep_table gets inserted next 10 cells in clients table, , process repeats through loop until 10 ids in 10 rows each fill 100 rows of data in clients table. i went creating 2 recordsets , trying loop through sql update. end 100 records containing last sales rep id 100 times repeating. can take @ code , let me know needs fixed? public sub command01_click() dim strsql dim clientstablequery, salesreplist dim datab database dim clientqd querydef dim salesqd querydef dim rstclient recordset dim rstsalesrep recordset clienttablequery = "clients" salestablequery = "salesreplist" 'creates

java - is String(byte[], charset) memory efficient -

i looking @ source code volley , java networking library android, , puts entire network response new string object using constructor new string(byte[], string) where bulk of network response byte[] , headers parsed string. is creating large string way memory efficient? i've seen network calls inputstream s converted string s in while loop , can crash application when application runs out of memory. you don't efficient compared what, question doesn't have answer, overall agree you. response body after headers should made available input stream. infinitely long after all. reading entire requests or responses (or files) memory poor practice, , not 'efficient' several measures, example memory usage , latency.

JavaScript .reduce, previousValue is always undefined -

i curious why previousvalue undefined in following code when using .reduce on array: code: [2,2,2,3,4].reduce(function(previousvalue, currentvalue){ console.log("previous value: " + previousvalue); console.log("current value: " + currentvalue); },0) output: previous value: 0 (index): current value: 2 (index): previous value: undefined (index): current value: 2 (index): previous value: undefined (index): current value: 2 (index): previous value: undefined (index): current value: 3 (index):24 previous value: undefined (index):23 current value: 4 a fiddle can found here: http://jsfiddle.net/lzpxe/ you need return value in order use reduce correctly. returned value used in next step. like: [0,1,2,3,4].reduce(function(previousvalue, currentvalue) { return previousvalue + currentvalue; }); // returns 10 in total, because // 0 + 1 = 1 -> 1 + 2 = 3 -> 3 + 3 = 6 -> 6 + 4 = 10

javascript - Calling a function which is inside of a function -

my c# oriented braincells keep telling me should work: var myapp = function() { currenttime = function() { return new date(); }; }; myapp.currenttime(); clearly doesn't. if javascript function object, shouldn't able call function on object? missing? currenttime global (set when call myapp ), not property of myapp . to call it, without redefining function: myapp(); currenttime(); however, sounds want either: a simple object var myapp = { currenttime: function() { return new date(); }; }; myapp.currenttime(); a constructor function var myapp = function() { this.currenttime = function() { return new date(); }; }; var myappinstance = new myapp(); myappinstance.currenttime();

class - JavaScript object output in console.log -

i want know console.log name of constructing function when printing object. also, effect code wise? function f() { this.test = 'ok'; } var f = new f(); console.log( f ); the output of console.log (in chrome) is: f {test: "ok"} where console.log f in f {test... ? if change f.constructor , f.prototype , , f.constructor random, still prints original f : function g() { this.fail = 'bad'; } function f() { this.test = 'ok'; } f.prototype = g; f.constructor = g; var f = new f(); console.log( f ); the output still same - f {test: "ok"} is information kept privately browser, question affect javascript code in way? is, creep during comparison or inheritance, after override constructor's prototype , constructor properties? update the original purpose following. function person ( _name ) { this.name = _name; } function construct( _constructor, _args, _context ) { function f () { var

sql - complicated column calculation in mysql to get a count of monthly visits -

i have 2 tables this customer table first last cust_id john doe 0 jane doe 1 ledger table posted_date cust_id 2014-01-14 0 2014-01-20 0 2013-12-20 0 2013-12-20 1 2013-11-12 1 2013-11-10 1 i need calculate number of months customer posted transaction @ least once, being called customermonths last 12 months. means customermonths each cust_id between 0 , 12. data want see cust_id customermonths 0 2 1 2 this because cust_id 0 in @ least once in jan 2014 , @ least once in dec 2013. similarly, cust_id 1 in @ least once in dec 2013 , @ least once in nov 2013. example cust_id 0: 2014-01-14, 2014-01-20 = 1 customermonths 2013-12-20 = 1 customermonths so total customermonths last 12 months cust_id 0 2. i have working 1 month not sure how work last 12 months. although i'd settle working last 2 months. think figure out rest. here's have. select distinct c.cust_id, (case when count(ljan.posted_date) = 0 0 else

javascript - Saving Mongoose nested schema -

i'm having issue saving nested subdocs - not sure if because it's not array or - docs seem suggest nested objects auto saved not in case. a child schema: var address = new schema({ phone: string, name: string, street: { type: string, required: true } }); main schema: var order = new schema({ code: { type: string }, address: { type: schema.types.objectid, ref: "address" } }); neither of these work. create doc doesn't throw errors subdoc not saved var = new address({ phone: 000 }); var o = new order({ address: }).save(); this gives cast objectid failed error: var o = new order({ address: { phone: 000 } }).save(); the way seems work saving subdocs first i'd avoid have multiple addresses it's bit messy. it's weird have never encountered issue - ideas? ok. evidently cannot use subdocs without array. see post embedded document without array? , bug thread explaining reasoning: https://github.com/l

odbc - C# DBF Error Opening -

i trying write program read dbf file , put datatable. don't have experience working foxpro database. below funcation opens dbf. pass filename function. private datatable loadfile(string filename) { system.data.odbc.odbcconnection conn = new system.data.odbc.odbcconnection(); conn.connectionstring = "driver={microsoft dbase driver (*.dbf)};deleted=1"; datatable dt = new datatable(); try { conn.open(); system.data.odbc.odbccommand comm = new system.data.odbc.odbccommand(); comm.commandtext = @"select * " + @filename; comm.connection = conn; dt.load(comm.executereader()); } catch (exception ex) { messagebox.show(ex.tostring()); } finally{ conn.close(); } return dt; } the variable filename is "c:\\users\\psun\\desktop\\new folder\\plog.dbf" at run time error error [42000] [microsoft][odbc dbase driver] syntax error in clause.

android - Scrolling page with image/text/image -

Image
i'm newbie working on first ever app. want have page images @ top , bottom , large block of text in between. want scroll vertically. no matter try emulator stops app when access page. <?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent"> <tablelayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchcolumns="1"> <tablerow> <imageview android:layout_margin="6dip" android:id="@+id/francis_top" android:layout_width="wrap_content" android:layou

constraint programming - Solving equations as CSP -

i have set of equations. have set of values , results equation. like: a + b + c = x and allocation might be: 1 + 1 + 1 = 3 2 + 3 + 4 = 9 however, actual equations longer , may contain functions, example logarithms. i need alter result of given set in way (1) equation becomes equal specific value xx , (2) parameters change little possible. i thought solve csp altering eqation to (a + ax) + (b + bx) + (c + cx) = xx where a, b , c correspond old values , ax, bx , cx differences need applied corresponding old values. , xx result want equation have. note a, b, c, xa, xb, cx etc. integer values , xx within distance x, i.e. xx - d < x < xx + d . in csp a, b, c , xx treated problem facts, ax, bx, cx treated planning variable , equation (a + ax) + (b + bx) + (c + cx) = xx hard constraint. minimizing of ax, ab, ac soft constraint. don't see planning entity here. global hardsoftscoreholder scoreholder; rule "changeisbad" when deltavariab

php - CakePHP 2.2.3: How to pass variables from one form to another -

i'm pretty new cakephp , i've tried searching question related i'm trying think hasn't been asked here is: i'm developing student forms site school. school has own special log in system want users able use instead of site having own separate log in system. in user view i've got login.ctp file calls login() usercontroller , login function connects school's log-in system , validates user's credentials (username , password stored in $user_name , $user_pass ). i have log-in function check if first time user has logged in checking user model username used log in school's system. if username doesn't exist form redirects register.ctp (still user view) user required fill in first name, last name , other info gets stored in user model. need register form store username , password used log school's system. once user registers in should redirect student/forms view , use studentcontroller . how access $user_name , $user_pass i

node.js - Warning from mongodb - "(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate..." -

h there, i running node 0.10.24 , i'm trying records mongodb collection , once collection goes on 1000 elements error: node.js:375 throw new error(msg); ^ error: (node) warning: recursive process.nexttick detected. break in next version of node. please use setimmediate recursive deferral. @ maxtickwarn (node.js:375:15) @ process.nexttick (node.js:480:9) @ cursorstream._next (/var/www/html/node_modules/mongodb/lib/mongodb/cursorstream.js:76:11) @ cursorstream._onnextobject (/var/www/html/node_modules/mongodb/lib/mongodb/cursorstream.js:98:8) @ /var/www/html/node_modules/mongodb/lib/mongodb/cursorstream.js:78:12 @ cursor.nextobject (/var/www/html/node_modules/mongodb/lib/mongodb/cursor.js:540:5) @ /var/www/html/node_modules/mongodb/lib/mongodb/cursorstream.js:77:18 @ process._tickcallback (node.js:415:13) i tried 2 ways of fetching data mongodb without success. version 1: exports.findall = f

osx - JFrame minimized to dock name "java" -

i displaying jframe on os x , getting "java" name of application when minimized dock. passing -xdock:name="foo" , , changing name in dock when application not minimized, once minimize name in dock wrong. to minimize calling setextendedstate(jframe.iconified) . to effect on mac os x, you'll need add option application bundle's info.plist , shown in example cited here . <key>vmoptions</key> <string>-xdock:name=foo</string>

haskell - ComboBox doesn't show any of its strings -

i started using gtk2hs (gtk3 on hackage) , have run issues comboboxes. cannot make simple comboboxnewtext display strings. have commented out unneeded in application have basic framework actual box. import graphics.ui.gtk import control.monad.io.class main = initgui window <- windownew set window [windowtitle := "table", containerborderwidth := 20, windowdefaultwidth := 800, windowdefaultheight := 600] table <- tablenew 10 10 true containeradd window table lbox <- hboxnew false 0 rbox <- hboxnew false 0 tableattachdefaults table lbox 0 3 0 10 tableattachdefaults table rbox 3 10 0 10 cb <- comboboxnewtext comboboxappendtext cb "test" boxpackstart lbox cb packgrow 10 on window deleteevent $ liftio mainquit >> return false widgetshowall window maingui am missing something? gtk3 marked unstable iirc on hackage, bug? or doing incorrectly? adding comboboxsetactive cb 0 doesn't either. clari

xcode - UIButton Difficult to Press Near iPhone Edges -

Image
i'm having problem uibuttons responding tap near edge of iphone. after creating new xcode project, dragging button viewcontroller in storyboard near left-lower corner, , running simulator, button appears respond nicely tap on entire surface area of button. however , if run program on iphone, uibutton takes 1 second register lower-half of button register upper half of button. why this? then, when drag button towards center of iphone screen, registers tap @ point across button surface area immediately. try running app button near edge - same result? here screen shot of lower-left corner of viewcontroller - nothing special @ all. have viewcontroller buttons added along bottom edge of iphone. edit although have not yet resolved issue, have discovered control center , notification center features of iphone interfering buttons. know way around this? adding viewcontroller.m resolved issue: - (bool)prefersstatusbarhidden { return yes; }

php - How to use GET on an external URL -

i using api returns json get request eg. https://api.domain.com/v1/account/{auth_id}/call/{call_uuid} returns { "call_duration": 4, "total_amount": "0.00400" } how can call page within script , save call_duation , total_amount separate variables? something following?: $call_duration = $_get[https://api.domain.com/v1/account/{auth_id}/call/{call_uuid}, 'call_duration']; $_get[] contains get parameters passed code - don't generate get request. you use curl make request: $ch = curl_init("https://api.domain.com/v1/account/{auth_id}/call/{call_uuid}"); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer, 1); $output = curl_exec($ch); curl_close($ch); $result = json_decode($output);

xcode - xcconfigs: How to set up multiple configurations for a target -

Image
i can't tell xcode ui if target using both warnings , pods xcconfigs , or one. i've looked @ build log in xcode, , search either xcconfig name comes empty. how can tell what's happening behind scenes? xcode's filtered build log shows no results either configuration file: the projects based on "warnings" , targets on "pods". settings still cascade project down target in example "pods" not apply project. maintain sets of xcconfig files best suited "seed" project settings , separate files suitable seeding targets. also note build setting propagation occurs separate build. changes xcconfig files affect project , target settings. why won't see in build log them. think of settings target build being derived target settings may inherit project settings, inherit system default settings. independently of think of xcconfig files way of automatically imposing settings @ either project or target level, @ low

sql server - Insert data to parent table and child table at thesame time sql -

i'm want insert data parent table child table 1 sql query. i have 2 tables, users table , userinfo table users table - parent table user_id - pk username password userinfo table - child table user_id - fk parent table lastname firstname etc... i'm using 2 inserts before have same user_id. there way in single query? you view instead of insert trigger. i'm not saying that's best idea, could. also, wrap in stored procedure pass username, password, first name, last name, etc , proc handle 2 (or more) inserts you.

python - Why using integer as setting _id with pymongo doesn't work? -

this question has answer here: pymongo saving embedded objectids, invaliddocumenterror 1 answer i've tried larger data set in python , had issues, created small test set, in python pymongo: from pymongo import mongoclient testcoll = mongoclient().tdb.tcoll data = {'foo': 'bar', 'baz': {1: {'a': 'b'}}, '_id': 'ab123456789'} testcoll.insert(data) this returns bson.errors.invaliddocument: documents must have string keys, key 1 replacing 1 in dictionary in baz 2 changes error key 2 accordingly why this? missing ids in mongo? i've submitted edit title of post considering misleading problem having. not trying update _id field indicated rather python dictionary definition incompatible bson spec. in line: data = {'foo': 'bar', 'baz': {1: {'a': 'b'}}

eclipse - Android studio external library projects -

i'm moving eclipse android studio , set in eclipse: have several android app projects, depending on several library projects (some shared) within 1 workspace. in android studio first started creating project per app, realized have have library projects modules within each project uses them. mean duplicating library projects , including them in each app, highly redundant , require maintaining multiple copies of libraries. so switched having apps , libraries modules within same project. works building creates other problems such version control issues since each module lives in separate version control repository. what cleanest way have setup? , real question is, can have separate projects in share same external library projects? note with release of android studio 0.5.0, answer obsolete, i'll leave below reference. more up-to-date instructions, see how share single library source across multiple projects in android studio, it's difficult have shared l

c++ - Expression: string subscript out of range. Attribute passing issue? -

i running error during program's runtime: "debug assertion failed! ... expression: string subscript out of range." this happening in loop when if statement attempts check if character @ 'i' in string isdelimiter() or isoperator(). passing char 'check' attribute, , in comments have made sure 'check' grabbing correct character. i've been working on issue while , can't seem resolve it. edited @ bottom string inputline = ""; string inputstring = ""; int main() { ifstream input("input.txt"); getline(input, inputline); if (input.is_open()) { while (!input.eof()) { getline(input, inputline); (int = 0; i<inputline.length(); i++) { char check = inputline[i]; //cout << check << "\n"; // test correct character

typescript - Weird error when overloading methods with generics -

i have class implements interface. both define method takes in generic , outputs array of same type generic. i'm getting weird error inconsistencies between class , interface , i'm not sure how solve it. here sample code: class random implements irandom { generatearray<t>(method: string): array<t>; generatearray<t>(constructor: new () => t): array<t>; generatearray(method: any) { return new array<any>(); } } interface irandom { generatearray<t>(method: string): array<t>; generatearray<t>(constructor: new () => t): array<t>; } here error snippet above code: class random declares interface irandom not implement it: types of property 'generatearray' of types 'random' , 'irandom' incompatible: call signatures of types '{ <t>(method: string): t[]; <t>(constructor: new() => t): t[]; }' , '{ <t>(method: string): t[

java - Using "or" statements with strings in an if statement -

so want make code categorizes words match phrase. catstring string inputted user. want execute rest of code if input fire or smoke. here's line i'm having trouble with: if(catstring = "fire" || "smoke" ); you need repeat catstring = . however, should not using == (not = , assignment operator) compare strings . use .equals() . like: if(catstring.equals("fire") || catstring.equals("smoke"));

node.js - Aggregate in mongoDB -

i did @ lot of code example never found out want. loop prefer use mongo engine result want it. more crazy begin spend lot of time on , looks basic ... i'm running nodejs express , mongodb. basically have collection information : { "aqi": 149, "area": "al", "position_name": "montgomery", "station_code": "1793a", }, { "aqi": 162, "area": "al", "position_name": "huntsville", "station_code": "1790a", }, { "aqi": 73, "area": "tx", "position_name": "dallas", "station_code": "1792a", } i result dataset like { "_id": "al", "positions": [ { "position_name": "montgomery", "station_code": "1793a" }, { "position_name": "huntsville&qu

in emacs-lisp, how to position point in middle of text string? -

in emacs-lisp, how position point in middle of text string? i'd cursor wind %s in following function: (defun web-research () (interactive) (insert "#+begin_quote\n\n%s\n#+end_quote\n") (org-mac-chrome-insert-frontmost-url) ) there many options. e.g., (defun web-research () (interactive) (insert "#+begin_quote\n\n%s\n#+end_quote\n") (search-backward "%") (org-mac-chrome-insert-frontmost-url)) or (defun web-research () (interactive) (insert "#+begin_quote\n\n") (let ((p (point))) (insert "\n\n#+end_quote\n") (org-mac-chrome-insert-frontmost-url) (goto-char p)) or (defun web-research () (interactive) (insert "#+begin_quote\n\n%s") (save-excursion (insert "\n#+end_quote\n")) (org-mac-chrome-insert-frontmost-url)) imo second best.

c# - Value from class is unreachable? -

in app i'm using web request pull json data web source , deserializing class. want pull specific value data, i'm finding can't reach current code. here classes public class result { public int id { get; set; } public string name { get; set; } public int tracknumber { get; set; } public string title { get; set; } public list<artist> artists { get; set; } public list<genre> genres { get; set; } public release release { get; set; } public label label { get; set; } public images images { get; set; } public int downloadid { get; set; } public string downloadurl { get; set; } // value i'm trying retrieve } public class rootobject { public metadata metadata { get; set; } public observablecollection<result> results { get; set; } } and code deserialize data attempt store desired value string variable rootobject data = jsonconvert.deserializeobject<rootobject>(response); string downloadurl =

javascript - How to get a difference between two cursor positions at the two different moment? -

for example have 1 position of cursor, put in variable, , want difference between variable , cursor position after 10 ms. have no idea do. i want make such drag'n'drop might drag element without focusing concretely it. i'm here, it's bullshit, may understand want)). <!doctype html> <html> <head> <title>example</title> <style> .red { width:500px; height:100px; background:red; cursor: move; position:relative; } .green { width:100px; height:100px; background:green; position:absolute; left:0; } </style> <script src="http://code.jquery.com/jquery-2.1.0.min.js" type="text/javascript"></script> <script type="text/javascript"> var draggble = false; var currentleft; var currentx; $(document).on("mousedown",".red",function(){ draggble = true; currentleft = parseint($(".

r - Forecasting a tslm model with seasonal and cubic components -

i'm having issues forecasting model of following form. y1<-tslm(data_ts~ season+t+i(t^2)+i(t^3)+0) it fits data well, run problem when attempting this: forecast(y1,h=72) this error gives me. "error in model.frame.default(terms, newdata, na.action = na.action, xlev = object$xlevels) : variable lengths differ (found 't') in addition: warning message: 'newdata' had 72 rows variables found have 1000 rows" as far can tell, has using tslm , having cubic function in it. if use "tslm(data_ds~season+trend)" works out fine, need model mentioned earlier. how can forecast model? thank in advance can give , apologize if foolish question, johnson

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

i have used httpclient3.1(java) connection pooling below : import org.apache.commons.httpclient.httpclient; import org.apache.commons.httpclient.multithreadedhttpconnectionmanager; import org.apache.commons.httpclient.params.httpclientparams; import org.apache.commons.httpclient.params.httpmethodparams; import org.apache.log4j.logger; public class httpclientmanager { private static logger logger = logger.getlogger(httpclientmanager.class); private static multithreadedhttpconnectionmanager connectionmanager = new multithreadedhttpconnectionmanager(); private static httpclientparams clientparams = new httpclientparams(); static { try { clientparams.makelenient(); clientparams.setauthenticationpreemptive(false); clientparams.setparameter(httpmethodparams.so_timeout, new integer(30000)); // set so_timeout clientparams.setparameter(httpmethodparams.head_body_check_timeout, new integer(3000)); // head responses

Application(.exe) created in visual studio 2012 in not working -

am using windows 8.1. have created application in visual c++,clr project in visual studio 2012. .exe file working fine in computer. when run .exe file in computer not opening/working. not showing error messages or app crash report. don't know problem can solve issue?

php - retrieving data from database does not work on this code -

categories databse table: id | name 1 | electronics 2 | automotive classifieds database table: id user_id category_id cover title price description 102 1 2 iamges/1.jpg blabla 10 blablabla i error saying: notice: undefined variable: name1 in **\post.php on line 49 $id = $_get['id']; $res2 = mysql_query("select * `classifieds` `id` = '" . $id . "' limit 1"); if($res2 && mysql_num_rows($res2) > 0){ while($row = mysql_fetch_assoc($res2)){ $id = $row['id']; $user_id = $row['user_id']; $category_id = $row['category_id']; $price = $row['price']; $cover = $row['cover']; $title = $row['title']; $description = $row['description']; $profile_data = user_data($user_id, 'username'); $res3 = mysql_query("select * `categories` `id` =

css - Cut the corner off of a responsive image -

Image
i have image has corner cut off. image has responsive can grow , shrink page. image managed cms has have corner cut programmatically. client won't doing manually before uploading. i've can use svg outline part of image need shown. unfortunately have give set path stops being responsive. tried creating pattern uses image fill path <svg version="1.1" viewbox="0 0 242 282" preserveaspectratio="xminymin meet" class="svg-content"> <defs> <pattern id="img1" patternunits="userspaceonuse" width="242" height="282" x="0" y="0"> <image xlink:href="http://placehold.it/242x282" x="0" y="0" width="242" height="282" /> </pattern> </defs> <path d="m 0 0 l 178 0 l 242 64 l 242 282 l 0 282 z" stroke="green" fill="url(#img1)"/> <

hibernate - Specify Postgresql datasource default schema in JBoss -

i've setup datasource on jboss connect eap 6.2 postgresql 9.3.2. i'm using postgresql-9.3-1100.jdbc4.jar driver. connects when using test connection button in jboss admin console. when trying connect (query/persist) entity via java gives me following error: org.postgresql.util.psqlexception: error: relation "student" not exist i've added following line in persistence.xml include schema <property name="hibernate.default_schema" value="archu"/> but error includes schema: org.postgresql.util.psqlexception: error: relation "archu.student" not exist i've queried database via netbeans , works modifying "archu.student" archu."student". in database table student spelled using uppercase s jboss datasource uses lowercase. jboss datasource appends schema "" around archu , student doesn't want work. is there better way specify schema in datasource , tell datasource not make lowerc

jdbc - movenext button not working in java -

private void btn_nextactionperformed(java.awt.event.actionevent evt) { try { class.forname("sun.jdbc.odbc.jdbcodbcdriver"); connect =drivermanager.getconnection("jdbc:odbc:reimbursement"); } catch(exception e) { system.out.println(e.getmessage()); } try { stmt = connect.createstatement(resultset.type_scroll_insensitive, resultset.concur_updatable ); sql = "select * reimbursementmaster"; rs = stmt.executequery( sql ); rs=stmt.getresultset(); if(rs.next()) { empcode=rs.getstring("employeecode"); empname=rs.getstring("employeename"); loc=rs.getstring("location"); location=loc; } else { rs.previous(); joptionpane.showmessagedialog(this, "end of file","message",joptionpane.information_message ); } } catch(sqlexception e) {

iphone - This bundle is invalid . New app and app updates submitted to the app store must be build with xcode 5 and ios 7 sdk -

Image
i'm not able post application xcode 4.6.2, while uploading giving me error. gets rejected due seems sdk error: error delivering ios app update. “this bundle invalid. new apps , updates submitted app store must built xcode 5 , ios 7 sdk.” i'm struggling figure out has changed since building same sdk did last weekend. starting february 1, 2014, new apps , app updates submitted app store must built latest version of xcode 5 , must optimized ios 7.

javascript - dc.js - data table using jquery data-table plugin -

i'm using dc.js create charts , data table. i wanted add pagination styles , search option in table. jquery data table script : $(document).ready(function() { $('#data-table').datatable(); }) problem - jquery data table options displayed search box, number of entries. none of them work. some 1 please help. found post . nothing useful. i use dynatable - http://www.dynatable.com/ 1) define table html: <table id="dc-data-table"> <thead> <tr> <th data-dynatable-column="client_name">client</th> <th data-dynatable-column="project_name">project</th> </tr> </thead> </table> 2) hook in dynatable preferred options , crossfilter dimension: var dynatable = $('#dc-data-table').dynatable({ features: { pushstate: false }, dataset: {

Does mono application bundled with mkbundle use app.config? -

i build application this: mkbundle --static -o de --deps deviceemulator.exe unionargparser.dll emulators.dll nlog.dll protocol.dll fsharpx.core.dll when run ./de on same machine application works fine. when copy other machine (i use lxc container) , start got error: exception: system.configuration.configurationerrorsexception: error initializing configuration system. system.configuration.configurationerrorsexception: unrecognized configuration section (/home/ubuntu/tests/device/deviceemulator.exe.config line 3) addition i found solution myself. need pass parameter --machine-config <path mono/runtime/etc/mono/4.0/machine.config> when bundle. solve problem error.

c++ - QTableView preserve selection after model refresh -

i tried build user interface displays content of table while data refreshed every second. therefore have chain of models: qsqltablemodel - access tables content mymodel - inherited qidentityproxymodel modify data bit (source tablemodel) somefiltermodels - have mymodel source this chain ends in qtableview. because qsqltablemodel refreshed every second, selection in tableview removed every second also. had 2 ideas fix this. prevent tablemodel detecting changes. not working well. catching events fired before , after model change store , restore current selection. sadly qidentityproxymodel not forward signals modelabouttobereset or modelreset or datachanged .. impossible reemit signals mymodel because private. i searching other ways counter refresh problems without success. can't imagine first person uses chain of proxy models combined periodic model refresh , selections. can give me tips? thanks in advance. maybe worth note: one qsqltablemodel used many t

asp.net mvc - Linq query, how to orderby -

i have method gets data database linq queries. data shown expected not in order wan't. need sort products database totalquantity property shown in query 1 , 2. im trying use ordeby i'm not sure how add in context. need one. this method: public ilist<bestsellersreportline> dailybestsellersreport() { orderstatus os; paymentstatus ps; shippingstatus ss; int billingcountryid = 0; int recordstoreturn = 10; int orderby = 1; int groupby = 1; var range = new { starttimeutc = datetime.today.adddays(-1), endtimeutc = datetime.today.addseconds(-1), createdonutc = datetime.today.adddays(-1), }; var query1 = opv in _opvrepository.table join o in _orderrepository.table on opv.orderid equals o.id join pv in _productvariantrepository.table on opv.productvariantid equals pv.id join p in _productrepository.table on pv.productid equals p.id (o.created

mysql - Is SQuirreL SQL Client compatible with QODBC? -

does know if squirrel sql client compatible qodbc? if not there plugin squirrel enable so? any insight appreciated have never used either. an example of qodbc driver working java odbc bridge product note: below example code 1 of our happy customers: // quickbooks variables connection con =null; statement stmt = null; resultset rs = null; // parameters quickbooks database static final string url = "jdbc:odbc:quickbooks"; // "quickbooks" system dsn name of qodbc driver // on windowsxp can set @ control panel > administrative tools > // data sources (odbc) static final string driver = "sun.jdbc.odbc.jdbcodbcdriver"; public static void main(string[] args) throws exception { insertcustomers t = new insertcustomers(); } public insertcustomers() throws exception { try { class.forname(driver); con = drivermanager.getconnection(url); stmt = con.createstatement(); system.out.println("querying qb customer table"); rs = stmt.ex

angularjs - How to configure Spring and Angular to work together -

i have spring rest server (v3.2) , angularjs client code. from understanding in basic scenario user navigates base domain .com, index.html being sent , and point angular manages communication. my questions are: 1. how set spring return angular file. 2. how handle situation user not go though base domain , navigates .com/books/moby-dick returns json representation of moby-dick book suppose rendered client a tutorial highly appreciated. web initialzer class: public class webappinitializer implements webapplicationinitializer { private static logger log = loggerfactory.getlogger(webappinitializer.class); @override public void onstartup(servletcontext servletcontext) { webapplicationcontext rootcontext = createrootcontext(servletcontext); configurespringmvc(servletcontext, rootcontext); filterregistration.dynamic corsfilter = servletcontext.addfilter("corsfilter", corsfilter.class); corsfilter.addmappingforurlpatterns

javascript - Error with django-grappelli 2.4.8 -

i have added grappelli project , following javascript error in console when opening list view in admin interface work django 1.5.5 , grappelli 2.4.8 typeerror: 'undefined' not function (evaluating '$("tr input.action-select").actions()') the javascript code: <script type="text/javascript" charset="utf-8"> (function($) { $(document).ready(function() { $("tr input.action-select").actions(); }); })(grp.jquery); </script> base.py grapelli before django.contrib on list 'grappelli', 'django.contrib.admin', anyone know about? steps taken far: clear cache my problem use amazon s3, needed delete old admin , grappelli files before using collect static again, once did that, worked.

__shared__ variable behaving oddly CUDA -

consider below code runs under 9us on k20 : __global__ void histogram( unsigned char *inputpointer, int *outputpointer) { __shared__ unsigned char localdispersedhistogram[ 256 ] [ 32 ]; __shared__ unsigned int parthist[ 256 ] ; int ; int tx = threadidx.x; int pixeloffset = (blockidx.x * blockdim.x) + threadidx.x; uint8_t val = inputpointer[ pixeloffset ]; uint8_t data = val/ 8 ; uint8_t position = val % 8 ; /**trying avoid loops thats why code */ localdispersedhistogram [ tx ] [ tx % 32 ] = 0 ; __syncthreads(); turn_on( localdispersedhistogram [ tx ] [ data ] , position ); __syncthreads(); parthist[ tx ] = 0; int k = 0 ; ( int = 0 ; < 256 ; ++ ) { k++; } } now below code take 72us on access of shared variable: __global__ void histogram( unsigned char *inputpointer, int *outputpointer) { __shared__ unsigned char localdispersedhistogram[ 256 ] [ 32 ]; __shared__ unsign

node.js - How To Reduce a Javascript Date Object to a String in this Format: "02/14/2010" -

this question has answer here: where can find documentation on formatting date in javascript? 33 answers how format date in mm/dd/yyyy hh:mm:ss format in javascript? [duplicate] 4 answers how can convert javascript date objects date string in following format: date object 2000-01-12 23:00:00.000z resulting string "01/12/2000 23" date.getdate() + '/' + (date.getmonth() +1) + '/' + date.getfullyear() + ' ' + (date.gethours() + 1) why +1 ask? because javascript. :(

python - PC name display for SimpleHTTPServer -

when run python -m simplehttpserver <port> on office network, can full pc name displayed in log output. serving http on 0.0.0.0 port 59992 ... <pc name> - - [04/feb/2014 04:59:30] "get / http/1.1" 200 - but when run same in home network or locally host it, logs display ip address accessed service. serving http on 0.0.0.0 port 59992 ... <my ip> - - [04/feb/2014 04:59:30] "get / http/1.1" 200 - is there way make home network same?

php - Getting the the input value after focus out -

i want add number of input fields in form depends on value of previous input fields. example: have 2 inputs if user 1.<tr><td>number of articles/posts/pages:</td><td><input type="number" name="count" ></td></tr> 2.<tr><td>keywords:</td><td><?php $number_of_keywords=$_post['count']; i="<input type='text' name='keyword'>"; i++; i==$number_of_articles; echo i; ?></td></tr> for example if user type 3 in count field, want show 3 input field. number of input fields depend on how user type in count field. please tell me if above code work here , how can count field value @ run time? no, can't count field value @ run time, value must submitted via form or passed parameter in query string, php knows it. this question more appropriated tagged javascript question, php question. if want @ run time. if strictly using ph