Posts

Showing posts from February, 2013

java - JAX-RS with CXF without using Spring -

java - JAX-RS with CXF without using Spring - i want run simple web application using cxf not using spring. able implement servlet using bailiwick of jersey , i'm trying out cxf. next web.xml. <!doctype web-app public "-//sun microsystems, inc.//dtd web application 2.3//en" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>output socket</display-name> <servlet> <servlet-name>jaxservlet</servlet-name> <servlet-class> org.apache.cxf.jaxrs.servlet.cxfnonspringjaxrsservlet </servlet-class> <init-param> <param-name>jaxrs.serviceclasses</param-name> <param-value>org.mycompany.servlet</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jaxse...

events - How can a background Python process not simply monitor but capture shortkeys? -

events - How can a background Python process not simply monitor but capture shortkeys? - i want have little python programme run in background monitoring keystrokes. when detects shortkey, want capture (i.e. not allow propagate focussed application) , corresponding shortkey. to specific, want programme watch key combinations , run little script snap windows around according shortkeys. let's it's terminal window want snap side of screen. key here not want shortkey propagate terminal; want programme capture it, not monitor it. how done on ubuntu? python events ubuntu key x11

java - Adding SQLite database value to ListView -

java - Adding SQLite database value to ListView - i want add together sqlite database value listview if record exists, i'm getting text edittext. here's i'm doing code databasehelper class public string ifexistin(string stationname) { string query = "select stationname review stationid='" + stationname + "' limit 1"; seek { sqlitedatabase database = getreadabledatabase(); cursor c = database.rawquery(query, null)); homecoming stationname; } } code activity class public view.onclicklistener searchstation = new view.onclicklistener() { @override public void onclick(view v) { databasehelper dbhelper = new databasehelper(getapplicationcontext()); string searchstring= searchtext.gettext().tostring(); dbhelper.ifexistin(searchstring); list.add(searchstring); arrayadapter= new arrayadapter<string>(searchandreview.this, android.r.layout.simple...

android - UI error in Titanium Alloy Screen when no top margin is defined -

android - UI error in Titanium Alloy Screen when no top margin is defined - hi newbie titanium app, , learning alloy method developing. i wrote in index.xml: <alloy> <window class="container"> <textfield id="title" hinttext="title"></textfield> <textarea id="description" hinttext="description"></textarea> </window> </alloy> but when previewed in android emulator, showing overlapped textfields onto center of screen. default, should start top , should automatically take margin top relatively. right showing is: i.imgur.com/kozup6k.png you have override default alignment of window children giving layout property value vertical or horizontal , check link more explanation. you can give text fields same class , give class top value, seek , check result in ui. index.xml: <alloy> <window class="container" layout="v...

php - Validating dates in Laravel (4.2) -

php - Validating dates in Laravel (4.2) - i'm having problem validating dates in laravel (4.2) $input = array('date_field' => '23/12/2'); $validation_rules = array('date_field' => 'required|date_format:d/m/y'); $validation = validator::make($input, $validation_rules); echo ($validation->fails()) ? 'fail' : 'pass'; with sample (though incorrect) date beingness passed 23/12/2, validator still returns pass, technically should fail. i'm trying forcefulness input field format matches dd/mm/yy uk date format. thanks! you may utilize regex: ensure format in add-on date_format , example: $validation_rules = [ 'date_field' => [ 'required', 'date_format:m/d/y', 'regex:#[0-9]{2}\/[0-9]{2}\/[0-9]{2}#' ] ]; but '23/12/2' not valid , supposed failed confused why passed, anyway! php laravel

php - MySQL closest values order by count -

php - MySQL closest values order by count - i have table: name count name 1 1 name 2 1 name 3 1 name 4 1 name 5 2 name 6 2 if select name 2 (count = 1), how select next , previous item (name 3, name 1)? after values same. how solve problem? if want single query think might query loooking for. select * table coun=(select coun table name='name1') , name!='name1' i rename count column coun count agg. function in mysql. hope works you.. php mysql

unity3d - High memory allocations when unregistering delegates from event in C# -

unity3d - High memory allocations when unregistering delegates from event in C# - we developing game unity3d engine (which uses mono user code - our code written in c#). the scenario have class exposing event, around ~ 250 registrations event (each level object on game's map registers event): // every level registers (around 250 levels) scoresdatahelper.onscoresupdate += handleonscoresupdate; when destroying scene, every object unregisters event: scoresdatahelper.onscoresupdate -= handleonscoresupdate; when using built-in profiler, seeing huge memory allocation, digging deeper shows due delegates beingness unregistered. i suspect due fact delegates immutable , when chaining them together, new instances created ? here's screenshot unity's profiler: is there way avoid these memory allocations when dealing big number of event subscriptions? as confirmed in comments want unsubscribe event subscriptions, there no reason unsubscribe 1 one. yo...

android - Changing Icon at run time in pagerslidingtabstrip -

