Posts

Showing posts from June, 2011

c# - Selenium.NoSuchElementException with dynamic tables -

please me problem! at moment, scraping website using selenium firefox driver in c#. data on website dynamically filled tables cover data concerning future dates. while structure of table same both future , past dates, tables being updated during selenium call throw "nosuchelementexception" concerning iwebelements there. these relevant copied xpaths tables. 1 past date, on works fine, , 1 on future date, on exception thrown. can see, identical. xpath 18052015 /html/body/div[1]/div/div[2]/div[5]/div[1]/div/div[1]/div[2]/div[1]/div[7]/div[1]/table/tbody/ tr[1] / td[1] /div/a[2] xpath 05022016 /html/body/div[1]/div/div[2]/div[5]/div[1]/div/div[1]/div[2]/div[1]/div[7]/div[1]/table/tbody/ tr[1] / td[1] /div/a[2] using findelements(by.xpath(...)) function, use 2 foreach loops go through highlighted tr's , td's in xpath text in a[2] header. in both cases, dom in firefox firebug seems identical in both cases. difference have observed between 2 tables fact e

c - Set Path Variable Permanently Using ShellExecuteEx -

i come code. execute correctly , return true. doesn't change path variable's value. when type --> setx path "c:\program files\java\jdk1.7.0_02\bin\" in cmd, works , change path value here code // prepare shellexecutinfo shellexecuteinfo shrun = {0}; shrun.cbsize = sizeof(shellexecuteinfo); shrun.fmask = see_mask_nocloseprocess; shrun.hwnd = null; shrun.lpverb =null; shrun.lpfile = "c:\\windows\\system32\\setx.exe"; shrun.lpparameters = "path \"\"\"c:\\program files\\java\\jdk1.7.0_02\\bin\\\"\"\""; shrun.lpdirectory =null; shrun.nshow = sw_shownormal; shrun.hinstapp = null; // execute file parameters if(shellexecuteex(&shrun)) printf("done"); else printf("no"); what problem here?? your quoting on arguments wrong. have many quotes. need write shrun.lpparameters = "path \"c:\\program files\\java\\jdk1.7.0_02\\bin\\\""; to see version fail did

C# - find the position of a string inside a predefined string array -

