Posts

linux script to test connectivity IP -

linux script to test connectivity IP - any thought how create script in order test connectivity ip represents default gateway. , in case of connectivity, print message "default gateway up" , if it's not connected give message "default gateway down" #!/bin/bash ping -c 1 192.168.1.1 2>&1 > /dev/null if [ $? -ne 0 ] echo -e "host not respond ping" fi put script in crontab , allow run every min or whatever frequency want. linux

drupal 7 - Using theme_hook_suggestions in hook_preprocess_page stops html.tpl.php from being used -

drupal 7 - Using theme_hook_suggestions in hook_preprocess_page stops html.tpl.php from being used - i've added line hook_preprocess_page in template.php: if (isset($vars['node']) && $vars['node']->type=='landing_page') { $vars['theme_hook_suggestions'][] = 'page__'. $vars['node']->type; } this worked fine on test server have set on staging , has caused: a) page template output - not surrounded html.tpl.php. b) preprocess_html function in template.php not beingness called @ all. if comment out line html.tpl.php used again. this thread discussing similar opposite problem. i'm stumped on - points useful! this beingness caused calling undefined function in page template. this wasn't apparent until started searching error logs. hope may save else time... drupal-7

sql - find COUNT using LIKE from an inner query without JOIN -

sql - find COUNT using LIKE from an inner query without JOIN - so im trying generate listing of artists in table & lookup total matches within rows of different table name, not exact. cant bring together tables cause dont have col bring together on. when run inner query preset artist name returns right count. however, running inner query returns 0 count. just curious if knows how can using sql, or if can done. otherwise can figure out looping. here illustration of im doing: select ar.name, (select count(*) sound au au.artist like('%'+ar.name+'%')) count artist ar order ar.name asc; try: select ar.name, count(*) count artist ar, sound au au.artist like('%'+ar.name+'%')) grouping ar.name sql

wpf - Control click through transparency c# -

wpf - Control click through transparency c# - i making form transparent. however, able click "through" form. mean need able command whether clicks go through form or not. using windows 8, heard makes difference in case well. how can this? thanks! edit: refining question: making form transparent , maximized. when user clicks, form catches click moves previous location clicked, , clicks "through" form @ new location. i've got of working in c# , wpf, cannot simulate clicks "through" form. how this? c# wpf transparent

android - EditText Loses Focus on Click -

android - EditText Loses Focus on Click - i'm writing activity list bunch of items database , show additional column quantity. implemented arrayadapter show custom layout. here code of of import parts of adapter: static class viewholder { protected textview text; protected edittext edittext; } @override public view getview(int position, view convertview, viewgroup parent) { view view = null; if (convertview == null) { layoutinflater inflator = context.getlayoutinflater(); view = inflator.inflate(r.layout.rowquantitylayout, null); final viewholder viewholder = new viewholder(); viewholder.text = (textview) view.findviewbyid(r.id.label); viewholder.edittext = (edittext) view.findviewbyid(r.id.edittext); viewholder.edittext.addtextchangedlistener(new textwatcher() { public void aftertextchanged(editable s) { log.i(tag, "editable:" + s.tostring()); } ...

c# - In what scenarios do I need foreign keys AND navigation properties in entity framework -

c# - In what scenarios do I need foreign keys AND navigation properties in entity framework - my order class has: public int customerid { get; set; } public client customer { get; set; } do need both properties create relation working? i not using disconnected entities, using code first approach. according julia lerman's book: programming entity framework: dbcontext, difference lies @ difficulty of updating navigation property. in page 85, suggests "if there 1 thing can create life easier in n-tier scenarios, it’s expose foreign key properties relationships in model." book includes samples both scenarios. the reason including foreign key property tells entity framework utilize foreign key association, simpler using so-called independent association when need update relationship, i.e., changing order 1 client in example. foreign key association, need changing customerid. without customerid foreign key, need more steps. independent association us...

greendao and sqlite triggers -

greendao and sqlite triggers - i tried utilize code below ensure referential integrity in database, seems not working greendao. can still delete records. on other hand, when seek delete in sqlitemanager, trigger raised , delete operation fails. devopenhelper helper = new daomaster.devopenhelper(this, common.dbname, null) { @override public void oncreate(sqlitedatabase db) { super.oncreate(db); db.execsql("create trigger grupe_artikli before delete on groups "+ "for each row begin "+ "select case " + "when ((select id_group products id_group = old._id) not null) "+ "then raise(abort, 'error') "+ "end; end;"); daosession session = new daomaster(db).newsession(); } does greendao back upwards triggers, or there method maintain database referential integrity? greendao has no built-in trigger support. however, cannot think of reason why app...