Posts

Showing posts from July, 2011

android - Adding NumberPicker to AlertDialog -

short version: i want display horizontal numberpicker on right hand side of each item of "single-choice-items" alertdialog . long version: i using alertdialog of "single-choice-items" type. works fine. displays list of strings want. now, want use numberpicker (with numbers 1 5) "single-choice-items" alertdialog . want numberpicker displayed horizontally, on right-hand-side of each of strings of alertdialog . i have no idea how modify "usual" alertdialog achieve this. please help! you can build own layout alertdialog inflate layout before call show(). alertdialog.builder builder = new alertdialog.builder(getcontext()); alertdialog dialog = builder.create(); dialog.setview(getlayoutinflater().inflate(r.layout.my_own_alert_with_picker,null)); dialog.show();

vtk - vtkAngleRepresentation2D calculation bug? -

i use vtkanglerepresentation2d (with vtkanglewidget) vtk 5.x. seems class provides different values same angle. representation draws current angle value on vtk window (e.g. 103.205), method getangle() provides minimal different value (e.g. 103.408)? does know why or how avoid behavior? want both interfaces provide absolute same value. regards, michael

asp.net - AJAX Control Toolkit: TabPanel Visible=false causes other tab panels to show mixed content when changing ActiveTabIndex -

i updated toolkit version 30930 (sep 2009) 7.1213 (dec 2013) on project containing complex implementation of tabcontainer. before update had no issue @ page , tabcontainer in general, referenced new toolkit version found out strange behaviors. reduced in simple, basic standalone page, follows: aspx page <%@ page language="c#" autoeventwireup="true" codebehind="tabcontainersample.aspx.cs" inherits="sampleproject.tabcontainersample" %> <%@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="cc2" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="head1" runat="server"> <title>tabcontainer tab not visible issue test page</title> </head> <body> <form id="form1" runat="server"> <cc2:toolkitscriptmanager id="toolkitscriptmanager1" runat="server"...

c# - Is this a good way to check if only one instance of a class exists without resorting to using the Singleton pattern? -

i have class in program of want 1 copy. don't want use singleton pattern though couple of reasons (* see below). know i'll have 1 copy of class because i'll 1 calling constructor. in class's constructor, want check 1 copy of class exist , throw exception if more 1 exists. code below pattern use case? public class mysingletonalternative : idisposable { private static int _count = 0; public mysingletonalternative() { int newvalue = system.threading.interlocked.increment(ref _count); if (newvalue > 1) { throw new notimplementedexception(); } } public void dispose() { int newvalue = system.threading.interlocked.decrement(ref _count); if (newvalue < 0) { throw new objectdisposedexception("mysingletonalternative"); } } } * why don't want use singleton: i want able control when class created. in traditional c# singleton pa...

http - MP4 - Prepare header for pseudostreaming requests -

assuming client not support byte-range requests , therefore make requests test.mp4?startoffset=2000 how can server prepare mp4 header works requests... there bare minimum works every time or must actual original header? similarly, there way use ffprobe export original header as-is (i.e. binary format) can resent @ beginning of each request, server? thanks! edit: did digging around using atomicparsley , looking @ pseudostreamed videos via archive.org. seems "header" need reconstructed new stream. specifically, moov atom , mdat data. putting aside mdat now, there helpful libraries out there convert moov moov, or @ least make easier? no c++ please, c fine

postgresql - Ignore duplicates when importing from CSV -

i'm using postgresql database, after i've created table have populate them csv file. csv file corrupted , violates primary key rule , database throwing error , i'm unable populate table. ideas how tell database ignore duplicates when importing csv? writing script remove them csv file no acceptable. workarounds welcome too. thank you! : ) on postgresql, duplicate rows not permitted if violate unique constraint . think best option, import csv file on temp table has no constraint, delete duplicate values, , import temp table final table.

outlook - Have ICS file with multiple events save to my Calendar, not Other Calendars -

Image
when convert excel spreadsheet csv file... convert csv file ics file... can open ics file single event inside, , accept meeting invitation, added calendar. (using app conversion) http://icsconverterwebapp.n8henrie.com/ the problem is, if put multiple rows in excel spreadsheet, final ics version opens "other calendars" can make ics file items added calendar, , not "other calendars"? i've read online seems common... not unique web app being used. here .ical looks when opened in notepad begin:vcalendar version:2.0 prodid:n8henrie.com begin:vtimezone tzid:eastern standard time begin:standard dtstart:16011104t020000 rrule:freq=yearly;byday=1su;bymonth=11 tzoffsetfrom:-0400 tzoffsetto:-0500 end:standard begin:daylight dtstart:16010311t020000 rrule:freq=yearly;byday=2su;bymonth=3 tzoffsetfrom:-0500 tzoffsetto:-0400 end:daylight end:vtimezone begin:vevent summary:xxxxxxxxxxxxxxx dtstart;tzid="eastern standard time":20140207t073000 dtend...

c# - Generic type whose type parameter is an abstract base class -

let's have base class named animal , 2 derived classes named lion , tiger . , i'd have generic type named animallist<animal> contain members of animal . example: var list = new animallist<animal>(); list.add(new lion()); list.add(new tiger()); very straightforward far there's catch...i'd base class animal abstract . is, i don't want allow instance of base class created. however, making base class abstract not surprisingly results in error cs0310 (see complete example below). i did come solution: make base class non-abstract required , throw exception default (parameterless) constructor: public animal() { throw new system.notimplementedexception(); } but makes me feel little uneasy. is there better way? here's complete example illustrates scenario describe above: // public class animal {} // ok public abstract class animal {} // 'abstract' keyword causes error 'cs0310' public class lion : anim...