i have predefined string array letters a q : string[] skippedareasarray = new string[] {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q"}; in textbox inside windows form user can enter skippedareas this: a,b,c,d... there validations , restrictions use letters , commas input guaranteed in format. what taking user input , populate string array: string[] skippedareasfromform = new string[17]; ... skippedareasfromform = (txtskippedareas.text).split(','); now comes tricky part i'm seeking assistance. user must enter number of areas example - 3. mean working a , b , , c . if number of areas 2 can use a , b if number of areas 4 a , b , c , d available , on. what need check if in array skippedareasfromform populated user input there area doesn

pyyaml - python ordereddict or OrderedDict? -

i'm confused right now. i'm using pyyaml editing yaml files. data = yaml.load_all(open('testingyaml.yaml'),loader=yaml.roundtriploader) my testingyaml.yaml file contains following content: spring: profiles: dev datasource: url: jdbc:postgresql://127.0.0.1:5432/nfvgrid dns: enable: false cassandra: host: 192.168.7.151 when print data prints following: ordereddict([('spring', ordereddict([('profiles', 'dev'), ('datasource', ordereddict([('url', 'jdbc:postgresql://127.0.0.1:5432/nfvgrid')]))])), ('dns', ordereddict([('enable', false)])), ('cassandra', ordereddict([('host', '192.168.7.151')]))]) i further want perform operations on ordered dictionary python throws error nameerror: name 'ordereddict' not defined it's ordereddict somehow pyyaml returns ordereddict. how should solve issue? you not using pyyaml stated, not have roundtripl

SSH into a system and browse the files in a particular folder using java -

i suppose ssh system , browse files in particular folder. using jsch library ssh system not sure how browse files. want user navigate through folders , select file similar jfilechooser. please can me this? regards, colin you have 3 options: this best option: if you're client able mount drive using ssh, mount drive , give them file chooser @ mount point. linux , mac make easy mount ssh servers drive. on windows, you're gonna have use third party tools. whichever case, can use command's tool mount drive. here how mount ssh drives or can use sftp. haven't had success if want user pick files 1 specific directory , no else; meaning no sub-dirs... etc you can make own gui , show content of dir. know content doing ls. if want file on system , possibly in nested directories you can go through of files on remote server using this , re-render gui on clients side using this

android - Activity's onTouchEvent() is not being called while clicking on Button -

i want b.logic in activity.ontouchevent() method. working fine textview , other non clickable views. however, not getting called uponclicking of button . need too. here code. public class mainactivity extends activity { private static final string tag = mainactivity.class.getsimplename(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); findviewbyid(r.id.button1).setonclicklistener(new onclicklistener() { @override public void onclick(view v) { toast.maketext(mainactivity.this, "oh shit!! click performed... :(", toast.length_long).show(); } }); } @override public boolean ontouchevent(motionevent event) { log.d(tag, "ssssssssssssssssssssssss:touch"); return super.ontouchevent(event); } public boolean dispatchtouchevent(motionevent

c++ - Compiler error C2653: not a class or namespace name -

so have been having extremely frustrating problem lately visual c++ 2012. until few hours ago, writing code fine , working intended, until decided optimize things , deleted few classes. fixed of errors popping because of that, e.g. false includes, etc. unfortunately, after vs compiler went crazy. started giving me errors such as: error 14 error c2653: 'class' : not class or namespace name or even error 5 error c2143: syntax error : missing ';' before '}' error 4 error c2059: syntax error : '>' i've checked multiple times, , in it's right place: headers included, symbols placed should be. as far understand, problem not code compiler itself... visual studio can annoying @ times, guess. anyway, grateful if me out on one. (by way, disabling precompiled headers did not work) relevant parts of code: error 14: #include "playerentity.h" playerentity::playerentity(void) {} // line causes error error 5: class gamescr

arrays - How to access the object in python? -

text_to_read = """{ "tts_type": "text", "tts_input": "i hungry" }""" my old code : scriptpath = os.path.abspath(__file__) scriptpath = os.path.dirname(scriptpath) line = os.path.join(scriptpath, "input.txt") text_to_read["tts_input"] = line i trying access tts_input of text_to_read. think, making mistake. can 1 me , how access ? i not able read 4 line of code , getting error : text_to_read[tts_input] = line attributeerror: 'str' object has no attribute 'tts_input'. can me ? you need parse text_to_read object. can use python library json achieve that. import json text_to_read = """{"tts_type": "text","tts_input": "i hungry"}""" text_to_read = json.loads(text_to_read) # rest of code text_to_read["tts_input"] = line of course, if text_to_read string defined in code

c# - ASP chart StackedColumn100 add percent symbol (%) on values -

Image
i have chart (using chart control build-in on .net): how add percent sign (%) behind of values (for example 44 => 44%, 56 => 56% , on) edit (after tried jstreet 's sugesstions in comment): stackedcolumn100 chart values percentages. tried <asp:series label="#val%"> , got this: (notice 0 values showing don't want, used these codes hide 0 values initially): protected void requestchart_customize(object sender, eventargs e) { //hide label value if 0 foreach (system.web.ui.datavisualization.charting.series series in requestchart.series) { foreach (system.web.ui.datavisualization.charting.datapoint point in series.points) { if (point.yvalues.length > 0 && (double)point.yvalues.getvalue(0) == 0) { point.isvalueshownaslabel = false; } } } }

C code completion in CodeBlocks -

i working on c project on codeblocks, still have c++ results when using autocompletion. do know how keep c completion? in settings>editor>code completion c/c++ parser options, allow alter header files , extensions parse. have tried removing c++ stuff?

c# - Binding SQL data to Label in WPF -

is there way data bind sql data label in wpf? i have sql database has total of summed data. want display last column's data label. if column reads "10" need label display "10". here code i've tried: c#: sqlconnection con = new sqlconnection(myconnectioninfo); sqlcommand scom = new sqlcommand(); scom.commandtext = "select top 1 [totalincidents] sixmonthreport order [totalincidents] desc" object temp = cmd.executescalar(); label.text = temp.tostring(); most appeared work until label.text portion not option in wpf. i can't seem find information on of wpf / labels appreciated. label not have text property have content one, can try like: object temp = null; using (sqlconnection con = new sqlconnection(myconnectioninfo)) { con.open(); using (sqlcommand command = new sqlcommand("select top 1 [totalincidents] sixmonthreport order [totalincidents] desc", con)) { temp = cmd.executescalar();

ruby on rails - Undefined method `avatar' for nil:NilClass -

i'm trying print image using paperclip gem. when print using views/devise/edit.html.rb looks when want print in views/layout/application.html.rb i'm getting error in console: actionview::template::error (undefined method `avatar' nil:nilclass): 7: <%= csrf_meta_tags %> 8: </head> 9: <body> 10: <%= image_tag @user.avatar.url(:thumb) %> 11: <%= yield %> 12: 13: </body> app/views/layouts/application.html.erb:10:in `_app_views_layouts_application_html_erb___4291648939640547438_70254980514000' this user.rb: class user < activerecord::base # include default devise modules. others available are: # :confirmable, :lockable, :timeoutable , :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable has_attached_file :avatar, :styles => { :medium => ["300x300>"], :thumb => ["100x100>"], :p

javascript - how to use promise.all inside then()-chain -

it may question title off, in case promise.all not need solve issue. i have then() - chain in promise , have series of similar operations should handle differently, new promises. return new promise(function(resolve, reject) { c.scraper.load().then(function () { .... var personurl = url + "/" + c.people[0]; return c.checkperson(personurl); }).then(function(){ var personurl = url + "/" + c.people[1]; return c.checkperson(personurl); }).then(function(){ var personurl = url + "/" + c.people[2]; return c.checkperson(personurl); .... i think problem. the first step combine these 3 one, , second step, if possible, make work unknown number of people in array c.people . first, since c.scraper.load() returns promise, can return result of entire promise chain, , don't need wrap in new promise(...) . next, since c.people seems array of paths want fetch, can map

html - Text centre vertical alignment -

image basically, want 'join now!' text centred within green rectangle. html: <p class="header-banner-button"><a href="#">join now!</a></p> css: .header-banner-button { position:absolute; text-align:center; vertical-align:middle; top:68%; left: 60%; margin-top: -225px; margin-left: -500px; font-size:28px; color:#fff; height:35px; background-color:#4caf50; border-radius:15px; } thanks guys :) try setting line-height height of button: line-height: 35px; also note it's better use <button> element. or, if have to, use <a> element without enclosing <p> element.

Ruby-on-Rails + FriendlyId gem + Acts_as_Votable gem - getting a Heroku error -

in index page have following part of setting acts_as_votable gem. <%= link_to like_bike_path(bike), method: :put, class: "btn btn-default" %> it working fine until added friendlyid, because like_bike_path looking id not friendlyid (ie vanity url). there way change like_bike_path to like like_friendly.find_path works on localhost:3000 heroku logs tell me actionview::template::error (undefined method slug' #<bike" 2 acts_as_votable calls "like_bike_path(bike)" , "<%= bike.get_upvotes.size %>". thanks! #app/models/bike.rb class bike < activerecord::base extend friendlyid friendly_id :column, use: [:finders, :slugged] end this allow use of slug without having change default pattern in activerecord... ( @bike = bike.find params[:id] ). -- in regards heroku error, means have not got database migrated (it doesn't include slug in columns). you need make sure run heroku run rake db:migrat

Change fontSize of Item of Listpicker in window phone 7 -

i have 2 listpicker. have bound lpkfamilymemberfrom database , lpkpaymentmode array value.i want 2 fullscreen mode , in full screen want item font size 40. in lpkfamilymemberfrom achieve font size 40 have done following code.but dont know how achive lpkpaymentmode becoze has not datatemplate becoz bound using array. <datatemplate x:name="pickerfullmodeitemtemplate"> <stackpanel orientation="horizontal" margin="16 21 0 20"> <textblock text="{binding name}" margin="16 0 0 0" fontsize="43" fontfamily="{staticresource phonefontfamilylight}"/> </stackpanel> </datatemplate> <toolkit:listpicker background="white" fontsize="44" expansionmode="fullscreenonly" x:name="lpkpaymentmode"/> <toolkit:listpicker itemtemplate="{staticresource pickeritemtemplate}" background="wh

c# - How to drag RenderTransform with mouse in WPF? -

i want make viewer move , zoom children mouse. so, create class transformviewer : usercontrol , override event methods. have problem onmousemove. when translate rendertransform, onmousemove called continuously, if don't move mouse. , rendertransform shakes. protected override void onmousemove(mouseeventargs e) { point mouse = e.getposition( ); vector delta = point.subtract( mouse, oldmouse ); oldmouse = mouse; if(keyboard.iskeydown( key.leftshift ) && (e.leftbutton == mousebuttonstate.pressed || e.rightbutton == mousebuttonstate.pressed)) { matrix matrix = transform.matrix; matrix.translate( delta.x, delta.y ); transform.matrix = matrix; e.handled = true; rendertransform = transform; } } why so? better change rendertransform of child. public class transformviewer : usercontrol { private readonly matrixtransform transform = new matri

Simulate click inside iframe with JavaScript or jQuery -

this question has answer here: jquery trigger click on iframe? 2 answers i have html containing iframe , 2 buttons, master , slave. slave displays "clicked" upon being clicked on while master simulates clicking action. works fine, i'd same behavior applied slave inside iframe. possible achieve such functionality? current code ignores iframe. $(document).ready(function() { $('#master').click(function() { simulateclick(50, 50); //iframe position simulateclick(50, 100); //slave position }); $('#slave').click(function() { alert('clicked'); }); }); function simulateclick(x, y) { jquery(document.elementfrompoint(x, y)).click(); } the document ready function not guarantee iframe has loaded. guess running before iframe has loaded. t

r - merTools predictInterval() for model with nested random effect -

does predictinterval() mertools package not nested random effects? example, using msleep dataset ggplot2 package: library("lme4") library("mertools") library("ggplot2") mod <- lmer(sleep_total ~ bodywt + (1|vore/order), data=msleep) predint <- predictinterval(mermod=mod, newdata=msleep) returns error: error in '[.data.frame'(newdata, , j) : undefined columns selected this runs fine no problem: mod <- lmer(sleep_total ~ bodywt + (1|vore) + (1|order), data=msleep) predint <- predictinterval(mermod=mod, newdata=msleep) (well gives warning na levels in random effect variables, i'm not concerned that) update as discussed in comments of ben bolker's answer below, new version of mertools accounts nested random effects. however, when try predict data contains new levels of nested random effect, errors. this works: mod <- lmer(sleep_total ~ bodywt + (1|vore/order), data=msleep) predint <- predictinter

properties - Android Webview Property - setAllowUniversalAccessFromFileURLs(boolean) -

the setallowuniversalaccessfromfileurls(boolean) property included in api level 16 , tthe default value of proprty true api level ice_cream_sandwich_mr1 , below, , false api level jelly_bean , above. have developed 1 android application runs api 8 16 . now, need set webview settings property common api 8 api 16. how can set property.?

jquery - slide table content from right to left -

i'm using following http://jsfiddle.net/zsffs/27/ in exaample won't slide attach code below please verify , let me know mistake made, can't able found mistake <html> <head> <style type="text/css"> .container{ width:500px; height:250px; overflow:hidden; margin:10px; position:relative } .table{ position:absolute; width:2000px; height:250px; left:0; background: -moz-linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet); } </style> <script type="text/javascript"> $('.next').click(function(event){ if($('.table').css('left') != '-1500px') { $(this).prop('disabled', true) $('.table').animate({left:'-=500px'}, 500, function() { $('.next').prop('disabled', false) }); } }); $('.prev').click(function(event){ if($('.table').css('left') != '0px') { $(this).prop(&

linux - Would it be possible to read out physical keyboard strokes in node.js? -

i have node application runs on raspberry pi keeps track of bunch of upnp-players (sonos), able control through physical remote. have couple of airmouses, has small keyboards volume buttons use. i have tried grip on how read out physical key strokes on linux machine, , come conclusion need read events input device, in case be: /dev/input/by-id/usb-dell_dell_quietkey_keyboard-event-kbd how find device , stuff not problem, real issue how interpret data read it. i know receive c struct, this: struct input_event { struct timeval time; unsigned short type; unsigned short code; unsigned int value; }; but i'm not sure how go reading node. if run external app triggered pre-defined keystrokes, , invoke http-request against node, second option, python script or native daemon. have looked @ hotkey-daemons, none of them worked. if of course nice if contain within node somehow. edit: did testing, , made simple snippet: var fs = require('fs'); var b

Android studio Unexpected top-level exception. Error parsing classes -

i know there many of questions, not pointing error have. i'm not using gradle, grandfathered project. working on redoing 1 activity using fragments. when done , there no errors/etc in classes - tried compile , got error. before running , compiling fine. can't find pointers in message in look. suggestions? error:android dex: [dmd-android] unexpected top-level exception: error:android dex: [dmd-android] java.lang.runtimeexception: exception parsing classes error:android dex: [dmd-android] @ com.android.dx.command.dexer.main.processclass(main.java:752) error:android dex: [dmd-android] @ com.android.dx.command.dexer.main.processfilebytes(main.java:718) error:android dex: [dmd-android] @ com.android.dx.command.dexer.main.access$1200(main.java:85) error:android dex: [dmd-android] @ com.android.dx.command.dexer.main$filebytesconsumer.processfilebytes(main.java:1645) error:android dex: [dmd-android] @ com.android.dx.cf.direct.classpathopener.processone(classpathopener.java:170) e

IntelliJ IDEA + Play!-plugin: Do not open UI Designer for Java source -

running community edition of intellij idea on arch linux (12.0.4 build 123.169), installed play!-2.0 plugin . once managed running, began hitting wall: whenever open *.java-source-file project-explorer, switches me ui designer-view, , can't access source code anymore - keeps telling me "form file invalid: not intellij idea gui designer form file". the files want work on pure java-code, have no need ui designer, there no swing involved. is there setting somewhere not invoke view files? note: weird thing works if disable play-plugin - in plugins.xml maybe?

javascript - Table pagination with jQuery -

Image
i'm trying simulate pagination using jquery , have worked out essential pagination elements can't navigation part work. worked list element not table structure. can please tell me issue? var show_per_page = 2; var number_of_items = $('tbody').children().size(); var number_of_pages = math.ceil(number_of_items / show_per_page); var current_link = 0; $('table').after('<div class=controls></div>'); var navigation_html = '<a class="prev" onclick="previous()">...</a>'; while (number_of_pages > current_link) { navigation_html += '<a class="page" onclick="go_to_page(' + current_link + ')" longdesc="' + current_link + '">' + (current_link + 1) + '</a>'; current_link++; } navigation_html += '<a class="next" onclick="next()">...</a>'; $('.controls').html(navigation_html); $('

mongodb - Set replSet without restarting the mongod -

is way can assign replset without restarting mongod ? mongodb doc says should restart mongo , assign parameters, i'm using mongohq's service (via heroku), can't find way set replset . how can it?

php - Convert seconds to date -

according this calculator date should mon apr 01 2013 13:11:57 gmt+0200. instead it's servers time: 2013-04-01 07:11:57. timezone problem (the server in -4) there way make timezone independent or have query user's timezone database? $date = 1364814717; $date = date('y-m-d h:i:s', $date); you can change default time zone this: date_default_timezone_set('utc'); if need make different per-user, send unconverted number , use javascript (see gettimezoneoffset), it's better let user choose (their computer might not know is!)

java - Windows-1250 in Eclipse Console -

i have got file in windows-1250 . i print file line line in eclipse console cannot see diacritic signs. i trying make changes in common tab in run configuration gives no results. i use bufferedreader reader = new bufferedreader(new filereader(filename)); thank in advance use inputstreamreader or allows specifying charset: bufferedreader reader = new bufferedreader(new inputstreamreader( new fileinputstream(filename), "windows-1250"));

ios - Run Activity Indicator across Views -

i using plugin: https://github.com/icanzilb/swiftspinner/ to show acitvity indicator, easy: swiftspinner.show("loading data") however, have view getting from: performseguewithidentifier("viewc1segue", sender: self) when clicked on table view cell. the problem is, when go new view, there initial blank white screen because data loaded via alamofire , takes few moments load. is there way load activity spinner on 1 view, , let views change undeneath it, when use .hide() on new view spinner disappear? there dilemma: i have tried adding swift spinner onto new viewdidload. works, however, of content loaded under viewdidappear function. add function, spinner fails load. ok, have question: what best way not show blank view @ beginning until data loads? if want have spinner on several views, create new loadingviewcontroller , nib it, set it's backgroundcolor transparent, show loadingviewcontroller on current context (or on full screen)

java - How to use data stored in a variable located in a seperate file? -

i have 2 files. 1 file counts number of listed events have in text file , stores number of events variable "count". want use value in variable computation in second file. how do this? have create object of class in first file , reference it? need example please, cannot seem work. here have tried. my first file: import java.util.*; import java.io.*; public class eventcounter { public static void main (string [] args) throws ioexception{ scanner file = new scanner(new file("event.txt")); int count = 0; while (file.hasnextline()) { count++; file.nextline(); } system.out.println(count); //test } } my second file: import java.io.ioexception; import java.io.filereader; import java.io.bufferedreader; public class readeventfile { private string path; public readeventfile(string file) { path = file; } public string[] ope

fpga - FSM 2 process VHDL -

i attempting write down vhdl code fsm of control unit of project. chose 2 process way 1 process state register , other process next state , output logic. anyway i'm having problems in setting solution signals give synthesis latch warning (i know why appear). solution found (without using 1 single process both state register , output logic , without adding 3 more states) add output logic in process manages state logic. with surprise works conceptually correct? mean, correct dirty code of state register process output logic or breaking 2 process pattern? this code of working , "latch-free warning" control unit. anyway latch involved signal sel_mode don't know how specify in else branch of state idle "keep previous value of "sel_mode"(without having latch warning). library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity control_unit port ( clock : in std_logic; reset_n_in : in std_logic; primo_operando : in s

swing - java Drag and Drop - List doesn't take parametrs -

i'm trying make simple application, use dnd file path. found here practicly same thing, use. got error - typ list not take parameters. when try dnd if works, positive answer, don't know other possibility, how file path. here's code, use: jtextfield8.setdroptarget(new droptarget() { public synchronized void drop(droptargetdropevent evt) { try { evt.acceptdrop(dndconstants.action_copy); list<file> droppedfiles = (list<file>) evt.gettransferable().gettransferdata(dataflavor.javafilelistflavor); (file file : droppefiles) { jtextarea1.append("drag & drop ok"); } } catch (unsupportedflavorexception ex) { logger.getlogger(mainform.class.getname()).log(level.severe, null, ex); } catch (ioexception ex) { logger.getlogger(mainform.class.getname()).log(level.severe, null, ex); }

ios - How to create custom back button for use with nav bar and subviews -

i have main view controller tableview , detail view controller display details selected item. have nav bar inserts button when user segues detail screen. on detail screen, have container view can show other view controllers on bottom half of screen. when user brings subview, want replace standard button custom button resigns subview, not going main view controller. once subview gone, button should revert stock button go main view controller when pressed. my issue i'm having trouble making buttons appear same user doesn't know i'm using different buttons achieve these different things. best way this? can't text match up, image better way go? currently in prepareforsegue in main view controller: // setting nav button text "<" default when no text let backitem = uibarbuttonitem() backitem.title = "" navigationcontroller?.navigationbar.tintcolor = uicolor.whitecolor() navigationitem.backbarbuttonitem = backitem cur

php - How to send and receive a xml to another computer -

i have 2 computers, comp 1 branch 1 , comp 2 main branch. in comp 1 have generated xml of database query using php. `<?php header ("content-type:text/xml"); //database configuration $config['mysql_host'] = "localhost"; $config['mysql_user'] = "root"; $config['mysql_pass'] = "donnaluz"; $config['db_name'] = "global89_branch1"; $config['table_name'] = "branchsales"; //connect host mysql_connect($config['mysql_host'],$config['mysql_user'],$config['mysql_pass']); //select database @mysql_select_db($config['db_name']) or die( "unable select database"); $xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; $root_element = $config['table_name']; $xml = "<$root_element>"; /*$title = $doc->createelement("branchsales"); $title = $root->appendchild($titl

Multidimensional String Array Assignment C++ -

i have preallocated multidimensional string array declared follows: std::string test[5][169] = { { },{ },{ },{ },{ } }; i need make function accepts input string this: {"abc","dac","fab" },{"hbv","acd" },{ "ccd","ahn","agt","atr"},{"are"},{ } and puts correctly values in array(as i'm assigning it); the problem can't pass 2d+ array parameter function in c++ , can't assignment multidimensional array this: test= {"abc","dac","fab" },{"hbv","acd" },{ "ccd","ahn","agt","atr"},{"are"},{ }; i'm looking method put correctly values array. i tried use std::vector , solved problem 1 dimensional array: std::vector<std::string> test; test = {"abc","dac","fab" }; but i'd need like std::vector< std::vector<std::strin

ios - Identify iphone's version -

i'm developing app can installed in iphone 4 , later versions.i go through uirequireddevicecapabilities , device compatibility matrix .i need more solution. well, first of can receive model string using uidevice class: [[uidevice currentdevice] model] this return "ipod touch" or "iphone". you can exact model platform using following code: (you have #include <sys/types.h> , <sys/sysctl.h> ) size_t size; sysctlbyname("hw.machine", null, &size, null, 0); char *machine = malloc(size); sysctlbyname("hw.machine", machine, &size, null, 0); nsstring *platform = @(machine); // old syntax: [nsstring stringwithcstring:machine encoding:nsutf8stringencoding] free(machine); now platform string containing generation of device, e.g.: iphone1,1 iphone 2g (the first iphone) iphone1,2 iphone 3g iphone2,1 iphone 3gs iphone3,1 or iphone3,2 iphone 4 iphone4,1 iphone 4s iphone5,1 or iphone5,2 iphone 5

math - Eliminate a redundant equation from a linear programming -

Image
i asked re-write linear programming question equation less. max 7x1+5x2 s.t : 4x1+3x2 <= 2400 2x1+0.5x2 <= 750 x1 >= 100 x1,x2 >= 0 what did used simplex method , found maximum profit 4030 x1 = 100 , x2=666. can use , to obtain maximum profit, x1 has 100, third equation extra ? since consider simple 2-dimensional problem, can solve graphically. first note gradient of objective function is ∇f_obj = (7, 5) from points , onwards, we'll denote variable x1 x , , x2 y . the constraints describe polytope (a) below, , level curves objective function given in (b) (brighter contour: increased objective function value). the optimal value marked red dot in (b) above, (x^*, y^*) = (262.5, 450) . it's apparent inequality constraints 4x+3y <= 2400 , 2x+0.5y <= 750 both active, optimum given in intersection of these two. the constraint x >= 100 ( x1 >= 100 ), is, however, not active, , hence redundant.

php - Can doxygen determine the class from the use statements? -

i'm trying document code doxygen , classes within app code links other classes work desired. if reference in @return or @param class elsewhere (e.g. vendor....) without namespace (cos have namespace referenced in "use"). doesn't find it. expected behaviour (and need prefix class name namespace)? class names should qualified doxygen/docblock return types. allow create links between classes.

c# - Simulate input of non-ASCII characters -

i looking way simulate input of non-ascii characters (e.g. cjk characters) using windows apis. keybd_event or sendinput won't work because input characters may not valid virtual keys. what want i want simulate input of unicode character(s) using windows api, without needing write ime or tsf provider. what i've tried i've tried send wm_ime_char message focused window: // gets focused input control (if any) internal static intptr getactivewindowcontrol() { intptr activewin = getforegroundwindow(); if (activewin == intptr.zero) { return intptr.zero; } uint threadid = getwindowthreadprocessid(activewin, intptr.zero); guithreadinfo guithreadinfo = new guithreadinfo(); guithreadinfo.cbsize = marshal.sizeof(guithreadinfo); getguithreadinfo(threadid, ref guithreadinfo); if (guithreadinfo.hwndfocus == intptr.zero) { return activewin; // example: console } else { return guithreadinfo.hwndfoc

amazon web services - Deploying/copying binaries to AWS Instance -

is there way programmatically copy dotnet libraries aws ec2 instance? idea copy dotnet libraries ec2 instance , execute unit tests. any idea on how can achieve this? i push binaries s3 , part of instance start have them copy on or prepare script on instance using aws cli copy them on needed.

ios - Comparing two arrays with NSPredicate -

i've 2 array, 1 represents list of full-size images , other 1 represents images' thumbnail. there way, using nspredicate, check if full-size image has thumbnail? the thumb called img{number}_thumb.jpg , full-size image called img{number}.jpg. using arrays, strings , loop : nsarray *thumbs=@[@"img1_thumb.jpg",@"img2_thumb.jpg",@"img3_thumb.jpg",@"img4_thumb.jpg",@"img5_thumb.jpg",]; nsarray *images=@[@"img1",@"img2",@"img3",@"img41",@"img5"]; bool issame=yes; (nsstring *name in images) { if (![thumbs containsobject:[nsstring stringwithformat:@"%@_thumb.jpg",name]]) { issame=no; nslog(@"%@ doesn't has thumb image",name); break; //if first not found not enough remove break } } nslog(@"%@",issame?@"all thumb has image":@"all thumb not have image"); using nspredicate: for (ns

Working with javascript variable arrays -

i'm trying return results each list, using array of variables containing names of lists. var filters = ["colour", "size", "len", "s_length", "occasion"]; var colour = ["black", "white", "blue", "brown", "gold", "green", "grey", "multi", "nude", "orange", "pink", "purple", "red", "silver", "yellow"]; var size = ["xs", "s", "m", "l", "uk 6", "uk 8", "uk 10", "uk 12", "uk 14", "uk 16", "uk 18+"]; var len = ["maxi", "midi", "mini"]; var s_length = ["sleeveless", "short", "3/4", "long"]; var occasion = ["casual", "party/evening", "work"];

.net - Net mvc 3 complex model send form data to controller save to database -

i trying pass dynamic complex model controller, without using , editor view template. after adding items, mark ends looking following. <ul> <li class="invitem"> <input type="hidden" value="bed california king" name="[0].efinvitem"> <input type="hidden" value="4" name="[0].efroomid"><span class="ui-icon ui-icon-circle-close removeitem"></span>bed california king </li> <li class="invitem"><input type="hidden" value="coffee table medium" name="[1].efinvitem"> <input type="hidden" value="4" name="[1].efroomid"><span class="ui-icon ui-icon-circle-close removeitem"></span>coffee table medium </li> <li> <a href="#" class="additem">add inventory item room</a> </