android - Changing Icon at run time in pagerslidingtabstrip - i using pagerslidingtabstrip library. aware state drawable can used tab selected , unselected property. have listview in first fragment. scroll listview @ particular moment have alter pagertab icon state drawable fragment. means have show new state drawable. not able it. please help!! android android-listview android-viewpager android-pageradapter

migration - For Ruby on Rails, how do you switch to a new and empty DB with the same DBMS or a different DBMS? -

migration - For Ruby on Rails, how do you switch to a new and empty DB with the same DBMS or a different DBMS? - if no need migrate data, seems can edit database.yml development: adapter: mysql database: myapp_development host: localhost username: root password: encoding: utf8 1) utilize brand new db 0 data, alter 3rd line to: database: myapp_development_02 and rake db:create , rake db:migrate , now, have brand new db 0 data? 2) if specifying using sqlite, can alter mysql description top part of post, , rake db:create , rake db:migrate , , have brand new db work with, , mysql? 3) rails 3 has db/schema.rb. can used instead of rake db:migrate , involve 30 migrations if there 30 migration files, if using schema.rb, can reach database schemas in 1 step? 4) think can create other development_02 , etc, in database.yml file, pointing old db, or pointing different dbms, create sure run rails ... -e development_02 ... or rake ... rails_env=devel...

How should I add Drupal to the usersgroup with full privilegies? -

How should I add Drupal to the usersgroup with full privilegies? - i want alter owner of files directory on drupal, but.. what's drupal user ? i have 1 user in unix system, 1 moved files. drupal complains cannot edit them. how can add together drupal usersgroup total writing access ? chown... thanks you don't need drupal own them, add together grouping has write access. drupal perform acts webserver typically using www user, ubuntu it's www-data . you can utilize chgrp add together grouping , chmod g+w give write permission. you can recursively, need once. drupal drupal-6

css - firefox dosen't support div width -

css - firefox dosen't support div width - i have problem firefox show this: (but ie show correctly) <div id="main_div" dir="rtl"> <div dir="rtl"> <div class="outer_div" dir="rtl"> text! </div> </div> <div dir="rtl"> <div class="outer_div" dir="rtl"> text! </div> </div> <div dir="rtl"> <div class="outer_div" dir="rtl"> text! </div> </div> </div> ====================================== body{ margin: 0px; padding: 0px; } div.main_div{ border: dotted; border-width: thin; padding-bottom: 10px; padding-top: 10px; padding-left: 20px; padding-right: 20px; background: #ffffaa; border-color: #ffcc66; width: 100%; float: right; } div.outer_div{ float: right; padding-bottom : 5px; padding-top : 5px; padding-left: 10px; padding-right...

c# - WPF - Resizing chromeless windows using attached behaviors,..Any suggestions? -

c# - WPF - Resizing chromeless windows using attached behaviors,..Any suggestions? - who fancies challenge? i'm working on controltemplate chromeless window part of reusable theme assembly. want behaviors moving, closing, minimizing , restoring implicit i've written attached behaviors functionality i've included in template. now,..i've come resizing , i've come junction. improve or worse i'm handling mouse move in behavior , finding whether cursor within resizing 'zones'. i'm far plenty alter cursor appropriately i've gotten resizing window there 3 options i've come across. i hand-ball affair , adjust left & top , width & height needed. simplest alternative , achievable using attached behaviors seems moderately heavy lifting , understand wpf go on render window adjusted causing flickering,..which sucks. the sec alternative message hook , hear wm_nchittest , solutions i've found far involve me sub-classi...

html - Block Elements Not Vertically Aligning -

html - Block Elements Not Vertically Aligning - i'm trying develop website. @ moment i'm trying design down, giving me quite tough time. i have 5 div's. each 1 contains 2 span's, column1 , column2. div's block , span's inline-block. however, reason div's don't want align vertically. help appreciated. also, thing. of span's within div's replaced div's. did because planned on using block elements within of particular areas , , still validate had div's, not span's. below current code: class="snippet-code-css lang-css prettyprint-override"> .header { color: #aec6cf; font-family: gabriola; font-weight: 900; font-size: 50px; position: relative; } /* id */ #row1 { width: 98%; height: 15%; position: absolute; display: block; } #row2 { width: 98%; height: 2.5%; position: absolute; display: block; } #row3 { width: 98%; height: 70%; position:...

regex - How does this pattern match hyphen without escape? -

regex - How does this pattern match hyphen without escape? - after toddling in regex101 few minutes, realized ] not need escaped, if follws [ . in regex101, pattern []-a-z] described /[]-a-z]/ []-a-z] match single character nowadays in list below ]-a single character in range between ] , (case sensitive) -z single character in list -z literally (case sensitive) but thought, if - has matched literally without beingness escaped, should either go @ beginning, or @ end. then why pattern not recognized error? why -z matches single character in list -z literally ? let's break down: []-a-z] ^^ ^ || +---- 3 |+------ 2 +------- 1 1 literal ] since appears @ start of pattern, , [] invalid character class in pcre. the 2 hyphen hence sec character in class, , introduces range, between ] , a . the next hyphen, 3 , treated literally, because previous token, a end of previous range. range cannot introduced @ point. in pcre, - treated lit...