entity framework - Where is the LocalDB database stored? -

i wanted test multiple approaches in building app (db first, model first, code first). after using t4scaffolding , having lots of issues db post modifications, though ef not enough flexible. have found weird thing. left single 'defaultconnection' specified in web.config , pointing single .mdf file in app_data folder of solution. using code-first approach, i've created entities (classes), scaffolded repositories, context, seems work fine, except data stored before 'deleted' , updated db. but, after checking in vs server explorer, database contains tables used identity (users, roles), , shows me actual database somewhere else. suspect located @ 'c:\users{myuser}\appdata\local\microsoft\microsoft sql server local db\instances'. cannot open .mdf files there check, since in use. stuck. data??? forgot mention have 2 contexts in application, therefore receive warning in pm console: "more 1 context type found in assembly ...". howerver, first '...

Calling Scala Method from Java - Set<Object> or Set<Long>? -

java set<long> set = new hashset<long>(); set.add(100); long x = 2; foo(x, set); scala def foo(a: long, b: java.util.set[long]) error: could not parse error message: required: long,set<object> found: long,set<long> reason: actual argument set<long> cannot converted set<object> method invocation conversion then, modified java code resolve compile-time error. set<object> set = new hashset<object>(); however, resolution of compile-time error came @ expense of type safety. how can resolve above error? edit after @som-snytt resolved issues here , ran problem. don't think it's same question since , in linked question, using, in scala, foo(long, java.util.set[long]) worked when calling (from java) scalaobject.foo(long, set[long]) the types wrong. type of set in java code java.util.set[java.lang.long] , while type in scala java.util.set[scala.long] . scala.long type trea...

c# - Checkbox not working in asp.net and HTML mixed page -

Image
i'm grappling issue site asp.net/c# controls on .aspx pages html , i'm not sure how go on if change asp.net controls. change minor. tasked add check box, in <input type="checkbox" name="disablefeaturemanager" runat="server" id="disablefeaturemanager" />disable feature manager , in .cs page want check if box checked , make decisions based on that, control's checked property false . submit button html control: <input type="submit" value="start" name="submitbutton" /> in page_load ckecking if check returns false. if (disablefeaturemanager != null && disablefeaturemanager.checked) nexturl.append(featuremanagerchoices.createquerystringfromformdata(request.form)); you keep checkbox html server control doing following: <input type="checkbox" name="disablefeaturemanager" runat="server" id="disablefeaturemanager" /> then c...

Consuming Rest Web Service with Bottle (JQuery and JSON) -

i want consume rest web service returns json response: web_service.py from bottle import route, run @route('/example') def example(): return {"result_1" : 3, "result_2" : 5} run(host='localhost', port=8080) my javascript file this: java_s.js $(document).ready(function() { $.ajax({ type: "get" url: "http://localhost:8080/example", contenttype: "application/json; charset=utf-8", datatype: "json", success: function(resp){ $('.result_1').append(resp.result_1) $('.result_2').append(resp.result_2) } }) }); and html file want cosume web service is: index.html <head> <title>example</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="java_s.js"></script> </head> ...

Python - ast - How to find first function -

i'm trying find first function in arbitrary python code. what's best way this? here's i've tried far. import ast import compiler.ast code = """\ def func1(): return 1 def func2(): return 2 """ tree = compiler.parse(code) print list(ast.walk(tree)) but i'm getting error don't understand. traceback (most recent call last): file "test.py", line 15, in <module> print list(ast.walk(tree)) file "/usr/lib64/python2.7/ast.py", line 215, in walk todo.extend(iter_child_nodes(node)) file "/usr/lib64/python2.7/ast.py", line 180, in iter_child_nodes name, field in iter_fields(node): file "/usr/lib64/python2.7/ast.py", line 168, in iter_fields field in node._fields: attributeerror: module instance has no attribute '_fields' use ast.parse , not compiler.parse : >>> import ast >>> >>> code = ""...

visual studio - How to show / unhide Web Essential bar from chrome? -

Image
i've checked autohide , bar disappeared how can see again? to see web essentials menu in chrome when using visual studio 2015: ensure you've installed web essentials 2015 - https://visualstudiogallery.msdn.microsoft.com/ee6e6d8c-c837-41fb-886a-6b50ae2d06a2 click 'view in browser' button in visual studio view site: the web essentials menu appear overlay @ bottom of web page press ctrl in chrome toggle web essentials menu on or off

How do I get the value inside a value in JSON with VB.NET -

i using visual studio 2010 , coding in visual basic. have json file , read through , can name , value of item. cannot name , value of item inside value of item. can "page-1.htm" , in braces "page-1.htm", cannot "title" or "safety". know can "safety" if know "title" there item("title").value, can see items have title , have numbers cannot info out way. here json { "page-1.htm":{ "title": "safety", "001": "1. purpose", "002": "2. definitions" }, "page-2.htm":{ "title": "testing", "001": "test first", "002": "test again", "003": "final test" }, "page-3.htm":{ "title": "once again" } } here start of vb try dim r...

First time parsing XML in Python: this can't be like like it was meant to be, can it? -

