Posts

Showing posts from July, 2011

Spring MVC: mapping multiple nested properties -

i new spring mvc, excuse me if has been answered before i have following request data.test=test&data.rating=4&data.comments=test model object is class resp { data data; } class data { string test; string rating; string comments; } i using @modelattribute , every thing working fine. my problem properties of data class variable. both number of properties , names of properties dynamic, change @ runtime. tried different approaches creating setdata(map<string, string) in resp class. nothing helped. thanks in advance update: sorry forgot mention earlier, or bad, using domain objects jpa entities you can take hashmap request or response in spring mvc. change instead of getting paramname field in object , key in map. works map in response @requestmapping(value = "/testurl", method = requestmethod.post) public @responsebody map<string,string> test( @requestbody map<string,string> requestmap) {

eclipse - Remove All Methodinvocation from JAVA Source AST -

hi find methodinvocation astvisitor , remove astrewrite when use "for loop" remove methods, remove first method invocation on ever call event. guess problem reason don't refresh ast , compiliationunit , icompilationunit or astrewrite don't know when , how can refresh remove in first event. static void createast(icompilationunit unit) throws javamodelexception { // create ast icompilationunits compilationunit parse = parse(unit); methodvisitor visitor = new methodvisitor(); parse.accept(visitor); (methodinvocation metinv : visitor.getmethods1()) { try { //if declarated user. if (metinv.resolvemethodbinding().getdeclaringclass().isfromsource()) { methodinvocremove(unit, metinv); } } catch (exception e) { system.out.println("excepotion:" + e.getmessage()); } } } this method remove methodinvocations. private static void methodinvocremov

How to solve java.net.SocketException: Software caused connection abort: socket write error exception -

i have error severe: severe: servlet.service() servlet [jsp] in context path [/firstjsp] threw exception [clientabortexception: java.net.socketexception: software caused connection abort: socket write error] root cause when run application . the error messages are java.net.socketexception: software caused connection abort: socket write error @ java.net.socketoutputstream.socketwrite0(native method) @ java.net.socketoutputstream.socketwrite(unknown source) @ java.net.socketoutputstream.write(unknown source) @ org.apache.coyote.http11.internaloutputbuffer.realwritebytes(internaloutputbuffer.java:216) @ org.apache.tomcat.util.buf.bytechunk.flushbuffer(bytechunk.java:460) @ org.apache.tomcat.util.buf.bytechunk.append(bytechunk.java:368) @ org.apache.coyote.http11.internaloutputbuffer$outputstreamoutputbuffer.dowrite(internaloutputbuffer.java:241) @ org.apache.coyote.http11.filters.chunkedoutputfilter.dowrite(chunkedoutputfilter.java:119) @ org.apache.coyote.http11.abstractoutpu

c# - Split a Folder Path and File Name -

this question has answer here: getting folder name(s) path 6 answers i have folder path , file name want split it. 2 paths : f:\autoimport - folder\20141612\inv.trg , f:\emailimport\rohan@yahoo.com_01-01-2014_05-05-22\inv.trg . so want split path , want "rohan" name , "20141612" path. please suggest how can achieve in .net using c# coding. this name needed used custom name in kofax capture batch name. of batch name is: 45- f:\emailimport\ram@afcl.com_09-01-2014_10-02-30\new text document.trg. don't know 45- came , batch name coming sample script giving kofax. here output. using string.split() can achieve : string filepath1 = @"f:\emailimport\rohan@yahoo.com_01-01-2014_05-05-22\inv.trg"; system.io.fileinfo fif = new system.io.fileinfo(filepath1); string folderdet = fif.directory.name; string[] arr1 = folde

python - Is it possible to ensure audio isn't modified when playing back under Windows -

we have python program outputs specific waveforms on audio drive led, easy , cheap robot programming device. with windows systems we've tested works fine, on systems waveform seems altered. we've used control panel disable 'enhancements' audio output endpoint doesn't seem help. so, possible, using python, instruct windows play audio unchanged? or of audio gurus here have theory of affecting audio? sound cards playing audio, not sending data. can't rely on arbitrary signal not being altered hardware, less software. example, many sound cards have capacitor in series output filter out dc bias. if try pass dc-biased (or low frequency) signal through such sound card, distorted. , there's nothing can @ software level.

php - Error in SQL syntax, check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY category ASC' at line 1 -

site has been working fine years , of sudden getting error. experts appreciated. you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'order category asc' @ line 1 here code in question: // sql injection attack prevention function $unit_recordset1 = ""; if (isset($_get['unit'])) { $unit_recordset1 = getsqlvaluestring($_get['unit'], "text"); } $category_recordset1 = ""; if (isset($_get['category'])) { $category_recordset1 = getsqlvaluestring($_get['category'], "text"); } else $_get['category'] = ""; // query builder create single or multiple , query $sql = "select * documents "; if(!empty($unit_recordset1)) {$sql .= " unit = $unit_recordset1 , ";} if(!empty($category_recordset1)) {$sql .= " category = $category_recordset1 , ";} // remove last , $sql = substr($sql, 0, -4); if(!empty($category_record

php - Using .htaccess to block URL containing a keyword only if it is not containing another keyword -

this odd situation, hammering our servers http requests trying access different tinymce based editors. want block url containing keyword editor have valid working urls containing same word ... example letter-from-editor.html or editorial-board.html is there way using .htaccess can contain url containing keyword editor if doesn't contain keyword html ? this trying right blocks editor only rewriterule (^|/)editor(/|$) - [f,l] i searched , couldn't find way around it. thanks you need add simple condition: rewritecond %{request_uri} !html rewriterule (^|/)editor(/|$) - [f,l]

android - Using loaders to display data from SQLlite in listview in fragments -

Image
my app implementation activity uses viewpager , different fragments show on screen depending on tab selection or user swiping screen. have attached screenshot example. now want load data on these fragments database in listview. reading loaders not sure how implement - whether use cursorloader uses content provider or use asynctaskloader. want avoid cursorloader since mandates uses of content provider, let me know if still make sense go rather asynctaskloader. also, can use single loader maybe in activity , use loader display data in different fragments? or should implementing loader each of fragments? before thinking use loaders had used simplecursoradapter display results have heard better use loaders asynchronous operations. let me know if simplecursoradapter suffice lightweight operation. i know have asked many questions beginner , little confused @ point. please help.

apache - Why does this RewriteRule produce infinite recursion? -

i trying rather basic url rewriting cannot running properly. i want redirect requests wordpress.foobar.com local symlinked wordpress installation via .htaccess file: rewriteengine on rewritecond %{server_name} ^wordpress\.foobar\.com$ rewriterule ^(.*) /html/wordpress/$1 [l] while can access foobar.com/html/wordpress , visiting wordpress.foobar.com raise 500 internal server error. apache's error log contain following: [error] [client 12.123.123.123] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace. when enable debug loglevel can see apache trying rewrite favicon.ico infinitely, appending layer of /html/wordpress/ until recursion limit reached. what's wrong rewrite? when error request exceeded limit of 10 internal redirects due probable configuration error. , ask question: how did design rules terminate @ poin

computer vision - Advantages of SIFT over HOG -

i studying sift (scale-invariant feature transform) , hog (histogram of oriented gradient). want know advantages of sift on hog in case when have extract features sequence of frames of activity (i.e. standing). until have understood: 1) in sift gaussian smoothing applied in order compute dog (difference of gaussian). performing scale extrema detection detect feature points. once have feature points need compute hog each feature. since takes 16x16 neighbourhood result 128 length descriptor. whereas hog compute edge gradient of whole image , find orientation of each pixel can generate histogram. 2) hog used extract global feature whereas sift used extracting local features. 3) sift scale , rotation invariant whereas hog not scale , rotation invariant. please let me know if there other advantages of sift. correct me if have wrong understanding. thank you

