Posts

ruby - Checkboxes in rails returning no value? How to get Checkboxes working with Rails -

i trying values check boxes, whenever use params[:chosen], seems return nil. missing? params right way it? this line have in view: <td><%= check_box_tag "chosen[#{i}]",i,true,:name => "chosen[]" %></td> this produce checkboxes can never seem value it. need put in controller? thank you i don't think need :name => "chosen[]". first argument used name. also, rails guides recommend using label_tag wtih check_box_tag <td> <%= label_tag :my_attribute, "attribute label" %> <%= check_box_tag :my_attribute, my_model.my_attribute %> </td> then controller can check params[:my_attribute]

osx - Unable to make file editable on Mac OS X -

i'm trying edit httpd.conf file located in /private/etc/apache2, , can't figure out how permission write i've done $ cd /private/etc/apache2 $ sudo chown bdh httpd.conf $ ls -lash 0 drwxr-xr-x 13 root wheel 442b jun 7 00:11 . 0 drwxr-xr-x 93 root wheel 3.1k jun 26 10:51 .. 0 drwxr-xr-x 13 root wheel 442b jan 3 16:26 24 -r--r--r-- 1 bdh wheel 24k jun 7 00:11 httpd.conf ...etc... $ vim httpd.conf and says "httpd.conf" [readonly] 677l, 24330c tried cp ing desktop, cant permission edit there either i'm pretty new using terminal, there other command can use? it unnecessary , undesirable alter access permissions edit file. edit file requires administrator (or other user) privileges without altering access permissions, use: sudo -e /private/etc/apache2 sudo's -e option tells want edit given file. this command copies file , makes writable you, tells editor specified sudo_editor, visual or edit...

date format - How to set dateformat to mdy in SQL Server 2005? -

i using sql server 2005. when execute set dateformat mdy , date format specific session. when disconnect management studio , connect not take format. but want set permanently. how can it? i don't think can. per msdn: this setting used in interpretation of character strings converted date values. not affect display of date values. the setting of set dateformat set @ execute or run time , not @ parse time. the way change permanently alter sys.syslanguages table, , aren't allowed alter system tables that. best bet create custom date parsing function sets dateformat , returns appropriate string value, you'd still need call function every date. set default language "british english" instead of "english"?

What specific problems does Declarative Programming solve best? -

i understand declarative languages have offer, have not yet connected dots why use them. example, not understand why describing problem more beneficial writing solution understood problem in imperative language (side-effects non-withstanding). this not discussion makes application in declarative language. want understand circumstances , common, specific project requirements make programmer "we should use declarative language this". as rule of thumb, guess declarative programming makes sense when there exists multiple strategies achieve 1 goal. declaratively programming what rather how let parser/compiler/runtime figure out strategies best--it optimizes execution you. two exemples of declarative languages , optimizations: regular expression -- want bother underlying dfa, ndfa required fast execution? sql queries -- dbms has statistics , caches , can (hopefully) figure out optimal execution plan the link provided @verisimilitude worth reading.

c# - how to use XMLTextWriter to write XML node at a specified position -

i have xml file likes below. <?xml version="1.0" encoding="utf-8" ?> <book> <title>title</title> <content>content</content> </book> i want write new node after 'content', know how use xmldocument that, there way use xmltextwriter that? you have write whole xml document, i.e. elements , attributes , attribute values using xmltextwriter . after you've written <content> element, can write additional element. something this: writer.writestartdocument(); writer.writestartelement("book"); writer.writestartelement("title"); writer.writestring("title"); writer.writeendelement(); writer.writestartelement("content"); writer.writestring("content"); writer.writeendelement(); // insert new data here writer.writeendelement(); writer.writeenddocument();

google chrome - Interface C/C++ library into HTML5 by using any tag -

my intention make ui having following features: should able run/ work on os platform windows, mac & linux. should able work web browser ie, chrome, firefox, etc. should able link or interface c/c++ library. if possible can embed other tool link these c & c++ lib. actually here, there no server involved. there independent application has link c & c++ lib , run on 3 os , every possible web browser. is possible how ? kindly suggest me appropriate way cross hurdle. how using qt , open html5 pages using qml webview element ? qt code can port possible platforms, , above can run html code. should able run/ work on os platform windows, mac & linux. qt code can ported platforms. should able work web browser ie, chrome, firefox, etc. you can use on qml's webview element or qtwebkit on platforms. should able link or interface c/c++ library. using qt's c++ code able link other libraries/processes via interprocess communicatio...

sharepoint - Infopath Custom Task Form Updation : System.xml.xmlexception -

i have created workflow create task , approve task using custom infopath form. while clicking button approve/reject, task form raises xml exception "date" unexpected token, expected token "=". below have listed stack trace of excetion, server error in '/' application. 'date' unexpected token. expected token '='. line 1, position 22. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.xml.xmlexception: 'date' unexpected token. expected token '='. line 1, position 22. source error: unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. stack trace: [xmlexception: 'date' unexpected token. expected token '='. line 1, position 22.] system.xml.xmlte...