Posts

Showing posts from August, 2010

Qt Creator precompiled headers code completion -

i have problem code completion in qt creator. have precompiled header named ogreheaders.h . building clang using qmake mkspec unsupported/linux-clang . project builds when edit don't code hints. think because precompiled header included using -include-pch compiler option, not #include directive. qt creator code model doesn't find it. had idea wrapping header in #ifdefs or #ifndefs parse not compile. #ifdef pch #include <ogreheaders.h> #endif i need somehow #define pch in qt creator code model, not in compiler's one. or reverse. tried using qmake_cxx_flags , defines , qt creator picks them up. i saw this article integraton. @ bottom of article says: when go “projects” mode, see tab “code completion settings”, can select “custom” header. when selecting option, code-model use header cache, compiler not use it. i don't have option in qt creator(2.8.0). ideas how workaround issue or need build qt creator clang integration git? pu...

android - Bluetooth not sending file to other device -

it asked didn't find solution. bluetooth application using bluetoothshare.class . my source code sending file target device mainactvity.class: set<bluetoothdevice> devices = btadapter .getbondeddevices(); final string btdevicename = selected_devicename; bluetoothdevice device = null; (bluetoothdevice itdevice : devices) { if (btdevicename.equals(itdevice.getname())) { device = itdevice; } } if (device != null) { contentvalues values = new contentvalues(); values.put(bluetoothshare.uri, uri.tostring()); values.put(bluetoothshare.mimetype, "image/jpeg"); values.put(bluetoothshare.destination, device.getaddress()); ...

java - JTable drop row makes a duplicate row -

