Posts

c# - Comparing a DateTimeOffSet From DataBase to Current Value -

what want simple. if datetimeoffset of created event older 24 hours want removed database. having huge amount trouble working converting system.linq.iqueryable system.datetime . any appreciated. index of events public actionresult index() { iqueryable<datetimeoffset> b = db.events.select(x => x.eventtime); datetimeoffset currentdate = datetimeoffset.now; if (currentdate > b) { db.events.remove(@event); db.savechanges(); return view(db.events.tolist()); } return view(db.events.tolist()); } my other question how structure requires 24 hour difference in order remove row database. the data table has eventtime datetimeoffset data type. i have been trying use datetimeoffset.compare(currentdate, b); but visual studio isn't liking line well. please if know how compare time database current time. there nothing in regards on site. have spent day on site , have yet find along this. thanks it might ea...

android - How do I expose a USB device to the Java API through HAL? -

background: i'm trying integrate new sensor android platform. development purposes, using nvidia jetson-tk1 dev board , spark core. spark core communicates sensor , outputs data serially through usb. at high level, needs are: to able read/write serial data spark core on usb to handle data android service written api accomplish @ high speeds in future when become more experienced @ working hal, may eliminate spark core , use gpio pins on jetson control sensor ic. onto details: i can read data through command cat /dev/ttyacm0 , i'm looking more low-level approach. want use hal communicate device. specifically, want spark core show when cat /proc/bus/input/devices . want able read data using getevent /dev/input/eventxx . the main question: here approach: find or develop usb device driver in native c code use jni compile driver within android source code create hal module (.so binary) hal definition compile android source code kernel ...

javascript - Can't get json from php -

i beginner in php , wordpress. try make simple plugin can show 3 latest post , show them in page. @ first want array has been encoded in json, , work with js. somewhere in code have mistake or maybe don't understand important. there code return nothing. if delete datatype in ajax, return whole code. advises appreciated. js , php in 1 file. <button onclick='myajax()'>button</button> <script type="text/javascript"> function myajax(){ $.ajax({ type: "get", url: "plug_in.php", data: {action: "call_this"}, datatype: 'json', success:function(data){ alert(data); } }) }; </script> <? //plugin name: plagin //description: plugin getting posts , posts function show_post(){ $args = array( 'numberposts' => 3 ); $post = get_posts($args); $all_post = arra...

python - Pygame: Accessing colliding sprite's properties using spritecollide() -

i building top down shooter in style of raiden 2. need know how access enemy object when detect collision using 'spritecollide'. the reason need enemy object can lower energy level every bullet hits them. this dictionary have work with: enemycollisions = pygame.sprite.groupcollide(shipbulletgroup, enemygroup, true, false) here's bullet class: class bullet(entity): def __init__(self, ship, angle): entity.__init__(self) self.speed = 8 self.level = 0 self.image = pygame.surface((bullet_dimensions, bullet_dimensions)).convert() self.rect = self.image.get_rect() self.rect.x = ship.rect.centerx self.rect.y = ship.rect.top self.angle = angle def update(self, enemygroup): if self.rect.bottom < 0: self.kill() else: self.rect.y -= self.speed here's unfinished enemy class: class enemy_1(entity): def __init__(self): entity.__init__(self) ...

hive - Change tungsten install directory in continuent-tools-hadoop -

hi im using load data in hive hadoop. https://github.com/continuent/continuent-tools-hadoop this gives following error: ls: cannot access /opt/continuent/tungsten/tungsten-replicator/: no such file or directory it obvious installed in tungsten in different folder not default one. where can change url of tungsten directory ? execute ./bin/load-reduce-check -r /mnt1/continuent

“unknown table status: TABLE_TYPE” and related messy stuff over mysql phpmyadmin 4.4.14 (X.A.M.P.P. 5.6.14-0-VC11, Windows 7 x64) -

already existent related question topics useless, since it's different (or older -3.40-) version. .patches don't fit in files described in other posts around web. in addition unknown table status these notices appear every time click on non empty table: notice in .\libraries\tbl_info.inc.php#78 undefined index: rows backtrace .\libraries\menu.class.php#221: include(.\libraries\tbl_info.inc.php) .\libraries\menu.class.php#85: pma_menu->_getbreadcrumbs() .\libraries\response.class.php#308: pma_menu->gethash() .\libraries\response.class.php#388: pma_response->_ajaxresponse() pma_response::response() notice in .\libraries\tbl_info.inc.php#80 undefined index: name backtrace .\libraries\menu.class.php#221: include(.\libraries\tbl_info.inc.php) .\libraries\menu.class.php#85: pma_menu->_getbreadcrumbs() .\libraries\response.class.php#308: pma_menu->gethash() .\libraries\response.class.php#388: pma_response->_ajaxresponse() pma_response::response() ...

Running arbitrary vim commands from bash command line to script vim -

i want script vim edit files command line. example want along lines of: vim -<some_option> 'iworld<esc>bihello <esc>:wq helloworld.txt<cr>' or: echo 'iworld<esc>bihello <esc>:wq helloworld.txt<cr>' | vim and have save file helloworld.txt body of hello world is possible? i've tried few different approaches none seem it. realize can things vim +plugininstall run ex commands command line, i'd love able string arbitrary motions this can achieved + flag , :normal command: $ vim +"norm iworld" +"norm ihello " +"wq helloworld.txt"