Posts

linux - Grub configuration for liveCD -

i need create custom linux livecd. used this perfect guide this. in few words: took linux mint livecd, mount it, unpack filesysetm.squashfs, edit chroot , pack iso. faced problem when tried customize grub settings. example, want set grub_timeout zero. can edit grub config file, can't run update-grub. voronwe@sul $ sudo chroot edit sul # mount -t proc none /proc sul # mount -t sysfs none /sys sul # mount -t devpts none /dev/pts sul # export home=/root sul # export lc_all=c sul # update-grub /usr/sbin/grub-probe: error: cannot find device / (is /dev mounted?). and can't mount boot: sul # mount boot mount: can't find boot in /etc/fstab or /etc/mtab sul # cat /etc/fstab # unconfigured fstab base system sul # cat /etc/mtab binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0 none /proc proc rw 0 0 none /sys sysfs rw 0 0 none /dev/pts devpts rw 0 0 so, know how can grub configuration update on livecd? i found way. there file ...

javascript - Store `new Date ()` in JSON object -

i have following field validator object: { type:'date', 'min':new date() } i hoping store new date() expression in json , executed when it's parsed save timestamp: { type:'date', 'min':(new date()).gettime() } after read back: var result = json.parse('{ "type":"date", "min":1234567 }'); result.date = new date(result.min);

insert - inserting json data in meteor collection -

here's code. https://github.com/studiomockingbird/sh_meteor its leaderboard example wwhere trying insert of own data in collections. my data resides in lib/book.js , has been defined object (var mybook). the code use inserting in leaderboard.js - pages = new meteor.collection("pages"); if (meteor.isserver) { meteor.startup(function () { if(pages.find().count() === 0){ var pages = json.parse(mybook.stories); (page in pages) { pages.insert(pages[page]); } } }); } when try run code gives me running on: http://localhost:3000/ exited code: 1 exited code: 1 exited code: 1 application crashing. waiting file change. what doing wrong? totally new meteor. there couple of things need iron out: remove scoping of book you've used var mybook , using var mybook variable being scoped, or @ least 0.6.0 rc8, if you're getting book console.log don't worry now, if run lat...

list - Compare numbers in a nested file -

example: let list = [[23, '2'], [2, '3'], [55, '4'], [1, '5']] i'm trying numeric sort of list (using 1st field): list[indexnr][0] i've found function in files: function! mycompare(i1, i2) return (a:i1 + 0) - (a:i2 + 0) endfunction how can adapt nested list let work above example? you have give index params: function! mycompare(i1, i2) return a:i1[0] - a:i2[0] endfunction

cassandra - Datastax DevCenter fails to start -

devcenter 1.5.0 won't start, though working few days ago. have tried suggested answer question : datastax devcenter 1.1 fail start however didn't work me. did lead me think might due having updated eclipse mars yesterday, perhaps? any ideas great. in advance. in response comments below running windows 7. realised though java_home set correctly gettng error when run java -version: microsoft windows [version 6.1.7601] copyright (c) 2009 microsoft corporation. rights reserved. c:\users\username>java -version error occurred during initialization of vm java/lang/noclassdeffounderror: java/lang/object update : fixed java -version issue above removing java.exe c:/windows/system32/ . devcenter still not working.

java - deserialize json field into plain string with gson -

i trying deserialize json object java bean. main issue facing i'd treat field object of json string plain string, if contains potentially correct json object. json structure this: { "type":"user", "object":{ "id":"1", ...} } how can tell gson ignore object value doesn't deserialized object? i'd mapped plain string field in bean can dispose proper deserialization it, once got type type field. just declare of type jsonobject class examplejsonmodel { @serializedname("type") public string type; @serializedname("object") public jsonobject object; }

html - How do I make a div with position sticky works on Chrome and IE? -

i have, global div, 2 divs 1 display header , second display body. scrolling enabled want make header fixed when scrolling vertically. i used position:sticky , works firefox. can me. css: .wrapper{ width: 400px; overflow: auto; } .headertable { background-color: white; min-width: 600px; top: 0; position: sticky; } .bodytable{ min-width: 600px; height: 100px } table{ width: 100%; border: 1px solid; text-align: center; } html : <div class="wrapper"> <div class="headertable" id="headerfixed"> <table> <tr><td>head</td><td>head</td><td>head</td><td>head</td><td>head</td><td>head</td><td>head</td><td>head</td><td>head</td><td>head</td></tr> </table> </div> <div class="bodytable"> <table> ...