Posts

ruby binary string compare -

i want clarify understanding of string comparison in ruby. how ruby compare binary strings? does (a) split strings on utf-8 characters, compare strings based on length of binary string in utf-8 characters , values of utf-8 characters, or (b) compare strings on byte level? it depends on version of ruby you're using in ruby 1.8, strings collection of bytes . in ruby 1.9, strings collection of encoded data . string comparisons in ruby 1.9 done on byte level, other operations regex matches not. best normalize string objects same encoding before comparing them.

How do I search and remove/append a row in Jquery or Javascript? -

if have table <table id="mytable"><tr><td>first thing</td><td>first value</td></tr> <tr><td>second thing</td><td>second value</td></tr> <tr><td>third thing</td><td>third value</td></tr> </table> how can use jquery or javascript search index of row text "second value" , remove it? possible create new row <tr><td>fourth thing</td><td>fourth value</td></tr> with click of button? have iterate through existing rows last index of row insert in? you can achieve using :contains() selector, remove() function, , append() function. don't need iterate through rows find you're looking for. to index: $("#mytable").find("td:contains('second value')").parent().index(); to remove it: $("#mytable").find("td:contains('second value')")....

objective c - Excel file into NSArray -

i have excel file data need use source table view. how can convert .xls plist file can parse nsarray? numbers app in iwork suite have option? thanks. the solution i’ve used in past export .xls tab-delimited file , use e.g. python script convert plist. it’s pretty easy, though providing sample code difficult because it’s pretty problem-specific.

deployment - ASP.Net MVC 3.0 "Error Executing Child Request" on Development Server but works fine on local machine -

here stack trace [nullreferenceexception: object reference not set instance of object.] hrorx.controllers.leftnavlinkscontroller.leftnavservices() in c:\common\pro\hrorx\controllers\leftnavlinkscontroller.cs:30 lambda_method(closure , controllerbase , object[] ) +78 system.web.mvc.reflectedactiondescriptor.execute(controllercontext controllercontext, idictionary`2 parameters) +263 system.web.mvc.controlleractioninvoker.invokeactionmethod(controllercontext controllercontext, actiondescriptor actiondescriptor, idictionary`2 parameters) +38 system.web.mvc.c__displayclass15.b__12() +128 system.web.mvc.controlleractioninvoker.invokeactionmethodfilter(iactionfilter filter, actionexecutingcontext precontext, func`1 continuation) +826410 system.web.mvc.controlleractioninvoker.invokeactionmethodwithfilters(controllercontext controllercontext, ilist`1 filters, actiondescriptor actiondescriptor, idictionary`2 parameters) +314 sys...

How to upload a file with Django -

i'm trying write form upload file django. admin form works fine, problem after click submit on form, form loses file selected (filename disappears , 'no file chosen' appears next 'choose file' button), , view won't validate form because file missing. form/view/file handler django example . forms.py class attachform(forms.modelform): class meta: model = attachment exclude = ('insp', 'contributor', 'date') views.py def handle_uploaded_file(f): destination = open('some/file/name.txt', 'wb+') chunk in f.chunks(): destination.write(chunk) destination.close() def attach(request, insp_id): if request.method == 'post': form = attachform(request.post, request.files) if form.is_valid(): handle_uploaded_file(request.files['file']) f = form.save(commit=false) f.contribut...

oracle - How to delete rows with bi-directional dependencies? -

i'm using oracle 10g express , trying delete records tables bi-directional constraints. i'm trying un-thread hundreds of tables , dependencies generated via hibernate (which can't changed @ point), here extremely simplified example: create table tablea (id number(19,0) not null, ..., rtablea_id number(19,0), primary key (id)); create table tableb (id number(19,0) not null, ..., rtableb_id number(19,0), primary key (id)); alter table tablea add constraint fka1 foreign key (rtablea_id) references tableb; alter table tableb add constraint fkb1 foreign key (rtableb_id) references tablea; trying delete entries either table returns following: edit: happens in case foreign keys prefixed sys_ ora-02292: integrity constraint (xxx.fka1) violated - child record found i've tried disable constraints attempts futile: ora-02297: cannot disable constraint (xxx.fka1) - dependencies exist i have wonder how data got in state in first place, since foreign keys not...

How to add a chart in iReport Designer 4.1.2 to my designer view? -

problem i have created blank report (mychart.jrxml).i cannot figure out how add chart blank report in designer view. what have tried i went samples folder under ireport folder of installation , opened 1 of samples has chart. in example (charts.jrxml) chart definition expanded in summary section on left tree navigation bar. so go blank (mychart.jrxml) file , try right click "summary" see if can add type of component cannot. update i have noticed in main navigation bar the palette menu item under tools empty. does know how? have pay edition accomplish this? thanks, official answer: click on window->palette open palette widnow on right