Posts

ruby - How can I store a hash in my database? -

ruby - How can I store a hash in my database? - is there ruby, or activerecord method can write , read hash , database field? i need write web utility take post info , save database, later on pull database in original hash form. ideally without 'knowing' construction is. in other words, info store needs independent of particular set of hash keys. for example, 1 time external app might post app: "user" => "bill", "city" => "new york" but time external app might post app: "company" => "foo inc", "telephone" => "555-5555" so utility needs save arbitrary hash text field in database, then, later, recreate hash saved. you can utilize serialization 3 options: marshal in binary format, yaml , json human-readable formats of info store. once trying each of methods, not forget measure time serialize , deserialize well. if need pull info in origin format, js...

iphone - How do I keep track of the total number of complete rotations of an image in an iOS app? -

iphone - How do I keep track of the total number of complete rotations of an image in an iOS app? - i working on app has rotating image (the user tapps , drags , image rotates in circle tracking finger). trying maintain track of how many times user makes finish circle. additional "hitch" need know if user circling clockwise vs counter clockwise. here code rotating image... please sense free request additional information. - (void)touchesmoved:(nsset *)touches withevent:(uievent *)event{ uitouch *touch = [[event alltouches] anyobject]; cgpoint touchpoint = [touch locationinview:self.view]; long double rotationnumber = atan2(touchpoint.y - originy, touchpoint.x - originx); totalrotationcount ++; schedulingwheel.transform = cgaffinetransformmakerotation(rotationnumber); offset = (rotationnumber * 100)/14; dateribbon.center = cgpointmake(offset, 24); } thanks help! my solution isn't elegant , there might cleaner so...

javascript - jquery: unable to print ajax response header (Jquery 1.7.1) -

javascript - jquery: unable to print ajax response header (Jquery 1.7.1) - $.ajax({ async:false, type: 'post', url: itemurl, success: function(data,status,jqxhr) { responseobj = data; console.log('success function resp'); console.log(jqxhr.getallresponseheaders()); }, error: function(data){ responseobj = data; }, data:item, datatype: "json", }); here's code; unable print response headers; missing anything? prints out empty string. tried using getresponseheader("location"), that's not working either; trying "location" header that's beingness returned ajax call. however firbeug shows response headers including "location" after. i using jquery 1.7.1 i worked @satish in he...

sql server collation for stored procedures generated script -

sql server collation for stored procedures generated script - i have generated stored procedures script database "modern_spanish_ci_as". run script without problem in 1 server has "sql_latin1_general_cp1_ci_as" collation, in server has "modern_spanish_bin" collation, script fails because variables declared @userlogin (or else) , used @userlogin. caps vs no caps there no difference whether script like: exec dbo.sp_executesql @statement = n'my sp body' or script like: create procedure [dbo].myspname i have executed next ensure database collation right one: select databasepropertyex('mydatabase','collation');/*returns "modern_spanish_ci_as"*/ i'm not allowed alter server collation. what (other alter case of thousands of expressions) in order succesfully run script , ensure sp's work fine??? and, there impact @ runtime when sp seek compare varchar values??? thanks in advance you must...

how to run GIF file in the blackberry simulator inside theme builder of blackberry theme studio6.0 -

how to run GIF file in the blackberry simulator inside theme builder of blackberry theme studio6.0 - hi have created gif animated image using blackberry theme builder 6.0 not showing moving image on simulator.when press ok still showing still image.how can solve issue. blackberry

java - How to test jsp attribute type -

java - How to test jsp attribute type - i have spring mvc app user settings. settings objects strings name, value, user , type field. edit values form table generated , values editable strings. for settings have value checkbox in field type, display checkbox, ie: <c:if test="setting.type=='checkbox'"> <form:checkbox path="setting.name" /> </c:if> i cannot figure out. suggestions? did seek change <c:if test="setting.type=='checkbox'"> to <c:if test="${setting.type=='checkbox'}"> ? of course, 'setting' object must passed jsp correctly. java jsp spring-mvc jstl

java - Using activerecord migrations for a non-rails application, what are the steps? -

java - Using activerecord migrations for a non-rails application, what are the steps? - i have java application, , want utilize rails migrations this. what steps working? i have done far: 1. installed jruby 2. installed next gems: rspec, cucumber, rake do install rails or activerecord? any suggestions on folder construction store rakefile? i'm assuming rake work on same path rakefile is? how tell db connection information? here's succinct article believe answers of questions: http://community.active.com/blogs/productdev/2011/02/28/using-activerecord-3-without-rails it talks using ar sinatra you'll see adapted problem. java ruby-on-rails activerecord jruby