Posts

Showing posts from July, 2015

ruby on rails - Feedzirra - How to get updated RSS feed? -

the following code gist on feedzirra updated content rss feed: feed = feedzirra::feed.fetch_and_parse(feed_url) feed = feedzirra::feed.update(feed) do_something_with_new_feed(feed.new_entries) if feed.updated? i don't understand how feedzirra know feed has been updated. can't working. in order know, have pass feed object returned (minutes or hours ago) feedzirra::feed.fetch_and_parse(feed_url) feedzirra::feed.update , no? how know if has been updated if use feed had fetch_and_parse? feeds (the sites accessing) can, don't necessarily, maintain 1 or 2 fields determine whether have changed since last access. these etag , last modified. if site supports either or both of these, returned when access feed. model should maintain these fields each feed of interest. feedzirra::feed.update uses them determine whether or not feed has been updated since last access. these allow feedzirra::feed.update pull entries new or changed since last access. if have neit

arrays - Minimum steps to win Snake Ladder -

given snake , ladder game, write function returns minimum number of jumps take top or destination position. can assume die throws results in favor of you ** here solution, not sure it's correct or not. this problem similar frog jump in array.but before have model problem in format. create array of size 100 , each position store 6 if there no snake or ladder. store jump count . if ladder present @ point . if snake present store -ve jump @ location. now have solve in how many minimum steps can reach till end. main problem can solved using dynamic programing in o(n^2) time complexity , o(n ) space. have @ this blog post, full mathematical analysis of chutes , ladders, using both monte-carlo simulations , markov chains. show way of calculating minimum number of steps win (basically construct transition matrix , see how many times have multiply starting vector solution has non-zero final position). not efficient way of doing it, post wo

html - Creating a POS (Point of Sale) system with python -

i want create functional pos system python, don't know begin. fluent in language, have never done web development python. can point me in right direction, how incorporate python html , mysql? not sure pos means, point of sale? for web development, people in python land tend go django , flask popular. https://www.djangoproject.com/ and http://flask.pocoo.org/

Prolog with .NET -