How do I add external images to a map using the Nokia Here Map Image API? -

How do I add external images to a map using the Nokia Here Map Image API? - thanks in advance. i'm trying figure out how add together client faces (images) locations on map using nokia here map image api. i able via javascript api, unfortunately need able download image utilize in generated pdf file, , can't figure out how add together external images map. any help much appreciated. :) i didn't understand requirement if want convert canvas shows map image, can map caprutre event, next should work map.capture(function(canvas) { if (canvas) { var img = new image(); img.src = canvas.todataurl("img/jpeg"); window.open(img.src); } else { // illustration when map in panorama mode alert('capturing not supported'); } }, [ui], 0, 0, document.getelementbyid("mapcontainer...

java - ConfidentialStore error on distributed Jenkins plugin running on slave -

java - ConfidentialStore error on distributed Jenkins plugin running on slave - i'm refactoring (not choice) jenkins plugin (that didn't write) can run distributed. plugin simple, takes resulting object job, creates changelog, compresses them both in zip file , sends through http post request app. following http://ccoetech.ebay.com/tutorial-dev-jenkins-plugin-distributed-jenkins moved code that's going run on node class this: class="lang-java prettyprint-override"> private static class uploadlauncher implements callable &ltvoid, exception&gt { ... @override public void call() throws exception { // here's code run in node. ... } } the problem i'm having somewhere in code plugin tries configure proxy this: class="lang-java prettyprint-override"> proxyconfiguration proxy; if (jenkins.getinstance() != null && jenkins.getinstance().proxy != null) { proxy = jenkins.getinstance().proxy; } else ...

java - Comparator for Optional -

java - Comparator for Optional<T> - i have abstract class optionalcomparator<t extends comparable<t>> implements comparator<optional<t>> so far, good. following model used optional itself, figured best have single instance of class, , cast when necessary (for example, optionalcomparator<integer> ). so made private static final optionalcomparator<? extends comparable<?>> absent_first . the problem came when tried assign value. should type be? new optionalcomparator<comparable<object>>() {...} doesn't work. new optionalcomparator<comparable<comparable<object>>>() {...} doesn't work. new optionalcomparator<integer>() {...} work, example, want least-specific type possible. what doing wrong? how can create base-case instance of class? you can have multiple implementations of optionalcomparator this: private static final optionalcomparator<? extends comparable...

php - WHERE clause not working, code sample included -

php - WHERE clause not working, code sample included - i have mysql query below. works fine. $query = sprintf("select id, name, fee, lat, lng, ( 3959 * acos( cos( radians('%s') ) * cos( radians( lat ) ) * cos( radians( lng ) - radians('%s') ) + sin( radians('%s') ) * sin( radians( lat ) ) ) ) distance markers having distance < '%s' order distance limit 0 , 20", mysql_real_escape_string($center_lat), mysql_real_escape_string($center_lng), mysql_real_escape_string($center_lat), mysql_real_escape_string($radius)); i'm trying add together where clause follows , not working $query = sprintf("select id, name, fee, lat, lng, ( 3959 * acos( cos( radians('%s') ) * cos( radians( lat ) ) * cos( radians( lng ) - radians('%s') ) + sin( radians('%s') ) * sin( radians( lat ) ) ) ) distance markers show <> 0 having distance < '%s' order distance limit 0...

Trying to retrieve a document by _id directly in template helper not working in meteor -