i have problem below code. have jtable. when move row gets below method , after: e.dropcomplete(importer.importdata(c, t)); i error says exceptionjava.lang.indexoutofboundsexception: invalid index public void drop(droptargetdropevent e) { //system.out.println("drophandler.drop(x)"); int dropaction = e.getdropaction(); jcomponent c = (jcomponent) e.getdroptargetcontext().getcomponent(); hookandeyetransferhandler importer = (hookandeyetransferhandler) c.gettransferhandler(); if (canimport && importer != null && actionsupported(dropaction)) { e.acceptdrop(dropaction); try { transferable t = e.gettransferable(); importer.setdroppoint(e.getlocation()); importer.setdropcomponent(c); e.dropcomplete(importer.importdata(c, t)); } catch (runtimeexception re) { e.dropcomplete(false...

oracle - why am I getting ORA-00936 error -

i can run following statements , correct results: select moon_phase_text (sysdate) dual; select date_day3 aday3import t1, aasum_report t2 t1.date_day3 = t2.game_date; this statement gives me list of days ie 22-feb-03 however when trying update field in table following statement error ora-00936: missing expression update aday3import set moon_phase = select moon_phase_ (select date_day3 aday3import t1, aasum_report t2 t1.date_day3 = t2.game_date ) dual; instead of going dual. try concatenating moon_phase_ in select statement update aday3import set moon_phase = (select 'moon_phase_'||date_day3 aday3import t1, aasum_report t2 t1.date_day3 = t2.game_date )

php - javascript for scrollTo -

i have script : $(document).ready(function() { $('a.link').click(function () { $('#wrapper').scrollto($(this).attr('href'), 400); $('a.link').removeclass('selected'); $(this).addclass('selected'); return false; }); }); function setposition(check, div, p1, p2, p3, p4, p5) { if(check==='#box1') { $(div).scrollto(p1, 400); } else if(check==='#box2') { $(div).scrollto(p2, 400); } else if(check==='#box3') { $(div).scrollto(p3, 400); } else if(check==='#box4') { $(div).scrollto(p4, 400); } else { $(div).scrollto(p5, 400); } }; but box4and box 5, thats won't slide left . slide bottom of box1 . layout : ________________________________________________________...

knockout.js - How to use knockout mapping plugin with Durandal? -

i'm new in durandal, , wanted rewrite existing knockout project using framework. in old project i'm using knockout mapping plugin , have problem it. work durandal sample project base. here piece of code: define(['durandal/app', 'durandal/system', 'knockout'], function (app, system, ko) { var clients = ko.observablearray([]); return { clients: clients, activate: function(data) { var self = this; ko.mapping.fromjs(getdata(), {}, self.clients); } }; }; the error is: uncaught typeerror: cannot call method 'fromjs' of undefined indeed, undefined, should add , make working? thanks. you should add mapping plugin in define otherwise not going load it. define(['durandal/app', 'durandal/system', 'knockout', 'knockout-mapping'], function (app, system, ko) { make sure able load script in requirejs configuration. i suggest load k...

php - MySQL UNION returning no results whatsoever -

i've been tearing hair out @ inability understand seems simple issue. i'm making small business contacts system enable our company store contact details of other business/companies business contacts (can freelancers or linked added companies. i'm trying have 1 search form enable me search either name of contact or name of business in both arabic , english. what doing wrong? update: union query works if remove arabic search portions each query section (i.e. removed "or contact_name_arabic '%".$querystring."%'" "or company_name_arabic '%".$querystring."%'") this becoming more complicated :/ table 1: companies id | company_name | company_name_arabic ----------------------------------------------- 1 | red arrow | السهم الأحمر 2 | white tower | البرج الأبيض 3 | mobilex | موبيليكس table 2: contacts id | company_id | contact_name | contact_name_arabic ---...

android - How to retrieve the String from MultiAutoCompleteTextView -

i using multiautocompletetextview , want append selected text in multiautocompletetextview, m trying public void onitemclick(adapterview<?> arg0, view arg1, int arg2, long arg3) { map<string, string> map = (map<string, string>) arg0 .getitematposition(arg2); string name = map.get("name"); string number = map.get("phone"); automulti.settokenizer(new multiautocompletetextview.commatokenizer()); log.d("ad:", automulti.gettext().tostring()); automulti.append(", " + name ); } try code, multiautocompletetextview myedittext = (multiautocompletetextview)findviewbyid(r.id.mymulti); string stringedittext = multiautocompletetextview.gettext().tostring();

java - Spring bean field (which is instantiated explicitly) is assigned to null sometimes -

one day faced incident application started crashing because of npe. found place crashing, cannot sure why happen. roughly speaking lets assume have class a appears spring bean @ same time. class has field property instantiated explicitly (yes, know how sounds like) , method propertyuser uses field: class { private objectclass property = new objectclass(); public void propertyuser() { property.action(); } .... getter\setter property } and after time of usual work, property field has become null has resulted in npe propertyuser method. changed legacy code , property assigned via spring container either, need sure reason of error appearance. so pleased if give me hint.

javascript - Change innerHTML doesn't work -

well have code: <script> function changeinner(id, inner) { document.getelementbyid(id).innerhtml = "<textarea>" + inner + "</textarea>" } </script> <span id="edit" onlick="javascript:changeinner('edit', 'more text in textarea!');">some text!</span> why doesn't work? it's simple, , doesn't work, don't know why... you have typo in html markup. changing onlick onclick makes work. <span id="edit" onclick="...

ios - Loaded nib but the view outlet was not set - UITableViewController -

i know question has been asked dozens of times. i've real answers on still cannot find issue :(((( i loaded nib view outlet not set when i'm trying activate view uitableviewcontroller . could please me ? below xib. added connections out of desperation doesn't help. <?xml version="1.0" encoding="utf-8" standalone="no"?> <document type="com.apple.interfacebuilder3.cocoatouch.xib" version="3.0" toolsversion="4504" systemversion="12e55" targetruntime="ios.cocoatouch" propertyaccesscontrol="none" useautolayout="yes"> <dependencies> <deployment defaultversion="1536" identifier="ios"/> <plugin identifier="com.apple.interfacebuilder.ibcocoatouchplugin" version="3734.1"/> </dependencies> <objects> <placeholder placeholderidentifier="ibfirstresponder...

Distinct Results from Solr Query -

this question has answer here: how select distinct field values using solr? 6 answers i have solr indexed data below <doc> <str name="pincode">792056</str> <str name="city">bijoypur-i bl.i -iii</str> <str name="district">changlang</str> <str name="locality">bijoypur-i bl.i -iii</str> <str name="state">arunachal pradesh</str> </doc> my problem 10 distinct pincodes same state have 10 documents , when query states using query http://ip:port/solr/select?q=state:arunachal pradesh returns 10 values same state name, need distinct values of state name only, please me on this checking grouping/field collapsing feature in solr

c# - Handling errors in WPF MVVM -

i using wpf mvvm im 1 of project. have datagrid bind list of objects. <datagrid itemssource="{binding path=listofvalues}" margin="5,38" in view model class have property listofvalues public observablecollection<classa> listofvalues { { return listofvalues; } set { listofvalues= value; raisepropertychangedevent("listofvalues"); } } in classa have 3 properties. public string name { get; set; } public long no { get; set; } public decimal amount { get; set; } in grid user can enter value amount filed.i want validate whether user enters valid decimal value filed. suggest me place can catch execption. try handle @ close of window. if user enters invalid value not saved in data context of view. tried validate in setter of classa not hit setter of value. perhaps attack problem different angle... how stopping users entering n...

validation - Java Constraint Annotations: Passing Parameter Value To Composite Constraint -

i'm trying create own composite validation annotation validate string - far made of annotations @notnull, @notblank , @size however, not want leave these @ default values , want able pass in parameter value, example if @validstring (min = 1, max = 50), @size annotation can read these values - possible? my constraint - @notnull() @notblank() @size() @constraint(validatedby = validstringvalidator.class) @target({method, field, annotation_type, constructor, parameter}) @retention(runtime) public @interface validstring { string message(); class<?>[] groups() default {}; class<? extends payload>[] payload() default {}; int min() default 1; int max() default 255; } no, annotation can contain other annotations, e.g. @notnull() @notblank() @constraint(validatedby = validstringvalidator.class) @target({method, field, annotation_type, constructor, parameter}) @retention(runtime) public @interface validstring { string message(); cla...

reporting services - Number of pages on SSRS Report Manager -

i have report has more 100 pages. when report loads, default should show actual number of pages shows 1 of 2 , upper limit increases 1 navigate next page. need change settings show exact number of pages? is there pagebreak on group? check properties on tablix member highlighting row group name on bottome panel , hitting f4. should bring tablix member properties windows, in under "group" settings can check , see if there pagebreak under "pagebreak" options. if 1 exists verify reset page number set "false" hope helps, cheers!

r - Change the font size of a ggplot chart -

in ggplot chart have title chart , values x , y axis. when save chart image labels tiny. i tried change font size using: size = 21 but didn't work. there easy way chage font size whole chart? size of texts changed using function theme() , choosing element need modify. set font size texts in plots attribute text should changed. ggplot(mtcars,aes(cyl,mpg))+geom_point()+theme(text=element_text(size=21))

javascript - jquery counter reset issue -

i have following code , after page refresh, counter not getting reset. please me out in resetting "counter". excuse me if there typo(s) or dirty coding. script : $(window).load(function () { $(document).ready(function () { $('p').click(function () { $(this).animate({ 'color': 'rgb(' + (math.floor(math.random() * 256)) + ',' + (math.floor(math.random() * 256)) + ',' + (math.floor(math.random() * 256)) + ')' }, 500); }); $('#counter').data('count', 0); $("#fl1").click(function () { $('#counter').val(function (i, val) { return val == '0' ? 1 : val + 1; }); }); $('#counter').data('count', 0); $("#fl2").click(function () { $('#counter').val(function (i, val) { return v...

sql - inserting multiple rows with varying data with one query -

so .. want have query creates multiple rows 1 query. want row 1: col1 = 'val1', col2 = 'val2', col3 = 'val3' row 2: col1 = 'val1', col2 = 'val2', col3 = 'val4' row 2: col1 = 'val1', col2 = 'val2', col3 = 'val5' where val3,val4,val5 are returned sub-query. thinking insert table_name (col1, col2, col3) values ('val1', val2, (select column_name table_two condition)); any ideas how can 1 query? yes, it's possible: if val1 , val2 constant, then: insert table_name (col1, col2, col3) select 'val1', 'val2', column_name table_two condition;

hashtable - Check Uniqueness of a Java Object, within some epsilon -

i'm trying prune 3d mesh checking vertices uniqueness. because each vertex has sort of error associated it, 2 "similar" verts same. e.g. <1.9999999, 1, 3> same vertex <2.000001, 1, 3> i have millions of vertices need check, going put of objects hash table , query see if unique. overriding isequal easy: take abs of difference between 2 coordinates , divide magnitude of one. example: if (math.abs((x2-x2)/x1) < 0.0000001) return true; but how come hashcode return same 2 equal, not equal vertices? i thought quantizing space, i.e. taking floor decimal place entire set. but, in example above round <1.999, 1, 3> , <2.000, 1, 3> example. but how come hashcode return same 2 equal, not equal vertices? in short, that's not possible. if hashcode(x) == hashcode(x + eps) x , it's true hashcode(x + eps) == hashcode(x + 2*eps) , on. the way satisfy int hashcode() { return constant; } , of limited use... as corolla...

c# - Modbus Communication -

i using c# communicate via modbus rs485 rs232 2 phase meters among other log power voltage. i have send data on bus can receive readings. have connected normal wire , shorted send , receive. the data recieved , event fired: private void port_datareceived(object sender, serialdatareceivedeventargs e) { serialport sp = (serialport)sender; byte[] buff = new byte[sp.bytestoread]; //read serial buffer sp.read(buff, 0, buff.length); string data= sp.readexisting(); foreach (byte b in buff) { addbuffer(b); //add byte buffer } } then buffer sent function one: private void addbuffer(byte b) { buffer.add(b); byte[] msg = buffer.toarray(); //make sure message integrity correct if (this.checkdataintegrity(msg)) { if (datareceived != null) { modbuseventargs args = new modbuseventargs(); getvalue(msg, args); datareceived(this, args); } buffer.removerange...

why android uses inner classes so much? -

this general question. in examples of android find adapters, tasks or else inner class. best practice in android? i know make easier handle ui changes, on other site makes large files. is there rules in android encapsulate in seperate files or include inner class? thanks lot. its not android java from java oracle docs: why use nested classes? there several compelling reasons using nested classes, among them: it way of logically grouping classes used in 1 place. it increases encapsulation. nested classes can lead more readable , maintainable code. logical grouping of classes—if class useful 1 other class, logical embed in class , keep 2 together. nesting such "helper classes" makes package more streamlined. increased encapsulation—consider 2 top-level classes, , b, b needs access members of otherwise declared private. hiding class b within class a, a's members can decla...

java - Why interface variable or field more precise are not default? -

i mean why cannot have default access specifier , please don't tell me java developer made know this link give me information ..my real question why cannot default access specifier? not having private make sense variable useless ..but why not default access specifier? the important thing how public interface is. doesn't make sense have interface methods less public interface itself. making interface methods public means visible whenever interface is. access modifiers there protect implementation details, if wanted hide method wouldn't expose in interface.

c# - Expressions - how to reuse business logic? How to combine them? -

note: it's long post, please scroll bottom see questions - make easier understand problem. thanks! i have " member " model defined follows: public class member { public string firstname { get; set; } public string lastname { get; set; } public string screenname { get; set; } [notmapped] public string realname { { return (firstname + " " + lastname).trimend(); } } [notmapped] public string displayname { { return string.isnullorempty(screenname) ? realname : screenname; } } } this existing project, , model, , don't want change this. got request enable profile retrieval displayname : public member getmemberbydisplayname(string displayname) { var member = this.memberrepository .firstordefault(m => m.displayname == displayname); return member; } this code not work because displayname not mapped field in database. okay, mak...

ios - multiple auto-resizable UILabels in table cell -

i'm trying put 3 uilabel in cell of table in ios6. first 1 number , on left, second 1 title , next first one, , third 1 date placed on right side of cell. date , title resize correctly according length of text, when title long 1 should truncated before date, instead appears on date. how title truncate before date? have tried set frame width , using sizetofit , no effect. just use condition expansion of titlelabel: titlelabel=[[uilabel alloc]initwithframe:cgrectmake(0, 0, 10, 20)]; datelabel=[[uilabel alloc]initwithframe:cgrectmake(160,0, 160, 20)]; [self.view addsubview:titlelabel]; [self.view addsubview:datelabel]; titlelabel.text=@"sjlkfdsfjdfkdlfjlkdsjflkdfjkldsfkdjfkljdslkjflkdslkf"; datelabel.text=@"fmldf"; [titlelabel sizetofit]; if(titlelabel.frame.origin.x+titlelabel.frame.size.width>datelabel.frame.origin.x) { titlelabel.frame=cgrectmake(titlelabel.frame.origin.x, titlelabel.frame.origin.y,...

java - How to decrease initial load time in Gwt multiple entry point project app -

i using java google web toolkit. problem when client uses our app, 1.1 mb downloaded , takes time load initially. does know how can decrease initial load time in our gwt multiple entry point project app? the official docs came bullet points enable compression remove unused css minify javascript minify css minify html defer loading of javascript optimize images serve scaled images serve resources consistent url. apart , next immediate step can code splitting. . as can reduce load in onmoduleload() ,that's helps bring app client faster. and compile time reports helps digging object. on top of these,you able enable gzip server ,which compresses data in gzip format client . more on standard java coding techniques(respective gwt) while coding. use arraylists instead of lists , hashmap's instead of map's gwt compiler not need compile code possible implementations of list ,map's etc. use stringbuilder's instead of string...

ruby on rails - Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2) (Errno::EADDRINUSE) -

i newbie ror , installed netbeans ide 6.9.1 , required software's on terminal server , seem work well, when 1 user running it. problem when user runs, netbeans fetching same port number (3000) time , errors out message c:/ruby187/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': 1 usage of each socket address (protocol/network address/port) permitted. - bind(2) (errno::eaddrinuse) (guess netbeans supposed fetch these port numbers automatically) this seem working fine in other terminal servers. is got ruby code or issue netbeans. any please.. you can run rails server specified port console instead of netbeans ide. think netbeans can set ports, didn't used ide long time , forgot it.... in project folder first. if using rails 2.* > ruby script/server -p 3001 if using rails 3+ > rails s -p 3001 -p xxxx port use, can specify port different user's. hope helps.

Variable scoping across <?php ...?> blocks with HTML interspersed -

i new webscripting , technologies. please pardon me if basic query. further have been researching day , haven't been able figure out why not working. i trying improve website wife. design dictates have common header.php file can included various static pages website contains. now new requirement, want target few static pages targeting different keywords, , company wants setup different "heading message". want dynamically pass different "$page_heading" before include header.php. my header.php has bunch of html code interspersed in between , following doesn't seem working: in <mypage.php>: ... <body> <div class="container"> <?php //global page_header; $page_header = 'a wildlife resort of south india'; include('header.php'); ?> ... in <header.php>: <header class="row-fluid"...

javascript - Is there a more 'Angular' way to implement this (communication between two elements)? -

i writing customized directive, add asterisk required input field. here link function, explained comments: // dom looks this: // <label id="label-1" for="example-1">name:</label> // <input id="example-1" type="text" acc-required> function (scope, element, attrs) { // element input node // included jquery, can use selector following. var label = $("label[for='" + element.attr('id') + "']"); if (label) { // @ add asterisk label of required input field var abbrelement = angular.element('<abbr title="required" class="required-marker"">*</abbr>'); label.append(compile(abbrelement)(scope)); } } is smell select label based on id attribute input? to avoid dom traversal, , hence use of ids , for , jquery, suggest putting directive on label rather input: <label acc-required>name:</labe...

ajax - PHP Poll with Results on Same Page -

there great article posted css-tricks.com describing how create poll using php , mysql database. i've followed , created nice poll myself. noticed in comments mentioning of using ajax show results on same page instead of separate page. i wondering best way display php poll results on same page? update: the answer simple. in fact, css-tricks' poll without ajax in opinion more difficult since requires database. 1 not! the complete tutorial creating poll php , ajax can viewed here: http://www.w3schools.com/php/php_ajax_poll.asp i wanted clarify how set arrays more 2 poll options. first "database" (i.e. text file, not mysql). //get content of textfile $filename = "poll_result.txt"; $content = file($filename); then put data in array: //put content in array $array = explode("||", $content[0]); $yes = $array[0]; $no = $array[1]; //if multiple options $array = explode("||", $content[0]); $option1array = $array[0]; //n...

java - How do I get email references in Yahoo mail? -

i have following code gets inbox yahoomail :- this._store = _session.getstore("imaps"); this._store.connect("imap.mail.yahoo.com", 993, this._uid, this._pwd); folder inbox = this._store.getfolder("inbox"); searchterm unread = new flagterm(new flags(flag.seen), false); imapmessage[] msgs = (imapmessage[]) inbox.search(unread); this returned me unread messages in form of variable msg . earlier had line of code worked fine gmail :- string ref = msg.getheader("references")[0]; but yahoo, gives me null pointer exception. now question is, references not stored in message header, in yahoomail, unlike gmail ? the references header set when reply message. if message you're reading not reply, it's not have references header. , replies depends on mailer sent reply add header; don't. have prepared header missing.

java - Update object and get old value via JPA -

i want log changes of account. therefore, have created entity class shall log changes. each time, account entity saved or updated logging object created. when object updated new balance old balance shall retrieved database. object bound session retrieving old balance not trivial, because 1 gets new balance. to circumvent, detached object session. yet, seems workaround should avoided. the following code snippets shall illustrate scenario. any suggestion highly appreciated! the test: public class accountservicetest { @autowired accountservice accountservice; @autowired changeaccountservice changeaccountservice; @test public void shouldhavechangelog() { account account = this.accountservice.updateaccount(new account(0, 10.0)); assertthat(account.getid(), is(not(0l))); account.setbalance(20.0); account = this.accountservice.updateaccount(account); final list<changeaccountlog> changeresultl...

android - Play Store: Beta test & Production APK different certificates -

i started beta test app in play store, want use certificate production ('real' release) apk without changing package name. is possible? just tested it, isn't possible, not alpha- , beta-test apks can't have different certificates.

Manually keying in a number for list indices in python -

i have list of file name eg. filenames=['blacklisted.txt', 'abc.txt', 'asfafa.txt', 'heythere.txt'] i allow users manually choose file name display , example , * print "please key in first log file use: " choice1=raw_input() print"please key in second log file use: " choice2=raw_input() filename1=filenames[choice1] filename2=filenames[choice2] print filename1 print filename2 * however, got error : filename1=filenames[choice1] typeerror: list indices must integers, not str. any advice ? thanks! you have first convert input int using int() print "please key in first log file use: " choice1=raw_input() . . filename1=filenames[int(choice1)] . or convert input straight int choice1 = int(raw_input()) filename1 = filenames[choice1] you should display list of files corresponding index numbers user know choose. update for error handling, can try like while true: choice1 = raw_input(...

jquery - DataTables warning (table id = 'IDTableName'): Cannot reinitialise DataTable -

i'm using jquery datatable in asp.net, , updatepanel (scriptmanager) . have next below error: datatables warning (table id = 'tbverificationapplicant'): cannot reinitialise datatable. to retrieve datatables object table, pass no argument or see docs bretrieve , bdestroy this jquery file create table: function datatablesexec() { $('#tbverificationapplicant').datatable({ 'bprocessing': true, 'bserverside': true, "spaginationtype": "full_numbers", 'sajaxsource': 'listverificationdata.ashx?ddlstatusvalue=' + $("#ddlstatusclient option:selected").text(), "fndrawcallback": function () { $('#tbverificationapplicant tbody tr').click(function () { var href = $("td:eq(0)", this).text(); document.location.href = 'frm_verifyidentity.aspx?i...

html - Why is not the image effected when I use margin-left -

this question try understand example , works should. have set styling margin:0 0 0 98px; on selector #sweden dd , want know reason why can image keep it's position when use above styling on #sweden dd . mean when use margin used push surrounding elements away specified space in case 98px placed between description element( dd ) , image. here complete markup , css <!doctype html> <html> <head> <style type="text/css"> body { font-family:arial, sans-serif; font-size:small; padding:0; margin:0; } #sweden { float:left; width:300px; padding:10px 0; border:2px solid #c8cdd2; } #sweden dl /* block element */ { float:left; margin:10px 20px; padding:0; } ...

delphi - How to set individual Character Color from a string and display in TLabel? -

Image
i having 1 delphi xe2 project. objective separate individual character string change font color after characters displayed in scrolling tlabel . project display scrolling tex each characters having different color prevoius character. character color vary according color slider . have implemented following logic: using timer1 leftmostcharacter separated , color changed , added label1 . label1 scroll right left. using timer2 rightmostcharacter separated , color changed , added label1 . label1 scroll left right. so have written following codes: unit unit1; interface uses winapi.windows, winapi.messages, system.sysutils, system.variants, system.classes, vcl.graphics, vcl.controls, vcl.forms, vcl.dialogs, vcl.stdctrls, vcl.extctrls; type tmainform = class(tform) label1: tlabel; label2: tlabel; timer1: ttimer; timer2: ttimer; button1: tbutton; button2: tbutton; procedure timer1timer(sender: tobject); procedure timer2tim...

c# - How to bind CheckBoxes from GridView to source DataTable? -

i have create form, in users can create multiple tests data. if user want validate data, must check checkbox in appropiate row , column test , then, click button titled "validate tests". if user want add new test (i.e. test2), must press "add test" button. all data stored datatable (dttests) , displaying gridview (dgvtests) on aspx page. my question is, how can checked-values each checkboxes ? example website: in example, user add 2 tests (look on image: http://i.stack.imgur.com/cr8l5.jpg ). in test1, want validate years: 1990, 1993, 1999 in test2, want validate years: 1990, 1993, 1998, 1999 new test column in dttests: datacolumn dc = new datacolumn("test" + i.tostring()) { datatype = typeof(boolean), readonly = false }; dttests.column.add(dc); i add new testx column gridview in way: templatefield cbxtest = new templatefield(); cbxtest.headertemplate = new checkboxtemplate(datacontrolrowtype.header, "test" + i....

wordpress - the best way to hide / customize this php error -

i have code works fine $done_getting = file_get_contents($url); if($done_getting == !null) { return $done_getting; } else { return $custom_error_msg; } if i'm online fetches $url , displays on page, in event of slow internet connection or offline warning: file_get_contents(url ): failed open stream: http request failed! in xxxxxx this correct error msg php , how customise msg instead of getting 1 tells user root files are. is possible customise it. i using in wordpress(debug mode). code above works too, when there error returns $custom_error_msg after showing default php error.

java - Spliting big XML file into small based on tag name -

i have requirement in xml file & tag name input, have split xml file using given tag name using java. pls. suggest me s input: xml file <note> <to>tove</to> <from>jani</from> <heading>reminder</heading> <body>don't forget me weekend!</body> </note> <book> <author>gambardella, matthew</author> <title>xml developer's guide</title> <genre>computer</genre> <price>44.95</price> <publish_date>2000-10-01</publish_date> <description>an in-depth @ creating applications xml.</description> </book> <book> <author>ralls, kim</author> <title>midnight rain</title> <genre>fantasy</genre> <price>5.95</price> <publish_date>2000-12-16</publish_date> <description>a former architect battles corporate zombies, evil sor...

mysql - Entity Framework Add method not available -

Image
i created ado.net entity data model mysql database. model not have add() or remove() method. for connection tot mysql database i'm using mysql.data v.6.7.4.0 , mysql.data.entity v.6.7.4.0. in console project. last week made project 1 , worked perfectly. don't know i'm missing now. this happen if declared collection read-only collection type (probably iquyerable<t> ). change dbset<t> .

php - Prevent from auto fill form data -

i facing problem related auto fill in form. running trust charity website collects fund donor. problem : when have entered donation 1 cause , again want enter donation same cause different credit card detail. strange form need enter detail card related retained of information previous donation entered. i have tried autocomplete="off" in form , in input. rename input each pageload. generate prefix, , put in hidden field in form. $prefix = date("u"); //lets use unix time this. ... <input type="hidden" name="prefix" value="<?php echo $prefix; ?>"/> <input type="text" name="<?php echo $prefix; ?>_cardnumber" /> ... and when processing $_post[$_post['prefix'].'_cardnumber']

php - How can I save input text with nestable's serialize() -

i trying fix admin interface menu system based on jquery nestable , php mysql. features i'm trying achieve nestable, sortable, rename, add , delete. i've started out nestable , http://robertan.com/blog/?p=108 , gotten pretty far it. see testsite but how can modify values text inputs saved nestable.serialize() function. serialize: function() { var data, depth = 0, list = this; step = function(level, depth) { var array = [ ], items = level.children(list.options.itemnodename); items.each(function() { var li = $(this), item = $.extend({}, li.data()), sub = li.children(list.options.listnodename); if (sub.length) { item.children = step(sub, depth + 1); } array.push(item); }); return array; }; data = step(list.el.find(list.options.listnoden...

javascript - Cant switch to fullscreen mode from an iframe -

i have backbone view button should make view goto fullscreen on click. i'm using screenfull.js , , cant see different examples , code. console.log(screenfull.enabled); return false in clickhandler. var fullscreenbutton = backbone.marionette.itemview.extend({ tagname: 'button', initialize: function () { this.$el.click(_.bind(this.gofullscreen, this)); }, gofullscreen: function () { console.log(screenfull.enabled); screenfull.request(this.options.container); } }); also without screenfull.js dont g oto fullscreen: gofullscreen: function() { var element = document.documentelement; if (element.requestfullscreen) { element.requestfullscreen(); } else if (element.mozrequestfullscreen) { element.mozrequestfullscreen(); } else if (element.webkitrequestfullscreen) { element.webkitrequestfullscreen(); } } the problem app runs in iframe. adding allowfullscreen="true" attribute iframe fixes bug.

javascript - AngularJS directive will only work until ng-include changes -

i have angularjs directives work once. when view changes , return no longer work, there no page refresh involved, use simple view loading system using ng-include page changes (sub pages not main routes). i have markup this. <div class="row" ng-controller="mainctrl"> <ul class="sidebar span3" sub-nav> <li><a ng-click="changepage('users')">users</a></li> <li><a ng-click="changepage('posts')">posts</a></li> </ul> <div class="span9" view-partial ng-include="route[active]"></div> </div> the "sub-nav" directive has method update "active" scope variable. have directive listens changes "active" variable , emits "pagechange" event if value different. (they separate controller applied more one). there 1 controller running code @ time , seems work perfe...

sublimetext - I can't get this to work: In Sublime Text (3), I am trying to alternate a setting's value using the same shortcut/keymap and contexts -

in sublime text 3, trying alternate setting's value using same shortcut, differing contexts. basically, want alternate draw_white_space setting between 3 possible values: none , selection , , all . i change setting enough 3 separate shortcuts/keymaps. here code (working): { "keys": ["ctrl+e", "ctrl+w"], "command": "set_setting", "args": { "setting": "draw_white_space", "value": "all", } }, { "keys": ["ctrl+e", "ctrl+q"], "command": "set_setting", "args": { "setting": "draw_white_space", "value": "none", } }, { "keys": ["ctrl+e", "ctrl+s"], "command": "set_setting", "args": { "setting": "draw_white_space", ...