i need read data xml file , using elementtree. reading number of nodes looks atm: def read_edl_ev_ids(xml_tree): # read edl events (those start "edl_ev_") xml # , put them dict # symbolic name key , number value. xml looks like: # <...> # <compu-method> # <short-name>dt_edl_eventtype</short-name> # <...> # <compu-scale> # <lower_limit>number</lower-limit> # <....> # <compu-const> # <vt>edl_ev_symbolic_name</vt> # </compu-const> # </compu-scale> # </compu-method> edl_ev = {} node in xml_tree.findall('.//compu-method'): if node.find('./short-name').text() == 'dt_edl_eventtype': subnode in node.findall('.//compu-scale'): lower_limit = subnode.find('./lower-li...

sql server 2005 - SQL Agent job hangs on packages with Execute Process Task -

Image
i have ssis package execute process task, runs 7zip exe zip file. works fine when run ssis. when run ssis sql agent hangs. assume permission. have given full control network services , sqlsvc folder has zip exe , folder extracting to. still no luck. should make ssis run th e sql agent. i have created proxy account has administrator privilege , change job step "run as" property new proxy account instead of sql agent service account. think sql agent service account doesnt have access run process. can change sql agent serice account group policies make work.

oop - javascript inheritance for namespace -

i new oop in javascript. var obj1 = { name : 'honda', getname : function(){ console.log(this.name); } } var obj2 = {name:'maruti'}; i want access getname of obj1 scope of obj2 , obj2.getname() . is want: obj1.getname.call(obj2); as @roland said, can use .apply(obj2, [arr of args]) if want provide array of arguments method. edit: if want import obj1 methods obj2 , can pure javascript: for (var m in obj1) { // if want copy obj1's attributes, remove line if (obj1[m] instanceof function) { obj[2][m] = obj1[m]; } } or can jquery: $.extend(obj2, obj1);

json - Javascript - Stingify : formatting numbers for Google charts -

i trying understand why 2 below code not produce same output. data in datatable formatted: 11254 shows 11,254. view.setcolumns([1, { calc: "stringify", sourcecolumn: 1, type: "string", role: "annotation" }]); the above creates 2 column. 1 original column 1 datatable. second 1 string annotation of chart. numbers end being formatted: 11,254. view.setcolumns([1,{ role: "annotation", type: "string", calc: function (dt, row) { if dt.getvalue(row, 1) == 0) { return ""; } else { return json.stringify(dt.getvalue(row, 1)); } } }]); in case numbers converted string not formatted anymore: 11254 instead of 11,254. 2 stringify function not same? the "stringify" function not documented, based on observation, returns formatted value of cell. second function returning string based on value, not formatted value, of cell. if...

jquery - Javascript: Prevent limitations on ajax requests on localhost? Just get XHR "pending" -

Image
firstly, let me clarify these requests coming , localhost on osx. the calling, , receiving scripts both on localhost under same domain in hosts. after few requests, xhr requests show pending. interestingly though ones external sources facebook/soundcloud continue work... here can see point @ start pending: any suggestions appreciated. ps. not consumer facing / production code, one-time script i run once myself parse apis db...

node.js - How to hide HTML and other Content in EJS and Node -

having tough time doing simple web site in ejs. i have set in server file: //use .html extension instead of having name views *.ejs server.engine('.html', require('ejs').__express); // avoids having provide extension res.render() server.set('view engine', 'html'); //set directory serve css , javascript files server.use(express.static(__dirname, '/views')); this works great. have html files, have graphics, have css. serving simple controller renders page. nothing dynamic in these pages. want them protected id/password system, , served through express. the access works fine, have end point set serve them. i'm forcing log in in end point. problem is, if knows actual path files, can @ them. so, access localhost:8081/admin/documentation/. however, files @ /views/app_documents. , entering in localhost:8081/views/app_documents/file_name.html, can download/view content, without going through controls. moved conte...

ruby - Why do I get invalid attribute error when I pass in a css selector? -

stackoverflow, here's i'm trying do def get_element_from_list(root, item, index) @browser.elements(:css => root).each |element| if element.present? return element.element(:css => item, :index => index) end end raise selenium::webdriver::error::nosuchelementerror end get_element_from_list('div[class*=x-combo-list]', 'x-combo-list-item', index).click gives me watir::exception::missingwayoffindingobjectexception: invalid attribute: :css what don't understand if do @browser.elements(:css => 'div[class*=x-combo-list]').each |element| if element.present? return element.element(:css => 'x-combo-list-item', :index => index) end end basically replacing root , item actual strings works without error. i think there might bug prevents locating elements :css , :index locator - issue 241 . you can work around issue getting element collection , getting element @ specific index: ret...

java - Spring constructor-arg not correct type -

i have following in context.xml: <bean id="mybean" class="org.stuff.morestuff.classclass" destroy-method="quit"> <constructor-arg name="someaddr"> <bean class="java.net.url"> <constructor-arg type= "java.lang.string" value="http://something@ondemand.saucelabs.com:80" /> </bean> </constructor-arg> <constructor-arg name="argtwo" ref="stability"/> </bean> i failed load application context error due to: constructor threw nested exception; java.lang.classcastexception: java.lang.string cannot cast java.util.map. i have looked , '@' not special character , should not need escaped (there no escape sequence regardless). url type string, still being parsed map spring. does know way around this? thanks.

c# - How to merge xml app.config files outside of the build process -