Trying to retrieve a document by _id directly in template helper not working in meteor - i trying retrieve document straight in meteor via _id of document. here helper: template.lesson.helpers({ lesson: function() { //url format: http://localhost:3000/lesson/crofdsknbriy7qchl var url = window.location.href; var result= url.split('/'); var id = result[result.length-1]; console.log('url: '+url); console.log('id: '+id); var lessonsdata = lessons.findone({_id: id}); homecoming lessonsdata; } }); this correctly grabs id url. i assume problem id beingness in string format. how can pass value in format meteor/mongo looking id in? here error message receive. exception in template helper: referenceerror: lessondata not defined thanks much help! updated question reference current error changes suggested. also can not utilize iron router project since using parts of polymer don't work it. ...

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API - i'm trying create app retrieve stock name, asking , purchase cost yahoo finance api, using restangular. i'm having problem accessing public api in local application i'm creating when request. url parameters i'm sending: http://finance.yahoo.com/d/quotes.csv?s=msft+ge&f=nab using postman, request returns array contains stock name, asking cost , purchase cost of stock. doing request in postman returns desired info without errors. when request in local, next error: xmlhttprequest cannot load http://finance.yahoo.com/d/quotes.csv?s=msft+ge&f=nab. no 'access-control-allow-origin' header nowadays on requested resource. origin 'http://localhost' hence not allowed access. the html code follows: <html ng-app="app"> <head> <title>restangular</title> <script src="https://ajax.googleapis.com/ajax/li...

ios - SCNFloor's firstMaterial's diffuse's content property as gradient -

ios - SCNFloor's firstMaterial's diffuse's content property as gradient - i have scnfloor scnfloor *floor = [scnfloor floor]; and want create uicolor gradient. uicolor *mygradient = ?; and want alter property gradient. floor.firstmaterial.diffuse.contents = mygradient; is there way can this? when seek add together image floor.firstmaterial.diffuse.contents = @"mygradient"; it gets repeated, undesirable result. when seek clamping edged image floor.firstmaterial.diffuse.wraps = scnwrapmodeclamp; floor.firstmaterial.diffuse.wrapt = scnwrapmodeclamp; i solid color that's contained in gradient. thank time! ios objective-c xcode scenekit

rest - How to confirm the swagger version being used in my API? -

rest - How to confirm the swagger version being used in my API? - i have integrated rest api (developed on jersey) swagger 2.0 when see json listing, shows me next entries : "apiversion": "1.0.0", "swaggerversion": "1.2", the swaggerverison listed 1.2, shouldn't 2.0 ? how can confirm api using swagger 2.0 ? due specific requirement, must using 2.0 version of swagger, , after lot of googling i'm not able confirm this. thanks in advance. i think might confusing between swagger core , swagger ui. the version 2.0 mentioned github version of swagger ui. swaggerversion 1.2 version of swagger core itself. rest jersey swagger

Couldn't get email using devise Rails -

Couldn't get email using devise Rails - i implementing devise mailers application have done next steps: in model: class user < activerecord::base # include default devise modules. others available are: # :lockable, :timeoutable , :omniauthable devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable, :trackable, :validatable end and added migrations of confirmation_token, confirmed_at, confirmation_sent_at in devise.rb, added: config.mailer_sender = 'example@gmail.com' config.mailer = 'devise::mailer' in development.rb: config.assets.raise_runtime_errors = true config.action_mailer.default_url_options = { :host => 'localhost:3000' } config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: 'smtp.gmail.com', port: 587, domain: 'gmail.com', authentication: :plain, user_name: 'example@...

javascript - How does the following code get away with not defining initial x and y coordinates for nodes? -

javascript - How does the following code get away with not defining initial x and y coordinates for nodes? - drawing attending wonderful d3 illustration here - http://www.d3noob.org/2013/03/d3js-force-directed-graph-example-basic.html, how x , y coordinates specified in forcefulness d.nodes.x , d.nodes.y, yet these never specified in first instance? an explanation of x , y coordinates within on tick fn "mean" useful - x , y coordinates nodes should move on duration of forcefulness (once force.start() activated)? force.draggable activated these coordinates become coordinates nodes should gravitate towards? thanks in advance help. the reply on d3noob page: initial node location arbitrarily determined d3.js when associate them links, i.e. links.foreach(function(link) { link.source = nodes[link.source] || (nodes[link.source] = {name: link.source}); link.target = nodes[link.target] || (nodes[link.target] = {name: link.target}); link.value = ...

Facebook share link does not remember the URL to share -

Facebook share link does not remember the URL to share - this related question , answers explain facebook share links should like: http://www.facebook.com/sharer/sharer.php?u=#url but when user not logged in facebook when clicks link, url share has been replaced url of fb login page: sorry, don't know how create fb show in english, can see in naviagtion bar value u has been lost after login , reads ...?u&ret=login instead of ...?u#url&ret=login . you can seek logging out of facebook , next link: http://www.facebook.com/sharer/sharer.php?u=#http%3a%2f%2fstackoverflow.com%2fquestions%2f29557906%2ffacebook-share-link-does-not-remember-the-url-to-share how can forcefulness facebook "remember" url share? i prefer avoid using javascript (but do, if necessary), , don't want register facebook app utilize share dialog. but when user not logged in facebook […] it doesn’t work when are logged in facebook either (then shows field i...

jquery - Customize Google Places autocomplete pac-item text -

jquery - Customize Google Places autocomplete pac-item text - i know how customize default google places autocomplete text shown when user types on autocomplete-enabled input (".pac-item" elements). specifically, want utilize portuguese language on results, when specify pt-br language on autocomplete instantiation results shown in english language (e.g. "state of", "brazil" ): var autocomplete = new google.maps.places.autocomplete( (document.getelementbyid('city_settings')), { language: "pt-br", types: ['(cities)'], componentrestrictions : { country: 'br' } }); any thoughts on how activate portuguese responses or how programatically edit texts? jquery css autocomplete google-places

Simple jQuery Slider/Carousel for Content with Left/Right Arrows & No-Autoplay -

Simple jQuery Slider/Carousel for Content with Left/Right Arrows & No-Autoplay - i'm trying create simple jquery slider/carousel controls. want slide in or out 3 divs when clicking on left , right arrows. don't need autoplay now. want tried many plugins , tutorials online. searched stackoverflow answers, don't solve case. so... this html (simplified): <div class="slider"> <div class="wrap-12"> <div class="slides"> <div class="slide name1"><!-- stuff --></div> <div class="slide name2"><!-- stuff --></div> <div class="slide name3"><!-- stuff --></div> </div> <div class="controls"> <div class="left"></div> <div class="right"></div> </div> </div> </div> and css: .slider .slides { wid...

ios - issue with -Apple-Mach-O Linker Error -

ios - issue with -Apple-Mach-O Linker Error - i developing app ios using parse , stripe . have implement payment functionality. hence downloaded sample project form parse.com after reading readme .md have completed step1 . but in step 2 when build , run project linker errors . i unable find solution 1 please suggest do. screenshot of errors are sure parse beingness included in build target? looks parse can't find classes referenced because didn't include in build target. ios objective-c parse.com xcode6

php - Arguments for not using a framework -

php - Arguments for not using a framework - a little while ago read great article described number of reasons against using of rad frameworks available php. basically, argued framework should off ground quickly, , should out of way. none of php frameworks did that. pointed out django @ doing (but that's not php framework). for life of me, can't find article now. so i'm curious. have solid arguments why applications should not built on top of rad framework? , i'm not talking generic applications (frameworks definition seek solve generic problem. quesiton translate specific problems). and when built on top of, mean ground based on framework. don't mean referencing framework series of libraries. mean basing entire architecture of application off of framework (which ties framework). i'm not talking rapid prototyping code re-written anyway. i'm more looking @ long-term applications have specific business requirement meet, , must supported ...

Can I override/null out an HTTP response header field with a php script so that the field is not set? -

Can I override/null out an HTTP response header field with a php script so that the field is not set? - if server automatically sending expires http header response default, can override/null out php script expires header field not set? yes can. cancel set expires header beingness sent: header('expires:'); it work if no headers have been sent already, before echo , php starts sending info browser. might have utilize output buffering that. and when upgrade php 5.3.* utilize header_remove('expires'); . php http-headers

html - Bootstrap 3 Jumbotron text floats right on some devices -

html - Bootstrap 3 Jumbotron text floats right on some devices - coding rookie here. i'm trying center vertically , horizontally text in full-width jumbotron, using bootstrap3. used modern.ie check out site on other devices. works out okay on devices few little devices (iphone6 , samsung3 example) text floats right, hangs little below jumbotron. sense i'm close have no thought why devices bump text right instead of beingness nicely centered. html <!-- jumbotron --> <div class="jumbotron"> <div class="container"> <div class="jumbotron-copy"> <h1 style="color: white;">hello friends</h1> <h3 style="color: white;">welcome our reception page</h3> </div> </div><!--end container--> </div> <!-- end jumbotron--> css .jumbotron { height: 400px; width: auto; position: relative; background-color: #072526; background-image: url(../images/jum...

Python delete lines of text line #1 till regex -

Python delete lines of text line #1 till regex - i have issue can't seem find solution within python. from command line can by: sed '1,/commands/d' /var/tmp/newfile this delete line #1 till regex "commands". simple but can't same python can find. re.sub , multiline doesn't seem work. so have question how can in pythonic way? rather not run sed within python unless have to. i utilize fileinput inplace=true alter original file setting flag when find match , removing lines until do: import fileinput import re found = false line in fileinput.input("your_file",inplace=true): if re.match("pattern",line): found = true if found: print(line,end="") # print line, python2 else: print(end="") # print, python2 if there nil complex pattern if "pattern" in line may work. python regex

c++ - Defending against stack overflow by user scripts -

c++ - Defending against stack overflow by user scripts - c++ has limited stack space no way functions check whether there's plenty space left them run. don't know when writing script bindings. for example: class container : widget { void addchild(widgetptr child) { ... } void draw(canvas& canvas) { (auto kid : m_children) { child.draw(); } } }; a malicious script can crash program: var = new container() (i = 0; < 10000000; i++) { var b = new container() a.addchild(b) = b } a.draw() // 10000000 nested calls ---> stack overflow there's callback problem: void dosomething(std::function<void()> callback) { callback(); } if wrapped using this: scriptvalue dosomething_wrapper(scriptargs args) { dosomething([&]() { args[0].callasfunction(); }); } crashed using: function badcallback() { dosomething(badcallback) } dosomething(badcallback) ... dosomething_wrapper dosomething scriptvalue::callasfun...

php - Error opening downloaded file from server -

php - Error opening downloaded file from server - i want user click , download .doc wherever want.. files download when open it, word says: 'missing file c:\users\myname\style.css. click ok , shows me corrupted word document. php <?php function download($pathtofile) { header('content-description: file download'); header('content-type: application/force-download'); header('content-transfer-encoding: binary'); header('content-length: '.filesize($pathtofile)); header('content-disposition: attachment; filename="'.basename($pathtofile).'"'); readfile($pathtofile); } if($_server['request_method'] == 'post'){ if(isset($_post['cvcrono'])){ download('../curriculum-vitae-modelo1-azul.doc'); } elseif(isset($_post['cvfun'])){ download('../curriculum-vitae-modelo1b-azul.doc'); } elseif(isset($_post['cvcomb'])...

python - "If, Then" Statement - registering back-to-back mouse clicks -

python - "If, Then" Statement - registering back-to-back mouse clicks - i want programme register 3 consecutive mouse clicks. upon each mouse click, unique object drawn (pre-determined location , shape). first click = first object appears, if click 1 time again = sec object appears, , if click 3rd time = 3rd object appears. should like? here's have, isn't working: def printer(event): x, y = event.x, event.y print(x,y) if event.x in range (130,224) , event.y in range(197,305): canvas.create_oval(146, 158, 140, 164, outline="indianred2", fill="red", width=1.5) elif event.x in range (130,224) , event.y in range(197,305): canvas.create_oval(180.5, 158, 174.5, 164, outline="indianred2", fill="red", width=1.5) elif event.x in range (130,224) , event.y in range(197,305): canvas.create_oval(209, 158, 215, 164, outline="indianred2", fill="red", width=1....

How does a liferay portal work? -

How does a liferay portal work? - i developing portal page using liferay . want know technical aspects of it. happens in background when portlet (either custom built or inbuilt) dragged , dropped portal page. curious know. please give me insights. thanks you might need go through basic portlet documentation first before start here. liferay having nice documentation developers, might want checkout. liferay developer documentation liferay portal

How to load Facebook property file in java using Spring and Hibernate -

How to load Facebook property file in java using Spring and Hibernate - i new spring , hibernate.i trying connect web application facebook.i have done using java script provided facebook want connect facebook using spring social. purpose have declare properties file under scr/main/resource folder.i have done not using xml file. have class loads properties , dao files.i don't know method of loading properties file of facebook. my applicationconfig class bundle net.codejava.spring.config; import java.util.properties; import javax.sql.datasource; import net.codejava.spring.dao.userdao; import net.codejava.spring.dao.userdaoimpl; import net.codejava.spring.model.user; import org.apache.commons.dbcp2.basicdatasource; import org.hibernate.sessionfactory; import org.springframework.beans.factory.annotation.autowired; import org.springframework.context.annotation.bean; import org.springframework.context.annotation.componentscan; import org.springframework.context.annot...

wso2esb - WSO2 add API context to headers -

wso2esb - WSO2 add API context to headers - i have several apis behind wso2 instance, each it's own context ("/api-1/", "/api-2/", ...) i'd add together context string dynamically http header (without hardcoding on per-api basis). so, example: <sequence name="wso2am--ext--in"> <header name="x-script-name" scope="transport" expression="get-property('', '')"/> </sequence> is there look can utilize accomplish this? or should resort creating per-api mediator include it? edit: i have tried using url regex, expecting treat {context} part of uri variables, doesn't seem it: <header name="x-script-name" scope="transport" expression="uri.var.context"/> did define "uri.var.context" before? not inbuilt variable used. can read "to" header , apply string manipulation using xpath, can context. edi...

jquery - JavaScript Scroll Script - Fires in test, not on dev site -

jquery - JavaScript Scroll Script - Fires in test, not on dev site - my script replace logo upon scroll works here in test 'http://jsfiddle.net/timsalabim/opek5mtz/` <!-- logo scroll --> var img = document.queryselector('.logo_h__img img'); // element img.dataset.orig = img.src; // dataset document.addeventlistener('scroll', function (e) { // add together event listener if (document.body.scrolltop > 0) { // check scroll position img.src = img.dataset.scroll; // set scroll image } else { img.src = img.dataset.orig; // set original image } }); it not work when implemented same way in website, think have tested correctly , firing too.... i set script in site in <head> </head> tags located in header.php file (wordpress website) within these tags: <script type="text/javascript"> </script> i didn't forget add together section image tag: data-scroll="http://...

regex - Notepad++ RexEx Remove everything between 2 html tags ( with line break between ) -

regex - Notepad++ RexEx Remove everything between 2 html tags ( with line break between ) - i want remove in html document notepad++ everything between marked area start point remove ( including ) "<imgcrlf" , between including crlf , including "detailscrlf</acrlf" end ponint i started simple <img.*<a/> , ticked and tried improve starting point got either nil deleted or much :) use <img.*?</a>[\r\n]* . .* greedy. [\r\n]* capture whitespace after </a> . also, if interested in matching <img subsequent line breaks, can utilize regex: <img[\r\n].*?</a>[\r\n]* html regex notepad++

How to resample an edge of an image in MATLAB? -

How to resample an edge of an image in MATLAB? - i trying decrease number of points of detected border of image didn't obtain result. want result contain 200 pixels of edges, points must chosen shape remain clear. how can this? here's illustration image of i'm working with: here results have received code wrote: code written function y = echantillonnage(x) contour_image = x; [lignes,colonnes]=size(x); n = nombre/200; contour_image_200px = contour_image; ok=0; i=1:lignes j=1:colonnes if (contour_image_200px(i,j)>0 ) ok=ok+1; if ( mod(ok,round(n))>0 ) contour_image_200px(i,j)=0; end end end end figure,imshow(contour_image_200px); %résultat y = contour_image_200px; end what can utilize bwboundaries trace boundaries of objects / edges sample array of points decrease number of border points. tracing done in clockwise order, sure...

Running Atlassian Stash & JIRA on same server -

Running Atlassian Stash & JIRA on same server - i trying run jira , stash on same server. when start 1 of them, can access fine. however, 1 time start sec one, can no longer access either of them. i have checked logs did not see anything. when run: lsof -np | grep ipv i see both jira & stash listening on respective ports. is there tomcat config need change? your best bet raise issue , send logs through @ support.atlassian.com jira atlassian atlassian-stash

arrays - Downsampling, or equalizing vector lengths in matlab -

arrays - Downsampling, or equalizing vector lengths in matlab - i'm having of basic problem yet can't seem solve it. have 2 big pieces of data. have matrix 48554 x 1 , and matrix b 160272 x 1. want "downsample" matrix b of same length matrix a. moreover, want function can pretty much big m x 1 , n x 1 matrices (so works more specific example). tried using resample function so: resample(b,length(a),length(b)) however i'm getting error indicating filter length large. next tried using loop extract every ith element matrix b , save new matrix, not working out nicely since vector lengths aren't divisible integer. have other (hopefully simple) ways accomplish this? you seek using interp1 function. know down-sampling isn't interpolating per se. here's example: x1 = [0:0.1:pi];%vector length 32 x2 = [0:0.01:pi];% vector length 315 y1 = sin(x1); y2 = sin(x2); %down sample y2 same length y1 y3 = interp1(x2,y2,x1);%y3 length 32 figure(1...

oracle - Insert into a table based on a cursor -

oracle - Insert into a table based on a cursor - i have below tables: table1: | resp_id | description | | 1 | aa | | 2 | aa | | 3 | aa | table 2: | org_id | resp_id | date | gid | | 001 | 1 | 08-sep-14 | 112 | | 002 | 1 | 08-sep-14 | 112 | | 003 | 3 | 08-sep-14 | 114 | | 004 | 5 | 08-sep-14 | | | 005 | 5 | 08-sep-14 | | | 006 | 6 | 08-sep-14 | | my requirement this: need insert gid table2 if resp_id in table2 not found in table1. hence wrote below script doesn't work: declare cursor resp_id_cursor select resp_id table1 description '%aa%'; flag number; begin resp_cur in resp_id_cursor select 1 flag table2 a.resp_id = resp_cur.resp_id; if flag != 1 in...

android - exit and back button implementation -

android - exit and back button implementation - either exit button or button can implemented in application.but want both implementations in application. so,please propose me solution. thanks in advance..:) please read reto meier's blogpost on 'exit' in android apps: http://blog.radioactiveyak.com/2010/05/when-to-include-exit-button-in-android.html summary: don't set 'exit button' in android app. android button widget exit back-button

java - Unlock JButton as fields have text -

java - Unlock JButton as fields have text - as topic suggests want unlock(setenabled(true)) jbutton register when other fields have text don't know type of listener this. upload image clearer understanding. http://postimg.org/image/ab8alz44d/ add document listener each text field. void init() { //construct text fields ... // add together listeners textfield1.getdocument().adddocumentlistener(new documentlistener() { public void changedupdate(documentevent e) { checkunlock(); } public void removeupdate(documentevent e) { checkunlock(); } public void insertupdate(documentevent e) { checkunlock(); }); // repeat each textfield } ... private void checkunlock() { boolean unlock = !(textfield1.gettext().equals("")) && !(textfield2.gettext().equals("")); // ... , on yourbutton.setenabled(unlock); } java swing jbutton enable-if

UrlAuthorizationModule.CheckUrlAccessForPrincipal does not work in multiple roles -

UrlAuthorizationModule.CheckUrlAccessForPrincipal does not work in multiple roles - when giving multiple roles in web.config urlauthorizationmodule.checkurlaccessforprincipal not working when giving 1 role in config file urlauthorizationmodule.checkurlaccessforprincipal working how check access page in asp.net can hide menu , submenu item class="snippet-code-html lang-html prettyprint-override"> when giving multiple roles in web.config urlauthorizationmodule.checkurlaccessforprincipal not working <?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <authorization> <allow roles="school.admin"/> <allow roles="super.admin"/> <deny users="*"/> </authorization> </system.web> </configuration> if (urlauthorizationmodule.checkurlaccessforprincipal("~/rollover/rolloverstudent.aspx", httpco...

windows store apps - Why does msbuild try to copy from wrong path? -

windows store apps - Why does msbuild try to copy from wrong path? - i seek build windows store app using msbuild. c:\windows\microsoft.net\framework\v4.0.30319>msbuild.exe /t:build /p:configurat ion=release;platform=x86 e:\myapp.w8.csproj /logger:filelogger,microsoft.build.engine;logfile=e:/log/test.txt /p:outputpath=e:/result and got error: "e:\myapp.w8.csproj " (build target) (1) -> (copygeneratedxaml target) -> c:\program files (x86)\msbuild\microsoft\windowsxaml\v12.0\8.1\microsoft.wind ows.ui.xaml.common.targets(476,9): error msb3021: unable re-create file "obj\x86\ release\e:\myapp.shared\app.xbf" "e:\result\e:\myapp.shared\app.xbf". given path's format not supported. [e:\myapp.w8.csproj] i don`t know why msbuild tries utilize obj\x86\release\e:\myapp.shared\app.xbf instead obj\x86\release\app.xbf or absolute path app.xbf. according this post, within .projitems file y...

java - Search in Arraylist with content of an array -

java - Search in Arraylist with content of an array - i´m trying search if arraylist, "lottoraws", contain integers random array, c, have. want print how many numbers of array, c, arraylist. tells how many corrects there lottoraw. //code: lottoraws=new arraylist<int []>(); } public void addlottoraws(int 5) { // illustration 5 int[] = {}; //------------------------generate random numbers arraylist random random = new random(); (int = 0; < 5; i++) { = new int[7]; (int j = 0; j < 7; j++) { int rand = (int) (random.nextint(35)); a[j] = rand; } lottoraws.add(a); } (int k = 0; k < lottoraws.size(); k++) { system.out.println(arrays.tostring(lottoraws.get(k))); } // -------------------------generate random numbers array int[] c = new int[7]; (int j = 0; j < 7; j++) { int rand = (int) (math.random() * 35 + 1); c[j] = rand; } ...

python - Daemon/Multiprocessing communicate through web.py -

python - Daemon/Multiprocessing communicate through web.py - this im trying do: create queue x pool workers. manage queue web.py add items view status (workres running, sleeping) maybe going @ wrong way? should create daemon handels queue , /script/ web.py communicates daemon on tcp or else? so, have made queue , worker class loads before web.py code loads (not in if main, if seek start there web.app dont know class.) what seems down-side is seems have habbit of creating new processes when reload page. should load them somewhere else? this log starting app (should not start 4 processes) starting engine-9589 starting engine-9590 http://127.0.0.1:6077/ starting engine-9711 starting engine-9712 import web import procname import json, time, random import re import multiprocessing mp datetime import datetime import os procname.setprocname('my-engine') urls = ( '/', 'index', ) class queue: def __init__(self):...

javascript - issue with parallax scrolling background images -

javascript - issue with parallax scrolling background images - for part working alright. issue 1 of parallax scrolling background images (of water tower near bottom of site) shows grayness line @ bottom of image when image near bottom of browser window in both firefox , chrome. don't have issue in safari when info speed set 55 or higher. gets improve in ff & chrome when set info speed much, much higher although never goes away entirely. i've left @ 300 now, although there no changes between 300-1000. here link site: http://west3rner.com/birds/index.html here html, css, javascript code: https://jsfiddle.net/aprilirene/qtwj4vh0/ html: <section class="intro8 section" id="section8" data-speed="300" data-type="background"> <div class="overlay2"></div> </section> css: .intro8 { height:50%; width:100%; background:url(../images/fullscreen05.jpg) no-repeat center to...

How to create simple userProfile route in Meteor with Iron Router -

How to create simple userProfile route in Meteor with Iron Router - i trying route current user's profile page using iron router, 'pathfor' spacebars helper not passing href attribute tag. this template: <div class="collapse navbar-collapse" id="navigation"> <ul class="nav navbar-nav"> {{#if currentuser}} <li><a href="{{pathfor 'requestsubmit'}}">submit request</a></li> <li><a href="{{pathfor 'userprofile'}}">view profile</a></li> {{/if}} </ul> <ul class="nav navbar-nav navbar-right"> {{> loginbuttons}} </ul> </div> the href submit request button passing in fine, reason view profile href not getting passed in. my router.js follows: router.route('/users/:_id', { name: 'userprofile', data: function() { homecoming meteor.users.findone(this.par...

c++ - Inheritance , how can i make two classes share the same base class contents? -

c++ - Inheritance , how can i make two classes share the same base class contents? - i have abstract class operations inherits var class , operations derived class(out,sleep,add) inherit operations class. fsm class inherits var also, want 1 instance of var class within program. i trying create vector < pair< string, int>> var shared info between fsm class , operations class , deviates . initialized var in main through fsm class . each time phone call exist function in var through class operation , returns doesn't exits cause empty ! how can overcome this? #include <iostream> #include <string> #include <vector> #include <fstream> using namespace std; class var { public: vector<pair<string, int>> var; var() { cout << "created var" << endl; } ~var(){ cout << "destrioed var" << endl; } void createvar(string x,int y) { pair<string...