Posts

Featured post

Issue with mongodb document limit -

i using mongodb 3.0.2 , when run "top" command : > db.runcommand( { top: 1 } ) i got following error message: 2015-06-01t16:36:52.886+0900 e query error: error: { "$err" : "bsonobj size: 46060490 (0x2bed3ca) invalid. size must between 0 , 16793600(16mb)", "code" : 10334 } @ error () @ dbquery.next (src/mongo/shell/query.js:259:15) @ dbcollection.findone (src/mongo/shell/collection.js:189:22) @ db.runcommand (src/mongo/shell/db.js:58:41) @ (shell):1:4 @ src/mongo/shell/query.js:259 it means can't monitor longer, doesn't it? can guys show me way out, please. some additional info: db size: 143.996gb - wiredtiger enable. replication set enable. no profiling.

javascript - OpenShift + Diet.js -

trying simple diet.js server running on openshift (free plan) server never starts (runs fine locally). domain ( http://twilio-levelout.rhcloud.com/ ) returns 503 , logs throw: events.js:72 throw er; // unhandled 'error' event ^ error: listen eacces here's code: var server = require('diet'), app = server(); var server_ip_address = process.env.openshift_nodejs_ip || '127.0.0.1'; var server_port = process.env.openshift_nodejs_port || 3000; app.get('/', function ($) { $.end('hello world!'); }); app.listen("http://" + server_ip_address + ":" + server_port); the server runs default example , simple express app not above. any ideas? the access error means not using proper port or trying bind interface have no access to, when tried example, did not work on local machine. the problem in example app.listen should appear before app.get. your example should this: var server

php - phpexcel not converting my html table tag -

this code using phpexcel $objphpexcel = new phpexcel(); $objphpexcel->setactivesheetindex(0); $objphpexcel->getactivesheet()->setcellvalue('a1', $message); $objphpexcel->getactivesheet()->settitle('sheet 1'); /*header('content-type: application/vnd.ms-excel'); header('content-disposition: attachment;filename="name_of_file.xls"'); header('cache-control: max-age=0');*/ $objwriter = phpexcel_iofactory::createwriter($objphpexcel, 'excel5'); $objwriter->save('test.xls'); i commented header because downloads using browser. $message contains <style> .td_font{ display: block; line-height:1px; } .header{ font-size:0.8em; display: block; text-align:center; font-weight:bolder;

javascript - FullCalendar today-button: date instead of text // issue with the lang -

i want show current date instead of fixed text in today-button. >> irismediainfo3.lili.de development-website working on. not find option in docs, searched in moment.js-docs , found: moment().format(); and used in fullcalendar this: buttontext: { next: '>', nextyear: '>>', prev: '<', prevyear: '<<', today: moment().format("mmmm yyyy") }, the result good, in english. fullcalendar should multilingual, tried combined with moment.locale(string); first try: buttontext: { next: '>', nextyear: '>>', prev: '<', prevyear: '<<', today: moment().locale('de').format("mmmm yyyy") }, but there no changes. thought moment.js maybe access lang-files of fullcalendar.

java - How to add new Lookup into DefaultGazetteer programatically -

i want add new lookup loaded defaultgazetteer programatically. if add string via file, works perfectly any welcomed. thanks string test="hello@code=555.5@code_asociated_description=world@code1=@code2=@code3=@code4=@code5=@code6=@code7="; gazetter.add(test, new lookup("glossary.lst", "test", "test", "en")); thelist.add(new gazetteernode(test, "@")); this add lookup only: lookup l = new lookup("glossary.lst", "major", "minor", "en", "annottype"); l.features = new hashmap<>(); l.features.put("somefeaturename", "some value"); gazetter.add("string found", l); this update linear definition ( .def & .lst files): lineardefinition ld = gazetter.getlineardefinition(); //add .lst record linearnode ln = new linearnode("glossary.lst", "minor", "major", "en"

java - How to pass args when calling one method from another -

i have written following code create key pair, store private key locally, , read private key file. when try call methods saveprivatekey(); , retrieveprivatekey(); testdata(view view) error says (string[]) cannot applied (). want able call both of above mentioned functions in testdata(view view); public class encryptionactivity extends actionbaractivity { private static final string tag = encryptionactivity.class.getsimplename(); textview textpublickey; textview textprivatekey; button buttontest; textview privatekey; integer n; string filename = "privatekey"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_encryption); // output keys screen textprivatekey = (textview)findviewbyid(r.id.textprivatekey); textprivatekey.setmovementmethod(new scrollingmovementmethod()); // textpublickey = (textview)findviewbyid(r.id.textpublickey); } private void asymmetricalgori

bash - Best practices on setting exit status codes -

when implementing own scripts, best practice exit different exit codes different failure scenarios? or should return exit code 1 failure , 0 success providing reason on stderr? providing descriptive error message stderr fine , interactive users, if expect scripts used other scripts/programs, should have distinctive error codes different failures, calling script make informed decision on how handle failure. if calling program not wish handle different failures differently check return code against > 0 - don't assume case.