i use app.config files settings, don't want have select different build configurations select settings use, rather build in release , app.config file different when application deployed. what way merge 2 xml files can deploy correct settings correct environment? have found several solutions based on selecting different build configurations , transform happens @ build time, want transform command line utility deploy script can run at company, use web config transformation runner , available on github. may invoked directly command line, bit this: d:\utils\webconfigtransformrunner.exe app.config app.production.config app.config we've incorporated larger packaging , deployment process handle deploying our various environments.

java - Call to jFrame from jInternalFrame does not work -

i have main jframe homepage.java , many other classes extend javax.swing.jinternalframe . 1 of classes (jinternalframe) login.java . check whether password correct in login.java , if password correct, load success.java . problem arises when have load success.java page. have function in homepage.java purpose remove internal frames , load success.java class. function follows :- public void login(){ jdesktoppane1.removeall(); system.out.println("pos 2"); success frame = new success(); frame.setvisible(true); jdesktoppane1.add(frame); setcontentpane(jdesktoppane1); try { frame.setselected(true); } catch (java.beans.propertyvetoexception e) { } } i call function in login.java page follows :- system.out.println("pos 1 "); (new homepage()).login(); the logic not work. but, receive output pos 1 pos 2 which shows program flow correct. not error also. weird factor when calthe same login() function menu in jfram...

Regex - how to get time and date and get ISO8601 timestamp -

i have text 2014-01-30 10:15 text here 2014-01-30 10:20 other text here i need regex matches timestamp group in iso 8601 format. required output: 2014-01-30t10:15z 2014-01-30t10:20z with regex can't want, replace space 't' , append 'z @ end. ^(?<timestamp>\s+ \s+) does know how solve problem? --- update --- btw, i'm using http://rubular.com/ test regex you perhaps modify current regex bit to: ^(\s+) (\s+).* and replace $1t$2z regex101 demo

java - Obtain float[] or int[] from BufferedImage -

i trying use tone mapping code here . has function: public void tonemap(final float[] image, final byte[] rgbout) { (int = 0; < image.length; i++) { final float clamped = math.max(0, math.min(1f, image[i])); rgbout[i] = (byte) (0xff & (short) (clamped * 255.0)); } } it takes in float array , byte array of images , applies simple clamping pixel values. tried: int[]rbg=((databufferint) image.getraster().getdatabuffer()).getdata(); but got following exception: java.lang.classcastexception: java.awt.image.databufferbyte cannot cast java.awt.image.databufferint other stackoverflow answers have explained why so. i have image file want apply function file. know can read image bufferedimage using imageio.read() . how float[] rgb it? possible? or there other libraries available can me conversion image float[] rgb array of pixels? edit: as few people have mentioned in comments code above nothing pixel values in rang...

numpy - finding cell coordinates between two points in meshgrid using python -

i have meshgrid defined as: from numpy import * x = arange(0,1107,1) y = arange(0,1129,1) xx,yy = meshgrid(x,y) i trying coordinates of cells lying between 2 end cells. eg, coordinates of cells lying between (435, 550) , (987, 980) when these 2 points joined straight line. finding cell coordinates, through straight line passes. nice. in advance. the problem trying solve equivalent drawing line in 2d array of pixels. have @ this: http://en.wikipedia.org/wiki/line_drawing_algorithm , http://en.wikipedia.org/wiki/bresenham%27s_line_algorithm you have precisely define mean "between", ie cell (x,y) included if line between xstart,ystart , xend,yend intersects rectangle (x,y,x+1,y+1). (or: want line @ xstart+0.5,ystart+0.5 etc?)

c++ - Clarification on postfix/prefix operators on iterators -

in accelerated c++ andrew koenig writes following code introduction templates , generic functions. code skip first element in container? or copy first iterator object before incrementing: template<class in, class out> out copy(in begin, in end, out dest) { while (begin != end) *dest++ = *begin++; return dest; } in other words, behave code?: template<class in, class out> out copy(in begin, in end, out dest) { while (begin != end) *dest = *begin; dest++; begin++; return dest; } post incrementing iterator (or else matter) may confusing doing pretty straight forward. makes copy of value, increments original , returns copy. location being referred "*dest++" same "*dest", difference after statement finishes dest refer next iteration in iteratable. the problems arise when programmers use incremented variable repeatedly in same expression. (which used brain teaser , resulting effect varies language language)

Issues with some vb6 datagrids on Windows 7 -

i apologize in advance long question... i have large project written in vb6 need use on windows 7 pcs. there many forms datagrids on them. 3 of these datagrids buggy in sense (a) have remnants of on screen before datagrids shown (portions of desktop, or other parts of application underneath datagrid) , (b) clicking, highlighting, , scrolling doesn't work (selection of 1 row doesn't de-select row, scrolling 1 way doesn't let scroll back, among other bugginess). additional info: on windowsxp , win7 32-bit, problem not appear; appears on win7 64-bit if vb6 installed (yes, numerous errors along way) on win7 64-bit machine, problem disappears there issues 1 other grid's rows being blacked out , many of textboxes in app being dark , hard read (on both win7 32 , 64-bit), corrected in both cases switching windows 7 classic theme (aero off) what have tried: manipulated msdatgrd.ocx many times. copied working winxp, win7 32-bit, , original vb6 sp6 installatio...

symfony - How to make JOIN with OR expression in DQL? -