javascript - How to tell what fraction of element is inside viewport? -

how determine percentage of dom element inside current viewport ? want calculate ratio of area of element inside viewport , total area of element. related question: how tell if dom element visible in current viewport? see getboundingclientrect , window.innerheight . let {top, height} = element.getboundingclientrect(), percentvisible = math.max(0, math.min(1, (window.innerheight - top) / height)); i'm guessing @ use case, in modern browsers, see intersectionobserver , intersectionratio .

java - Getting value of string inside some regular expression -

i have code this: string s1 = "((${adapterkind=vmware, resourcekind=virtualmachine, metric=disk|usage_average}*${this, metric=summary|oversizedvmcount})+${this, metric=summary|poweredoffvmcount})"; //some code want output inside string[] s2 = {${adapterkind=vmware, resourcekind=virtualmachine, metric=disk|usage_average}, ${this, metric=summary|oversizedvmcount}, ${this, metric=summary|poweredoffvmcount}}; basically want values "${...}". how can achieve this? string s1 = "((${adapterkind=vmware, resourcekind=virtualmachine, metric=disk|usage_average}*${this, metric=summary|oversizedvmcount})+${this, metric=summary|poweredoffvmcount})"; pattern p = pattern.compile("\\$\\{[^}]*\\}"); matcher m = p.matcher(s1); while(m.find()) //here have captured texts, //you can put array/collection system.out.println(m.group()); this output: ${adapterkind=vmware, resourcekind=virtualmachine, metric=disk|usage_average} ${this, me

