Posts

Featured post

javascript - Why jQuery Select box change event is now working? -

i working on product filters user select select box according his/her preference not getting selected value user in jquery. html code:- <select name="product_filter" id="product_filter"> <option value="price_low_first">price : low high</option> <option value="price_high_first">price : high low</option> <option value="latest">latest</option> <option value="popular">most popular</option> </select> jquery code: $(function () { $("#product_filter").change(function () { alert("hi") var selectedtext = $(this).find("option:selected").text(); var selectedvalue = $(this).val(); alert("selected text: " + selectedtext + " value: " + selectedvalue); }); }); hi believe code perfect. once please check jquery.min.js

sql - MySQL - Finding Empty relations -

i trying work out how full list of team leaders , team members our tables. including team leaders have no team. we have basic data structure have table person contains our basic person object. people extend table in details table. one of extended pieces of information have team_leader status. have 2 relevant details define this: detail_isteamleader , detail_teamleader . first boolean , defines short list of team leaders. second defines persons team leader (ideally subset). _person table_ person_id person_name _detail table_ detail_id detail_person_id detail_isteamleader detail_teamleader i can team leaders have team using following query: select tl.person_id tlref, tl.person_name tlname, per.person_id perref, per.person_name pername detail left outer join person per on detail.person = per.person_id left outer join person tl on detail_teamleader = tl.person_id order tlname, psname however, fails team_leaders detail.isteamleader true not occur in detail_teamleader

tcl - array allowed not allowed -

i have script "proc backup". have each directory many words allowed or not allowed. thought integrade array. not ahead ... or there simpler? bind pubm - "*fertig*" backup proc backup {nick host handle channel text} { set name[lindex [split [stripcodes bcru $text]] 2] set dir[lindex [split [stripcodes bcru $text]] 4] if {[catch {exec sh backup.sh $dir $name} error]} { putlog $error } putnow "privmsg $channel :backup $name done"; } array set allowed { "dir1" "to rar" "dir2" "backupserver1 " "dir3" "2016 2017" } array set not_allowed { "dir1" "test crap" "dir2" "old backupserver2 jpg zip" "dir3" "2015 2014 2013 2012 2011 2010 209 19" } edit : line irc: ( lindex 2 , 4) run backup.sh when word in name is word0 word1

date - Java 8 - Trying to convert String to LocalDateTime -

this question has answer here: java string date conversion 13 answers i trying convert below string localdatetime , somehow not working. val formatter = datetimeformatter.ofpattern("yyyy-mm-dd hh:mm:ss.sss"); val datetime = localdatetime.parse("2016-09-21 13:43:27.000", formatter); it seems there problem in pattern. you have problem pattern, should use 'h' hours(0-23). type formatter , datetime wrong. work correctly: datetimeformatter formatter = datetimeformatter.ofpattern("yyyy-mm-dd hh:mm:ss.sss"); localdatetime datetime = localdatetime.parse("2016-09-21 13:43:27.000", formatter);

html - Flexbox grid: two equal length rows, top row split into two columns -

Image
i'm trying make layout following image using css flexbox. but i'm not familiar flexbox can me make this? here i'm trying: .row.flex { display: flex; } .row [class=^"col-"] { width: 200px; height: 100%; } <div class="row flex"> <div class="col-xs-12 col-sm-6"> </div> <div class="col-xs-12 col-sm-6"> </div> <div class="col-xs-12 col-sm-12"> </div> </div> thanks :) option 1 set flex container wrap . make each flex item take 50% of space. adjust margins calc . the third item, forced wrap, gets flex-grow: 1 , consumes remaining space. .row.flex { display: flex; flex-wrap: wrap; } .row [class^="col-"] { flex: 0 0 calc(50% - 10px); height: 100px; margin: 5px; background-color: lightgreen; } .row [class^="col-"]:last-child { fle

core data - NSBatchDeleteRequest with NSPredicate in swift -

how delete rows coredata using nsbatchdeleterequest nspredicate. i want delete records older 30 days. i dont want data in memory , compare , delete, want use nsbatchdeleterequest, in nsbatchupdaterequest. here code far have written let date = nsdate(); let yesterday = date.datebyaddingtimeinterval(-24*60*60); let predicate = nspredicate(format: "date > %@", yesterday); let fetchrequest = nsfetchrequest(entityname: "notification"); let batchdelete = nsbatchdeleterequest(fetchrequest: fetchrequest) please give answers in swift this simple example. possible rich using of nspredicate filter request. let calendar = nscalendar.currentcalendar() let thirtydaysago = calendar.datebyaddingunit(.day, value: -30, todate: nsdate(), options: []) let fetchrequest = nsfetchrequest(entityname: "notification") fetchrequest.predicate = nspredicate(format: "(date >= %@)", thirtydaysago) let deleterequest = nsbatchdeletere

c - Android and JNI real time clock -

i got problem mini android application , use of real time clock signals in c (jni) function. it seems android ui doesn't real time signals timers instanced in c function. in following poc , timer trigger signal 5 times per second , if signal triggered while ui updating, application crashes. if don't start timer => no crash if don't put on ui => no crash i wrote little poc evidence behaviour. java part call jni function , put button on screen. public class mainactivity extends appcompatactivity { button bt; static { system.loadlibrary("testtimer-jni"); } /* jni ingresso */ public native void jnistarttimer(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); jnistarttimer(); /* load button */ bt = new button(getbasecontext()); setcontentview(bt); } } and main.c file content. timer instanced , starte