Posts

Showing posts from April, 2010

javascript - JQuery Content Arrow Navigation -

i've been in trouble code: http://jsfiddle.net/xarlyblack/4wsx3zkx/ i want jquery fadein/out content navigation. it works when go next div , again. when i'm in last div , click next, content disappears (why had created if statement return first). happens same when i'm in first div , click previous, want go last div. i tried .last() / .first() .find()eq() . goes. think i'm missing something. jquery code: var ilust = $('.ilust'); var wrapper = ilust.find('.pag-ilust'); var pag = wrapper.find('.pag'); var btn = ilust.find('.nav-btn'); btn.click(function(){ if ($(this).hasclass('nav-next')){ var currentpag = $('.active-pag'); var nextpag = currentpag.next(); currentpag.fadeout('fast').removeclass('active-pag'); nextpag.fadein('slow').addclass('active-pag'); if (nextpag = false){ nextpag = pag.first(); ...

javascript - Take a single picture using webcam in html5 -

i making small class in javascript use webcam electron , cylon application. need use camera digital camera, in, see video stream, click button, , save image. class camera { constructor() { this.video = document.createelement('video'); } getstream() { return new promise(function (resolve, reject) { navigator.webkitgetusermedia({ video: true }, resolve, reject); }); } streamto(stream, element) { var video = this.video; return new promise(function (resolve, reject) { element.appendchild(video); video.src = window.url.createobjecturl(stream); video.onloadedmetadata = function (e) { video.play(); resolve(video); } }); } } this allow me make stream , append stream page video element. however, question is: how can single picture stream? eg, on sort of button click, save current frame. $('button[data-action="take-picture"]').on('click', function (ev) { // clicked butt...

node.js - NPM error - failed to fetch from registry: http://registry.npmjs.org/sass -

i deleted project folder ( /var/www/current/ ) morning due git issue having , unable npm install . can see why failing fetch sass registry? vagrant@localhost /var/www/current (crm-email)$npm install npm err! linux 3.10.0-123.4.4.el7.x86_64 npm err! argv "node" "/usr/local/bin/npm" "install" npm err! node v0.10.30 npm err! npm v2.13.3 npm err! failed fetch registry: http://registry.npmjs.org/sass npm err! npm err! if need help, may report error at: npm err! <https://github.com/npm/npm/issues> npm err! please include following file support request: npm err! /var/www/releases/20150805093500/npm-debug.log my package.json : { "name": "crmpicco", "version": "1.0.0", "description": "crmpicco platform", "main": "gulpfile.js", "dependencies": { "backbone": "^1.1.2", "browser-sync": "^2.3.1",...

oracle - ORA-01460 unimplemented or unreasonable conversion requested sqldeveloper -

i connected database using sql developer. i can make queries, "open description in popup" on stored procedure, throws "object not found" message. if try open browser options: views, procedures, functions, materialized views, throws error "ora-01460 unimplemented or unreasonable conversion requested". your version of sql developer using jdbc driver (12.2.1.0) speaking dialect version of database, not understand. you can try use thick client connection - configure sql developer use 11.2.0.3 instant client make connection - , might - depends on how old database is. your other option use older version of sql developer ships older version of jdbc driver. ideally you'll want keep databases updated modern versions. that's ultimate , hardest solution though.

Fast way to cluster time series data in R -

i'm trying cluster time-series data: have 16000 time-series vectors, each vector ~1500 samples long. i tried using dtw package: d = dist(x = time_series, method = "dtw") hclust(d) however distance matrix calculation didn't finish running throughout whole weekend. i'm looking faster way since data set larger. your data on length 1500. suppose oversampled.. if downsample 1 in 2, dtw 4 times faster. if downsample 1 in 4, dtw 16 times faster. if downsample 1 in 10, dtw 100 times faster. this might starting point. are using cdtw or dtw? former significant faster, , can more accurate. a paper in sigkdd week has faster way cluster dtw using upper , lower bounds [a]. however, matrix of size (16000 * 15999)/2. so if have 2 days: 2 days / (16000 * 15999)/2 = 337 microseconds so need each comparison in 337 microseconds, not lot of time. difficult..., doable effort. if stuck, email me (i last author of [a]) [a] nurjahan begum, liudm...

grails - Spock throws MissingMethodException on dynamic method that is not presented in interface -

i have groovy.lang.groovyobject interface extended. implementor class not have public constructor , contains dynamic method not presented in inteface. i'm trying this: def bean = stub(groovyobject) bean.getresults() >> ['result1', 'results2'] while invoking: bean.getresults() it throw groovy.lang.missingmethodexception. in fact not carry interface contract, merely need make sure stubed object returns expected list. also cannot stub implementor class, throw cannotcreatemockexception. it seems have found solution myself. instead of stub groovystub has used. allow no verification against methods of stubed class. groovyobject interface didn't work, had use groovyobjectsupport abstract class: def bean = groovystub(groovyobjectsupport) bean.getresults() >> ['result1', 'results2'] assert bean.getresults() == ['result1', 'results2']

python post and get commands -

i have been having trouble post function. application design people enter birthday , if put in month, day, , year in right post "thanks! that's totally valid day" if not date post "that doesn't valid me, friend", not refreshes self each time push submit. in code did go wrong post function or , post function? import webapp2 form=""" <form method="post"> birthday? <br> <label>month<input type="type" name="month"></label> <label>day<input type="type" name="day"></label> <label>year<input type="type" name="year"></label> <div style="color: red">%(error)s</div> <br> <br> <input type="submit"> </form> """ class mainpage(webapp2.requesthandler): def write_form(self, error=""): s...

awk - how to select multiple line in log -

i try make file. has error message in particular log file. this log contents. [error] 2015-08-05 14:20:10 handlerexceptionresolver - org.springframework.jdbc.badsqlgrammarexception: ..... ..e(sqlerrorcodesqlexceptiontranslator.java:231) ..ractfallbacksqlexceptiontranslator.java:73) ..possible(mybatisexceptiontranslator.java:73) ..interceptor.invoke(sqlsessiontemplate.java:371) ..electone(unknown source) ..emplate.selectone(sqlsessiontemplate.java:163) [info] 2015-08-05 14:20:39 logginginterceptor - /products/430 and try it awk '$1 ~/^\[error\]$/{print$0}' original.log > extract.log but result 1 line. [error] 2015-08-05 14:20:10 handlerexceptionresolver - my expected is.. [error] 2015-08-05 14:20:10 handlerexceptionresolver - org.springframework.jdbc.badsqlgrammarexception: ..... ..e(sqlerrorcodesqlexceptiontranslator.java:231) ..ractfallbacksqlexceptiontranslator.java:73) ..possible(mybatisexceptiontranslator.java:73) ..interceptor.invoke(sqlsessiontempl...

webserver - PHP ignores an invalid php.ini on the production server, but PHP refuses to work completely with the same INI on a Vagrant machine -

i have stupid problem driving me nuts @ moment. our web apps pretty small run them on shared hosting environment. therefore don't have lot of possibilities change server configuration. thing can edit php.ini used our domain. configuration of else out of reach. that's why wanted set local vagrant server close production server possible installing same php version (almost! in vagrant php 5.4.43, production server runs php 5.4.16) , using same php.ini used online. both servers running apache 2.4 , php via fastcgi using php-fpm. however, when try start php-fpm in vagrant machine php.ini have downloaded administration panel of our hosting provider, exits fatal errors because of directives in given php.ini deprecated , have been removed. made me wonder why same php.ini refuses work in vagrant, works online without problem. as phpinfo() on production server tells me, downloaded ini file php.ini being loaded. however, file seems ignored , instead default values applied. ...

node.js - What is the purpose of the `(app)` in `require(controller)(app)`? -

i'm new node, blah blah i'm looking through code found, , encountered lines var app = express(); var glob = require('glob'); var controllers = glob.sync(config.root + '/app/controllers/*.js'); controllers.foreach(function (controller) { require(controller)(app); }); i understand goes , gets filenames of every file in /app/controllers/ ends .js , , sticks them in array, iterates on each 1 , calls require on it. makes sense, , looks nice way of not requiring each 1 individually. question what's last (app) for? tried looking @ node documentation, there no require()() function. editing out (app) leaves code working fine no errors, doesn't load controllers. if had take guess, 'multiplying' app found controller? why app.require(controller) not suitable option? thanks in advance require part of node , how modules loaded. when edit out (app) , still loading controllers because haven't passed app object on each co...

http post - Android HttpClient.execute not working -

i have asynctask follow: @override protected arraylist<string> doinbackground(string... params) { arraylist<string> result=new arraylist<>(); try { httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(constants.url); // add data list<basicnamevaluepair> namevaluepairs = new arraylist<basicnamevaluepair>( 2); namevaluepairs.add(new basicnamevaluepair("id",params[0])); httppost.setentity(new urlencodedformentity(namevaluepairs, "utf-8")); // execute http post request httpresponse response = httpclient.execute(httppost); httpentity httpentity = response.getentity(); inputstream = httpentity.getcontent(); // deal response here .... } catch (exception e) { log.e("debug", e + " " + e.getmessage()); } return result; } however, on jellybean, a...

Accesing local defined variable in other functions - Swift -

i making game kind of space invaders. have function creates invaders @ random position.x . inside addinvader() , have defined attacker skspritenode(imagenamed: "someimage") . this have defined inside function, since there added new attacker every second. my problem inside function: override func update(currenttime: nstimeinterval) { if attacker.position.y < cgfloat(size.height/5*2) attacker.texture = sktexture(imagenamed: "someotherimage") } } since attacker constant local, update(currenttime: nstimeinterval) function can`t access it. how can access attacker.position inside update-function? there no way can access variable defined privately in method. but can this.. in addinvader() method, below this var attacker = skspritenode(imagenamed: "someimage") you want add following code attacker.name = "attacker" you can set attacker.name want string . setting allow find node in sksce...

performance - Instruction to get the current time on x86 -

is there x86 instruction current time? basically... replacement clock_get_time ... minimum overhead... don't care getting time in specific format... long it's format can use. basically i'm doing work "detect how physical real life time" has gone by... , want able measure time possible! i guess can imagine i'm doing profiling app... :) i need aggressively efficient access hardware time. ideally... asm time... store somewhere... massage later format can process. i'm not interested in _rdtsc measures number of cycles gone by. need know how physical time has executed... not cycles can vary due thermal fluctations or so.. for profiling, it's useful profile in terms of cpu clock cycles, rather wall-clock time. cpu dynamic clocking (turbo , power saving) makes annoying cpu ramped full speed before start of measurement period. if still need wall-clock time after that: recent x86 cpus have tsc runs @ fixed rate, regardless of cpu fre...

java - How do I transition between these GUI frames? -

Image
so, have java program here , it's choose own adventure game. @ each step of game, user has choice between 2 options, "one" or "two" , options branch off different parts of story. for example: female college student named angelina jackson on break studying. @ favorite neighborhood cafe 1 day, when bump stranger , spill coffee on both of you! do? option one: apologize being clumsy. option two: you're furious because shoes brand new. turn around , prepare give him scolding of life! currently, program runs text in eclipse. i'm trying make entire game appear on gui shown in picture below. problem can't transition between different frames of project, there multiple frames 1 in picture below. how can connect frames "one" , "two" buttons? when 1 button pressed, transition next frame. i'm not sure how work that. this code first instance of our game (as seen in picture): import java.awt.borderlayout; import java.aw...

java - Parameter as Left Hand Side Operator LIKE JPQL -

i’m trying execute following query: (using eclipselink 2.5.2, mysql 5.5) em.createquery("select r region r (:pattern concat(r.pattern, '%'))") .setparameter("pattern", "eu.fr.pr") .getresultlist(); (background: i’m trying find super regions of region. super regions of eu.fr.pr eu.fr , eu .) however throws following exception: java.lang.illegalargumentexception: have attempted set value of type class java.lang.string parameter pattern expected type of class java.lang.boolean query string the oracle docs state a expression determines whether wildcard pattern matches string. the relevant parts of region class are: @entity @namedquery(name="region.findall", query="select r region r") public class region implements serializable { private static final long serialversionuid = 1l; @id @generatedvalue(strategy=generationtype.identity) private int id; privat...

plone - How to change field changeNote from IVersionable behavior to be required -

i have use case users should allways fill changenote field when saving changes on content. possible (ttw) change changenote field iversionable behavior required ? , if not, possible in code ? best way override standard fields properties foreign/preinstalled behaviors ? i don't know if there's way may override value of required attribute implementing in code: (pdb) plone.app.versioningbehavior.behaviors import iversionable (pdb) iversionable <schemaclass plone.app.versioningbehavior.behaviors.iversionable> (pdb) iversionable['changenote'] <zope.schema._bootstrapfields.textline object @ 0x7fe45a60f550> (pdb) iversionable['changenote'].required false (pdb) iversionable['changenote'].required = true (pdb) iversionable['changenote'].required true

javascript - How to submit form using radio option -

i'm doing website in safari. works in safari, firefox , chrome. in explorer it's not working properly. here want submit form , direct page when radio option clicked. have used onchange="this.form.submit(); in input. not work in explorer. please suggest me solution. have tried query too. that's not working. have attached code below. <script src="https://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript" language="javascript"> (function(document, window, $, undefined) { var form = $('#form-id'); $('.radio-class').each(function(i, element) { var radio = $(element); radio.on('change', function() { // selected value var radiovalue = $(this).val(); form.submit(); }); }); }(document, window, jquery, undefined)); </script> <body> <form action...

javascript - Equivalent to XMLHttpRequest timeout in synchronous JS -

having little bit of trouble understanding why timeout wouldn't work in synchronous js. script synchronous , need able timeout exception deals it, possible? i've attempted research implementations (using settimeout etc.) seem instantly run following code , skip trying connect, if timeout set 0ms. function httpget(theurl) { try { var xmlhttp = new xmlhttprequest(); xmlhttp.open("get", theurl, false); xmlhttp.timeout = 3000; xmlhttp.send(null); notifyuser("success", "<b>success</b> have synced server."); return xmlhttp.responsetext; } catch (e) { console.log("connection failed, grabbing local"); notifyuser("info", "<b>connection failed</b> using local database - edits not saved!(yet)"); return offlinepopu...

Clear Neo4j Embedded database -

with new version of spring data neo4j can't use neo4jhelper.cleandb(db); so, effective way completly clear embedded neo4j database in application? i have implemented own util method purpose, method slow: public static void cleandb(neo4jtemplate template) { template.query("match (n) optional match (n)-[r]-() delete n,r", null); } how clear/delete database ? updated this similar question how reset / clear / delete neo4j database? don't know how programmatically shutdown embedded neo4j , how start after deleting. i use spring data neo4j , based on user request i'd clear/delete existing database , recreate new data. how start new embedded database after suggested invocation of shutdown method ? use case: on working application have configured embedded database: graphdatabaseservice graphdb = new graphdatabasefactory() .newembeddeddatabasebuilder(environment.getproperty(neo4j_embedded_database_path_property)) ...

sql server - SQL dynamically store data from a database to another -

hi guys im new here , need help. im building sql query purpose data imported database excel file existing database hold information. dont want build linq query that. want build native sql query. the query has problem. lets ^^. declare data cursor select [n#ºcontab] efa..eventos declare @n#ºcontab nvarchar(200) declare @associadoid int declare @loopnum int = 0 declare @looprows int open data set @looprows = @@cursor_rows while @@fetch_status = 0 begin if @loopnum = @looprows break fetch next data @n#ºcontab set @associadoid = (select id l_7associadosapddemo..l_associado numero = @n#ºcontab) use efa declare @colnum int = 1 declare @colrows int declare colnames cursor select column_name information_schema.columns table_name = 'eventos' order ordinal_position open colnames set @colrows = @@cursor_rows while @@fetch_status = 0 begin declare @col...

java - how to find all possible solutions to a formula, like 100*7-8*3+7? (8 Out of 10 Cats Does Countdown solver) -

so fun decided write simple program can solve 8 out of 10 cats countdown number puzzle , link form countdown, same rules. program goes through possible combinations of axbxcxdxexf, letters numbers , "x" +, -, / , *. here code it: private void combinerecursive( int step, int[] numbers, int[] operations, int combination[]){ if( step%2==0){//even steps numbers for( int i=0; i<numbers.length; i++){ combination[ step] = numbers[ i]; if(step==10){//last step, 6 numbers , 5 operations placed int index = solution.issolutioncorrect( combination, targetsolution); if( index>=0){ solutionqueue.addlast( new solution( combination, index)); } return; } combinerecursive( step+1, removeindex( i, numbers), operations, combination); } }else{//odd steps operations for( int i=0; i<operations.length; i++){ com...

amazon web services - How to access wordpress database using aws server -

how can access wordpress database using aws server. currently, existing website in running online , server used aws. need update , need db run our local , dev site. have tried using aws on other website 1 wordpress site, database cannot found on aws rds. i'm thinking db added somewhere in ftp (maybe phpmyadmin folder) don't know how , find it. how can solve one? your question bit confusing, wordpress uses mysql database. defined in wp-config.php you can edit file change database wordpress using https://codex.wordpress.org/editing_wp-config.php#set_database_host

Query optimization in SQL Server -

select t2.entity1id, t1.entity1id t1 full outer join t2 on t1.c2 = t2.c2 , t1.c1 = t2.c1 , t1.c3 = 1 ((t1.c1 = 123 ) or (t2.c1 = 123)) , (t1.c3 = 1 or t1.c3 null) above query taking 12 seconds in sql server 2014, idea tune query? there indexes on c1,c2,c3 columns. observation: in above query, when remove condition or (i.e. select t2.entity1id, t1.entity1id t1 full outer join t2 on t1.c2 = t2.c2 , t1.c1 = t2.c1 , t1.c3 = 1 (t1.c1 = 123) , (t1.c3 = 1 or t1.c3 null) then it's returning results in 0 seconds. each table has around 500'000 records. first, final condition (t1.c3 = 1 or t1.c3 null) redundant. given join condition, these possible values. so, query is: select t2.entity1id, t1.entity1id t1 full outer join t2 on t1.c2 = t2.c2 , t1.c1 = t2.c1 , t1.c3 = 1 (t1.c1 = 123 ) or (t2.c1 = 123) if doesn't have performance, consider breaking 2 queries: select t2.entity1id, t1.ent...

ios - UINavigationBar back button item font color won't set -

i have navigation bar on viewcontroller can enable/disable. the problem can't font uibarbuttonitem s change colors after view loads, though arrow change. i disable uinavigationbar on myviewcontroller following line of code: self.navigationcontroller.navigationbar.userinteractionenabled = no; i have uicontrolstate s configured in appdelegate.m uibarbuttonitem s enabled , disabled, nothing happens font after view loads. in appdelegate.m , have following code set uinavigationbar 's font , color: // uibarbuttonitem styling nsshadow *shadow = [[nsshadow alloc]init]; shadow.shadowoffset = cgsizemake(0.0, 1.0); shadow.shadowcolor = [uicolor whitecolor]; // enabled nsdictionary *enabledtextattributedictionary = @{nsforegroundcolorattributename : [uicolor customcellhyperlinkcolor], nsshadowattributename: shadow, nsfontattributename:[uifont fontwithname:@"gillsans" size:17.0]}; [[uibarbuttonitem appearancewhencontainedin:[uinavigationbar class], nil] set...

oop - How to make a method accessable to only one class? -

Image
let's have class top , class bottom. "outside code" can call method of class top, , result in class top accessing class bottom's method. how make sure works way, , nobody other top not try access bottom directly? here illustration: if i'll make bottom private, top not able access it. if i'll make bottom public, able it. there in between of these two? heard guys draw uml diagrams, there way inforce design right in ide? why? when change? moving comment real answer on request. in c#, , i'm pretty sure c++, looks you're looking nested types. msdn.microsoft.com/en-us/library/ms173120.aspx public class container { public container() { nested nested = new nested(); nested.doit(); } class nested { private container parent; public nested() { } public nested(container parent) { this.parent = parent; } public void doit() ...

Implementing callback mechanism as async/await pattern in C# -

how transform following callback-driven code async/await pattern properly: public class devicewrapper { // external device provides real time stream of data private internaldevice device = new internaldevice(); private list<int> accumulationbuffer = new list<int>(); public void startreceiving() { // following callback invocations might synchronized main // ui message pump, particular window message pump // or other way device.synchronization = synchronization.ui; device.dataavailable += dataavailablehandler; device.receivingstoppedorerroroccured += stophandler; device.start(); } private void dataavailablehandler(object sender, dataeventargs e) { // filter data e.data , accumulate accumulationbuffer field. // if certail condition met, signal pending task (if there any) //as complete return awaiting caller accumulationbuffer or perhaps temporary buffer created accumulationbuffer // in order make available ...

yarn - Error in running spark application -

i have simple spark application run on pre-built spark 1.4.1 gt strange error message follows exception in thread "main" java.lang.noclassdeffounderror: com/google/protobuf/serviceexception @ org.apache.hadoop.ipc.protobufrpcengine.<clinit>(protobufrpcengine.java:69) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:270) @ org.apache.hadoop.conf.configuration.getclassbynameornull(configuration.java:1659) @ org.apache.hadoop.conf.configuration.getclassbyname(configuration.java:1624) @ org.apache.hadoop.conf.configuration.getclass(configuration.java:1718) @ org.apache.hadoop.ipc.rpc.getprotocolengine(rpc.java:203) @ org.apache.hadoop.ipc.rpc.getprotocolproxy(rpc.java:537) @ org.apache.hadoop.hdfs.namenodeproxies.creatennproxywithclientprotocol(namenodeproxies.java:328) @ org.apache.hadoop.hdfs.namenodeproxies.createnonhaproxy(namenodeproxies.java:235) @ org.apache.hadoop.hdfs.namenodeproxies.c...

php - laravel 5 send email with html elements and attachment using ajax -

i stuck on point want send email using ajax. find code below. $user = \auth::user(); mail::send('emails.reminder', ['user' => $user], function ($message) use ($user) { $message->from('xyz@gmail.com', 'from'); $message->to($request['to'], $name = null); // $message->cc($address, $name = null); // $message->bcc($address, $name = null); $message->replyto('xyz@gmail.com', 'sender'); $message->subject($request['subject']); // $message->priority($level); if(isset($request['attachment'])){ $message->attach($request['attachment'], $options = []); } // attach file raw $data string... $message->attachdata($request['message'], $name = 'dummy name', $options = []); // underlying swiftmailer message instance.....

c# - How to extract the values of all of the constants in an enum - into a char array? -

it's possible extract values in enum char[] ? i have enum : enum etypelanguage { typed = 't', functional = 'f' } how extract values etypelanguage char array? seems looking (it returns string[] ): enum.getnames(typeof(etypelanguage)); //returns: typed, functional if looking values ('t', 'f') may (this won't throw system.invalidcastexception enum): var values = enum.getvalues(typeof(etypelanguage)) .cast<etypelanguage>() .select(i => (char)i).toarray(); //returns: 't', 'f'

ckeditor - Unable to integrate text editor into Moodle 2 -

i have not been able integrate ckeditor moodle 2.9.1+. (i suspect issue apply text editor, not ckeditor.) per readme instructions , cloned moodle-ckeditor https://github.com/electrolinux/moodle-ckeditor lib/editor directory of moodle installation administer. i renamed downloaded directory moodle-ckeditor ckeditor . i added line config.php in root moodle directory: $cfg->texteditors='ckeditor,tinymce,htmlarea'; when navigate admin > plugins > text editors > manage editors, see original 3 editors: tinymcs html editor, plain text area, , atto html editor. fwiw, when experimentally removed "tinymce," shown line of config.php , still showed on "manage editors" page. makes me think $cfg->texteditors not being used. know being read, because error on "manage editors" page if put syntax error line. i've appended console session in case call attention or rule out mistakes due typos, permissions, etc.: [~/pub...

java - How to make the screen adaptive to small screens in android? -

when developing android apps there exist missing layout when run in small screen size. is there can make user scroll show hidden part ? rookie right fill scrollview whit buttons make sure buttons put in linearlayout linear put scrollview

java - Map Jackson XML attribute to corresponding JSON element -

i using jackson xmlmapper deserialize xml pojo. using objectmapper serialize json. i'd set json key value using xml attribute value. appreciated. thanks. example xml: <response> <label data="somevalue" /> </response> needs map json as: { "response" : { "label" : "somevalue" } } this can right now: { "response" : { "label" : { "data" : "somevalue" } } } this pojo label element: @jsonignoreproperties(ignoreunknown=true) public class labelobject { @jacksonxmlproperty(localname = "data", isattribute = true) private string data; // getter setter }

How make sure that a Composite also lays out its children after calling Composite.layout() in Java -

i'm having composite children, possibly composites can other controls. example this composite composite = new composite(parent, swt.none); composite childrencomposite = new composite(composite, swt.none); control childrenchildrencontrol = new control(childrencomposite, swt.none); control childrencontrol = new control(composite, swt.none); and if call composite.layout() want childrencomposite calls layout-method. done automatically? or have call separately? composite.layout(); i found out following. if u want make sure childrens of composite layouted use composite composite = new composite(parent, swt.none); composite childrencomposite = new composite(composite, swt.none); control childrenchildrencontrol = new control(childrencomposite, swt.none); control childrencontrol = new control(composite, swt.none); composite.layout(true, true);

JMS Request Reply Pattern, No Output -

testrequestresponse: public static void main(string args[]) throws jmsexception { tibjmsconnectionfactory connectionfactory = new tibjmsconnectionfactory( "tcp://localhost:7222"); connection con = connectionfactory.createconnection("admin", ""); con.start(); session s = con.createsession(); system.out.println("successfully created jms connection , session!"); queue q1 = s.createqueue("train.ems.queue.test"); system.out.println(q1); system.out.println("queue created!"); temporaryqueue tq = s.createtemporaryqueue(); messageproducer mp = s.createproducer(q1); messageconsumer mc = s.createconsumer(tq); textmessage tm = s.createtextmessage("hi abhishek!"); tm.setstringproperty("country", "in"); tm.setjmscorrelationid("sender"); tm.setjmsreplyto(tq); mp.settimetolive(30000); mp.setdeliverymode(deliverymode.no...

php - cURL using info from mySQL, then storing the cURL'ed info (articles and guides is much appreciated!) -

Image
maybe simple thing - me it's quite hard! for starters, i'm new programming in php (been doing time time @ university when needed)and i've tried reading sorts of guides , articles on curl subject. those i've found usefull until how curl through 1 site lot of information, need how on multiple sites not information - few lines, matter of fact! another part is, article focus @ storing @ ftp server in txt file, have loaded around 900 addresses mysql, , want load them there, , enrich table information stored in links - provided beneath! we have open public libraries addresses , information these , api. link main site: the function use: http://dawa.aws.dk/adresser/autocomplete?q= sql structure: data example: http://i.imgur.com/jp1j26u.jpg fx addresse: dornen 2 6715 esbjerg n (called adrname in databasen). http://dawa.aws.dk/adresser/autocomplete?q=dornen%202%206715%20esbjerg%20n this give me following output (which want store in adrid in database): ...

How to create a border in Pygame -

i know how create border in pygame stop user controlled object exiting screen. right now, have python prints text when user controlled object has come near 1 of 4 sides. here code far. import pygame pygame.locals import * pygame.init() #display stuff screenx = 1000 screeny = 900 screen = pygame.display.set_mode((screenx,screeny)) pygame.display.set_caption('block runner') clock = pygame.time.clock() image = pygame.image.load('square.png') #color stuff red = (255,0,0) green = (0,255,0) blue = (0,0,255) white = (255,255,255) black = (0,0,0) #variables x_blocky = 50 y_blocky = 750 blocky_y_move = 0 blocky_x_move = 0 #animations def blocky(x_blocky, y_blocky, image): screen.blit(image,(x_blocky,y_blocky)) #game loop game_over = false while not game_over: event in pygame.event.get(): if event.type == pygame.quit: pygame.quit() quit() if event.type == pygame.keydown: if event.key == pygame.k_up: ...