Posts

Swift crashing with two core data entities -

Swift crashing with two core data entities - i have app set core info , 1 entity named "subject", when seek add together entity core info called "homework", app crashes , error 2014-10-04 12:41:05.302 homejournal[1050:20160] unresolved error optional(error domain=your_error_domain code=9999 "failed initialize application's saved data" userinfo=0x7fe6bb60cac0 {nslocalizedfailurereason=there error creating or loading application's saved data., nslocalizeddescription=failed initialize application's saved data, nsunderlyingerror=0x7fe6bb524760 "the operation couldn’t completed. (cocoa error 134100.)"}), optional([nslocalizedfailurereason: there error creating or loading application's saved data., nslocalizeddescription: failed initialize application's saved data, nsunderlyingerror: error domain=nscocoaerrordomain code=134100 "the operation couldn’t completed. (cocoa error 134100.)" userinfo=0x7fe6bb5247...

java - Sorting and Filtering in J2EE Application -

java - Sorting and Filtering in J2EE Application - i have been learning java web development while, , have pretty handle on servlets, jsp's, , familiar ajax/css/javascript. one thing have seen on lot of sites ability sort , filter list of items on webpage(items in storefront example). example, if i'm looking @ list of shoes, can filter , show ones available in size, , sort highest lowest price. i see ajax used in cases, question is, far end concerned, i'm assuming database isn't beingness queried every time sorting , filtering, of techniques accomplishing this? are objects stored in session, , when ajax phone call made, filtering parameters sent part of request, , servlet filtering , passes results? there pattern used this? it depends on dataset. little datasets, can, say, homecoming single json request client , filtering/sorting in javascript. for huge datasets, you'll allow server filtering , sorting, such you'd need transfer fraction...

excel - REALLY SLOW Loop -

excel - REALLY SLOW Loop - can give me insight why takes long run? i'm running winxp on parallels, 16gb macbook pro (4 gigs allocated vm). spreadsheet (created client) absolute nightmare - 38 sheets total of ridiculously complicated formulae, , multi-step overly complex algorithms create rube goldberg quite jealous. still, simple routine takes 30 minutes run. sub onelist() 'application.screenupdating = false ncols = range("scores").columns.count nrows = range("sc_id").rows.count 'msgbox nrows, ncols redim preserve scores(1 nrows, 1 ncols) = 2 nrows j = 1 ncols scores(i, j) = application.index(range("scores"), i, j) ' debug.print i, j ' debug.print scores(i, j) ' sheet36.range("a1:d197").cells(i - 1, j).value = scores(i, j) next j next sheet36.range("a1:d197").clear = 1 nrows b = 1 ncols sheet36.range("a1:d197").cells(a, b).value = scores(a, ...

java - How to use UserGroupInformation with Kerberos WebHDFS -

java - How to use UserGroupInformation with Kerberos WebHDFS - following client code on non hadoop scheme perform actions on secured remote hdfs. configuration conf = new configuration(); conf.set("hadoop.security.authentication", "kerberos"); conf.set("java.security.krb5.conf",krbpath); conf.set("fs.defaultfs", "webhdfs://10.31.251.254:50070"); conf.set("fs.webhdfs.impl", org.apache.hadoop.hdfs.web.webhdfsfilesystem.class.getname()); conf.set("com.sun.security.auth.module.krb5loginmodule", "required"); conf.set("debug", "true"); conf.set("ticketcache", "dir:/etc/"); system.out.print("conf......"); usergroupinformation.setconfiguration(conf); usergroupinformation.loginuserfromkeytab("dummy@example.com", keytab); system.out.print("obtained......"); uri uri = uri.create("webhdfs://dummy:50070"); filesystem fs ...

Display specific data from CSV using PHP -

Display specific data from CSV using PHP - the code have below working narrow downwards results. @ moment shows info column 1 (date), 2 (name), , 3 (result). now, search csv word 'won' in column 3 , limit search 3 results. example, show latest 3 games have got word 'won' in column 3. $file_handle = fopen("future.csv", "r"); while (!feof($file_handle) ) { $line_of_text = fgetcsv($file_handle, 1024); print $line_of_text[1] . $line_of_text[2]. $line_of_text[3] . "<br />"; } fclose($file_handle); any help much appreciated. cheers. keep counter of how many times "won" shows up, , when it's 3/more stop looping. $file_handle = fopen("future.csv", "r"); $counter = 1; while (!feof($file_handle) ) { $line_of_text = fgetcsv($file_handle, 1024); if (strpos($line_of_text[3], 'won') !== false) { print $line_of_text[1] . $line_of_text[2]. $line_of_text[3] . ...

How to limit the amount of requests per ip in Node.JS? -

How to limit the amount of requests per ip in Node.JS? - i'm trying think of way help minimize harm on node.js application if ever ddos attack. want limit requests per ip. want limit every ip address many requests per second. example: no ip address can exceed 10 requests every 3 seconds. so far have come this: http.createserver(req, res, function() { if(req.connection.remoteaddress ?????? ) { block ip 15 mins } } if want build @ app server level, have build info construction records each recent access particular ip address when new request arrives, can through history , see if has been doing many requests. if so, deny farther data. and, maintain info piling in server, you'd need sort of cleanup code gets rid of old access data. here's thought way (untested code illustrate idea): function accesslogger(n, t, blocktime) { this.qty = n; this.time = t; this.blocktime = blocktime; this.requests = {}; // sch...

ddms - how save a folder with some sub folders and files in mnt->sdcard? -

ddms - how save a folder with some sub folders and files in mnt->sdcard? - i want save folder sub folders , files in mnt->sdcard on emulator ddms .i can save files 1 after other cant save many files @ time or cant save folder totally in sdcard because new android.i did searches can not doing job yet.what do? maybe this? file root = new file(environment .getexternalstoragedirectory()+"/myprivatefolder"); if(!root.exists()){ root.mkdir(); } else{ file[] files = root.listfiles(); //access files } file myfile = new file(environment .getexternalstoragedirectory()+"/myprivatefolder/myfile.txt"); myfile.createnewfile(); // creating file don ever hardcoe "/sdcard" or smth this. more convenient method of navigation each file has methods accessing abosulutepath, getting info file or folder or exists , other android-sdcard ddms