here sql equivalent of expect doctrine: select c.* comments c left join articles on a.id = c.articles_id or a.translation = c.articles_id c.published = 1 , c.language = a.language the problem cannot make doctrine generate join operation or supposed be. if execute query following querybuilder object: $qb->select('c') ->from('project:comment', 'c') ->leftjoin('c.article', 'a', 'with', 'a = c.article or a.translation = c.article') ->where('c.published = true , c.language = a.language'); we receive following sql statement: select ... comments c0_ left join articles a0_ on c0_.articles_id = a0_.id , ( a0_.id = c0_.articles_id or a0_.translation = c0_.profiles_id ) c0_.published = 1 , c0_.language = a0_.language which not same initial query, with operator seems add additional conditions basic 1 instead of replacing whole condition. is there way force doctrine output need? ...

java - Stage don't show up When call -

i'm trying menu option of game i'm creating. screen use tablelayout can't work. black screen. see : package com.me.mygdxgame; import com.badlogic.gdx.gdx; import com.badlogic.gdx.screen; import com.badlogic.gdx.files.filehandle; import com.badlogic.gdx.graphics.gl20; import com.badlogic.gdx.scenes.scene2d.actor; import com.badlogic.gdx.scenes.scene2d.stage; import com.badlogic.gdx.scenes.scene2d.ui.checkbox; import com.badlogic.gdx.scenes.scene2d.ui.label; import com.badlogic.gdx.scenes.scene2d.ui.skin; import com.badlogic.gdx.scenes.scene2d.ui.table; import com.badlogic.gdx.scenes.scene2d.utils.changelistener; import com.badlogic.gdx.scenes.scene2d.utils.clicklistener; public class bluetoothoptionscreen implements screen{ final stage stage; skin skin; boolean hote = false; table table; public bluetoothoptionscreen() { this.stage = new stage(gdx.graphics.getwidth(), gdx.graphics.getwidth(), true); filehandle skinfile1 = gdx.f...

bpm - Evaluation of Activiti as Continuous Integration orchestrator -

i'm working in devops space , supporting overly complicated ci system. purpose test & certify multiple java artifacts against tests every single artifacts , artifacts against each other. have multiple jenkins instances , complicated custom workflows, share same limitation: lack of resources control. ended bunch of purely technical jenkins jobs deal limitations aren't perfect , initial workflow became bloated. here i'm asking expertise applicability of activiti bpm engine ci process. we have following issues current process: cloud nodes can handed-over 1 jenkins job another. if workflow became terminated in middle (let's functional tests failed on newly built artifact) have free nodes. jobs can consume multiple resources - databases, environments of multiple nodes, etc. resources must freed when workflow finished ideally, should able define workflow steps in dsl , bind resources steps. later on, during workflow execution, possible workflow engine deter...

objective c - ios - does it reuse previously allocated object? -

i wondering why object allocating reused address used. the scenario this: appdelegate created loginviewcontroller (we call guy, log1 ) after logging in log1 , created instance of slidenavigationcontroller (i named sn1 ) sn1 has initial uiviewcontroller uvc1 log1 calls presentviewcontroller: sn1 making log1 presentingviewcontroller of sn1 (sn1.presentingviewcontroller == log1) uvc1 setup make sn1 have sliding menu menu1 menu1 has logout option menu1 create loginviewcontroller log2 sn1 present log2 making sn1 presentingviewcontroller of log2 after logging in log2 , created sn2 . thus, log2 presentingviewcontroller of sn2 sn2 has own uvc2 uvc2 setup make sn2 have sliding menu menu2 now here crazy part menu2 's memory address same menu1 menu2 creates log3 again, log2 , log3 has same memory address thus, when sn2 presents log3 , error occur since log3 log2 , log2 presentingviewcontroller sn2 the rest crash this method/function creating/...

parsing an XML with JAVA -

i trying parse few specific parts of xml doc. looking @ pulling data out of analysis section, need warnings, errors, passes , need go each of sections () , result , result level , text example in "error" need level of error , text "error". <document> <configuration> </configuration> <data> </data> <analysis warnings="5" errors="3" information="0" passed="false"> <files> </files> <results> <form> <section number="0"> <result level="error">error</result> <result level="error">error</result> <result level="error">error</result> <result level="warning">warning</result> <result level="war...

ios - How do I (the designer) test and use an iPhone in development if I don't have access to computer in which the code is being written? -

hi i'm intending have iphone app developed coder us. live in uk. when app being developed, there way can preview , use app being developed, see if designs , functionality correct? basically app equivalent of seeing developer url of website being developed. -thanks you need give developer udid of device. you can find via itunes. the developer add udid developer profile. can create install files (the file extension .ipa ) device can use. sends ipa file , use itunes install it. another approach use testflight . can register device site , developer's account on site. developer can udid web site , upload .ipa file site. once he's done that, can install app directly web site without downloading mac or pc first. note still reasonably secure because app encrypted , can run on devices included in developer's profile.

c# - Find Line that Contains String and Delete that Line in .txt file -

