Posts

jquery - How to check status of Django generated multiple checkbox? -

i know how use jquery save names of selected options django based multiple checkbox? seems not able select group of checkbox... can give me suggestions on code? thanks! jsfiddle example html code <table class="tab_model"> <tbody> <tr> <th> <label for="id_model_0">model:</label> </th> <td> <ul> <li> <label for="id_model_0"> <input type="checkbox" name="model" value="a" id="id_model_0">model a</label> </li> <li> <label for="id_model_1"> <input type="checkbox" name="model" value="b" id="id_model_1">model b</label> ...

delphi - Update existing Google calendar entry using TMS Cloud component -

i use following code add new entry google calendar using tms cloud component have new entries in table in database , added ok able update entry also, cant find about. demo supplied controls has option, don't want load entries calendar , select 1 edit there. want save sort of entryid given , use update. devexpress has option lets sync table , outlook calendar (works nice) think should possible tms the question is: how id of calendar entry when creating can store record in table , use afterwards updating? var ci: tgcalendaritem; begin advgcalendar.app.key := settings.google.key; advgcalendar.app.secret := settings.google.secret; advgcalendar.logging := true; if not advgcalendar.testtokens advgcalendar.refreshaccess; if not advgcalendar.testtokens advgcalendar.doauth else connected := true; ci := advgcalendar.items.add; advgcalendar.getcalendars(); ci.calendarid := settings.google.calendar; ...

android send intent to specific contact (whatsapp, sms, hike, etc.) -

i have implemented app in can pick contact , list custom information contact in tablelayout. in each row of tablelayout have column (button) should send message specific user using sms, whatapp, hike, etc. on click event, action_send intent should open instead having pick contact want put contact or contact id not have choose contact list in whatsapp/sms/hike intent. possible or have implement send picker on own , start specific intent each app? cheers magnus you have implement send action different messaging apps hike whatsapp hike etc. can't tell these apps send message specific contact database protected. reason you never know contact has id in these apps may "foo" can else in whatsapp database. so have put data , package name. hike - com.bsb.hike whatsapp - com.whatsapp intent i=new intent(); i.setpackagename(""); startactivity(i); hope helps.

tsql - How can I convert this INT field to a usable date field? -

the db working in stores date values int . needing determine date difference between 2 date fields unsure how approach since int . dates stored follows: 20130101 - yyyyddmm . performing datediff results in arithmetic overflow error. any ideas on how either convert 2 date fields or find date difference between them? select cast( cast( 20130101 varchar(8) ) datetime ) so, if have following 2 values: 20130101 , 20130201 , might following: select datediff( d , cast( cast( 20130101 varchar(8) ) datetime ) , cast( cast( 20130201 varchar(8) ) datetime ) ) update if have values less 17530101 (the min value datetime), need use case expression validate data processed. in scenario, use of cast(0 datetime) result in 1900-01-01 our minimum date value. select datediff( d , case when value1 <= 19000101 cast(0 datetime) else cast( cast( value1 varchar(8) ) datetime ) end , case when value2 <= 19000101 cast(0 date...

hash - Are there any SHA-256 javascript implementations that are generally considered trustworthy? -

i writing login forum, , need hash password client side in javascript before sending on server. i'm having trouble figuring out sha-256 implementation can trust. expecting there kind of authoritative script used, i'm finding loads of different projects own implementations. i realize using other people's crypto leap of faith unless you're qualified review yourself, , there no universal definition of "trustworthy", seems common , important enough there ought kind of consensus on use. naive? edit since comes lot in comments: yes, more stringent hash again on server side. client side hashing not final result save in database. client side hashing because human client requests it. have not given specific reason why, overkill. the stanford js crypto library contains implementation of sha-256. while crypto in js isn't well-vetted endeavor other implementation platforms, 1 @ least partially developed by, , extent sponsored by, dan boneh , well-est...

ruby on rails - Active admin - checkbox doesn't make batch action enabled -

i install gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4' and works fine but.. when click on checkbox resources, batch action doesn't change enabled. have: index |description| selectable_column column :id column :user column :description default_actions end batch_action :destroy, :confirm => "delete ??", :plural_model => "descriptions" |selection| profile.find(selection).each { |d| d.reset_description! } redirect_to collection_path end and batch action :destroy. active admin works correct in rails 4? had same problem, first comment of op solved me: add //= require active_admin/base to active_admin.js

javascript - remove an .append() to return an element to it's original state -

i'm loading ul image slider need remove images ( ul ) , revert original state (before javascript manipulations) when slider closed because later need reload ul set of different images. here how i'm loading slider. var get_images = [ "show_1.jpg", "show_2.jpg", "show_3.jpg", "show_4.jpg"]; $.each(get_images, function(i,img){ $('#container ul').append('<li><a href="#" class="thumbnail"><img src="'+img+'"/></a></li>'); }); i think might looking for: var get_images = ["show_1.jpg", "show_2.jpg", "show_3.jpg", "show_4.jpg"]; var original = $('#container ul').html(); $.each(get_images, function (i, img) { $('#container ul').append('<li><a href="#" class="thumbnail"><img src="' + img + '"/></a></li>'); })...