Posts

ruby - Nested registration data in Rails 3.1 with Devise -

ruby - Nested registration data in Rails 3.1 with Devise - hello again, stackoverflow community! i'm working on writing simple blog scheme in rails, , i'm using devise authentication part. i got basic email/password registration going, , i've set one-to-one connection of users table (the basic 1 generated devise) , userdata table, containing things such username, permissions, about, , on. it's pretty easy - user table 100% devise vanilla, , has_one userdata. userdata belongs_to user. i tried expanding sign form generated devise, allow user enter, not e-mail , password, desired user name. way, when form sent, if names of form fields right (the right construction of nested hashes, such "email" user's email, , "userdata[name]" user's desired name), new user created automatically, , proper corresponding userdata entry should created automatically rails, correct? right now, i'm having huge issue userdata[name] field not appe...

c# - Confused between Web Application and Web Forms -

c# - Confused between Web Application and Web Forms - i purchased twilio business relationship , 888 business number, , working setup simple phone call scheme business. examples working fine, wish create c# web forms application run server. there c# based examples seem centered around asp.net web applications though, know nil about. can c# asp.net application self serving (standalone) .exe, or there way can create c# windows form application work instead? if needed, tutorial next , need implement... http://www.twilio.com/docs/howto/ivrs-the-basics i don't understand question but... twilio features require code running on webserver webserver can send requests to. standalone .exe isn't going that. asp.net web forms (though when run server twilio's server can reach). c# .net winforms webforms

vectorization - How can I populate the rows of an R data frame, in which each row represents a day, with a single common value for each day of a year? -

vectorization - How can I populate the rows of an R data frame, in which each row represents a day, with a single common value for each day of a year? - r: how can populate rows of info frame, in each row represents day, single mutual value each year? i have info frame consisting of date column, cost column , various other columns derived 2 columns. 1 of columns calculates, each day in given year, percentage alter in cost origin of year (this related before question). i want add together column holds, each day of given year, percentage alter in cost whole of year. so, if cost rose 10% first lastly day of 2009, column days of 2009 should hold value 10% (or 0.1). if cost fell 2% between first , lastly days of 2010, column each day in 2010 should hold value -0.02 , on. the code have far is: require(lubridate) require(plyr) # generate info set.seed(12345) df <- data.frame(date=seq(as.date("2009/1/1"), by="day", length.out=1115),price=...

sql server - Perl Module for Simplifying SQL Query -

sql server - Perl Module for Simplifying SQL Query - over years, i've noticed few issues sql queries in perl scripts: they're hard read most developers aren't sql. let's have next tables: pet pet_type color ======== ========== ============ pet_id pet_type color_id name description description owner pet_type color_id and, want find reddish dogs, i'll have produce next sql query. find pet_id, name, owner pet, pet_type, color color_id.description = 'red' , pet_type.description = 'dog' , pet.color_id = color.color_id , pet.pet_type = pet_type.pet_type i perl module simplify producing querying. allow me create database connection, predefine how tables linked. 1 time done, developer have simplified query. i imagine interface this: # # create new database connection # $db = some:module->new(\%options); # # describe how these tables relate each other. # ...

excel - The filename feed1.xls is not readable in php -

excel - The filename feed1.xls is not readable in php - hi want parse excel file using zend framework. went zend developer zone , found solution download phpexcelreader. downloaded code set project @ localhost , run code. when treid read .xlsx file generates error the filename feed1.xlsx not readable i saved file in .xls format , run code parsed file successfully. want implement in project developed in zend framework . created model, , in project , require_once ed excelreader @ top of project this. require_once 'excelreader/excel/reader.php'; class excelreadermodel extends zend_db_table { function readfile() { $data = new spreadsheet_excel_reader(); // set output encoding. $data->setoutputencoding('cp1251'); //$data->read('excelreader/excel/feed1.xls'); $data->read('feed1.xls'); echo '<pre>'; print_r($data); echo '</pre>'; } } i called model function in controller....

iphone - Core Data Fetch Request -

iphone - Core Data Fetch Request - i have datamodel looks this: i show list of customers on tableview, when user selects customer, shows list of rooms client - works fine. the problem getting when seek , show detail view room. when user selects room, shows view values of room. (well should do). have working extent, if have 2 rooms named same ie - "bedroom 1", 2 different customers doesnt show right room data. here code using: appdelegate_shared *appdelegate = [[uiapplication sharedapplication] delegate]; nsmanagedobjectcontext *context = [appdelegate managedobjectcontext]; nsentitydescription *entitydesc = [nsentitydescription entityforname:@"rooms" inmanagedobjectcontext:context]; nsfetchrequest *request = [[nsfetchrequest alloc] init]; [request setentity:entitydesc]; nspredicate *pred = [nspredicate predicatewithformat:@"(room = %@)", titlestr]; [request setpredicate:pred]; nsmanagedobject *matches = ...

sql - Calculating the length of each record in the table -

sql - Calculating the length of each record in the table - possible duplicate: how find rowsize in table how calculate length of each record in table (sql server 2008) try len() instead of datalength() select len(yourcolumnname) lengthofentry yourtablename this gives length of each entry in column just string them every column entries entire table example: select len(yourcolumnname) column1, len(yourcolumnname2) column2 yourtablename you can utilize sum() total of every character in column select sum(len(yourcolumnname)) column1, sum(len(yourcolumnname2)) column2 yourtablename sql sql-server-2008 tsql