html - How do I create a link in a table that reveals my search results? -

i have 2 sets of data, 1 clients , 1 vacancies of clients. in table have created button when clicked displays client results, includes clientid , client name. have linked in vacancy details manage to tally amount of vacancies have in relation client. right create fourth table header populated links bring user page displays vacancies, instead of tallying them in header. paste code (except data) see if helps. 8th day of coding mvc , still find confusing @ time. if dont want write code, helpful if tell me if need controller, or more models. thank you. view: <table> <thead> <tr> <th> reference </th> <th> client name </th> <th> number of vacancies per client </th> <th> link vacancies </th> </tr> </thead> <tbody> <% dim oclient vacancymanager2.datamodels.client

ios - NSData return nil when parse html -

i want information website " http://phim14.net/ ". use code : nsurl *url = [nsurl urlwithstring:@"http://phim14.net/"]; nserror *error; nsdata *htmldata = [nsdata datawithcontentsofurl:url options:nsdatareadinguncached error:&error]; tfhpple *parser = [tfhpple hpplewithhtmldata:htmldata]; at beginning code working , can info. after several times trying met error "htmldata" return nil, think website down can connect webpage using firefox. try parse other website it's still ok? try print out error , said that `"error nserror * domain: @"nscocoaerrordomain" - code: 256 0x00007fbb224023c0"` someone please me figure out problem?? it seems errorcode 256 doesn't have description. safe way data url , use method sendsynchronousrequest:returningresponse:error: nsurlconnection . nsdata* data = [nsurlconnection sendsynchronousrequest:[nsurlrequest requestwithurl:url cachepolicy:nsurlrequest

mysql - Using aggregate function in code igniter -

i have model transaction.php <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class transaction extends ci_model{ public function mytransaction(){ $this->load->database(); $query = $this->db->get('transaction'); return $query->result(); } public function mysum(){ $this->db->select("sum(total) mysum"); $this->db->from("transaction"); return $query1->row(); } } , controller invoice.php <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class invoice extends ci_controller{ public function index(){ $this->load->model('transaction'); $data1['query'] = $this->transaction->mytransaction(); $this->load->view('transactionview', $data1); } } and lastly view <table width="600px" border=&

asp.net core - looking for samples on how to user services.add* in asp.vnext -

i know can find samples explains differences among services.addinstance , services.addscoped , services.addsingleton , service.addtransient . i found articles explain point in generic way, think source sample more clear. the scope of questions rather large, since seems looking addscoped information narrowed sample down scoping inside web application. inside web application addscoped mean pretty scope of request. entityframework using scoping internally, doesn't affect user code in cases i'm sticking user code shown below. if register dbcontext service, , register scoped service, each request single instance of scoped service resolve dbcontext . the example code below should make clearer. in general recommend trying out way i'm showing below familiarize behavior, stepping through code in debugger. start empty web application. note code i'm showing beta2 (since in beta2 added [fromservices] attribute makes easier demonstrate, underlying behavior

c# - How to set the datatextfield value instead of the value on a drop down list? -

i have list of countries, returns id , name. have string. drop down sets value id, @ point don't have id's. want able set selectedvalue text field. there way this? or there way compare string against list work out id? string country = "australia"; ddlcountry.datasource = listofcountries; ddlcountry.datatextfield = "value"; ddlcountry.datavaluefield = "key"; ddlcountry.databind(); ddlcounty.selectedvalue = ??? thanks ddlcountry.items.findbytext(country).selected = true

html - Echo php using CSS Content: property -

i need echo php using css content: property. php: <?php $links = "<a href=\"https://www.facebook.com\" target=\"_blank\"><img src=\"images/fb.png\" width=\"16\" height=\"16\"></a> <a href=\"https://twitter.com\" target=\"_blank\"><img src=\"images/twitter.png\" width=\"16\" height=\"16\"></a>"; ?> css: body li:nth-child(2):after{ content: "<?php echo "$links"; ?>"; color:#fff; } html: <ul> <li>date</li> <li>time</li> </ul> desired output: date time fb tw try like css: body li:nth-child(2):after{ content: "<?php echo $links; ?>"; color:#fff; } you can try like content: <?php echo $links; ?>; assuming css in same file php

c# - xpath where clause returning 0 nodes -

my clause in xpath expression not working , returning 0. cannot figure out wrong. code here. value of currentrelationship variable 'testentity_relname.'; var entity = doc.selectnodes(string.format("//settings/entity[relationshipname={0}]", currentrelationship)).cast<xmlnode>().tolist(); and xml document looks this; <settings> <accessrighttypes> <accessrighttype>writeaccess</accessrighttype> <accessrighttype>shareaccess</accessrighttype> <accessrighttype>readaccess</accessrighttype> <accessrighttype>noneaccess</accessrighttype> <accessrighttype>deleteaccess</accessrighttype> <accessrighttype>createaccess</accessrighttype> <accessrighttype>assignaccess</accessrighttype> <accessrighttype>appendtoaccess</accessrighttype> <accessrighttype>appendaccess</accessrighttype> </accessrighttypes> &l

jquery - Highcharts Datepicker -

01) have following sql statement generates output mentioned bellow. select date(a1.date_time) date, a4.ph1_active_energy - a1.ph1_active_energy 'ph1', a4.ph2_active_energy - a1.ph2_active_energy 'ph2', a4.ph3_active_energy - a1.ph3_active_energy 'ph3' powerpro a1 join (select date(date_time) date, min(date_time) min powerpro group date(date_time) ) a2 on a1.date_time = a2.min join (select date(date_time) date, min(date_time) min powerpro group date(date_time) ) a3 on date(a1.date_time) = a3.date - interval 1 day join powerpro a4 on a4.date_time = a3.min date(a1.date_time) between date_sub(now(), interval 30 day) , now() order a1.date_time generated output +------------+------+------+------+ | date | ph1 | ph2 | ph3 | +------------+------+------+------+ | 2014-11-26 | 38 | 11 | 20 | | 2014-11-27 | 20 | 5 | 12 | | 2014-11-

OVER PARTITION BY giving error in SQL Server 2008 -

i have following query: select *, sum(balanceqty) on (partition item_code order [date]) (select date, item_code, sum(in_quantity) in_quantity, sum(issue_quantity) issue_quantity, (sum(in_quantity) - sum(issue_quantity)) balanceqty (select tbl_add_product.date date, tbl_add_product.item_code, tbl_add_product.in_quantity, 0 issue_quantity tbl_add_product item_code = 'pen' union select tbl_issue_product.date date, tbl_issue_product.item_code, 0 in_quantity, issue_quantity tbl_issue_product item_code = 'pen') x group item_code, date) o it working fine in sql server 2012 causing error in sql server 2008. please suggest solution it. if wa

http status code 404 - how to forcefully send invalid url queries to 404 page - PHP -

i have custom 404 page , working fine pages not exist. but want show 404 page if query_string found missing/invalid/null url. how can so? www.example.com/mypage.php?param1=value1 if(isset($_get['param1']) && $_get['param1'] !='') { //general code } else { // here want redirect 404.php } also 404 page being accessed directly, , want prevent it. i solved using include, marco mura suggested in comment. www.example.com/mypage.php?param1=value1 if(isset($_get['param1']) && $_get['param1'] !='') { //general code } else { include "404.php"; }

linux - What are the column heading for this "-rwxr-xr-x 1 root root 920788 Mar 28 2013 bash" when I do "ls -l" in the Ubuntu terminal -

i executed command "ls -l" in ubuntu terminal, understand "ls -l" long listing in ubuntu, don't understand columns example: (this first line) -rwxr-xr-x 1 root root 920788 mar 28 2013 bash how find out column headings above? the columns : permissions (owner, group. all) links owner group size in bytes time of last modification name so "-rwxr-xr-x 1 root root 920788 mar 28 2013 bash" means: user root has permissions rwx (read, write, execute). group root has permissions r-x (read , execute). everybody has permissions r-x (read , execute). the file has 1 hard link. the owner root. the group root. size 920788 bytes. last modified in march 28, 2013. the file name bash .

model view controller - Kendo upload mvc in ie - no progress bar or percentage -

i'm using mvc kendo controls. { @(html.kendo().upload() .name("fileuploaddocs") .multiple(true) .showfilelist(true) .events(events => events.select("fileuploaddocs_onselect")) .events(events => events.upload("fileuploaddocs_onupload")) .events(events => events.success("fileuploaddocs_onsuccess")) .events(events => events.error("fileuploaddocs_onerror") .async(async => async .save("save", "document") .remove("remove", "document") .autoupload(true) ) ) in every browser, except ie, there dynamically added progress bar , percentage span. how can force display progress bar or percentage span in ie? in advance! you did not specify ie version use assume may 8, 9 or older. you progress bar missing because kendo upload uses hmtl5

pandas - difference between np.linalg.lstsq and linear regression in scikit learn -

comb 1 pandas data frame following values. yearid    teamid     salary         w 408         ana        51464167      82 409         ari       81027833      85 when use np.linalg.lstsq able print dfg data frame. dfg = pd.dataframe() comb1 = combined[combined['yearid'] == 2000] x1 = comb1['salary'].values /1000000 y1 =comb1['w'].values a1 = np.array([x1, np.ones(len(x1))]) w1 = np.linalg.lstsq(a1.t,y1)[0] yq = (w1[0]*x1+w1[1]) dfg['new val'] = y1 - yq when use scikit learn libary linear regression , same operation getting value error from sklearn.linear_model import linearregression fg = pd.dataframe() x2 = comb1['salary'].values /1000000 y2 =comb1['w'].values x2_reshape = x2.reshape(-1,1) y2_reshape = y2.reshape(-1,1) clf1 = linearregression() clf1.fit(x2_reshape, y2_reshape) predicted_train = clf1.predict(x2_reshape) x_pre = y2 - predicted_train fg['new val'] = x_pre what difference b

jquery - wrap text in second line if it's too long -

i have made on h1 h1 { font: 13px bpg arial; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.15); line-height: 41px; width: 476px; padding: 0 5px; height: 41px; } i don't know when client write long text , when short. want if there's big text it's make on second line. i know must reduce line-height don't know how on current problem jsfiddle i suggest use white-space:normal instead of word-break: break-all . also, replace height min-height .newstitle class. .newstitle { min-height: 41px; } h1 { white-space:normal; min-height: 41px; }

Send an Android Intent object through a socket? -

i wondering whether intent object can sent through objectoutputstream ? example lets have client(y) server(x) both of android based applications , y created intent instead of running it, y wants send x through socket x start intent, intent or intentservice . now know same thing sending action string of intent x , create intent @ x , start provided both x , y have whatever intent starting, wondering sending whole object intent. serialized object , possible send ? if yes, security drawback of theory? thanks.

html - How did the background video on the website of "http://www.exodusgodsandkings.com" autoplay on the iPad? -

how did background video on website of " http://www.exodusgodsandkings.com " autoplay on ipad ? using javascript onload function example window.onload = function() { document.getelementbyid('yourid').play(); }

Erlang/OTP pattern to ensure Composite process accepts a message only when children are done -

Image
is there erlang/otp pattern/library following problem(before hack own): at highest level, imagine there 3 components(or processes?) such a->b->c -> means sends message to. b in terms of architecture composite process. composed of many unit processes(shown in khaki green below). sometimes, message chain goes b1->b2->b3->c , goes b1->b4->b5->b6->b3->c. what is: b can accept next message when it's children processes done i.e b receives message i1 , depending on message, choose 1 flow , c gets message o1. until happens, b should not accept message i2. ensure ordering of messages o2 of i2 not reach c before o1 of i1. this has few names. 1 "dataflow" (as in "reactive programming" -- sort of overblown ball of buzzwords if up) , "signal simulation" (as in simulation of electrical signal switches). not aware of framework in erlang, because straightforward implement directly. the issue of message order

c++ - Sorting a vector of pointers using std::sort resulting in jumbled addresses? -

i'm writing function sort vector of class pointers. before sorting, vector contains following pointers: {0x784170, 0x7841a0, 0x784050, 0x783f10, 0x783f40, 0x7832a0, 0x7832d0, 0x7831a0, 0x7831d0, 0x783080, 0x7830b0, 0x782f40, 0x782f70, 0x7827c0, 0x7827f0} after sorting, contains these: {0x3141954a38, 0x3141954a38, 0x784050, 0x783f10, 0x783f40, 0x7832a0, 0x7832d0, 0x7831a0, 0x7831d0, 0x783080, 0x7830b0, 0x782f40, 0x782f70, 0x7827c0, 0x80} the following code: bool dnodecomparator(dnode* x, dnode* y) { return x->getdfn() < y->getdfn(); } void sortfunction(){ vector<dnode*> operations = applicationgraph.getoperations(); std::sort(myvector.begin(), myvector.end(), mycomparator); } class dgraph { private: vector<dnode*> nodes; public: vector<dnode*> getoperations(){return nodes;} }; the code runs on dependency graph contains vector of dnode* objects. i'm returning vector of pointers , sorting each node it

c - fprintf both to file and to stdout -

this question has answer here: how print both stdout , file in c 4 answers my c program expected produce lot of output. some of these output lines special , write copy special file. end doing file * outf = fopen("special_file", "a"); fprintf(stdout, "normal line 1\n"); fprintf(stdout, "special line!\n"); fprintf(outf, "special line!\n");/*inelegant & dangerous code duplication*/ fprintf(stdout, "normal line 2\n"); is there easy way avoid such inelegant & dangerous code duplication? have quite lot of , may write things printf("next %d\n", num++); cannot duplicated naively, e.g. using macros. at moment see no solution short of spawning child process run tee equivalent. other idea? e.g. can 1 define kind of file* in way redirect both stdout & outf ? i think dup(2) s

Get data from a website in android -

i developed app in windows phone 8/8.1, trying develop android users. getting data website , displaying in app. website needs login userid,password. implemented in c#. unable in java. can guide me. my code in c# : httpclienthandler handler = new httpclienthandler(); httpclient client = new httpclient(handler, false); handler.allowautoredirect = true; handler.preauthenticate = true; uri vceuri = new uri("http://xxxx/default.aspx"); var html = await client.getstringasync(siteuri); var doc = new htmlagilitypack.htmldocument(); doc.loadhtml(html); var viewstatenode = doc.getelementbyid("__viewstate"); var eventvalidationnode = doc.getelementbyid("__eventvalidation"); var viewstate = viewstatenode.getattributevalue("value", ""); var eventvalidation = eventvalidationnode.getattributevalue

mongodb - Pushing inside multiple array's in Mongoose -

as new mongoose, able push inside single array using $push when tried $push multiple array fields no error shown on console database not updating recent values model: var networkschema = new schema({ userid: { type: schema.types.objectid, ref: 'user' }, networklist: [{ type: schema.types.objectid, ref: 'user' }], networkrequest: [{ to:[{ type: schema.types.objectid, ref: 'user'}], from:[{ type: schema.types.objectid, ref: 'user' }] }] }); page: <div ng-controller="authenticationcontroller" style="margin-top: 50px"> <div ng-controller="networkscontroller"> <ul> <li ng-repeat="network in networkfriends"> {{network.firstname}} <button type="submit" class = "btn btn-default" data-ng-click="update(network._id,network.email)">add friend</button>

extjs - Can I override Ext.define? -

i want override default namespace ext.define. how can that? want thing abc.define instead of ext.define . thank in advance. cheers!! you can reference ext in variable if must. abc = ext; abc.define(.... i'm not sure why you'd want though. if real intention have created objects in custom namespace - ext.define does. ext.define("abc.model.website", {....

javascript - Serialize form post to controller -

html: <form id="testform"> <div> customer 1 <input type="hidden" name="employeeid" value="1" /> <input type="checkbox" name="firstname" value="10"> test 10 <input type="checkbox" name="firstname" value="20"> test 20 <input type="checkbox" name="firstname" value="30"> test 30 <input type="checkbox" name="firstname" value="40"> test 40 <input type="checkbox" name="firstname" value="50"> test 50 <input type="checkbox" name="firstname" value="60"> test 60 </div> <div> customer 2 <input type="hidden" name="employeeid" value="2" /> <input type="checkbox" name

jquery - What would be the best way to read values from <h:selectOneMenu /> to javascript function? -

i have jquery modal div displays on on-click event.... <div id="time_scheduler" style="display: none;" title="change event time" class="dialog"> <div class="block"> <h:form> <span>select shift</span> <p></p> <h:selectonemenu value="#{fieldcontroller.shift}"> <f:selectitems itemlabel=" #{s.shiftname} &nbsp; &nbsp; &nbsp; #{s.starttime} #{s.endtime}" var="s" value="#{fieldcontroller.allshiftunfiltered}" /> <f:converter converterid="shconvert" /> </h:selectonemenu> <p></p> <h:commandbutton onclick="getshift('#{request.contextpath}/changeevent?','#{fieldcontroller.shift.starttime}','#{fieldcontroller.shift.endtime}');" styleclass="bt

java - SQL selecting all records with IN statement -

in case, first 2 parameters mandatory. when users hasn't given rest of parameters, i'm using charachter '%' statement data shown. idea how solve in statement? solution param in ('%') not working => null parameters: java.sql.timestamp, java.sql.timestamp, java.lang.string, java.lang.string, java.lang.string, java.lang.string query: select * rc_recall t inner join rc_recallstore s on t.id = s.recallid t.creationdate >= ?1 , t.enddate <= ?2 , t.id ?3 , t.afdeling in (?4) , s.storeid in (?5) order id desc the in statement in sql cannot accept wild card character. have add or query work... select * rc_recall t inner join rc_recallstore s on t.id = s.recallid t.creationdate >= ?1 , t.enddate <= ?2 , t.id ?3 , ('%' = ?4 or t.afdeling in (?4)) , ('%' = ?5 or s.storeid in (?5)) order id desc if you're using parameter position pass parameters, you'll have change and ('%' = ?4 or t.afdeli

Is it possible to use a single jQuery mobile widget within a non-mobile web page? -

i using jquery ui put widgets on web page designed large screens. looking flipswitch widget, , found 1 provided jquery mobile framework. is possible use jquery mobile make flipswitch widget work, without whole jquery mobile theming ? you can use jquery mobile's widgets creating custom build . have choose widgets want, , load js library style sheets in head. need modify style sheets, either modifying them manually or using themeroller . html <head> <link rel="stylesheet" href="structure.css" /> <link rel="stylesheet" href="theme.css" /> <script src="jquery-1.11.1.min.js"></script> <script src="custom-build.js"></script> </head> <body> <form> <label for="flip-checkbox-1">flip toggle switch checkbox:</label> <input type="checkbox" data-role="flipswitch" name="flip-checkbox-1"

ios - Swift: How to create instance of a class, if I have the name of the instance in a variable? -

i have team, teamscore, userscore information on parse. download , want store locally , update it. create team() class, have scores properties , creating instances of class team names downloaded parse. problem how create instance of class names parse downloaded team names? or there simpler way solve problem without classes? you can try that: var classname = "teamclassname" var c = nsclassfromstring(classname) as? teamscoresuperclas.type if let cl = c { println("ok") } else { println("false") } you should have superclass team, score, etc classes. in example above pass team class name parameter if change score fine until superclass same.

MySQL changing large table to InnoDB -

i have mysql server running on centos houses large (>12gb) db. have been advised move innodb performance reasons experiencing lockups application relies on db becomes unresponsive when server busy. i have been reading around , can see alter command changes table innodb take long time , hammer server in process. far can see, change required use following command: alter table t engine=innodb i have run on test server , seems complete fine, taking 26 minutes on largest of tables needs converted. having never run on production system interested know following: what changes recommended made mysql config take advantage of additional performance of innodb tables? server has 3gb assigned innodb cache - thinking of increasing 15gb once additional ram installed. is there else should server change? i recommend using either percona mysql or mariadb. both have tools out of innodb, tools diagnose , optimize database further (for example, percona's online schema chan

unicode - How to translate words literally? -

i want translate names of businesses literally. i.e : flafel adam want translate hebrew, f -> פ l -> ל -> א . . . so פלאפל אדם both names have same spelling ! don't care bout meaning , want have same spelling in both languages ! how ? you use table lookup, i.e. table translates every character 1 language another. in obj-c, use nsdictionary initialize nsdictionary *table = @{@"f": @"פ", @"l": @"ל", @"a": @"א" }; etc. can translation e.g. nsstring *translatedl = table[@"l"]; etc.

mysql - How can I insert data in oracle sql developer from already created tables -

i trying input data 1 of tables links table in database, code below have found keeps putting in null, missing or doing wrong? insert volunteer(volunteerid,membershipid,membername,memberdaytimeno) values (1, (select membershipid membership membername = 'frances'), (select membername membership membername = 'frances'), (select memberdaytimeno membership membername ='frances') ); i using oracle sql database. insert volunteer(volunteerid, membershipid, membername, memberdaytimeno) select 1, membershipid, membername, memberdaytimeno membership membername = 'frances';

sql - Overlapping times -

i have table this: id, timestart, timefinished i need find timestart begins prior timefinished , has higher id , means overlapping time. id timestart timefinished 1 2014-01-01 2014-01-02 2 2014-01-02 2014-01-03 3 2014-01-02 2014-01-04 this found in row 3. here timestart < timefinished in row 2. (or find row 2 timefinished > timestart in row 3) try left outer join : select t1.* table t1 left join table t2 on t1.id > t2.id , t1.timestart < t2.timefinished t2.id not null

java - Better way to initialize log4j2 (TWO) programmatically -

this i'm doing load log4j2.xml file, specifying log file location property file keep configuration simple support purposes: myproperties props = myproperties.getinstance(); system.setproperty(myconstants.audit_log_env_var, props.getauditlogfilename()); configurationsource source = new configurationsource(new fileinputstream(new file( system.getproperty(myconstants.properties_file_env_var) + "/log4j2.xml"))); configurator.initialize(null, source); and log4j2 pick , use file name because i've specified in appender using envvar substitution: <file name="auditlogger" filename="${sys:audit_log}"> <patternlayout pattern="datetime %d{yyyy-mm-dd hh:mm:ss:sss zzz}%n%msg%n" /> </file> however don't because there's smell pushing file name value out system environment before reading in again on next line of code. i configure log4j2 programmatically using co