Posts

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.

Android: sharing the Facebook page post -

i'm creating android app , need integrate facebook functions in app. among them need share facebook page posts. try use native share button. https://developers.facebook.com/docs/sharing/android but can't achieve sharing of page post. when try share page post can share page. for example, try share post https://www.facebook.com/arsenaltheprideofengland/posts/863092823730119 and result sharing of page https://www.facebook.com/arsenaltheprideofengland i read graph api docs sharing , discover it's not possible use sharing. is possible @ share facebook page post using custom android app?

database - php wikipedia (change information in div) -

does know how can make wikipedia website -change information , send mail -can changed if logged i think can make script "only changing when logged" self, need begin. dont know how can make script web-stars <div>this information, if logged, can change me , send change emailadress</div> <input type="button" name="changediv" valuee="change" /> yes! need install script http://www.mediawiki.org/wiki/mediawiki on host. it's php script wich copy of wikipedia template.

ios - How to retrieve user's friend list and show in TableView with swift -

i'm using parse , i'm able save user's friend user added in current user's object don't know how retrieve current user's friend list , show them in tableview how can list current user's object , display in tableview parse in swift. (my app doesn't have facebook @ all). appreciated. thank you edit: op posted code in comments, formatted question: var query = pfuser.query(); var currentuser = pfquery(classname:"user"); currentuser.wherekey("currentuser", equalto: pfuser.currentuser()) currentuser.findobjectsinbackgroundwithblock { (objects:[anyobject]!, error:nserror!) -> void in if error == nil { self.tableview.reloaddata() } i've managed save friend user added in pfrelation can't manage show user list in tableview.my tableview didn't show username of current user account you may want check post on parse.com, explains how findobjectsinbackgroundwithblock: works: https://w...

javascript - Calculate total for selected items in a table -

i have 3 tables each multiple rows. need find way calculate total of columns. each row has checkbox, when checked, need able add rows values total. i have this, adding totals each column, can not work out how when checkbox selected total updated, , if deselected removed total. table example... <table class="transfer-group-table table table-hover tablesorter"> <thead> <tr> <th>name</th> <th>invoice #</th> <th>invoice amount</th> <th>order status</th> <th>payment menthod</th> <th>service fee</th> <th>funding fee</th> <th>delivery date</th> <th>transfer amount</th> <th></th> </tr> </thead> <tbody> <tr id="2942"> <td> <p>a company ltd</p> </td> <td...

operating system - Random access alternative to named pipes -

is there way create "file" (i.e. point in file system) can opened program regular file, reading/writing go program instead of disk? named pipe seems meet requirements, except allows serial file access. i interested in *nix type systems, curious hear of such system on os/file system. here implementation: demon.c: #include <stdio.h> #include <stdlib.h> #include <sys/mman.h> #include <unistd.h> #include <fcntl.h> #include <assert.h> #include <string.h> #include <errno.h> void map_file(const char *f) { int fd = open(f, o_creat|o_rdwr, 0666); if (fd < 0) { perror("fd open error\n"); exit(-1); } char *addr = (char *)mmap(null, 10, prot_read | prot_write, map_shared, fd, 0); if (addr == map_failed) { exit(-1); } int i; (i = 0; != 10; ++i) { addr[i] = '0' + i; } while (1) { (i = 0; != 10; ++i) { if (addr[i...

Identifying and highlighting a blank row in Excel VBA -

scenario: each row contain 23 columns; 20 contain user populated data , last 3 autogenerated through vba. while running if vba code identifies first 20 columns of row blank cells whole row declared blank , highlighted. i have been able write following code: each rng in range("a1:a" & lastrow) rng if .value < 1 msgbox "blank cell found" blnkcnt = 0 each mycl in range("a" & activecell.row & ":t" & activecell.row) mycl if .value < 1 blnkcnt = blnkcnt + 1 end if end next mycl if blnkcnt = 20 lcount = lcount + 1 .entirerow.interior .colorindex = 6 .pattern = xlsolid .patterncolorindex = xlautomatic end end if end if end next rng if lcount > 0 msgbox "data contains blank row(s): " & lcount end else msgbox "no blank rows" end if ...

angularjs - Form Submission in Modal Window and Refresh Content of a Tab -

i have 2 tabs: list.brands , add.brand: <script type="text/ng-template" id="list.brands"> <table class="table table-striped table-bordered bootstrap-datatable datatable datatable" id="datatables_table_0" aria-describedby="datatables_table_0_info" ng-controller="brandsctrl"> <input type="text" ng-model="searchbox"> <thead> <tr> <th><tags:label text="brandid"/></th> <th><tags:label text="name"/></th> <th><tags:label text="isactive"/></th> <th></th> </tr> </thead> <tbody> <tr id="actionresult{{$index + 1}}...

java - Why GraphicsContext uses methods with double params? -

i'm moving swing javafx. wondered why graphicscontext uses methods double params. example fillrect(double x, double y, double w, double h) unlike swing has methods drawrect(int x, int y, int width, int height) . should calculations in double? drawrect in inherited graphics uses int specify co-ords & size. the graphics2d object on other hand, capable of dealing graphics values lie 'between whole pixels'. compensate typically render dithered pixel (part way between drawing , bg color) @ parts of rendering has deal fractions of pixel. should calculations in double? yes! double values equal integer rendered might expect graphics method - sharp, clean lines. if boundary of shape ever falls between whole pixels, color dithered.

mysql - Java DatabaseMetaData.getSchemas() returns empty ResultSet, expected non-empty ResultSet -

trying understand going on here. databasemetadata returning empty result set, sql query same not. not major issue using second code example work around. databasemetadata dmd = this.connection.getmetadata(); resultset rs = dmd.getschemas(); while (rs.next()){ // empty result set } expected non-empty result set. resultset rs = this.connection.preparestatement("select schema_name information_schema.schemata;").executequery(); while (rs.next()){ // non-empty result set expected results } expected non-empty result set , got it. as far can tell mysql jdbc driver considers catalog, not schema. should use getcatalogs instead (and everywhere use it, need use catalog parameter, not schema parameter). the getschemas method in connector/j returns empty result set: public java.sql.resultset getschemas() throws sqlexception { field[] fields = new field[2]; fields[0] = new field("", "table_schem", java.sql.types.char, 0); fie...

c# - Xamarin PCL library and Sqlite data storage -

i'm developing cross platform application xamarin android, ios , windows phone. i'm creating pcl library contains business logic including calls rest api. seem work fine, however, need store bits of information in persistent space, such api authentication keys etc, , figured might use sqlite this, seems supported on 3 platforms. the problem i'm running system.data , mono.data.sqlite don't seem available within context of pcl project. even if pcl library can't, or doesn't, link required assemblies, should @ least able use references (through using ) in pcl library, right? mean, should able have application responsible creating database connection , use dependency injection inject connection library. seems can't make references in code system.data , mono.data.sqlite @ all. how abstract data layer in pcl library xamarin android, ios , windows phone? [1] http://developer.xamarin.com/guides/ios/advanced_topics/system.data/ i recommend usi...

android - Checkbox not working properly on listview -

i made listview db , added onitemclicklistener. when click on item take me next activity , show full detail of item. added checkbox on listview checks item. problem when click on checkbox wont work, when click on item, starts next activity , after it, when go listview , try again click on checkbox, item checkbox works , other 1 doesn't work. when select second item listview , go checkbox works. checkbox works on item @ least 1 time click. have idea of causing problem? here's java: public class datalistactivity extends activity { listview listview; sqlitedatabase sqlitedatabase; fooddbhelper fooddbhelper; cursor cursor; listdataadapter listdataadapter; listdataadapter dataadapter = null; button button; dataprovider dataprovider; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); setcontentview(r.layout.data_l...

zend framework2 - postgresql RETURNING in zf2 table gateway -

how 1 add returning clause in insert via table gateway ? insert users (name, age) values ('liszt', 10) returning id; $dataarray = array('name'=> 'liszt','age' => 10); $this->tablegateway->insert($dataarray); $userid = $this->tablegateway->lastinsertvalue; another method : $userid = $this->tablegateway->getlastinsertvalue();

javascript - Directive scope variable -

i using directive 3 consecutive time in html page, scope variable passing different @ every time taking scope variable third directive ?, example first time, <my-dir is-active=true></my-dir> sec time, <my-dir is-active="true"></my-dir> third time, <my-dir is-active="true" is-action="true"><my-dir> js: angular .module('app') .directive("mydir", function(){ scope:{ isactive:'@', isaction:'@' }, controller:[function('$scope'){ $scope.isaction ? doaction() : doactive(); function doaction() { console.log('in action'); } function doactive() { console.log('in active'); } }] }) here @ every time getting "in action" log 3 time ? should 1 time not passing "isaction" scope directive first 2 time ? i pretty sure issues syntax errors. if correct seems work correctly. plunker .directive("myd...