Posts

Showing posts from March, 2013

c++ - What does "0 skipped, 0 blacklisted" mean in the Qt Unit Test framework? -

when run qt unit test project, ends summary looks this: totals: 28 passed, 1 failed, 0 skipped, 0 blacklisted the "passed" , "failed" categories obvious, meaning of "skipped" , "blacklisted"? under conditions test framework skip test? how different blacklisting it? my qt version qt 5.4.1. test skipped, if qskip() called test function. qtestlib looks file called blacklist in test directory , parses if found. file contains simple ini style list of functions blacklist. details see qtestblacklist.cpp .

html - Height not adjusted when set to float value? -

i wrote html page css is body{ margin: 0 auto; min-width: 992px; background: #f2f2f2; } .container{ margin: 30px auto; padding:5px; width: 992px; height: auto; border: 1px solid #c6c6c6; border-radius: 15px; background: #fff; } .column{ margin:0px 5px 5px 0px; float:left; height: 50px; width: 486px; background: #0094ff; } and body <div class="container"> <div class="column"></div> <div class="column"></div> <div class="column"></div> <div class="column"></div> </div> when run page removing float:left div class .column , height of .container automatically increase when set float value in div class .column height of div class .container don't increase. please can tel me how fix problem? add overflow:hidden; .containar

actionscript 3 - AS3 - using dynamic Text as a mask -

pretty sure possible. need dynamically load , populate textfield, , in turn use text mask on movieclip below it. have function domask():void{ mymc.dynamictxtfield.text = "some text use mask"; mctobemasked.mask = mymc; } domask(); what happens entire textfield being used mask, not text contains. i'm not sure how use dynamic text mask, can achieve similar effect blend modes. e.g. multiply image on top of dynamic text on black background.

opening Internet Explorer using c programming language -

i made c program in used notorious system () function open internet explorer.there no error compiled giving me output illegal command. problem?? have rechecked internet explorer address in c drive perfect. how solve this? i guess have specified path internet explorer this "c:\program files\internet explorer\iexplore.exe" but because \ character "escape" character in literal string, need defeat escape "c:\\program files\\internet explorer\\iexplore.exe" there no error when compiled because compiler cannot check whether command passed system() meaningful, or valid @ runtime.

Django + rest framework - url tracking -

i want keep track of url hit count daily in db , wondering best tool so? i'm running nginx, django, , django rest framework. edit: main goal not track given url parameters passed in. have object building , object person. people belong building. pass in building id (get using url) , receive people building. i'm wanting able see total url calls buildings , count each particular building. one tool i've found drf-tracking . seems track want through addition of simple mixin on view.

xcode - equal spacing between uiimageview using size class -

Image
i'm trying add 4 or (more in future) uiimageview in ipad application landscape mode. want equal spacing between each uiimageview. used wregular hregular format build application , used few constraints, when try run application in simulator i'm getting different result different ipad devices. how can achieve having equal spaces between uiimageview irrespective size of screen ? below screen shots. ipad2: ipad air : ipad retina : resizable ipad : auto layout system lets lay out app’s user interface creating mathematical description of relationships between elements. define these relationships in terms of constraints either on individual elements, or between sets of elements. using auto layout, can create dynamic , versatile interface responds appropriately changes in screen size, device orientation, , localization. try link learn size classes , auto layout. http://www.appcoda.com/introduction-auto-layout/

android - webview shouldOverrideUrlLoading doesn't work as expected? -

i have webview loads real url https://example.com i open links according pattern in second webview. i have following code: public boolean shouldoverrideurlloading(webview view, string url) { // handle external url boolean openinnew = manageurl (url); log.i("openurl", url + " : " + openinnew); if (openinnew) { this.callback.openwebview2 (url); return true; } else { return false; } } the second webview shows correctly external url want load. the problem found happens original webview, redirected empty blank page (with loading icon). is possible keep first webview in original page? thought shouldoverrideurlloading should enough. maybe forgot something, appreciate. thanks lot.

Draw 0 or more cardinality relationship in mysql workbench -

Image
how drawn 1: 0 or more relationship in mysql workbench? used manual assign method. don't drag , match method you can draw relationship , edit opening relationship editor via double click on relationship. select 1:n cardinality , uncheck "mandatory": of course use second relationship tool (hotkey: 2) drag 1:n relationship on canvas.

visual studio 2010 - VS2010 javascript debugger wants to launch in new instance of VS2010 -

when debug asp.net 4.0 application , hits debugger; javascript statement wants debug new instance of vs2010 an unhandled exception ('script breakpoint') occured in iexplore.exe how can make use vs2010 open? enabled script debugging in ie11. enabled script debugging in vs2010 -tools - options - debugging - 'just in time' also worked until recently. i turned on silverlight debugging applied, , turned off again. think did trick, because works now.

vim - how to delete all lines that match a pattern asking permission in vi -

hello i'm new vi , have problem making vi ask me permission delete line pattern. file looks this: seqres 1 46 gly ser glu ala arg glu cys val asn cys gly ala thr seqres 2 46 ala thr pro leu trp arg arg asp arg thr gly tyr seqres 3 46 leu cys asn ala cys gly leu tyr lys met asn gly seqres 4 46 gln asn arg pro leu ile arg i want delete lines contain string 'gly' this came to: :g/gly/cd but it's wrong only :substitute command has c onfirm flag. however, if use regular expression matches entire line (including trailing newline), can use delete entire lines, confirmation: :%s/.*gly.*\n//c alternatively, build own confirmation :global ; here's simple 1 have answer either enter or esc : :g/gly/if confirm('delete: ' . getline('.')) | delete _ | endif

c++ - ZigBee Arduino, Incorrect parsed datas -

i've got trouble make communication between 2 arduinos uno work. arduino1<>zigbee >---------- < zigbee < > arduino2 i'm trying make them understand each other. message going between 1st arduino zigbee second zigbee. arduino1<>zigbee>----------< zigbee--x-- arduino2 the problem is: when try parse, on arduino2 payload of incoming packet arduino1, messages differents. since i'm using zigbee api2, there's crc on message while travelling between zigbees (after investigations) i'm sure packet correct arriving on zigbee2 (if not, packet dropped). so main event now: memmove(received,xbee_rx.getdata(),24); when receive packet xbee.readpacket(); if (xbee.getresponse().isavailable()) { if (xbee.getresponse().getapiid() == zb_rx_response) { xbee.getresponse().getzbrxresponse(xbee_rx); memmove(received,xbee_rx.getdata(),24); (int = 0; < 24; i++) { serial.print(received[i],hex);...

javascript - Senchat Touch 2 : how to list data inside a scrollable panel? -

i trying build layout sencha touch 2.4 app. want page : a panel a list of data another panel and want global scroll. don't want scroll on list itself. list should take height needs contains data. i created fiddle : here is . see problem, reduce height of brower window. items not visible anymore. if replace flex:1 height:'400px' , see try obtain. i tryed set size of list when painted event triggered, : listeners: { painted: function() { this.setheight(this.itemscount*(this.getitemheight()+3)); } but getitemheight return size doesn't match real size of each element. there clean way i'm trying achieve ?

c# - What are self contained functions? -

so i've been assigned talk adding new code routines program such self contained functions , new classes, yet haven't been taught kind of programming terminology yet. i've tried looking online everywhere doesn't explain enough. the questions i'm little confused following: what self contained functions in c#? (code examples :3) , how added in object-oriented way? help appreciated, thanks. self-contained functions , classes , object-oriented pretty same thing @ high level you're talking about. http://en.wikipedia.org/wiki/object-oriented_programming i'm guessing code base mess, functions using global variables, , giant code files. goal make each item 1 thing. instead of function called "run" 500 lines long, should instead have function called "run" calls functions "getrecentdata", "checkdataforerrors", "reporterrors", "processvaliddata", , "reportsuccess". means whe...

c# - Running applications in Run and RunOnce Registry programmatically -

i have developed custom shell written in wpf/c# replaces explorer.exe shell on windows 8.1 system. runs fine, except run applications in run/runonce registry locations. main issue there seems no standard way of putting entries in registry - have double-quotes around entries, don't; run through rundll32 , have entry point defined followed comma-separated arguments; have space separated arguments; have few executables in 1 entry. there service or executable can call run these entries, or stuck trying figure out way parse best possible , using process.start()? thanks help! i had similar project @ work. following code more-or-less wrote. can't guarantee it's foolproof seemed work registries tested against. public static class processhelper { const string registrysubkeyname = @"software\microsoft\windows\currentversion\run"; public static void launchstartupprograms() { foreach (string commandline in getstartupprogramcomm...

ios - SWIFT - Property not seen outside viewdidload -

i try pass string vc1 vc2, value of tex passed property detailitem loaded viewdidload, , not in function viewcontroller 1: @iboutlet var tex: uitextfield! // prepare fore segue pass value of txt override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if segue.identifier? == "todo" { let navvc = segue.destinationviewcontroller uinavigationcontroller let itemvc: checklistviewcontroller = navvc.topviewcontroller checklistviewcontroller itemvc.detailitem! = tex.text } } viewcontroller 2: var detailitem : string! // can see value of tex in viewdidload override func viewdidload() { super.viewdidload() println("viewdidload \(detailitem)") tableview.rowheight = 44 } // here , in function below result nil. required init(coder adecoder: nscoder) { println("print init \(detailitem)") items = [checklistitem]() super.init(coder: adecoder) loadchecklistitems() } func documentsdirectory() -> stri...

google maps - Add Two library in android studio -

my application working fine in android studio when added library of google map.showing error. package com.iremember.kiet; import android.app.fragment; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import com.google.android.gms.maps.googlemap; //no error import info.androidhive.slidingmenu.r;// cannot resolve symbol r (when added library of google map) build.gradle apply plugin: 'com.android.application' android { compilesdkversion 18 buildtoolsversion "21.1.2" defaultconfig { applicationid "info.androidhive.slidingmenu" minsdkversion 11 targetsdkversion 17 } buildtypes { debug { debuggable true } release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile ...

PHP Ignoring all but last array element -

i'm playing around basic php site own knowledge , have text file filled "passwords". i've opened text file array page, when search specific element, password shows valid last option, , seems ignore every other element in array. so if password list is passwords 12345 test qwerty when search first 3 elements, says not exist in array. however, if searched last value, 'qwerty' here, match. <?php $file = explode("\n", file_get_contents("passwords.txt")); //call function , pass in list if (isset($_post['submit_login'])) { //set search variable $search = $_post['password']; search_array($file, $search); } else { //echo "you did not search! <br />"; //echo "<a href='searchform.html'>try again?</a>"; } function search_array($array_value, $search_query) { echo "<span><h4>the array list: </h4><span/...

Stop Ajax Events in Drupal 7 Form -

i'm faced drupal 7 problem , built-in ajax framework. fields registered step step when user fills them , final check made when form submitted (without js time). i'm using #ajax callback every field except submit button: $form['myfield'] = array( '#type' => 'textfield', '#default_value' => 'test', '#title' => 'test', '#ajax' => array( 'callback' => '_form_submit_callback', 'wrapper' => 'name-error-icon-container', 'method' => 'html', 'effect' => 'none', 'progress' => array( 'message' => null, ), ) ); //edit: callback asked function _form_submit_callback($form, &$form_state) { form_state_values_clean($form_state); //remove unuseful values $form_state['values'...

ios - using Twitter SDK to send tweet failed, but I'dont know why -

i'm using twitter sdk loggin , tweet. authenticate it's ok, when use twtrcomposer simple text, sdk callback return 'twtrcomposerresultdone', simulator/device show 'the tweet "text" cannot sent because connection twitter failed. debugger show 'plugin com.apple.share.twitter.post invalidated' aparently correct. is there bug or forgot thing. my code: twtrcomposer *composer = [[twtrcomposer alloc] init]; [composer settext:@"some text"]; [composer showwithcompletion:^(twtrcomposerresult result) { if (result == twtrcomposerresultcancelled) { nslog(@"tweet composition cancelled"); } else { nslog(@"sending tweet!"); } }]; tweet using sdk 1. crearte app on twitter.developer 2. add twitter frameworks twittercore.framework, twitterkit.framework, fabric.framework, twitterkitresources.bundle 3. write below code in tweet button ...

build.gradle - How can I specify gradle project properties in gradle.properties file? -

is possible specify project properties such name in gradle.properties file possible access them build.gradle using project.name ? i've tried no luck: name=some project.name=some org.gradle.project.name=some you can it. for example in root gradle.properties file can have: version_name=2.0.2 then in build.gradle file (in root folder) can have example: allprojects { version = version_name } if use in module build.gradle file can have: android { defaultconfig { versionname project.version_name } }

php - How to use xml_parse_into_struct() -

i have trying use xml_parse_into_struct() , returning false my code looks $p = xml_parser_create(); if (xml_parse_into_struct($p,$contenido,$vals, $index)) { print_r($vals); } the content of variable $contenido looks <saltest31> <anuncio1> <id>12346</id> <titulo> bd authority</titulo> <descripcion>preciosa casa en jardines de las animas, en xalapa veracruz. 550 m2 de terreno la mayoria jardin con arboles frutales, amplias recamaras, cocina, salon de juegos, terraza y palapa cvica123</descripcion> <fecha>11/12/2014 10:27:15</fecha> <municipio>chalchuapa</municipio> <moneda>peso</moneda> <construccion>500</construccion> <terreno>550</terreno> <habitaciones>5</habitaciones> <banos>4</banos> <imagenes> <total>10</total...

java - Spring boot Autowired Mongo Repository not working -

i trying connect spring boot application mongo db follwoing this tutorial. pretty simple, have class scanresults objects trying save in db when receive post request. following error on autowired. exception in thread "main" org.springframework.beans.factory.beancreationexception: error creating bean name 'application': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: public com.gandharv.iiitd.scanresultsrepository com.gandharv.iiitd.application.repository; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'scanresultsrepository': invocation of init method failed; nested exception org.springframework.data.mapping.model.mappingexception: not lookup mapping metadata domain class java.lang.object! @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues(autowiredannotat...

common table expression - PostgreSQL changes result when i play with offset, limit -

hi guys im using below query if change limit 10 or 20 results different i'm learning postgresql couldn't figure out problem there postgresql specific warning ? recursive children ( select id, name, 1 depth wapi_categories parentid = 1 , visible = true union select a.id, a.name, depth+1 wapi_categories join children b on(a.parentid = b.id) a.visible = true ) select wapi_issues.* (select distinct on(wapi_issues.publicationid) wapi_issues.* wapi_publications right join wapi_category_publication on wapi_category_publication.publication_id = wapi_publications.id right join ( select *, max(wapi_issues.issue_identifier) on (partition wapi_issues.publicationid) max_id wapi_issues wapi_issues.status = true order wapi_issues.issue_identifier desc ) wapi_issues on wapi_issues.publicationid = wapi_category_publication....

css - Sass / Compass in Symfony2 -

i try'in use scss files symfony2 , asseticbundle. my config.yml assetic part: assetic: debug: %kernel.debug% use_controller: false bundles: [] filters: sass: ~ compass: ~ #closure: # jar: "%kernel.root_dir%/resources/java/compiler.jar" #yui_css: # jar: "%kernel.root_dir%/resources/java/yuicompressor-2.4.7.jar" my base.html.twig : <!doctype html> <html> <head> <meta charset="utf-8" /> <title>{% block title %}welcome!{% endblock %}</title> {% block stylesheets %} {% stylesheets filters="compass" "@testbundle/resources/public/sass/main.scss" %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %} {% endblock %} <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" /> </he...

recursion - recursive function in c# get a parameter -

i'm trying parameter function... public static int subsumer(string id,int acc,sqlconnection connection) { acc++; sqlcommand cercas = new sqlcommand("select * common_relation id_source ='" + id + "' , type='@' ", connection); sqldatareader leggsyn = null; leggsyn = cercas.executereader(); int f = 0; while (leggsyn.read()) { f= subsumer(leggsyn["id_target"].tostring(),acc,connection); if (acc <= f) { acc = f; } } //siamo arrivati alla fine return acc-1; } each cycle parameter acc increment , debugging see in case reach value 3, in final recursion 0...i can't it...thank all by returning acc - 1 , decrementing f returned recursive call , don't think that's expect. public static int subsumer(string id,int acc,sqlconnection connection) { sqlcommand cercas = new sqlcommand("select * common_relation id_sou...

How to do times and device in mysql? -

i want take 2 values in ms devide them , *1000. select count_star exec_count, sum_timer_wait total_latency, (sum_timer_wait/count_star)*1000 'avg_latency(sec)' dbname the following working (sum_timer_wait/count_star) 'avg_latency(ms)' exec_count total_latency avg_latency(ms) 13 3282064379000 252466490692.3077 13 23618632000 1816817846.1538 1 10046560000 10046560000.0000 however when add *1000 convert seconds bad value (sum_timer_wait/count_star)*1000 'avg_latency(sec)' exec_count total_latency avg_latency(sec) 13 3282064379000 25246649069230.7692 13 23618632000 181681784615.3846 1 10046560000 1004656000000.0000 it not giving bad value rather extending values more decimal points. you can use floor nearest inetger value. try this: select count_star exec_count, sum_timer_wait total_latency, floo...

javascript - Three js render child mesh always before his parent -

Image
i have scene() , meshes: scene: scene.add(layer1) layer.add(layer2) layer2.add(layer3) wanted result is: layer1 covered layer2 , covered layer3. it works fine, when go far away camera, there start loss precision problem , looks this: (layers not correctly rendered 1 another) i tried solve materials, layer2.material.depthtest = 0; layer3.material.depthtest = 0; works fine, there problem object between camera , layers. do exist best practice solution?

javascript - How to add JS array to Meteor autoform entry -

i using meteor 1.1.0 , aldeed:autoform , need put values string array generated in template's js file document entry of type [string] during (or before) submit. how can that? the solution add before: hook in autoform.hooks insert: function in it, modify document entries ( work parameter must defined in schema ). example: autoform.hooks({ 'add-form': { before:{ insert:function(doc){ doc.fileid = '1234; // doc data form. return doc; // .fileid element try modify } } } });

c# - Unity 2D particle collision not getting event -

Image
when turn on particle system in 2d game, , check collision button in inspector window, expect event on-particle-collision , never happens! i added thing named worldparticlecollider , also, no collisions. i have tried adding worldparticlecollider enemy(just no reason), , sure did not work. screenshot: why ? according question @ unity forums onparticlecollision may not support 2d games now. according unity roadmap, feature available unity 5.3 (dec 8, 2015). maybe can use 3d collider 2d game. remember collider cannot trigger!

python - How to try all possible paths? -

i need try possible paths, branching every time hit point. there <128 possible paths problem, no need worry exponential scaling. i have player can take steps through field. player takes step, , on step there encounter. there 2 options when encounter found: i) input 'b' or ii) input 'g'. i try both , continue repeating until end of field reached. end goal have tried possibilities. here template, in python, talking ( step object returns next step using next() ): from row_maker_inlined import step def main(): initial_stats = {'n':1,'step':250,'o':13,'i':113,'dng':0,'inp':'empty'} player = step(initial_stats) end_of_field = 128 # walk until reaching encounter: while player.step['n'] < end_of_field: player.next() if player.step['enc']: print 'an encounter has been reached.' # perform input on encounter step: ...

javascript - Get element node count with jquery -

i don't know if can explain right... i have table this: <table> <tr> <td class="mytd">aaa</td> <td class="mytd">bbb</td> <td class="mytd">ccc</td> <td class="mytd">ddd</td> <td class="mytd">eee</td> </tr> </table> some jquery this: $('.mytd').on('click', function(e){ //... here ...// }); when click on td want node count of clicked td. e.g. if click on ccc want alert 3 is possible in way or have explizit add id ? $('.mytd').on('click', function(){ alert( $(this).index() ); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <table> <tr> <td class="mytd">aaa</td> <td class="mytd">bbb</td> ...

ruby on rails - How save multiselect values to database -

how can add values string field in database multiple select. i have field in database: t.string "types" and view: <%= f.select :order, [["one", 1], ["two", 2], ["three", 3]], {}, { :class => 'form-control', :multiple => true } %> maybe serialize or json goot idea? possible save , simple way read this? you can use rails serialize on column: serialize :order, hash or json (depending want it): serialize :order, json however, columns needs of type 'text' not 'string' serialize work, sure create migration change column type. rails g migration change_order_type_in_table_name class changeordertypeintablename < activerecord::migration def change_column :my_table, :order, :text end def down change_column :my_table, :order, :string end end

c - Linux: My char driver creates a node in sysfs but can not clean it after reloading -

i writting simple char driver. create node in sysfs device_create() , created properly. node in /dev automatically well. problem class_distroy() , device_destroy() don't clean /sys/devices/virtual/tdmcdev/tdm/ directory crated on init. init , close code below ... /* node in /dev/ */ tdm->dev_major = 0; //for dynamic major tdm_dev = mkdev(tdm->dev_major, 0); tdm->dev_major = major(tdm_dev); err = alloc_chrdev_region(&tdm_dev, 0, 1, "tdm"); //one node read/write data frame if (err) { printk("can't alloc minor /dev/tdm\n"); return -enodev; } cdev_init(&(tdm->cdev), &tdm_dev_fops); tdm->cdev.owner = this_module; err = cdev_add(&(tdm->cdev), tdm_dev, 1); if (err) { printk("cdev_add() failed /dev/tdm\n"); unregister_chrdev_region(tdm_dev, 1); return -enodev; } /* node /sys/devices/virtua...

r - Obtain combined standard errors of main and interaction term -

how combined standard error of main , interaction term? in model1 wish combined estimates progacademic , progacademic:math. i have provided sample data below: df <- read.csv("http://www.ats.ucla.edu/stat/data/poisson_sim.csv") df <- within(df, { prog <- factor(prog, levels=1:3, labels=c("general", "academic", "vocational")) id <- factor(id) }) mdel1 <- glm(num_awards ~ prog + math + prog*math, family="poisson", data=df)

Symfony configure Twig template for hinclude -

i trying obey http://symfony.com/doc/current/book/templating.html#asynchronous-content-with-hinclude-js setting hinclude don't contents of hinclude.html.twig , instead " ::hinclude.html.twig " displayed. in /app/config/config.yml have: templating: engines: ['twig'] hinclude_default_template: "::hinclude.html.twig" hinclude.html.twig resides in /app/ressources/views/default/hinclude.html.twig , nothing more than: loading.... the actual content loaded correctly hinclude.js instead of displaying loading... displays template path in config file: ::hinclude.twig.html also these configurations not work: hinclude_default_template: ::hinclude.html.twig hinclude_default_template: "hinclude.html.twig" hinclude_default_template: hinclude.html.twig how can use twig template? thanks! it figured out misconfiguration... this doesn't work: hinclude_default_template: "::hinclude.html.twig" hinclude_d...

vba - Conditional formatting, select only visible cells -

i have written code select specific sheets , on button click email data of selected sheets. in 1 sheet there conditional formatting applied on dropdown list. so requirement when dropdown option 1 chosen, below 2 cells not visible. secondly when dropdown option 2 selected cells visible. with code gets selected. i tried code : overallrange = activesheet.range("c1:d50").specialcells(xlcelltypevisible).select can advice better ways this.... you're headed right way, see sniplet below: sub ert() dim rng range each rng in activesheet.range("c1:d50").specialcells(xlcelltypevisible) rng.select selection .formatconditions.add type:=xlexpression, formula1:="=true" 'replace formula .formatconditions(selection.formatconditions.count).setfirstpriority .formatconditions(1).stopiftrue = false .formatconditions(1).interior.color = 49407 'give touch of orange end next end sub p.s. noone t...

javascript - Radio Buttons with X-editable -

i've started using http://vitalets.github.io/x-editable/ jqueryui. i used input text , select menus, , next wish implement radio buttons. ux should same other input types (i.e. user clicks text, 2 or more radio buttons popup along enter , cancel icon). is possible, , if so, how? the following script works necessary... https://gist.github.com/taivo/da6d47c7b291f71b9502

Spring MVC: Does this code make child-parent relationship between two context? -

i have learned how configure spring mvc without web.xml , .xml files parent , child context link . saw how programmatically make context hierarchy in the official spring docs follow. applicationcontext parent = new genericxmlapplicationcontext(parentannotationconfig.class); genericapplicationcontext child = new genericapplicationcontext(parent); but post the link don't have similar statements above ones. code make context hierarchy between 2 context or not? the code link submitted uses spring mvc. programmatic method show independant of spring mvc. makes big difference. spring mvc automagically creates parent child relations between root context , dispatcher servlet context(es). wepapp should have : one single root context referenced in servletcontext . supposed used not directly related servlet : model, persistance , filters can exist independantly of servlet one context per dispatcher servlet constructed root context parent. supposed used controllers, vi...

arrays - PHP: "Notice: Undefined variable", "Notice: Undefined index", and "Notice: Undefined offset" -

i running php script, , keep getting errors like: notice: undefined variable: my_variable_name in c:\wamp\www\mypath\index.php on line 10 notice: undefined index: my_index c:\wamp\www\mypath\index.php on line 11 line 10 , 11 looks this: echo "my variable value is: " . $my_variable_name; echo "my index value is: " . $my_array["my_index"]; what these errors mean? why appear of sudden? used use script years , i've never had problem. what need fix them? this general reference question people link duplicate, instead of having explain issue on , on again. feel necessary because real-world answers on issue specific. related meta discussion: what can done repetitive questions? do “reference questions” make sense? notice: undefined variable from vast wisdom of php manual : relying on default value of uninitialized variable problematic in case of including 1 file uses same variable name. majo...

java - Debug JSP using Eclipse and JBoss -

i need debug jsp files using eclipse , jboss. have big project. have made remote debug. configured jboss , created debug configuration in eclipse. if put breakpoint in place inside java class - works , execution stops @ breakpoint. i'm trying same thing inside jsp file execution doesn't stop @ breakpoint. should make jsp breakpoints work? after building , compilation i'm getting ear file. i'm using eclipse luna java ee developers , jboss application server 7.1.1. i'm setting breakpoints on java code inside jsp file. jboss starts with bat file: @echo off rem ------------------------------------------------------------------------- rem jboss bootstrap script windows rem ------------------------------------------------------------------------- rem $id$ @if not "%echo%" == "" echo %echo% @if "%os%" == "windows_nt" setlocal if "%os%" == "windows_nt" ( set "dirname=%~dp0%" ) else ( s...

Send job results to sql table -

ok newb question here: i trying create query job log query table. select login_name, total_elapsed_time, total_elapsed_time sys.dm_exec_sessions when use creates new table. want create new record in existing table query_results. use insert select this insert query_results(login_name, total_elapsed_time, total_elapsed_time) select login_name, total_elapsed_time, total_elapsed_time sys.dm_exec_sessions

php - How to effeciently track dependency version changes? -

i'm working on php driven website has number of dependencies via composer . recently, dependency had minor version (as per semver ) change backwards compatibility breaking change in it. website broke unexpectedly. updated dependency version number more precise, 1.2.16 instead of 1.* . but makes versions harder track, because minor versions change often. how keep track of dependencies in way both simple , avoids breaking changes break project ?

mono - Monodeveloper run current project -

how can make mono developer run ( ctrl+f5 ) current project i'm on, in solution more 1. in solutions startup options can choose run specific project or multiple @ same time. there option run "current selection" in visual studio ? in solution window can right click project , select either run item or start debugging item . run item run without debugger, whilst start debugging item run debugger.

python - How to import a module given the full path? -

how can load python module given full path? note file can anywhere in filesystem, configuration option. for python 3.5+ use: import importlib.util spec = importlib.util.spec_from_file_location("module.name", "/path/to/file.py") foo = importlib.util.module_from_spec(spec) spec.loader.exec_module(foo) foo.myclass() for python 3.3 , 3.4 use: from importlib.machinery import sourcefileloader foo = sourcefileloader("module.name", "/path/to/file.py").load_module() foo.myclass() (although has been deprecated in python 3.4.) python 2 use: import imp foo = imp.load_source('module.name', '/path/to/file.py') foo.myclass() there equivalent convenience functions compiled python files , dlls. see also. http://bugs.python.org/issue21436 .

How do you configure PHP to use mysql instead of sqlite -

i have php 5.3 , mysql 5.1 installed on centos. php uses sqlite default, how can configure php use mysql instead? if drupal doesnt recognize mysql valid database backend, mysql doesnt seem installed correctly. try yum install mysql mysql-server php-mysql chkconfig --levels 235 mysqld on /etc/init.d/mysqld start mysql_secure_installation and restart apache with /etc/init.d/httpd restart then try again configure drupal.

Adding things to a git bare repository -

i know if have files in bare repository, can access them using git show head:path/to/file . but can add new content bare repository without cloning , modifying working tree? if add 1 file, 1 file in commit, aka added new , it's set in stone there's several convenient ways add single-file commit tip of master branch in bare repo. so appears need create blob object, attach tree, attach tree object commit. all ways commit boil down doing that, it's question of how convenience commands suit purpose. git add creates blob , makes entry in index; git commit git write-tree adds new trees what's in index, , git commit-tree adds commit of top-level resulting tree, , git update-ref keep head date. bare repos have head commit, attached (aka symbolic ref for) branch master , . . . so git's convenience commands doing want. 1 file, going easy. say example files appear in ~server/data/logs/ , bare repo you're using distribution @ ~serve...

php - Sorting query result to associative array with optional keys -

using php running query on database , result data-set optional values. example: result: array ( [0] => array ( [attribute_1] => red, [attribute_2] => car, [name] => sportscar ) [1] => array ( [attribute_1] => red, [attribute_2] => , [name] => rose ) ) i want format resulting data such: array ( [red] => array ( [car] => array ( [0] => sportscar ) ) [0] => rose ) so access sportscar by $array['red']['car'][0]; and rose by $array['red'][0] this make easier output data nice little foreach loop. of course actual case bit more complex lot more values etc example demonstrates principle. the problem can't think of proper way format data efficiently. not recursive @ least not 1 million if , elses nice. any...

xcode SpriteKit New game template -

hi i'm trying learn spritekit tutorials have read game template has gameview.swift file , gameview.sks file , loads hello world click on screen adds sprite of space ship. the 1 xcode 6.2 has no gameview.swift or gameview.sks file i've tried adding these going add new file cocoa touch class subclass of skscene add import spritekit new file resources spritekit scene but can't seem work ? there tutorial i'm missing of how this. hope can point me in right direction cheers

Release Management and Dsc - How to queue a build when a release is in progress? -

i have vso , release management 2013.4 working , deploying azure vm's via dsc the build profile set trigger on commit git repo , release template set triggered on successful build tfs however if developer commits in quick succession resultant builds cause releases overlap in rm? - causes of releases fail dsc error ("the consistency check or pull cmdlet in progress....") is there way force rm prevent concurrent releases? (based on same release template , build profile)

java - How to aviod comma in jstl -

i use format tag print decimal value using below code. <fmt:formatnumber value="${scorecomponentnormalization.rangeend}" maxfractiondigits="1" /> my expected value is: 2000 but in prints: 2,000 how avoid comma.any appreciated!!! use following in fmt:formatnumber tag groupingused="false" /> since default true

iText -- how to associate actions with graphical object? -

Image
i haven't been able find solution itext problem either here in itext in action book, , appreciate suggestions. want include technical diagrams, composed of rectangles, lines, etc. in pdf such diagram can float image would, such can associate pdf actions graphics objects such rectangles. need extend itext this? for now, drawing graphics wmf package , inserting wmf image, cannot associate actions way or put graphical objects in layers. please take @ addlinkimages example. @ first, planned use wmf files (as per request), didn't find many, used png, bmps , single wmp. you want these images added other object, want add action them. can achieved wrap image inside chunk described in chapter 2 of book. once have chunk , can define pdfaction triggered when chunk (or in case, image wrapped in chunk) clicked: public chunk createimage(string src, string url) throws badelementexception, ioexception { image img = image.getinstance(src); chunk chunk = new chunk(i...

c# - Windows default shell and path not found -

i've changed windows default shell application , everythings ok. aplication in c# , need run external python scripts, , here error because path variable not found. i've tried set path started process : process.startinfo.environmentvariables["path"] = "c:\\python27;c:\\python27\\scripts"; this dosen't work. the problem path variable not loaded because i've changed default windows shell explorer.exe dosent come up. thank you.

javascript - getElementsByTagName for a specific form in jquery -

i'm trying write generic javascript function (using jquery) acquire input elements on specific form - , return them json. function getformdataasjson(sformid) { // read input attributes form; return json var form = $(sformid); if (form != null) { var inputs = $('input', form); var json = {}; for(i = 0; < inputs.length; ++i) { var next = inputs[i]; var key = $(next).attr('id'); var val = $(next).val(); if( val != null && key != null) json[key] = val; } return json; } } the error above in line: var inputs = $('input', form); where form form object. how can input elements in given form? $("form").each(function(){ $(this).find(':input') //<-- should return input elements in specific form. }); or can use var form = $('#'+sformid); this you.

javascript - Highcharts tooltip not displaying corrosponding text value, instead displaying 'undefined' -

i have list of text values corresponding score values (value x , value y). able plot dot @ intersection of value x , value y. hovering on dot displays location value of dot on x,y coordinates corresponding text value displaying unidentified. <script> var array = @html.raw(json.encode(viewbag.items3dlist)); var practicalityscore = []; for(var in array){ var serie = new array(array[i].yaxis, array[i].avgipa, array[i].title); practicalityscore.push(serie); } $(function () { var chart = new highcharts.chart({ chart: { renderto: 'practicalityscore', zoomtype: 'xy', defaultseriestype:'scatter', borderwidth:1, bordercolor:'#fff', marginleft:50, marginright:50, backgroundcolor:'#fff', plotbackgroundcolor:'#fff', }, ...