there's question 1 she's 4 years old , question kind of "time related" . i need implement logic prolog , call clr based application (mainly c# windows , mono , scala windows) take advantage of prolog features. problem is, can't found maintained "prolog.net" compiler... prolog.net looks 2 years old. p# looks 9 years old the other prolog.net looks 3 years old so have still maintained prolog compiler ? or, experience, think 1 of 1 above enough stable , enough secure use them without support ? this one, c# prolog, looks in development (latest release tagged june 2013). whether it's or not (or better other ones), i've got no idea. http://sourceforge.net/projects/cs-prolog/ also, amzi prolog has binding .net: http://www.amzi.com/manuals/amzi/ls/lsadotnet.htm and here's clr binding integrate swi-prolog .net world: http://www.lesta.de/prolog/swiplcs/generated/index.aspx

c++ - using getline to pass a string to an object without using an extra string variable -

so question simple (i hope). have class constructor looks this: constructor(string szname) the string holding name; may more 1 part. john, john smith, john h smith, must valid inputs. know following: std::string input; getline(cin, input); myclass foo(input); and work fine. there anyway me directly send getline input constructor? thank in advance. well, if you're fine making function, this: std::string readline() { std::string input; getline(cin, input); return input; } and initialize class so: myclass foo(readline());

sql - Table from a tree structure, how to select branches then partition more info for each branch -

i have table describing geographical structure, built tree structure, column1 'country', column2 contains largest administrative area called 'region1', 'region2' column contains children of region1 etc. so this r / | \ 1 2 3 / | \ / | \ / | \ 11 12 13 21 22 23 31 32 33 is represesented each distinct combination: cntry| r1 | r2 ------------------ r | 1 | 11 r | 1 | 12 r | 1 | 13 r | 2 | 21 r | 2 | 22 r | 2 | 23 r | 3 | 31 r | 3 | 32 r | 3 | 33 in addition, each leaf node contains additional info, can span multiple rows. such zip code. table actually looks this: cntry| r1 | r2 | zip | --------------------------| r | 1 | 11 | | r | 1 | 11 | aa | r | 1 | 11 | aaa | r | 1 | 11 | aaaa| r | 1 | 12 | b

Jenkins QC plugin Can't create TDConnection Object -

i'm attempting use jenkins qc plugin, when build on jenkins i'm getting following console errors started user anonymous building in workspace c:\users\builder.jenkins\workspace\qc plugin [qc plugin] $ cscript /nologo "c:\users\builder.jenkins\workspace\qc plugin\runtestset.vbs" http:// * ** * ** caine test test qcreport-test-4.xml 100 run_planned_host c:\users\builder.jenkins\workspace\qc plugin\runtestset.vbs(163, 5) microsoft vbscript runtime error: activex component can't create object: 'tdapiole80.tdconnection' 5/30/2012 2:55:04 pm : script parameters: 5/30/2012 2:55:04 pm : * ** * ** * ** * ** * ** * ** * ** * ** * ** 5/30/2012 2:55:04 pm : qc server : * 5/30/2012 2:55:04 pm : qc username : * 5/30/2012 2:55:04 pm : qc password : * * 5/30/2012 2:55:04 pm : qc domain : ** 5/30/2012 2:55:04 pm : qc project : * 5/30/2012 2:55:04 pm : qc testsetfolder: test 5/30/2012 2:55:04 pm : qc testsetname : test 5/30/2012 2:55:04 pm : xm

java - JavaFX 2 slider labelFormatter not being used -

i have following code not label slider "foo50", etc... 1 expect setlabelformatter call, instead seems have no effect (the slider labelled 50, 100, etc , println's dont run). there missing? not implemented in default 2.2 skin? using oracle java 7 package javafxbugtest; import javafx.application.application; import javafx.scene.*; import javafx.scene.control.*; import javafx.stage.*; import javafx.util.stringconverter; public class javafxbugtest extends application { @override public void start(final stage primarystage) { slider cp = new slider(); cp.setlabelformatter(new stringconverter<double>() { @override public string tostring(double t) { system.out.println("nope?"); return "foo" + t.tostring(); } @override public double fromstring(string string) { system.out.println("he

el - Is it mandatory initialize "sub-objects" when use JSF? -

i have class called customer , called person . class customer has property person , see code bellow; public class customer{ private string name; private person person; } but when try use #{customermanagedbean.customer.person.id} got error because can't reach property id person, because person null. so changed code to: public class customer{ public customer{ person = new person(); } private string name; private person person; } and works fine. mandatory initialize objects inside class before using it? yes, is. setter method invoked on final property, id . jsf, or more specifically, el , won't autocreate nested properties you. model (the backing bean) responsible that. should in fact create person in customermanagedbean class, not in customer class. that works managed beans because managed beans via @managedbean or @named explicitly registered auto-created when not exist in el scope yet. in turn not apply nested properties.

c# - Integrating an API that uses SSL to connect machines -

i want integrate api allow application send requests web server. unfortunately, api not documented, , have not gotten reply person supports web service released api. instructions on how integrate api following: all api calls connect standard ssl port, , must begin https://www.websitename.com/api.php?username=username&password=password& , followed list of parameters expressed parametername=value& i new c# development. can interpret set of instructions , tell me how i'd go integrating api? confused connecting ssl port. this sounds it's http request particular url. want use webclient class, , possibly call downloadstring method, depending on response contains.

c# - Fill DataTable using array of NewRows -

and help! i'm trying fill datatable before pulled in report microsoft reporting services. i thought run (depending on how many rows there in "maintable", , assign each category , flush rows.add , repeat apparently cannot row.add same name newrow. here's have far. help!: mydataset.essrow newess = mydataset.ess.newessrow(); (int = 0; < ds.tables["maintable"].rows.count; i++) { datarow drow = ds.tables["maintable"].rows[i]; if(convert.toint32(drow.itemarray.getvalue(9).tostring()) > shiftdelta)//checks if instance longer shift { newess.station = "7"; newess.switch ="7"; newess.start = drow.itemarray.getvalue(6).tostring(); newess.stop = drow.itemarray.getvalue(7).tostring(); newess.switchis = drow.itemarray.getvalue(8).tostring(); timespan t = timespan.fromseconds(convert.toint32(drow.itemarray.

regex - Skip lines whose 2nd column has a string -

my cvs file has 10 columns , want rid of lines 2nd field ($2) has string beginning "synonymous". tried this: awk '$2 ~ /^synonymous/ {next}' but not print out anything. you need tell awk want do. far you've told skip records 2nd field starts "synonymous" haven't told awk @ rest of them. try instead: awk '$2 !~ /^synonymous/' that says "if 2nd field doesn't start synonymous, invoke default action of printing record".

VIM Error: E474: Invalid argument: listchars=tab:»·,trail:· -

summary: i receiving following error having below line in .vimrc file error: e474: invalid argument: listchars=tab:»·,trail:· .vimrc: set list listchars=tab:»·,trail:· i have researched , appears have utf8 encoding being set. system setup: lsb_release: distributor id: ubuntu description: ubuntu 12.04 lts release: 12.04 codename: precise locale: lang=en_us.utf-8 language= lc_ctype="en_us" lc_numeric="en_us" lc_time="en_us" lc_collate="en_us" lc_monetary="en_us" lc_messages="en_us" lc_paper="en_us" lc_name="en_us" lc_address="en_us" lc_telephone="en_us" lc_measurement="en_us" lc_identification="en_us" lc_all=en_us solution: place following lines @ top of .vimrc error mentions: .vimrc: scriptencoding utf-8 set encoding=utf-8

c# - Setting MdiParent property of a form breaks/prevents its Shown event from firing -

so, i've been searching trough similar topics on stackoverflow , on other internet forums , knowledge bases far had no luck trying solve problem i've been struggling whole week. here code: private void matrículastoolstripmenuitem_click(object sender, eventargs e) { form1 form1 = new form1(); form1.show(); form1.mdiparent = this; // == main form of aplication, wich has ismdiparent property set true. } if take out "form1.mdiparent = this", shown event of form1 fire normally, executing of handler's content, if let there, shown event of form1 not fire (i did set breakpoits, none of them triggered). curiously, if use load event instead of shown, works fine, i'm bit afraid if swapping shown load break :(. try code form1 form1 = new form1(); //subscribe event here form1.mdiparent = this; form1.show(); this works me i don't know why code doesn't work, i'll once answer. edit: have got answer

Twitter web intent to post image? -

is possible attach image tweet via twitter's web intents ? right now, if put image in message, full url of image put message, instead of shortened , attached image url... https://twitter.com/intent/tweet?original_referer=http%3a%2f%2fwww.website.com%2f&text=mytext+http%3a%2f%2fwww.website.com%2fimg%2fimage.png&url=www.someurl.com click here see result (no attached image, full image url in message....) when paste in image url tweet on twitter.com, image url automatically shortened , image attached tweet, shows image when view tweet. i'm looking similar web intents. you can not attach image, can use twitter card . with twitter cards, can attach rich photos, videos , media experience tweets drive traffic website. essentially, need add metadata page. when twitter sees that, automatically insert image tweet. for single photo , need put code on each page (put in own details) <meta name="twitter:card" content="photo" /&

javascript - Why doesn't a console loaded script have access to the DOM? -

i added script dom using // in console of facebook.com var test = document.createelement('script'); test.src = "foo"; document.head.appendchild(test); but script has no access dom. does have same origin policy? here working solution add jquery: var jq = document.createelement('script'); jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; document.getelementsbytagname('head')[0].appendchild(jq); jquery.noconflict();

sql server - how to install sql 2008 after VS 2012 -

after install vs 2012 want install sql server 2008 r2 need sp1 when install sp1 give me error a compatible version of visual studio 2008 not detected on system. update designed microsoft visual studio 2008 (enu) product family, , not compatible express editions.

fft - Reconstructing a signal from its discrete fourier transform in R -

Image
i trying replicate following figure in r: (adapted http://link.springer.com/article/10.1007/pl00011669 ) the basic concept of figure show first few components of dft, plotted in time domain, , show reconstructed wave in time domain using these components (x') relative original data (x). modify above figure such of lines shown overlaid on single plot. i have been trying adapt figure real data sampled @ 60 hz. example: ## 3 second sample where: time in seconds , var variable of interest temp = data.frame(time=seq(from=0,to=3,by=1/60), var = c(0.054,0.054,0.054,0.072,0.072,0.072,0.072,0.09,0.09,0.108,0.126,0.126, 0.126,0.126,0.126,0.144,0.144,0.144,0.144,0.144,0.162,0.162,0.144,0.126, 0.126,0.108,0.144,0.162,0.18,0.162,0.126,0.126,0.108,0.108,0.126,0.144, 0.162,0.144,0.144,0.144,0.144,0.162,0.162,0.126,0.108,0.09,0.09,0.072, 0.054,0.054,0.054,0.036,0.036,0.018,0.018,0.018,0.018,0,0.018,0,

mysql - Run web application from local machine and host files on external server -

rewrite of same question i'm building web application using django. have web server holds static files, can do. want run website computer using mamp. on system have mysql database. how tell django fetch static files server , serve them user? currently computer (in network) can go site , request pages. mamp receives fetches files local directory on hd. want set fetch files origin server. info on i'm using: mamp, mysql, apache, django thanks if understand correctly, change static_url in settings.py server holds static files: in settings.py: static_url = 'http://staticserver/path/to/static/on/apache' (make sure change media_url if needed)

python - How can I test this script that accesses urls through several different proxy servers? -

right script: import json import urllib2 open('urls.txt') f: urls = [line.rstrip() line in f] open('proxies.txt') proxies: line in proxies: proxy = json.loads(line) proxy_handler = urllib2.proxyhandler(proxy) opener = urllib2.build_opener(proxy_handler) urllib2.install_opener(opener) url in urls: data = urllib2.urlopen(url).read() print data this urls.txt file: http://myipaddress.com and proxies.txt file: {"https": "https://87.98.216.22:3128"} {"https": "http://190.153.7.189:8080"} {"https": "http://125.39.68.181:80"} that got @ http://hidemyass.com i have been trying test going through terminal output (a bunch of html) , looking see if shows ip address somewhere , hoping 1 of proxy ip's. doesn't seem work. depending on ip recognition site, either throws connection error or tells me have enter validation letters

Git fetch only one directory -

i have developer works on 1 folder , works on another. update production specific folder i'm looking command like: cd /myproject git pull myfolder and expect myfolder updated is possible? ok, i'll rephrase... have 1 project, 1 branch , 2 developers , 2 folders in project. each developer works on 1 folder. both make changes , push them branch. i want pull changes of 1 folder local machine basic/simple isn't it? assuming you're asking remotely grab files git repository, without having working tree of own (or clone of repository locally), this: git archive --format=tgz --remote=<url-to-repo> master -- myfolder | tar zxvf - this says create gzipped tar ball of master branch of repository living @ <url-to-repo> , include contents under myfolder . piping through tar unarchive data , put in current working directory. if you're trying manage working tree , work other 2 developers, you're asking goes against grain of tool. you

angularjs - javascript swiper library in an angular directive -

how initialize swiper library inside angular js directive. especially when directive has slides created ng-repeat here first attempt on plukr. http://plnkr.co/edit/lfv3y1lxol8gfml2m3mp and here library http://www.idangero.us/sliders/swiper/ i :) please check angularjs-idangero.us-swiper repo work in dynamic view in routing , have tricky solution mix ng-click , onslideclick download repo , extract it, copy angularjs-idangero.us-swiper-master xampp htdoc(or wamp or web server) , go localhost/angularjs-idangero.us-swiper-master/#/test see demo

javascript - How can I reposition offset addresses quickly? -

i have file information. each section of information located @ offset. there 100 sections of information. every section of information starts @ beginning of word "lps" @ beginning of file there list of offset addresses point each section of information. for example: " 801f 0b00 " link offset " b1f80 " new section of information starts " 80b0 0b00 " refers offset " bb080 " new section of information starts i'm adding/shortening information of lines, need change offsets @ beginning of file (the list) make them coincide new locations. so, code me automatically? example, tool must recognize offset addresses (the list) allow me add new information then, modify list of offset new locations. thanks lets assume file has 100 offsets , strings. once see how works change 100 variable. to read file, this #define n 100 typedef int offset; // assume int 4 btyes , big enough hold file offset offset offset[ n ]; // offs

android - Application crashes when program goes from one activity to another -

i try launch application menuactivity recipesactivity. in recipesactivity try select elements table, create in database class (database.java). table empty. debugger can't me, don't know why application crashes, maybe because tables empty now. part of menuactivity.java case r.id.recipes: case r.id.iconrecipes: intent i2 = new intent(this, recipesactivity.class); this.startactivity(i2); break; part of recipesactivity.java public class recipesactivity extends activity implements onclicklistener { static final public int addingrecipe = 0; static final public int editingrecipe = 1; //static final public string editrecipe = "editrecipe"; static final public string recipeid = "recipeid"; static final public string showrecipe = "showrecipe"; linearlayout ll; database sqh; sqlitedatabase sqdb; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentvie

internet explorer - IE Compatibility issue : a possible solution? -

i have been searching past 3 hours solution problem. finished building website our company, , works fine in firefox 3.0, safari 3.1, chrome 1.0.154 , opera 11. in internet explorer, not work @ (i have tried ie7 , ie8. using jquery 2 mean limited ie9+. anyways, thought of possible solution : if displayed entire website in flash window ? way no matter version of ie (that supports flash), people able view website normally, , nightmares over. do know of technique/trick achieve ? thanks lot ! cheers. edit 1 : as requested, provide below home page code, + css goes it. i'll let test out browser want , see result in ie ^^ : http://www.fileconvoy.com/dfl.php?id=g15ca070e2414ccb3999353780aaa6ba73041229a0 althought still called website, sounds try embed actual website else. means have bigger problem take care of. internet explorer little different other browsers still can dealt , that's way needs done. not recommend workaround. if want deal ie, please provid

java - Best way to create a child object from its parent -

this question has answer here: java: creating subclass object parent object 11 answers which best way create child given parent data? ok have method parents values on child class as: public class child extends person { public child(parent p) { this.setparentfield1(p.getparentfield1()); this.setparentfield2(p.getparentfield2()); this.setparentfield3(p.getparentfield3()); // other parent fields. } } to copy parent data ti child object? child child = new child(p); i recommend creating constructor in parent class accepts object of type parent . public class child extends parent { public child(parent p) { super(p); } } public class parent { public parent(parent p){ //set fields here } }

map - What are some efficient Geohash bounding box coverage algorithms? -

my requirement is: given lat-lon bounding box, return set of geohashes such that: the number of geohashes in set should small (1 5 geohash rectangles) if possible. the coverage should closed input lat-lon bounding box possible. tolerance +/- 10%. ok under-cover and/or over-cover little bit. it should efficient , can carried out on mobile device i interested in algorithm or conceptual approach. plan implement in java/obj-c android , ios if no open source implementation exists. this java project on github https://github.com/davidmoten/geo has documented algorithm doing want. in particular works nicely @ limits of geohash region (namely @ poles , @ -180/180 longitude line). keeping number of geohashes small (1 5) tolerance 10% won't fly i'm afraid. 5 geohashes many rectangles covered geohashes @ 600% of area of target rectangle. in fact example below getting within 10% of area requires 667 hashes! here's table taken readme on geo project site:

Plotting TimeStamp Data from Excel -

Image
i have data recorded on excel sheet. data timestamp. i plot recorded time-stamp first image values similar second following figure. answering both question , comment, want build histogram of occurrences in time. you need define size of bin want. let's bin size 5 minutes, , want plot histogram 24 hours period. doing hand create little table follows: | b | c ----------------------------------------------------- 1 | start | end | event_count 2 | 00:00:00 | =a2 + time(0,5,0) | =countifs(datasheet!g:g,">=" & a2,datasheet!g:g,"<" & b2) 3 | =b2 | =a3 + time(0,5,0) | =countifs(datasheet!g:g,">=" & a3,datasheet!g:g,"<" & b3) copy formulas in row 3 times need. create bar chart. notice value in formula written in cells b2 , b3 ,... size of bin specifying. doing code since programming q&a site, programming solution expect

javascript - Only one Modal Pops Up - Bootstrap -

i'm having problem bootstrap - 1 of modals popping up! i've reviewed code , couldn't find problem is. first modal coded others, don't know what's going wrong. here's codepen (like jsfiddle): codepen and here code: references <link href="favicon.ico" rel="icon" type="image/x-icon"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/bootstrap-responsive.min.css"> <link rel="stylesheet" href="style.css"> <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> <script src="js/bootstrap.js"></script> thumbnail gallery <div class="container"> <div class="row"> <div class="span12"> <ul class="thumbnails">

how to spawn multiple ssh requests in a twisted server? -

from twisted ssh example docs: http://twistedmatrix.com/documents/current/conch/examples/sshsimpleclient.py , we learn twisted need reactor spawn ssh request: protocol.clientcreator(reactor, simpletransport).connecttcp(host, 22) reactor.run() and want know how can spawn ssh request in twisted server ? there reactor in twisted server. you may review examples how use http://twistedmatrix.com/documents/current/conch/examples/ reactor embedded twisted , called reactor.run() need write callbacks handling connection results.

javascript - Open JQuery Popup after Button click -

i have problem jquery mobile. here teh jsfiddle: http://jsfiddle.net/gc7mr/3/ first have panel buttons, importan button button id=define)! <div data-role=header data-position=fixed> <div data-role=navbar> <ul> <li><a href=#define data-role=button data-icon=edit data-inline="true" data-rel="popup" id="define" data-position-to="#map_canvas">define</a></li> <li><a href=#compose data-role=button data-icon=gear data-inline="true" data-rel="popup" data-transition="slidedown" data-position-to="#map_canvas">compose</a></li> <li><a href=#search data-role=button data-icon=search data-inline="true" id="search">search</a></li>

Angularjs/Javascript Do not reload page, but change url and update screen -

recently have come problem need update page using angular, update url, not reload page. confused? let me further explain. have table of data (uses ng-grid) , want when click row 1 angular prints out 1 , changes url 'currenturl/1' without reloading page. click row 4, 4 prints out , changes url 'currenturl/4'. possible angular this. make page not reload every time clicked row, put following var lastroute = $route.current; $scope.$on('$locationchangesuccess', function(event) { $route.current = lastroute; }); which want, changes url, page doesn't reload, angular not updating number. doing wrong? it see part of code prints out number, code changing url without refreshing route looks fine. without more information, shot in dark controller updating $scope variable update isn't getting applied angular. try wrapping variable update so: $scope.$apply(function() { $scope.numbertoprint = newnumber; }); the basic ide

Playing Youtube, Vimeo and any other video services' videos in one's own player -

i know youtube , vimeo both have embed codes allow embed player webpage. however, i'm looking build web player consistent appearance. more importantly, i'm looking build player play videos many video hosting services out there. i'm starting youtube , vimeo, want gradually increase support video services. figured maybe if there interface consistent between video hosting services, maybe easier, protocol of sort. hit me urls general protocol sort of thing; no need re-invent protocol. so, if youtube , vimeo provided url video file play in player, can find cross-section between these services. this why i'm here; i'm asking if knows if these services provide url raw video file or files (for different formats, flv, h.264, webm, etc) can use custom video player? or hosting services prohibit due advertising revenue things? it's unlikely you'll find video hosting service gives direct access files themselves, many of reasons speculate (there's issue

WordPress Creating Empty database -

wordpress creating empty database. (there database out values!) i on local wamp server 2.4 (php 5.4) windows 8 wordpress 3.6 (also tried 3.5.1) wamp apache giving errors pasting few lines here: access.log: "get /test_3/wp-admin/css/colors-fresh.min.css?ver=3.6 http/1.1" 304 - "get /phpmyadmin/db_structure.php?db=db_test_3&token=4bb71407ccf91fc27d3c8338186ee369&db=db_test_3&ajax_request=true&ajax_page_request=true&menuhashes=572d5b14-cb7c7ed1-ada592ed-4fce1948&_nocache=1376960501429607598 http/1.1" 200 40875 apache_error.log [mon aug 19 13:34:54.335301 2013] [mpm_winnt:notice] [pid 7864:tid 468] ah00418: parent: created child process 6540 [mon aug 19 13:34:54.769224 2013] [mpm_winnt:notice] [pid 6540:tid 344] ah00354: child: starting 150 worker threads. [mon aug 19 18:09:28.498364 2013] [mpm_winnt:notice] [pid 7864:tid 468] ah00422: parent: received shutdown signal -- shutting down server. possibly related issue: have change

java - Can an XML catalog refer to files in a separate JAR? -

i have several jax-ws clients, each talking different soap service, generate wsimport , package own jar. each client has own xml catalog wsimport can work locally wsdl's , xsd's stored alongside project. the actual applications use these client each have own xml catalog save on network calls wsdl @ runtime. these unions of xml catalogs of clients application using. this works catch that, in addition application xml catalog, still have keep copy of wsdl's application jar since uri's relative xml catalog. need remember update application 's copy of wsdl whenever client 's copy updated. is there way say, in jax-ws-catalog.xml , wsdl in jar? there seems no way package wsdl's , xsd's alongside jax-ws-catalog.xml file.

php - SQL database not inserting data? -

i working on program takes html code made wysiwyg editor , inserting database, redirecting user completed page, reads code off database. can manually enter code in phpmyadmin , works in php code not overwrite entry in code column id specified. have provided php code me. php not giving me parse errors. incorrect following code? <?php //post variables------------------------------------------------------------------------ //$rawcode = $_post[ 'editor1' ]; //$code = mysqli_real_escape_string($rawcode); $code = 'good'; $id = "1"; echo "$code"; //sql variables------------------------------------------------------------------------- $database = mysqli_connect("localhost" , "root" , "password" , "database"); //insert query data here---------------------------------------------------------------- $queryw = "insert users (code) values('$code') id = '" . $id . &quo

Can't send a variable to javascript from java -

i'm fetching url , trying send it's text content javascript function inside webview. i java code: httpclient client = new defaulthttpclient(); httpget request = new httpget("http://volteck.net"); // response responsehandler<string> responsehandler = new basicresponsehandler(); string response_str = client.execute(request, responsehandler); response_str = response_str.replaceall("\n", "\\"); // because js don't support multi-line strings mywebview.loadurl("javascript:myfunction('" + response_str + "')"); system.out.println("javascript:myfunction('" + response_str + "')"); this code inside webview: function myfunction(val){ document.body.innerhtml = val.length; } so far i'm trying text length. when use url of previous code, nothing happens. , log: 08-19 23:55:03.141: i/dalvikvm-heap(1846): grow heap (frag case) 3.551mb 262160-byte allocation 08-19 23:55:03

c++ - Printing to a STL(stereolithography) file in binary mode -

i trying print stl file , can't print correctly. there lot of samples hex format printing in c++ no sample program binary format. program follow. wrong program? string name = "create stlwrite.m "; name = name + currentdatetime(); pfile.setf(ios::left); pfile.width(sizeof(unsigned char)*80); //header pfile << name; unsigned int size = faces.rows; //size pfile.write((char*)&size,sizeof(size)); int height = 25; unsigned short ** data= new unsigned short *[height]; for(int = 0; < height; i++) { data[i] = new unsigned short[142000]; } for(int j = 0; j < 142000; j++) { int = 0; //for 1 facets for(int k = 0; k < (*facets[j]).cols; k++) { for(int l = 0; l < (*facets[j]).rows; l++) { float f = (*facets

How to debug Node.js programs in eclipse (using node-eclipse)? -

i newbie eclipse node.js concerned. have tried several basic programs in node.js. now question there many articles explaining how debug node program in eclipse. dnt working. on windows 7 32-bit machine , installed eclipse indigo node-eclipse plugin installed.. please can body me how start debugging programs. disclaimer: new eclipse ide, node & stackover flow well, please help.. debugging - breakpoint, trace, etc... via eclipse debugger plug-in v8 how install: update site : http://www.nodeclipse.org/updates testing site: http://www.tomotaro1065.com/nodeclipse/updates/ how debug : open javascript source files want set breakpoints. double-click on ruler @ left end of line want set breakpoint. if want remove breakpoint, double-click on ruler again. select main source file of node application on project explorer, open context menu right-clicking, select [debug as]-[node application] menu. for more, please check nodeclipse &am

noscript - JavaScript disabled: how to show different messages for mobile and desktop. -

i need display different messages desktop , mobile web sites when javascript disabled. currently have <noscript> <meta http-equiv="refresh" content="0; url=/error.html" /> </noscript> and need code (i use pseudocode) <noscript> if desktop <meta http-equiv="refresh" content="0; url=/error.html" /> if mobile <meta http-equiv="refresh" content="0; url=/mobile-error.html" /> </noscript> thanks is there server backend website? try , mobile browser detection based off of user-agent received connecting browser. see this stackoverflow post using user agent detect mobile.

I have proplem in java i cant print all swing compont -

hi i'm trying print swing components find code explain me gettoolkit() do? code toolkit tkp = jpanel9.gettoolkit(); printjob pjp = tkp.getprintjob(this, null, null); graphics g = pjp.getgraphics(); jpanel9.print(g); i can print 1 swing component bay calling print() method not component in jpanel you should use printall on print from javadocs public void print(graphics g) prints component. applications should override method components must special processing before being printed or should printed differently painted. default implementation of method calls paint method. the origin of graphics context, (0, 0) coordinate point, top-left corner of component. clipping region of graphics context bounding rectangle of component. and printall ... public void printall(graphics g) prints component and of subcomponents . origin of graphics context, (0, 0) coordinate point, top-left corner of component. clipping region of g

javascript - set the current date as the default early in my datepicker so that I can filter the data according to the current date -

i have daterangepicker here can see javascrpt , css in: http://jsfiddle.net/cumfw/ i have try show set default date solution( jquery-ui datepicker default date & how pre-populate jquery datepicker textbox today's date? ) still not work. this partially experiment php code: <script type="text/javascript" src="js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.7.1.custom.min.js"></script> <link rel="stylesheet" href="css/ui.daterangepicker.css" type="text/css" /> <link rel="stylesheet" href="css/redmond/jquery-ui-1.7.1.custom.css" type="text/css"title="ui-theme" /> <script type="text/javascript"> $(function(){ $('#tgl').daterangepicker({ defaultdate: new date(), arrows:true, onchange: function(){ $('#frmdate').submit()

java - How to check if variable name contains string and then output string variable content -

so have these 4 variables private final string prog_dept = "programming/engineering"; private final string des_dept = "design/writing"; private final string art_dept = "visual arts"; private final string sound_dept = "audio"; what want able string , compare variable , out put variable contains if equals it. for example if string equals "art_dept" check if there variable called art_dept , output "visual arts" i thinking of putting in 2d string array or list i'm not sure how want do the data type you're looking map<string, string> . map<string, string> departmentnames = new hashmap<string, string>(); departmentnames.put("prog_dept", "programming/engineering"); departmentnames.put("des_dept", "design/writing"); //...etc... //... string dept = "prog_dept"; string deptname = departmentnames.get(dept); system.out.println(deptname); /

Django Error code 28 while synchronizing the database (MySQL) -

in django create new models in existing database. while synchronizing models displays error. cannot fix these problem. i'm using mysql database. added error code. kindly share ideas. python manage.py syncdb creating tables ... creating table registration_securityquestions traceback (most recent call last): file "manage.py", line 14, in <module> execute_manager(settings) file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 459, in execute_manager utility.execute() file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argv self.execute(*args, **options.__dict__) file "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 232, in execute

c++ - Huge "Grid" of PushButtons lags awfully, buttons can't be enabled -

in project, have 256 tiny pushbuttons in 1 16x16 grid layout. (yeah took forever.) editing , running program laggy. also, strange reason, qt not let me enable of buttons, other buttons side work fine? is there easy way determine square of grid clicked without having bunch of buttons? (like following cursor on image maybe?) also, when each "square" of grid clicked, becomes "selection" , needs "square" selected. (think huge chess board) here pic: http://gyazo.com/988cdbb59b3d1f1873c41bf91b1408fd later on, need again 54x54 size grid (2916 buttons) , don't want button button. thanks time, hope understand question :) you can easy way, i've explained in code, if have questions feel free ask, , please, accept answer if solved problem :) import sys pyqt4 import qtgui, qtcore pyqt4.qtgui import * pyqt4.qtcore import * class drawimage(qmainwindow): def __init__(self, parent=none): super(qmainwindow, self).__init__(pare

jquery - Adding callback parameter to $.ajax with jsonp -

i trying implement jquery ajax call cross domain call using jsonp, , code - $.ajax({ async:true, cached:true, url: 'cfcs/temprepository.cfc?method=getallcategories' +'&storeid='+ storeid +'&callback=?', type: 'get', data: '', datatype: 'jsonp', success: populatecategoryobject, error: function (xhr, status, error) { console.log(xhr + ',' + status + ',' + error); } }); function populatecategoryobject(results) { //populate categories } i confused here use of callback. if remove success attribute of $.ajax , use callback=populatecategoryobject in place of callback=? - $.ajax({ async:true, cached:true, url: 'cfcs/temprepository.cfc?method=getallcategories' +'&storeid='+ storeid +'&callback=populatecategoryobject', type: 'get', data: '', datatype: 'jsonp&#