Posts

Showing posts from April, 2012

xsd - Multiple XML file with same root name refer to 1 XML schema: setting a unique key to element -

Image
eg. have 2 separate files same root name can seen in employment.xml , education.xml. common word between both files word "code". ensure "code" , values not repeated in respective files. so moving onto schema, how make verification code only. since apprently 2 selectors not work in 1 . trying prevent writing , make schema reusable more similar lists "code". my idea create function thing. in sense, if identifies "employmentstatus", should result in 'xs:selector xpath = "employmentstatus"' , if identifies "education", should result in '"xs:selector xpath = "education"' etc. is possible in xml schema? suggestions great? xml files: employment.xml education.xml xml schema: rootwithattribut.xsd "xs:selector xpath = "*" " this works because * matches element node. works temporarily have 1 element currently. has helped element name. works. ...

ios - Using Twitter framwork to get tweet details -

i developing ipad application running in ios 5.1 in twitter integration has been done. able tweet using application using twitter.framework. want details of tweet made. used twrequest in framework post query as -(ibaction)querybuttontapped:(id)sender{ twrequest *request = [[twrequest alloc] initwithurl:[nsurl urlwithstring:@"http://search.twitter.com/search.json?q=indians&rpp=5&with_twitter_user_id=true&result_type=recent"] parameters:nil requestmethod:twrequestmethodget]; [request performrequestwithhandler:^(nsdata *responsedata, nshttpurlresponse *urlresponse, nserror *error) { if([urlresponse statuscode] >= 200){ nserror *error; nsdictionary *dict = [nsjsonserialization jsonobjectwithdata:responsedata options:0 error:&error]; uialertview *alertview1 = [[uialertview alloc] initwithtitle:@"twitter response" message:[nsstring...

jquery - Custom validation with ajax.....Here remote method is not working -

i using jquery.validate.js, in code below both remote , regex works separately when try integrate both not working. can me did wrong? <head> <script type="text/javascript"> $(document).ready(function(){ $("#clear").click(function(){ $("input[type=text], textarea").val(""); }); }); function submitform() { $.validator.addmethod("subtitleval", function(value, element) { return this.optional(element) || /^[a-za-z\s\_,\.:;()''""]+$/.test(value); }, "enter valid name."); var validator = $("#company").validate({ errorplacement : function(error, element) { offset = element.offset(); error.insertbefore(element) error.addclass('message'); error.css('position', 'absolute'); error.css('left', offset.left + element.outerwidth()); ...

groupwise maximum - how to get column of latest row mysql -

Image
the query below fine me except content in column message_content of first row in table al_messages . how can content of latest row? select a.conversation_id, a.creator_id, c.screen_name creator_screen_name, c.first_name creator_first_name, c.last_name creator_last_name, count(d.message_id) messages_count, message_content al_conversations inner join al_subjects b on a.subject_id = b.subject_id inner join al_members c on a.creator_id = c.member_id inner join al_messages d on a.conversation_id = d.conversation_id a.subject_id = 301 , b.creator_id = 17 group a.conversation_id the query result:

How To use Rendering plugin in grails -

Image
i using rendering plugin creating pdf.. plugin working fine.. but when click on download pdf.. rendering me page ![enter image description here][2] and gives me result in pdf format. . and gives me option save![enter image description here][3] but wanted.. when click on download pdf button(image 1) .. show me direct save window (image 3) rather rendering me page.. sorce code : def renderformpdf(long id){ def empinstance= emp.get(id) renderpdf(template:"view", model:[empinstance:empinstance, pdfrendering:true]) } try this def renderformpdf(long id){ def empinstance= emp.get(id) response.setcontenttype("application/pdf") response.setheader("content-disposition", "attachment; filename=filename.pdf") renderpdf(template:"view", model:[empinstance:empinstance, pdfrendering:true]) }

Perl variable garbage collection and refcount -

i have little confuse variable garbage collection in perl in following example : #!/bin/env perl use v5.14; package mytestmodule { sub foo { $fh = shift; for(1..100){ "put"; $fh->autoflush(1); print $fh "heloo\n"; sleep 1; } } } package main; use anyevent; use anyevent::fork::template; $cv = anyevent->condvar; $anyevent::fork::template->fork->run("mytestmodule::foo", sub { $fh_fh_fh = shift; $w_w_w; $w_w_w = anyevent->io(fh => $fh_fh_fh, poll => "r", cb => sub { $w_w_w unless 1; sysread $fh_fh_fh, $rslt, 10; "got:", $rslt; } ); }); $cv->wait; in above code, if remove $w_w_w , because of anyevent->io create object, reference become zero, reclaimed perl, make code not work ( cb not called ); ... $anyevent::fork::template->fork->run("mytestmodule::foo", sub { $fh_f...

r - Unauthorized error with ROAuth -

i using streamr package pull tweets twitter streaming api. working fine till recently. - getting error whenever handshake. > library(roauth) > requrl <- "https://api.twitter.com/oauth/request_token" > accessurl <- "https://api.twitter.com/oauth/access_token" > authurl <- "https://api.twitter.com/oauth/authorize" > consumerkey <- "<myconsumerkey>" > consumersecret <- "myconsumersecret>" > my_oauth <- oauthfactory$new(consumerkey=consumerkey,consumersecret=consumersecret,requesturl=requrl,accessurl=accessurl,authurl=authurl) > my_oauth$handshake(cainfo = system.file("curlssl", "cacert.pem", package = "rcurl")) error: unauthorized i have tried recreating new application on dev.twitter.com , still same error. have tried changing callback url , access levels - no use. have tried using master branch of roauth github. idea going wrong? using r 3.0.1 ...

macros - Conditional C preprocessor directives -

in code had macro: #define tps 1(or 0) int main() { .... if(var) { #ifdef tps #endif } } but now, want merge if(var) macro acheive: int var=1; #define tps (if(var)) int main() { int a, b, c; a=1;b=2;c=3; #if tps printf("a: %d\n", a); printf("b: %d\n", b); printf("c: %d\n", c); #endif printf("++a: %d\n", ++a); return 0; } i.e. block of code inside macro conditionals should present if var=1 eg, var=1: int main() { int a, b, c; a=1;b=2;c=3; printf("a: %d\n", a); printf("b: %d\n", b); printf("c: %d\n", c); printf("++a: %d\n", ++a); return 0; } and, var=0: int main() { int a, b, c; a=1;b=2;c=3; printf("++a: %d\n", ++a); return 0; } how can implement #define tps achieve this? you cannot dreaming of. preprocessing 1 of earliest phase of compiler (e.g. gcc ). , tps looks want have compilation behavior ...

Why file exists statement not true in android? -

i working email attachment .i facing 1 problem while attachment .problem want sent mail attachment .i have 1 file on path sdcard0 fgg hh.html.when debug on file file = new file(attachments.getstring(i)); show file:/storage/sdcard0/fgg/hh.html after not go if condition why ? file file = new file(attachments.getstring(i)); if (file.exists()) { uri uri = uri.fromfile(file); uris.add(uri); } here hole code jsonarray attachments = parameters.getjsonarray("attachments"); if (attachments != null && attachments.length() > 0) { arraylist<uri> uris = new arraylist<uri>(); //convert paths android friendly parcelable uri's (int i=0; i<attachments.length(); i++) { try { file file = new file(attachments.getstring(i)); if (file.exists()) { ...

c# - How to read data from serial port and write to serial port? -

hi i'm writing application in c# connect device via rs232(com) port. need send "read" command read data , "write" command send data it. i read articles in here , other sites , know there methods when i'm defining serial port in c#. but question ,should concerned dtr ,rts ,... ? for? how use them? just give idea simple function writes command byte array on serial , reads corresponding input serial port (in example read fourth byte of value read serial port): private string readfromserial() { try { system.io.ports.serialport serial1 = new system.io.ports.serialport("com1", 9600, system.io.ports.parity.none, 8, system.io.ports.stopbits.one); serial1.dtrenable = true; serial1.rtsenable = true; serial1.readtimeout = 3000; var messagebufferrequest = new byte[8] { 1, 3, 0, 28, 0, 1, 69, 204 }; var messagebufferreply = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; int bufferleng...

java - Svn Merge not taking Roo generated aspectj files into account -

i have project spring roo use generate javabean, jpa , service aspects java files. use svn eclipse. when modify javabean example, aj files updated , can commit new changed .aj files svn without problem. problem starts when try merge these changes different branch of same project. can see changed java files merged roo generated files not show in merge. target branch retains old version of these files. checked in svn history of branch commited new .aj files , show in history properly. stuck , don't have solution of now. aby eclipse filtering aj files. can turn off filtering by: in package explorer, click down arrow on top right corner click filters... uncheck "hide generated spring roo itds"

VB.NET - Checkbox losing checked value on lost focus -

i have vb.net form , have added checkbox. using databindings checkbox per below: txtid.databindings.clear() txtid.databindings.add("text", ds.tables(0), "id") dim myid new binding("checked", ds.tables(0), "userid") addhandler myid.format, addressof chkformatter addhandler myid.parse, addressof chkparser chkid.databindings.add(myid) if check box checks fine, once click onto field, checkbox loses check. can me understand why please? i have other checkboxes on form using databindings in same way , working fine. thank you, understand bind myid "userid", "userid" boolean field? if yes, piece of code update field other means?

iphone - Underline label/Strike-out label : 'shouldStrikeOut' not working when the text-width exceeds label-width -

i wish make label in text struck-out. label dynamic , can take text of width. i have imported 'underlinelabel' class given in below link. https://github.com/guntistreulands/underlinelabel/blob/master/readme.md [strikelbl setshouldstrikeout:yes]; the above line working fine except when label's content-width exceeds label's frame-width. eventhough below code set, helps in fitting label within given width. but, strike-out not working in case. strikelbl.minimumfontsize = 7; strikelbl.adjustsfontsizetofitwidth = yes;

c# - Quickfix/n, most efficient way to extract message Type? -

what efficient way in quickfix/n 1.4 extract message type defined here: http://www.fixprotocol.org/fiximate3.0/en/fix.5.0sp2/messages_sorted_by_type.html i use var msgtype = message.getmsgtype(message.tostring()); results in "a" logon message. there better way? try determine message type within toadmin(...) in order catch outgoing logon request message can add username , password. i love through messagecracker far have not found way implement catch-all-remaining message types in case have not implemented onmessage overloads. (please see related question: quickfix, there "catch-all" method onmessage handle incoming messages not handled overloaded methods? ). thanks not title question, key part of it: i try determine message type within toadmin(...) in order catch outgoing logon request message can add username , password. here's blob of code pretty nails ( taken post qf/n mailing list ): public void toadmin(message message, sess...

go - What is correct way to use goroutine? -

i need apply tests each request , fire responce based on result of tests. if 1 of test fail, need send responce imediatelly, otherwise wait when tests done succesfully. want tests concurrency. now, (simplified): func handler_request_checker(w http.responsewriter, r *http.request) { done := make(chan bool) quit := make(chan bool) counter := 0 go testone(r,done,quit) go testtwo(r,done,quit) .............. go testten(r,done,quit) { select { case <- quit: fmt.println("got quit signal") return case <- done: counter++ if counter == 10 { fmt.println("all checks passed succesfully") return } } } func main() { http.handlefunc("/", handler_request_checker) http.listenandserve() } example of 1 of goroutine: func testone(r *http.request, done,q...

Size of an index on the file system in elasticsearch -

i have simple setup consisting of 1 elasticsearch 0.90.2 running in ubuntu 13.04 64-bit system. using _status , information of 1 of indexes: "edge":{ "index":{ "primary_size":"63.6kb", "primary_size_in_bytes":65127, "size":"63.6kb", "size_in_bytes":65127 }, "translog":{ "operations":0 }, "docs":{ "num_docs":43, "max_doc":63, "deleted_docs":20 }, "merges":{ "current":0, "current_docs":0, "current_size":"0b", "current_size_in_bytes":0, "total":0, "total_time":"0s", "total_time_in_millis":0, ...

security - Integrity Measurement Architecture(IMA) & Linux Extended Verification Module (EVM) -

i trying activate ima appraisal & evm modules. after compiling linux kernel 3.10.2 on bt5r3 , setting kernel boot option in first time this: grub_cmdline_linux="rootflags=i_version ima_tcb ima_appraise=fix ima_appraise_tcb evm=fix" and after running command generate xattr security.ima , security.evm find / \( -fstype rootfs -o -fstype ext4 \) -type f -uid 0 -exec head -c 1 '{}' \; like this: grub_cmdline_linux="rootflags=i_version ima_tcb ima_appraise=enforce ima_appraise_tcb evm=enforce" i try create digital signature of xattr it's recommended on tutorial tutorial ima & evm every steps have been followed, creating rsa keys, loading them @ boot in initramfs keyctl. session keyring -3 --alswrv 0 65534 keyring: _uid_ses.0 977514165 --alswrv 0 65534 \_ keyring: _uid.0 572301790 --alswrv 0 0 \_ user: kmk-user 126316032 --alswrv 0 0 \_ encrypted: evm-key 570886575 --alswrv 0 ...

android - java.lang.IllegalStateException: CookieSyncManager::createInstance() needs to be called before CookieSyncManager::getInstance() -

i trying cookies in webview on shouldoverrideurlloading() method , got error. please have @ code below, webviewclient loginclient = new webviewclient() { @override public boolean shouldoverrideurlloading(webview view, string url) { cookiemanager cookiemanager = cookiemanager.getinstance(); final string cookie = cookiemanager.getcookie(url); //some code after } } and m getting error, java.lang.illegalstateexception: cookiesyncmanager::createinstance() needs called before cookiesyncmanager::getinstance() use cookiesyncmanager.createinstance(this); in activity's oncreate() method. error says createinstance() need called before calling getinstance() .

CKEDITOR - How to enable hyphenation? -

is possible enable hyphenation in ckeditor? i'm unable find regarding this. thanks! take on articles auto hyphenation , mdn (also can use... ). you'll find feature available in browsers only. still can add editor using ckeditor.addcss if like.

linux - python SyntaxError when trying to import package BUT only when running remotely -

i have following scripts: test.py: import sys try: import random print random.random() except: print sys.exc_info()[0] run.sh: python "test.py" >> "test_file" ; when running following command on linux server: [saray@compute-0-15 ~]$ nohup ./run.sh & test_file includes random number expected: [saray@compute-0-15 ~]$ cat test_file 0.923051769631 but, when running same command remotely using: [saray@blob-cs ~]$ ssh "compute-0-15" 'nohup ./run.sh > /dev/null 2>&1 &' python fails upload random package!! [saray@compute-0-15 ~]$ cat test_file exceptions.syntaxerror what's wrong? your remote machine running different python version, python 3. in python 3, print statement has been replaced print function , , code throwing syntax error. the work-around either run code remotely python 2 well, or make code compatible both python 2 , 3: from __future__ import print_funct...

jquery - If input box is empty show label, if there is text, hide label -

is there way can show <label> if contact form input box empty , hide once starts entering text? this sample of markup <label for="name">name *</label> <input type="text" id="name" name="name" value=""/> try this: $("#name").bind("keyup", function(e) { $('label[for="name"]').hide(); })

hashmap - Getting only one value of single key in android -

in android app, i'm trying values of single key using hash map. below code. getting 1 value "maharashtra" key "blr" , not "banglore" (in code). missing? hashmap<string, string> mymap = new hashmap<string, string>(); mymap.put("ind", "india"); mymap.put("tn", "tamilnadu" + " how"); mymap.put("blr","bangalore"); mymap.put("blr","maharashtra"); set<entry<string,string>> set = mymap.entryset(); (map.entry<string, string> me : set) { if(me.getkey().equals("blr")){ system.out.println(me.getvalue()); } } first of all: can't. stated here: public v put(k key, v value) associates specified value specified key in map. if map contained mapping key, old value replaced. please read: http://docs.oracle.com/javase/7/docs/api/java/util/hashmap.html se...

sencha touch - removeFilters(filters) : Ext.util.Collection -

can please explain me how can use removefilters(filters) method ext.util.collection? i've seen similar post here: remove individual filters store in sencha touch 2.x wasn't helpful me. i have list of contacts , want filter 2 filters example , after remove 1 filter. now, have store gets data file wil make read data server. thanks. no problem. var oldfilters=[]; var newfilter; var store = mylist.getstore(); oldfilters = store.getfilters(); newfilter = oldfilters[1]; //get second filter store.clearfilter(); store.setfilter([newfilter]); if want can keep store sorting speed things.

c++ - Improve matching of feature points with OpenCV -

i want match feature points in stereo images. i've found , extracted feature points different algorithms , need matching. in case i'm using fast algorithms detection , extraction , bruteforcematcher matching feature points. the matching code: vector< vector<dmatch> > matches; //using either flann or bruteforce ptr<descriptormatcher> matcher = descriptormatcher::create(algorithmname); matcher->knnmatch( descriptors_1, descriptors_2, matches, 1 ); //just temporarily code have right data structure vector< dmatch > good_matches2; good_matches2.reserve(matches.size()); (size_t = 0; < matches.size(); ++i) { good_matches2.push_back(matches[i][0]); } because there lot of false matches caluclated min , max distance , remove matches bad: //calculation of max , min distances between keypoints double max_dist = 0; double min_dist = 100; for( int = 0; < descriptors_1.rows; i++ ) { double dist = good_matches2[i].distance; if(...

c# 4.0 - extracting lines from a file with C# -

i have text file1 , wish extract lines (which don't exist in file2)in new file3 example : file1: /** * gets total volume. * * @return total volume */ public int gettotalvolume() {return totalvolume;} file2: * gets total volume. * * @return total volume file3: /** */ public int gettotalvolume() {return totalvolume;} my function: public void traitv2(string file1, string file2, string file3) { streamreader monstreamreaderfile1 = new streamreader(file1); streamwriter monstreamwriterfile3 = new streamwriter(file3); string ligne = monstreamreaderfile1.readline(); while (ligne != null) { streamreader monstreamreaderfile2 = new streamreader(file2); string ligne1 = monstreamreaderfile2.readline(); while (ligne1 != null) { if (!ligne.equals(ligne1)) { console.writeline(ligne); monstreamwriterfile3.wri...

textarea - TextField Not horizontal scrolling with text[Titanium] -

i want textarea scroll horizontally once test string has exceeded width of textarea. tried below code, however, not work reason. i tried adding wrapper view scroll view , adding textarea wrapper view; not work either. how can fix ? var scroll = ti.ui.createscrollview({ top:40, left:230, width:290, height:50 }); win.add(scroll); var texttype = ti.ui.createtextarea({ backgroundcolor:'#e6e6e6', bordercolor:'blue', borderradius:10, top:0, left:0, width:290, height:50, font:{fontsize:26, fontfamily:customfont}, editable:false, enabled:false, textalign:'right', scrollable:true }); scroll.add(texttype); i know sound simple but, default text area vertical scrollable. , behavior know of it. have tried different properties like: layout:"horizontal", horizontalwrap:true, scrollable:true, but has not resolve issue.

android - Will apk installed manually (not from play store) receive notification when update becomes available? -

i want preinstall apk on tablet (know how it). will tablet receive notification play store, update ready on play store , should install it? to preinstall apk, need device oem; how gets done depends on exact environment. if apk has no native libraries internally, can safely place apk in firmware image (in same location standard apk suite). beyond that, (for example, similar i've seen in motorola devices) create special directory (such /preinstall) , have script perform "pm install ..." each file in location items not installed. regarding updates, people have commented: no problem since you're not changing package name. increase package version store upload. also, safety, upload package (older version, non-functional ok) store in order reserve package name on store -- otherwise place own on store before you.

c# - localization without re-compiling project -

i building project , need make customizable. trying build support 4 languages. , user have admin panel he/she can change label's text or button's text. want user go admin panel , change button's text without calling me :) i have used old style of localization .resx files. have sample code below. private void combobox1_selectedindexchanged(object sender, eventargs e) { if (combobox1.selecteditem.tostring().equals("en-gb")) { thread.currentthread.currentuiculture = cultureinfo.getcultureinfo("en-gb"); label1.text= formlabels.test1; label2.text = formlabels.test2; } else if (combobox1.selecteditem.tostring().equals("de-de")) { thread.currentthread.currentuiculture = cultureinfo.getcultureinfo("de-de"); label1.text = formlabels.test1; label2.text = formlabels.test2; } } if let user change button's...

ember.js - How to get records in JSON format from the model in emberjs? -

i accessing model data using .find method how records in json format model? getting output .find() as: (console log view) class {type: function, store: class, isloaded: true, isupdating: true, tostring: function…} ember1375269653627: "ember313" __ember1375269653627_meta: meta _super: undefined content: function () { isloaded: true isupdating: false set content: function (value) { store: class tostring: function () { return ret; } type: grid.modalmodel __proto: object i new user of community, unable upload image. if you're using ember model, model.tojson(). if trying values model should use getter model.get('name').

c# 4.0 - XMl parsing in c# 4.0 -

i have following xml parsed <config> <parametrictesting>y</parameterictesting> <functionaltesting>y</functionaltesting> <utilities>n</utilities> <commonapi>n</commonapi> <clientdata>n</clientdata> <datasourcetest>y<datasourcetest> <excel> <excelfilepath>myexcel1.xlsx</excelfilepath> </excel> <access> <accessdb> </accessdb> </access> <sql> <sqlconnectionstring> </sqlconnectionstring> </sql> <runnerconsole>n</runnerconsole> <schedular>n</schedular> </config> i using xmlreader read xml since new c# don't know why code breaking after reading second tag i.e parameterictesting. code: string configxml = path.getfullpath("config.xml"); xmlreader xmlreader = xmlreader.create(configxml); while (xmlreader.read()) { if ((xmlreader.nodetype== xmlnodetype.element) && xmlreader.name...

g++ 4.7 - CUDA 5.5 RC with g++ 4.7 and 4.8: __int128 build errors -

i'm trying compile code cuda sdk 5.5 rc , g++ 4.7 on macos x 10.8. if understand correctly cuda 5.5 should work g++ 4.7. looking @ /usr/local/cuda/include/host_config.h should work g++ 4.8. concerning g++ 4.8: tried compile following program: // example.cu #include <stdio.h> int main(int argc, char** argv) { printf("hello world!\n"); return 0; } but fails: $ nvcc example.cu -ccbin=g++-4.8 /usr/local/cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/cstdlib(178): error: identifier "__int128" undefined /usr/local/cellar/gcc48/4.8.1/gcc/include/c++/4.8.1/cstdlib(179): error: identifier "__int128" undefined 2 errors detected in compilation of "/tmp/tmpxft_00007af2_00000000-6_example.cpp1.ii". the same program compiles , runs g++ 4.7: $ nvcc example.cu -ccbin=g++-4.7 $ ./a.out hello world! but if include <limits>... // example_limits.cu #include <stdio.h> #include <limits> int main(int argc, char** argv) { ...

java - javax.mail.AuthenticationFailedException: 535 authentication failed (#5.7.1) -

i making auto send email java project using javamail api. when send mail using smtp.gmail.com host, works. when use own host server mail.sitename.com...it shows exception..my username , password right. please me sort out problem... exception is:- javax.mail.authenticationfailedexception: 535 authentication failed (#5.7.1) @ com.sun.mail.smtp.smtptransport$authenticator.authenticate(smtptransport.java:826) @ com.sun.mail.smtp.smtptransport.authenticate(smtptransport.java:761) @ com.sun.mail.smtp.smtptransport.protocolconnect(smtptransport.java:685) @ javax.mail.service.connect(service.java:317) @ javax.mail.service.connect(service.java:176) @ javax.mail.service.connect(service.java:125) @ javax.mail.transport.send0(transport.java:194) @ javax.mail.transport.send(transport.java:124) @ com.zenga.servlet.mailnotification.sendmail(mailnotification.java:130) @ com.zenga.servlet.mailnotification.dopost(mailnotification.java:45) @ javax.se...

Finding out the Python used to install the current package? -

this question has answer here: find full path of python interpreter? 5 answers is there way programmatically find python version used install current package? if have package called mypackage , has in setup.py like: scripts = ["myscript.py"] suppose install package easy_install or pip using particular python version, python 2.x: /usr/local/bin/python2.x setup.py install then in myscript.py , how can find out /usr/local/bin/python2.x used install mypackage myscript.py opposed other python version available on system? i'd know full path , not version info because want use /usr/local/bin/python2.x in script. use sys.executable . a string giving absolute path of executable binary python interpreter, on systems makes sense. if python unable retrieve real path executable, sys.executable empty string or none.

java - How one to many relationship gets persisted in JPA if i have thousands of related entities already in data base and i add new entities in collection -

we have 2 entities entity1 , entity2, entity1 contains set of entity2, have thousands of entities stored in database of entity type entity2 referenced instance of entity1, myentity. now if add more entity2 entities collection , try persist myentity, newly added entities of entity2 persisted. my question how behavior on persist of myentity , whether existing members of relation travel memory , new members added or new members added database without bringing existing members memory if have thousands of referenced entities, might better not map relationship , instead query when needed - allowing use paging or other mechanisms reduce amount of entities read in @ time. depends on type of mapping is, owning relationship needs mapped (the 1 doesn't have mapped by) set foreign key in database. set entity2 side owning side if isn't already. if m:m relation table , doesn't make sense map entity2 side instead - add entity relation table read in same way. new e...

java - How tomcat is running my project in Eclipse? -

i know how configure tomcat run dynamic web project created in eclipse. can body please explain me step step process tomcat run web project? i see detail clarification regarding in following links; where eclipse deploy web applications using wtp? http://oreilly.com/pub/a/java/archive/tomcat.html?page=1 http://www.mulesoft.com/tomcat-deploy

ios - I'd like to have a UITabBarController, with no UITabBar -

i'm building akin uisplitview on ipad. "master" panel have buttons, instead of list. the detail panel have @ 7 different screens (corresponding buttons in master pane). so, i'd build uitabbarcontroller in interfacebuilder (for no other reason it's easy view). each button press in "master" view tell tab-bar controller show different panel. can done, or approach silly? suppose create container view, , swap view-controllers in , out. using uitabbarcontroller in ib makes obvious (visually) these views connected. thanks advice. i did same thing, unable hide tab bar in clean , legal way. so, decided change approach: use uitabbar in storyboard "placeholder" connections , fill viewcontrollers array of splitcontroller, when loading splitcontroller, load programmatically uitabbarcontroller storyboard, copy content of viewcontrollers array and, finally, dismiss uitabbarcontroller. with approach have manage transition between vc...

android - Is file transfer possible with asmack? -

i implementing chat application ,for using 1. openfire server 2. asmack-jse-buddycloud-2010.12.11.jar i able text chat. trying file transfer . have tried documents code, nothing worked me. some developers writing asmack , smack bug. so, has implemented file transfer code using asmack . if it's not asmack issue please give me suggestion. thanks in advance.

python - Flask-Admin extending templates -

i'm trying extend template 'master.html' template of flask-admin this: {% extends 'admin/master.html' %} {% block body %} hello!!! {% endblock %} and error: file "/usr/local/cellar/python/2.7.3/lib/python2.7/site-packages/jinja2-2.6-py2.7.egg/jinja2/environment.py", line 894, in render return self.environment.handle_exception(exc_info, true) file "/users/slowpoke/projects/python/spider/spider/templates/form.html", line 1, in top-level template code {% extends 'admin/master.html' %} file "/usr/local/cellar/python/2.7.3/lib/python2.7/site-packages/flask_admin-1.0.6-py2.7.egg/flask_admin/templates/admin/master.html", line 1, in top-level template code {% extends admin_base_template %} file "/usr/local/cellar/python/2.7.3/lib/python2.7/site-packages/flask-0.9-py2.7.egg/flask/templating.py", line 57, in get_source return loader.get_source(environment, local_name) file "/usr/local/cellar/python/2.7.3/lib/p...

javascript - move npapi plugin object in webpage from one div to another, why plugin destroy and recreate?[chrome, FireFox] -

i got 1 plugin , embeded webpage page, plugin used play media files(.mp3,mp4,m3u8, etc).my webpage looks like: <div id='div1'>plugin</div> <div id='div2'><div id='div2sub'></div></div> plugin created <object id='plugin' type='xxxx' width='xxxx' height='xxxx'></object> the problem is: when move plugin div1 div2sub like: var x = document.getelementbyid('plugin'); var y = document.getelementbyid('div2sub'); y.appenchild(x); then find result ie: plugin still playing media file, video, audio output,it works fine(activex plugin) chrome , firefox: no video, audio output,plugin not play media file anymore.(npapi plugin) i found reason is: ie, plugin moved,not destroy recreate, chrome , firefox,the plugin destroy recreated, have 1 function register callback event on pluin, chrome console shows plugin never received callback event, media file can't ...

SFTP a file created on SQL Server with a Stored Procedure to a UNIX Server -

i'm trying create sql server stored procedure generate xml file. once file generated, has sftp file unix server. i've never done sftp stuff before here i'm seeking help. please take @ below stored procedure i've written , me out. use [mydb] go set ansi_nulls on go set quoted_identifier on go create proc [dbo].[generatexml] select fileid, systemid, filename dbo.file xml raw('file'), elements, root('file') declare @cmd varchar(255) set @cmd = 'osql -e /q “exec generatexmlproc” /o usadevenv01:/home/xml/file.xml' exec xp_cmdshell @cmd go i facing similar problem , solved using ssis , free tool called winscp. first shuold know that: by default, sql server integration services (ssis) not support access sftp sites. 1 way of getting done using third party software, there's free tool called winscp provides command line utility communicate sftp sites. has scripted command line , executed ssis. then... the first s...

Oracle: one query to output different where condition result -

i've got following query output plots 3 rows , 3 columns. each "owner" want extract on same line "pdf" in common , "pdf" doesn't exist on second table. do know other elegant , faster way show in same query output result of different conditions? with temp (select t.owner, (select flh_punto_erogazione dual exists (select 1 netatemp.backlog_nobill_storico p p.flh_punto_erogazione = t.flh_punto_erogazione)) "pdf in comune", (select flh_punto_erogazione dual not exists (select 1 netatemp.backlog_nobill_storico p p.flh_punto_erogazione = t.flh_punto_erogazione)) "pdf non in comune" netatemp.tmp_backlo...

VB6 Split String with < > Characters -

i trying split this when source webpage , contains value multiple times, don't think split because of "<" character, way around this? sourcesplit = split(source, "<span class='btext' id='btext'>") i tried using chr(60) instead, didn't either, ideas? thanks help i guess html uses double quotes attribute values, not single. need escape double quotes: sourcesplit = split(source, "<span class=""btext"" id=""btext"">")

matlab - How to organize a list of tags with IDs and subtag-relations into a nested structure? -

i have given 1xn-fields struct array nested n structs 3 fields: id : unique numerical identifier name : unique alphanumeric name parent_id : parental relation id the parental relation given parent_id , refers id under current id nesting, making current tag subtag. parent_id can blank, meaning current id @ root level , not nested under other id. example: tags = field1: [1x1 struct] field2: [1x1 struct] tags.field1 = id: 1 name: 'tag1' parent_id: [] tags.field2 = id: 2 name: 'tag2' parent_id: 1 with struct tags above, field2 nested in field1 in tree diagram. leads me problem: how can reorganize data in given format efficiently generate text based tree diagrams , provide data further processing? one approach tried reorganization whole bunch of nested structs, this: tags_sorted = field1: [1x1 struct] tags_sorted.id_1 = id: 1 name: 'tag1' parent_id: [...

facebook graph api - Error : (#1) An error occured while creating the share on php sdk -

i have php/javascript api on website posting messages on user wall depending on actions on website. use on 1 side javascript api logging user app , php sdk on other side posting on user wall link. the thing when launch php graph api method, facebook respond me given error : error : array(1) { 'error' => array(3) { 'message' => string(46) "(#1) error occured while creating share" 'type' => string(14) "oauthexception" 'code' => int(1) } } the php call : $facebook->api( '/me/feed/', 'post' ,$data ); and data $data array message , link but if exact same code in javascript( using fb.api('/me/feed' ) method), message posted on wall. is there have missed ?

spring - @Autowired on a constructor of a Scala class -

i have simple question, how use spring @autowired on constructor of scala class? class messagembeanexporter(messagedirectory: messagedirectory) extends mbeanexporter smartlifecycle { ..... } i haven't tried it, according this , this link , 2.8+ do: class messagembeanexporter @autowired() (messagedirectory: messagedirectory) extends mbeanexporter smartlifecycle { ..... }

asp.net - Multi Project Template folder structure incorrect -

so trying build multi project template , when set folder structure coming out incorrectly (not how microsoft when creating projects) , it's messing things packages folder , references folder. this current structure: solution folder -solution file -folder (solution name) --packages --references --project1 folder --project2 folder i wanting have same structure .net automatically: solution folder -solution file -references folder -packages folder -project1 folder -project2 folder here vstemplate: <vstemplate version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" type="projectgroup"> <templatedata> <name>asp solution template</name> <description>this solution template asp applications</description> <icon>__templateicon.ico</icon> <projecttype>csharp</projecttype> </templatedata> <templatecontent buildonload="true...

What are the valid characters in PHP variable, method, class, etc names? -

what valid characters can use in php names variables, constants, functions, methods, classes, ...? the manual has some mentions of regular expression [a-za-z_\x7f-\xff][a-za-z0-9_\x7f-\xff]* . when restriction apply , when not? the [a-za-z_\x7f-\xff][a-za-z0-9_\x7f-\xff]* regex applies when name used directly in special syntactical element. examples: $varname // <-- varname needs satisfy regex $foo->propertyname // <-- propertyname needs satisfy regex class classname {} // <-- classname needs satisfy regex // , can't reserved keyword note regex applied byte-per-byte, without consideration encoding. that's why allows many weird unicode names . but regex restricts only these "direct" uses of names. through various dynamic features php provides it's possible use virtually arbitrary names. in general should make no assumptions characters names in php can contain. parts arbitrary strings. doing th...