my goal erase line matches string donatorplayer if (targetplayer == null) { player.message("that not online. please try again when online may notified in due time."); } else { //switch (donationcheck) //{ foreach (string line in lines) { whichloopdelete += 1; if (line == donatorplayer) { switch (donationcheck) { case 0: lines[whichloopdelete] = null; file.delete("donators.txt"); file.create("donators.txt"); donationcheck = 1; break; case 1: textwriter tw = new streamwriter("donators.txt"); //here need delete line break; } } } //} } just use: lines = lines.where(line ...

node.js - Gradle NPM node error (npm' is not recognized as an internal or external command) -

how gradle recognize npm commands? i getting exception gradle build task npm' not recognized internal or external command preconditions: i have installed node locally on windows machine. npm command working through command line, while running gradle build file command or ide getting exception. verify have npm installed (it should live in nodejs program folder) if don't find file called "npm" in there, (re)install node downloading , running nodejs msi file (npm comes it) add node.js's program folder systems path , restart command line.

javascript - What's the benefit of re-trigger a custom event to another custom event? -

for example, following code: this.notifyclosed=function(){this.trigger("uisigninorsignupdialogclosed")}, this.on(this.$node,"uidialogclosed",this.notifyclosed) // <- benefit of calling function forward event event name? to clarify, event name in second line "uidialogclosed" defined within class (which first line included). so, steps coder doing this trigger event name (a) in function in class, capture event name (a) in same class, and dispatch function in class, then trigger event name (b) in class what's benefit of doing instead of triggering event name (b) in step (1)? source code reference: https://abs.twimg.com/c/swift/en/init.c55682c6beb3d82a7317d5287646278649c9e765.js search 'this.notifyclosed' in above source code. there 2 occurrence in source code. , explains question.

python - Corrupted / Garbled Output when capturing stdout from IPython -

a similar question asked here: ipython redirect stdout display corruption , answer not satisfactory. what i'm trying capture standard output, write pyqt4 qedittext while sending terminal normal. i'm using python 2.7 , ubuntu 12.04 lts. the problem when embed ipython terminal inside program, terminal output text gets garbled , lose autocomplete ability. i able reproduce issue on ubuntu machine (the problem doesnt seem exist on windows). in ubuntu termianl: ipython import ipython.utils.io tee = ipython.utils.io.tee('fds') right here text gets garbled while trying use tee object. in program things little differently, boils down overwriting sys.stdout custom object , when write or flush gets called log captured text , send original stdout , pyqt4 gui. so, there way safely peek @ standard out whenever write or flush command gets called? , there way doesn't break ipython terminals? it's due special encoding coloring of text in term...

asp.net - Cisco IP Phone Services - Dynamically Generate XML pages -

i new cisco ip phone services (ipps) , still trying understand concept behind it. application developer, have experience in web development either. i have been looking @ singlewire documentation here: http://www.singlewire.com/free-xml-apps.html here understanding far: phone menus in xml form, , when user select menu, directed xml depending on user input. for example, xml page stockquote is: <ciscoipphoneinput> <inputitem> <defaultvalue/> <displayname>ticker symbol</displayname> <inputflags>a</inputflags> <querystringparam>sym</querystringparam> </inputitem> <prompt>enter ticker symbol</prompt> <title>stock quote</title> <url>http://www.singlewire.com/cgi-bin/stockquote.pl</url> </ciscoipphoneinput> if user input csco, somehow generate following page xml in it: www.singlewire.com/cgi-bin/stockquote.pl?sym=csco my que...

javascript - How to make a page loop script -

is there can make script download multiple pages, instead of 1 single page? this script in python: import json, urllib page_data = urllib.urlopen("http://example.com/wp-content/themes/example/html5system/request/example-8/get/1/").read() js = json.loads(page_data) #print js['page'] open('page1.svg', 'wb') f_out: f_out.write(js['page'].encode('utf-8')) import json, urllib in range(1,301): # loop 1 300 page_data = urllib.urlopen("http://example.com/wp-content/themes/example/html5system/request/example-8/get/%d/" % i).read() js = json.loads(page_data) open('page%d.svg' % i, 'wb') f_out: # save each page in separate svg f_out.write(js['page'].encode('utf-8')) f_out.close() i added simple loop around existing code runs numbers 1 300. did string replacement '%d' % i inserts value of i %d located in string. did same thing file name, ea...

apache - HTTP socket connection remains in TIME_WAIT well after page is served -

i seeing lot of long lasting time_wait connections port 80 on apache 2.2.3 server on red hat linux 6. confirmed after pages have loaded, connection remains in state more 10 seconds, lot longer that. why be? have not configured special in apache, no cache enabled on server, , no proxy out in front. ajp_proxy used via module proxy tomcat port 80. why be? because that's it's supposed do . default value /proc/sys/net/ipv4/tcp_fin_timeout on linux system 60 seconds (imho bit excessive purposes). can change writing file.

r - Convert character list to data frame -

i have data in json trying use in r. problem cannot data in right format. require(rjsonio) json <- "[{\"id\":\"id1\",\"value\":\"15\"},{\"id\":\"id2\",\"value\":\"10\"}]" example <- fromjson(json) example <- do.call(rbind,example) example <- as.data.frame(example,stringsasfactors=false) > example id value 1 id1 15 2 id2 10 this gets close, cannot numeric column convert numeric. know can convert columns manually, thought data.frame or as.data.frame scanned data , made appropriate class definitions. misunderstood. reading in numerous tables - different - , need have numeric data treated such when it's numeric. ultimately looking data tables numeric columns when data numeric. read.table uses type.convert convert data appropriate type. same cleaning step after reading in json data. sapply(example,class) # id value # "characte...

mysql - Simple many-to-many relationships -

apologies, haven't slept, want clarify in head. a team can have many users, user can member of several teams. is many-to-many relationship? if so, need third table join them in mysql? many many relationships many many relationships exist , you're right point works somehow differently many 1 / 1 many. it's not at all stupid question. most of time, need add fields characteristics relation. because you'll want informations relationships themselves. whether or not need information (and fields) determine if need third-part table or not. real life example : men & women let's have men , women tables. man can date many women through course of live, , reciprocally. so, have typical many many relationship. can without third table. but now, suppose want add information: each relationship (be in romantic sense or in database sense (never thought sentence 1 day in life)), want tell when union started, , when ended. then need third part tabl...

html - CssRules that make 'box-sizing:border-box' not working in IE9-10 -

i have css-rules don't work correct in ie9-10. there parent div (which has box-sizing:border-box) , child element. when hover on child element parent div expands (like doesn't have box-sizing property) html: <div class="wrap"> <button class="btn">just hover me</button> </div> css: .wrap{ width: 350px; background-color: #dedede; position: relative; padding: 20px 10px; min-height: 70px; overflow: hidden; -moz-box-sizing: border-box; box-sizing: border-box; } .btn{ display: inline-block; padding: 4px 15px; border: 10px solid #cccccc; background-color: #f6f6f6; color: #333; cursor: pointer; -moz-box-sizing: border-box; box-sizing: border-box; } .btn:hover{ border-color: #89bede; background-color: #fff; color: #137ebe; } but interesting moment in case if delete 1 of next properties, example works: min-height (of .wrap) overflow:hidden (of ....

c# - Is this use of Create() right in an Entity Framework context? -

when creating object persisted database, , using create() method purpose, following snippets same? snippet 1: client client = new client(); client.name = "jonh doe"; database.clients.add(client); database.savechanges(); snippet 2: var client = database.clients.create(); client.name = "jonh doe"; database.savechanges(); according http://msdn.microsoft.com/en-us/library/gg679504(v=vs.113).aspx don't. "note instance not added or attached set" so second snippet should be var client = database.clients.create(); client.name = "jonh doe"; database.clients.add(client); database.savechanges();

css - <SELECT> wraps text to next line if small width in Chrome -

Image
the weirdest problem: <select> elements wrap text next line if width set 2em (smaller contents, not much). in chrome! firefox , ie 9 work fine. both dropdowns have 2 options: - , stripe . if stripe option selected (even during runtime!!) element wraps that. opening works , should: options overflow required width: the simple version relevant css: jsfiddle ( the fiddle isn't broken me ) * { margin: 0; padding: 0; box-sizing: border-box; line-height: 1.6; } .bookmarks .change-group select { width: 2em; /* overflow: hidden; tried - no difference */ } /* chrome tells me <select> inherits one: */ .bookmarks, .bookmarks li { list-style: none; } and html (but without white space): <div class="change-group"> <select> <option value>-</option> <option value="stripe">stripe</option> </select> </div> (that's applicable css!) <select> inside <div> ...

javascript - clearInterval does not work -

i'm trying create simple countdown timer. counts down number entered. however, i'm trying clear interval when counter gets 0 . @ moment seems acknowledge if statement , not clearinterval() . http://jsfiddle.net/tmyie/cf3hd/ $('.click').click(function () { $('input').empty(); var rawamount = $('input').val(); var cleanamount = parseint(rawamount) + 1; var timer = function () { cleanamount--; if (cleanamount == 0) { clearinterval(timer); } $('p').text(cleanamount); }; setinterval(timer, 500); }) you're not saving return value of call setinterval , value needs passed clearinterval . passing timer handler no good. var timer, timerhandler = function () { cleanamount--; if (cleanamount == 0) { clearinterval(timer); } $('p').text(cleanamount); }; timer = setinterval(timerhandler, 500);

php - mySQL error, that I can't find -

i'm writing because can't find error, copied code document , edited few things, have error. i'm unable see is. the following error is: you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'by,telefon,email) values (987, , , , by, , )' @ line 1 and code following: $taelf = mysql_result(mysql_query("select count(*) `firma` `navn` = '$navn'"),0); if($taelf < 1){ mysql_query("insert `firma` (navn,cvr,adresse,postnr,by,telefon,email) values ($_post[navn], $_post[cvr], $_post[adresse], $_post[postnr], by, $_post[nummer], $_post[email] )" ) or die(mysql_error()); echo "<div id='success'>vupti, firmaet er nu oprettet. '$_post[navn]','$_post[cvr]','$_post[adresse]','$_post[by]','$_post[postnr]',...

Why can't Java resolve the variable in this for each loop? -

in following each loop, "bird cannot resolved" error @ lines marked !. have setup interface bird implemented abstract class birdtype of cardinal, hummingbird, bluebird , , vulture children. getcolor() , getposition() methods defined in abstract class while fly() unique each of child classes. client code provided professor test interface/inheritance relations have setup. note have tested interface, abstract class , child classes , seem work. think issue for-each loop can provide code other classes if needs be. advice? import java.awt.*; public class aviary { public static final int size = 20; public static final int pixels = 10; public static void main(string[] args){ //create drawing panel drawingpanel panel = new drawingpanel(size*pixels,size*pixels); //create pen graphics g = panel.getgraphics(); //create birds bird[] birds = {new cardinal(7,4), new cardinal(3,8), new hummingbird(2,9), new...

sql server - While Loop in SQL not working -

i need in understanding why loop below not working. inserts first record stops. declare @new_balance float , @cur_new_balance float , @old_balance float , @cur_old_balance float , @initial_balance float , @rate float , @monthly_rate float , @monthly_interest float , @payment float select @rate = interest accounts account = 'amexdelta' set @monthly_rate = (@rate / 12) / 100 select top 1 @cur_new_balance = new_balance , @cur_old_balance = old_balance payments order id desc select @cur_new_balance new_balance , @cur_old_balance old_balance while @new_balance > 0 begin set @monthly_interest = (@cur_old_balance * @monthly_rate) set @old_balance = (@cur_new_balance - @payment) set @new_balance = (@monthly_interest + @old_balance) insert payments(payment, monthly_interest...

c# - Cannot implicitly convert type delegate to string -

i'm trying create class @ runtime can pointed various data inputs. trying use delegates. have worker method returns string (in actual implementation, there others choose from). return value of delegate returned method exposed rest of code. private delegate string delmethod(); private static delmethod pntr_method = new delmethod(onedelegatemethod); public static string exposedmethod() { return pntr_method; } public static string onedelegatemethod() { return "this string"; } i'm getting error cannot implicitly convert type 'ob.database.delmethod' 'string' i'm puzzled why this, when method has worked bools , idatareaders . if want call delegate , return value, have use "()": public static string exposedmethod() { return pntr_method(); }

iphone - _pthread_kill +32 iOS app crashes on device not on emulator -

i have updated old app, , took lot more work anticipated , done... kinda. runs fine in emulator on computer when try on actual device (iphone 5) crashes(pauses?). first view loads fine, pressing of 5 buttons go next view crashes app. maybe shouldn't "crash" loads indefinitely. it _pthread_kill + 32 highlighted , says "thread 1:signal sigabr" libsystem_kernel.dylib`__pthread_kill: 0x389091f4: mov r12, #328 0x389091f8: svc #128 0x389091fc: blo 0x38909214 ; __pthread_kill + 32 0x38909200: ldr r12, [pc, #4] ; __pthread_kill + 24 0x38909204: ldr r12, [pc, r12] 0x38909208: b 0x38909210 ; __pthread_kill + 28 0x3890920c: .long 0x01e23e14 ; unknown opcode 0x38909210: bx r12 0x38909214: bx lr what ended being me problem google analytics. had old version , wasn't compatible phone or os. commented out google analytics stuff , removed plug in , worked fine. ...

html - How to use nth-child with :hover to style multiple children? -

js fiddle easier debugging: http://jsfiddle.net/gregsfiddle/wyc7y/1/ i trying setup css when mouseover nine, 9 , below bg color changed. mouseover 5, , 5 , below have color changed. idea. not sure how use nth-child(-n+#) selector :hover. ol.motivationbox .motivationbars li:nth-child(10):hover:nth-child(-n+9) { background-color: #008cba; } that bit of code not functioning. did format incorrectly? since currently can't transverse dom tree, seems thing possible in pure css. basically, general sibling combinator, ~ , allows access succeeding sibling elements. updated example here ol.motivationbox .motivationbars:hover ~ .motivationbars, ol.motivationbox .motivationbars:hover { background-color: #008cba; } .. if wanted use jquery , select preceding sibling elements, use this: alternative example here $('.motivationbox .motivationbars').hover( function(){ $(this).prevall().andself().addclass('active'); }, fun...

c++ - Operator<< cant access private int of class -

i when try compile: ../monster.h:26:9: error: ‘int projectiv::monster::con’ private `int con;` ^ ../monster.cpp:17:39: error: within context cout << "constitution: " << monster.con << endl; ^ make: * [monster.o] error 1 from understand making operator<< friend should allow access int con. not seeing. monster.h: #ifndef monster_h_ #define monster_h_ #include <iostream> using std::cout; using std::endl; using std::ostream; #include <string> using std::string; namespace projectiv { class monster { friend ostream &operator<< (ostream &out, const monster &monster); public: monster(int con); private: int con; }; } /* namespace projectiv */ #endif /* monster_h_ */ monster.cpp: #include "monster.h" ostream &operator<< (ostream &out, const projectiv::monster &monster) { cout << "co...

youtube - android URL stream cannot get whole data -

i'm trying youtube download link using this string data = geturl("http://www.youtube.com/get_video_info?video_id=" + id); but return part of data. end of data "..." example, expire%253d1391242316%2526ms%253dau%2526fexp%253d900356%25252c902546%25252c936910%252... i used code public string geturl(string s){ inputstream = null; try{ url r = new url(s); urlconnection rc = r.openconnection(); datainputstream dis = new datainputstream(rc.getinputstream()); list<byte> l = new arraylist<byte>(); while(true){ try{ l.add(dis.readbyte()); }catch(exception e){ break; } } byte[] b = new byte[l.size()]; for(int = 0; < l.size(); i++){ b[i] = l.get(i); } return new string(b,"utf-8"); }catch(exception e){ e.printstacktrace(); return null; ...

session - PHP logging in redirection -

i'm working on site , when try login, automatically redirects me login page not allowing me login. think sessions, not sure. if please take me. dashboard based site supposed redirect user there correct dash`board there rank, seems not working. heres login page: login: <?php require 'core/config.php'; if(isset($_post['submit'])) { $username = $db->real_escape_string($_post['username']); $password = md5($_post['password']); if(empty($username) or empty($password)) { echo 'you must fill in both boxes!'; } else { $query = $db->query("select * users username = '".$username."'"); while($row = $query->fetch_array()) { $dbpassword = $row['password']; } if($password !== $dbpassword) { echo 'password incorrect.'; } else { $query1 = $db->query("select * user...