Posts

memory - how to know process working set size in linux /proc -

process working set info in linux i finding working set size of process in proc folder link can find working set size in /proc don't know how know. knew rss working set size rss different working set size can know working set size using /proc/[pid]/statm ? i don't believe /proc/[pid]/statm gives wss, or /proc/[pid]/status matter. wss number of pages process needs in memory keep "working". rss number of pages of process reside in main memory. so rss >= wss. meaning rss may include pages process doesn't need right now. maybe used stale pages in past. from understanding of linux internals, kernel doesn't keep track of wss on per-process basis. wss involved track continuously , doesn't have exact formula. rss simpler calculate, kernel reports that. note if sum of wss of processes greater or equal main memory size (i.e. system thrashing or close thrashing) rss equals wss because pages absolutely needed process kept in main memory. g...

grails - Sorting on nullable fields in GORM -

i'm trying figure out how sort on multiple fields in grails 3, 1 of may or may not null. have book domain: class book { string title string sorttitle static constraints = { title blank: false sorttitle nullable: true } } books titles "the peripheral" have sorttitle of "peripheral, the", otherwise sorttitle null. want books sorted sorttitle if 1 exists, otherwise title . i found other similar questions, none nullable field. happen have pointers in right direction? you can use: coalesce(book.sorttitle, book.title) here have official hibernate documentation.

Convert "Day Date Of Month YYYY" To YYYY-MM-DD In Php -

how convert "friday 20th of march 2015" "2015-03-20" in php ? options tried (failed): $time = strtotime(stripslashes("friday 20th of march 2015")); echo date("y-m-d",$time); $time = strtotime("friday 20th of march 2015"); echo date("y-m-d",$time); option 2 (failed): $old_date = date('friday 20th of march 2015'); $old_date_timestamp = strtotime($old_date); $new_date = date('y-m-d', $old_date_timestamp); echo $new_date; option 3 (failed): $date = datetime::createfromformat('l d of f y', 'friday 20th of march 2015'); $new_date_format = $date->format('y-m-d'); echo $new_date_format; duplicate entries didn't work out: how convert "day, dd month yyyy" "yyyy-mm-dd" in php convert 1 date format in php this code works: $date = datetime::createfromformat('l ds \o\f f y', 'friday 20th of march 2015'); ...

c# - Delegate with generic list signature for passing data to another form -

i'm quite new in c#, i'm struggling more 2 days. hope 1 can me out one. below simplified code application. i want pass list form1 form2 using delegate , event. how can this? read tons of explanations events , delegates, still can't figure out, how works. form1: public delegate list<string> profileimporteventhandler(); public event profileimporteventhandler profileimported; private void btnimport_click(object sender, eventargs e) { // raise event onprofileimported(); } protected virtual void onprofileimported() { if (profileimported != null) // check if there subscribers { profileimported(); } } form2: public partial class form2 : form { form1 frm1; public form1() { // constructor logic frm1.profilechanged += new form1.profileimporteventhandler(form1_onprofileimported); } } list<string> form1_onprofileimported() { // } update none of solutions worked far. here have tried: form 2 ...

java - Swing JTextPane in javafx -

i'm looking rich textarea in javafx. have tried richtextfx component tomas mikula buggy needs. i thinking whether possible plug in swing jtextpane using swingnode class. so far works in, can see text in jtextpane , jscrollpane around works. mouselistener on jtextpane seems triggered correctly mouse events other that...nothing works. there no cursor indicating current position, no way "click" mouse change position, select text,... key events don't arrive (using keylistener) is possible use jtextpane in javafx , if so, missing? currently know workaround problem. node.setonmousereleased(event -> node.requestfocus()); (node swingnode). used mousereleased mimic same behavior standard fx nodes.

ms word - ActiveDocument.Tables.Count returns 0 but there are 4 tables -

Image
issue resolved: had 2 different sessions of word running. code in 1 tables in other. there 4 tables in document activedocument.tables.count isn't working. ideas? i had 2 different sessions of word running. code in 1 tables in other.

php - Manually Logout from previous browser session if user login in any new browser in Cakephp 3 -

i working on cakephp 3. i need user login once @ time. i using cakephp auth component login app. worked database session , cake session . but when try delete session manually database or delete session file form app/tmp/session , session re-create again. i don't want disallow second login of user, want destroy previous session. how can achieve single session of user in cakephp 3. you can store current session id of user in users table: before login, check if current session id present in users table user. if session id present, destroy old session deleting sessions table. after login, store generated session id.