Posts

Showing posts from August, 2012

c# - Access to Windows 8 live id -

i want create app, users can rate stuff, don't want can rate 1 place multiple times. tought use live id of user, windows 8 uses default. there way that? if not, there built in way "recognize" user, or have use live sdk? unfortunately there no way, live sdk pretty too.

string - Use of ^ and gsub in Lua -

function title case(thestring) return (thestring:gsub("^%a", string.upper):gsub("%s+%a", string.upper)) end i have above mentioned code. wanted know use of ^ operator in above code. know ^ used in sets exclude/negate succeeding values in set since it's not set, ^ meant ? why gsub used twice in above code? both times, letters being converted upper case! please explain what's happening in above line of code. ^ in beginning of pattern anchor "the beginning of string", i.e, "^%a" matches "%a" (a letter) if it's in beginning of string. the first string.gsub() make first letter in string uppercase, second string.gsub() make first letter of other words (a letter follows whitespace) uppercase. for instance, string "hello world" turns "hello world" after first string.gsub() , turns "hello world" after second string.gsub() .

image - make a table from ul elements without the top and the sides borders in CSS -

value 1 || value 2 ^^^^^^^^^^^^^^^^^^^^^^ value 1 || value 2 ^^^^^^^^^^^^^^^^^^^^^^ value 1 || value 2 ^^^^^^^^^^^^^^^^^^^^^^ i have ul tag inside them there li tags text , image. want them table above. inside each block there image , text next each other. table without borders top & left & right ((the || , ^ line of table)) <ul> <li>value 1</li> <li>value 2</li> <li>value 3</li> <li>value 4</li> <li>value 5</li> <li>value 6</li> </ul> inside each li tags there be: <li> <img src="test.jpg"/> <p>some text</p> </li> nesting set of ul s each li . working jsfiddle example <ul class="top-level"> <li class="border-bottom"> <ul class="horizontal"> <li class="border-right"> <p>some text</p&

jquery - Find element index by its text -

<div id='xlink'>mc</div> js $('#next').click(function() { var xlink = $('#xlink').html(); var links = [ 'qd', 'mc', 'vr', 'lm', 'ms', 'kl', 'yu', 'an' ]; foreach(links, element) { if (element.value==xlink){y = element.index}; alert (y); }); what need: foreach element in links array, if element value equal xlink value y = index of element . in case should 1 . get elements text use key, , in array indexof, or more cross browser jquery's $.inarray , , return index $('#next').on('click', function() { var links = [ 'qd', 'mc', 'vr', 'lm', 'ms', 'kl', 'yu', 'an' ]; var key = $.trim( $('#xlink').text() ); var y = $.inarray(key, links); alert(y); }); fiddle

Select a color using the number in openGL -

you know glcolor3f(), contains red green , blue values. i'm developing simple program should allow select color i'm not sure how set set of rgb color values make callback. example, int red = (1,0,0); glcolor3f(red); obviously, has error i've tried other ways make work int[] red = {1,0,0}; still didn't work. can give me suggestions? update #1: made program test. first code line should global state. glfloat color[3] = {1,0,0}; then color should changed rand() in following: int r1 = rand() % 100; if(r1 < 50) color = {0,1,0}; else color = {0,0,1}; glcolor3fv(color); first: learn proper syntax of c, because this int red = (1,0,0); is not valid c. (c not know tuple type). types matter. well use glfloat array , pass glcolor3fv (if want use integers must use glcolor3i[v] . glfloat const red[3] = {1,0,0}; glcolor3fv(red); but that's not useful, because not want artificially limit user's choices. present them color selec

freepascal - How to have an object with Text property equal to the character made from an integer from an array -

i'm trying write short program using lazarus. initialise array of integers; have tedit object x1 text value (after clicking 'initialise' button) want equal (character made from) first element of array. here relevant code segments: var w: array[0..3] of integer = (1,0,1,0); (...) procedure tform1.initialiseclick(sender: tobject); begin x1.text:=inttostr(w[0]); end; unfortunately, gives me following message: unit1.pas(81,22) error: no default property available unit1.pas(81,22) fatal: syntax error, ")" expected "[" found with cursor right @ 'w' after 'inttostr('. what doing wrong? googling 'properties of arrays' did not me (as can tell, i'm newbie...) in advance! my guess different "w" in scope, e.g. field of tform1 class, or defined global variable/symbol unit usesd in implementation in such cases, trying reduce source minimum example still exhibits bug, , makes disappear ca

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

i have got fresh install of delphi 2010 on windows 8.1. i create new project, , under packages, select "build runtime packages". i compile , error "[dcc fatal error] e2202 required package 'indycore' not found" i have checked: package indycore140.bpl available in $bds\bin directory other indy related packages. indycore.dcp file available in $bds\lib , $bds\lib\debug. this driving me nuts. hints? this command line when enable "show command line" option (line breaks added readability): dcc command line "project2.dpr" c:\delphi\delphi2010\bin\dcc32.exe --no-config -lurtl;vcl;vclx;vclimg;vclactnband;dbrtl;vcldb;vcldbx;bdertl;vcltouch;xmlrtl; dsnap;dsnapcon;teeui;teedb;tee;adortl;vclsmp;vclie;inet;inetdb;webdsnap; websnap;inetdbbde;inetdbxpress;soaprtl;dbxcommondriver;dbxclientdriver; dbxinterbasedriver;dbxmysqldriver;dbexpress;dbxcds;tdbf;intrawebdb_100_140; intraweb_100_140;indycore;indysystem;indyprotocol

performance - Website loading time over 20 seconds, only sometimes -

i have website every 10-15 minutes becomes slow regarding loading times. started happen today , before website loading time under 2s, it's on 20 seconds. this pingdom report http://tools.pingdom.com/fpt/#!/wxanj/http://www.walkingoutlet.it/ shows waiting time of 27s request not much, 3 css's, 2/3 js's @ , images. don't know if problem hosting company or website, not familiar technical part numbers of report, tell me problem may ? i hope question fits here because don't know post elsewhere. thank you the sources content looks , should fast. did see largest image sfondo.jpg wasn't visible anywhere (is tiny band @ top) , if rid of gray crosshatch of second largest outlet-online-scarpe.jpg lot smaller. in general small jpgs being delivered own web server delivered kind-of slow in pingdom report. because pingdom servers located distantly own server. might want try website testing site located closer server or (even better) move site located @

ggplot2 - Trouble displaying contours in R and ggplot with basic dataset -

Image
i trying plot nmds co-ordinates x , y, , use diversity measure (shannon)to plot contour keep getting following error , can't see why... error in if (empty(new)) return(data.frame()) : missing value true/false needed my code is: all_merge <-read.table("test.txt", header=true) p <- ggplot(all_merge, aes(nmds1, nmds2, z = shannon)) p + geom_contour() and dataset is: nmds1 nmds2 shannon -0.287555952 -0.129887595 9.516558582 -0.314104852 -0.048655648 8.985087924 -0.214910534 -0.127167065 8.928241917 -0.341295065 -0.296282805 8.315476782 -0.470025718 0.083835083 8.494348157 -0.429386114 0.044064347 8.669813919 -0.427608469 0.124631936 8.15886319 -0.584412991 0.257278736 8.469688185 -0.436526047 -0.070633108 8.496878956 -0.584707076 0.120411579 8.319057817 0.183493022 0.445239412 5.611249955 0.172968855 0.583787121 5.728358304 -0.404838098 -0.0271276 8.679667562 -0.458718755 -0.05638174 8.714026645

Whats wrong with this geo_shape elasticsearch query? -

i trying geo_shape query document location (see example document below) , getting nullpointerexception when trying execute elasticsearch via chrome addon "sense". exact results @ bottom of question... any on getting right geo_shape query work appreciated. query throwing exception { "query": { "geo_shape": { "location": { "shape": { "type": "polygon", "coordinates": [[-87.6363976, 41.8772528], [-87.6363976, 41.8902152],[-87.62131840000001, 41.8902152], [-87.62131840000001, 41.8772528], [-87.6363976, 41.8772528]] } } } } } example document { "id": 1483, "name": "independance day movie day", "location": [ 41.9527, -87.725 ] } exact results sense { "error": "searchphaseexecutionexception[failed

string - Use of '*' and '+' in Lua pattern -

i, j = string.find("the number 1298 even", "%d+") print(i,j) in above code, if use %d+ , 12,15 expected %d* , returns 1,0 . difference between 2 * accepts 0 value + accepts 1 or more. why returning 1,0 ? first, pattern %d+ matches 1 or more digits, , %d* matches 0 or more digits, in example, %d+ matches "1298" , while %d* matches empty string in beginning. 0 occurrence of digits can matched %d* , that's difference between + , * . second, index 1 , 0 empty string seems bit odd, makes sense. index 1 means beginning of string, end index of empty string, can't have 1 because mean match first character "t" , must less beginning index, 0 1 got. furthermore, return value of string.find() can used arguments string.sub() substring found. in call string.sub (s, i, j) , if i greater j , returns empty string.

Android service working with mySQL data -

so have desktop app working mysql db. need include notification system inside desktop app, allowing desktop users send notifications set of 10 tablets. it's sending sms, not really. tablets users must receive notifications sent desktop users , other way around, tablet users must able send notifications desktop users. since common ground between 2 mysql db, thought of following schema:i need build notification service, run time on tablet after run once. should check remote mysql table see if new records inside, , if so, display notification on tablet. sure many of experts have done @ least once. so path thought of is: i have mysql db on server, , have application (desktop) allows users input notification (a new record) inside mysql table. build php backend serve android service "yes" or "no" answers , second php return data of notification upon request build service make call php every minute in case "yes" received service make call second p

netbeans - Java: Set the default button -

to set default button suppose jbutton4 following code has used: this.getrootpane().setdefaultbutton(jbutton4); add this? what tried: tried add in main function gave me error, tried put inside button action performed block did not work, tried put before main function gave me error. question: put line of code works? using netbeans gui make program. you add line everywhere want set default button (a button click, create ui etc.). i think nice place create ui elements. in case be, after initcomponents();

c# - WPF TextBox format mask -

Image
i'am searching solution define format mask textbox. know masked textbox toolkit not looking for. need currency format mask. masked textbox toolkit has limitation characters input. don't want this. i want have currency format 1.000.000,00€ no character limitations. i know stringformat (with combination of local settings): {..., stringformat={}{0:c}} but problem textbox not bindable - no mvvm pattern. so know how define format mask on textbox not bindable? ----------> update for best solution use of decimalupdown spinner wpf extended tooklit. if hide , down buttons... <wpfx:decimalupdown formatstring="c2" margin="45,343,305,27" allowspin="false" /> regards, igor

jquery - Javascript image change -

javascript being used make neat log-out button. works except cannot figure out how attach line 'span' edits image because code uses self variable. how can image used in script attached span in link image changes regardless if hovering on link or image. have tried use few solutions nothing either worked way wanted or not @ all. jquery fine solution well. ignorant far javascript/jquery goes of coding far php/css. <a href="#logout"> <span>logout</span> <img src="images/logout.png" onmouseover="this.src='images/logout_hover.png'" onmouseout="this.src='images/logout.png'" /> </a> since events propagate, should work: <a id="login_link" href="#logout" onmouseover="document.getelementbyid('login_image').src='images/logout_hover.png'" onmouseout="document.getelementbyid('login_image').src='images/logout.png'&qu

php - Upload xml file to root of Wordpress app hosted in Openshift -

Image
while verifying ownership of domain www.chansek.com, found bing webmaster tools telling upload bingsiteauth.xml file root of web app. how do that? site hosted in openshift through wordpress app. install bing webmastertools plugin , open plugin page settings menu on admin panel. copy/paste bing verification code plugin input textbox below , save;

Spring 3 Form Validation is working for @NotNull but not working for @Size annotation -

Image
i facing problem spring form validation. works @notnull annotation how not working @size. attaching code below. in advance. package com.doctor; import javax.validation.constraints.notnull; import javax.validation.constraints.size; public class doctor { @notnull(message="cannot null") private string uname; @size(min=1,max=8,message="min 1 , max 8") private string password; private string doctor_fname,doctor_lname,address,dept_id,experience,email,phone,resume,image; public string getuname() { return uname; } public void setuname(string uname) { this.uname = uname; } public string getpassword() { return password; } public void setpassword(string password) { this.password = password; } .................... ................... doctorcontroller package com.doctor; import org.springfra

c++ - Debugging in Eclipse a Cocos2dx application (Cpp) -

i'm trying cocos2dx in windows environment, using eclipse cdt. i'm able build game , play in android phone. problem i'm not capable of debugging game. put breakpoint in .cpp file , not being reached. what going on? for debugging android apps written in c++,try using nvidia ndk debugger. allows 1 set breakpoints in c++ , debug @ runtime. can from https://developer.nvidia.com/nvidia-debug-manager-android-ndk

jquery - anonymous function in javascript -

i pass anonymous function-a parameter function-b. after call b.destroy, function exists , gets executed, live anonymous scope itself. found unexpected behavior through debugger. following code. var builder.record.verifyexplorer = new builder.verifyexplorer( window.bridge.getrecordingwindow(), builder.getscript().seleniumversion, function(step) { builder.getscript().addstep(step); builder.stepdisplay.update(); // don't stop: cause listener prevents click // activating selected element detached prematurely. settimeout(function() { builder.record.stopverifyexploring(); }, 1); window.bridge.focusrecorderwindow(); } ); i destroy above function defining stopverifyexploring be builder.record.stopverifyexploring = function() { builder.record.verifyexploring = false; builder.record.verifyexplorer.destroy(); builder.record.verifyexplorer = null; builder.record.continuerecording(); }; even after verifyexplorer.destroy

html - Div not being centre aligned inside another div -

i can't seem centre align div(title) sits inside div. html <div class="wrapper"> <div id="header"> <div class="title">home</div> </div> </div> css #header { position:relative; width:1200px; height:400px; margin:auto; border:1px solid red; } .title { position:absolute; width:1000px; height:140px; background-color:red; margin:auto; } remove position: absolute , works perfectly. position: absolute necessary when need specific placement outside of normal document flow. in case, nothing special needed apart automatic left , right margins, have.

javascript - AngularJS - parse JSON -

i have list of photographs being generated following snippet. render table structure, each photo being cell in table. id of each photo example 1d means photo in first row of table , in 4th/d column. <ul> <li class="row"> <ul> <li class="photo" id="photo-1a">1a</li> <li class="photo" id="photo-1b">1b</li> <li class="photo" id="photo-1c">1c</li> <li class="photo" id="photo-1d">1d</li> <li class="photo" id="photo-2a">2a</li> <li class="photo" id="photo-2b">2b</li> <li class="photo" id="photo-2c">2c</li> <li class="photo" id="photo-2d">2d</li> <li class="photo" id="photo

html - Making wide table fit bootstrap container -

i have table so: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <div class="container"> <div class="panel-body"> <div class="table-responsive"> <table class="table table-bordered table-hover table-striped"> <thead> <tr> <th class="col-md-1">id</th> <th class="col-md-1">enabled</th> <th class="col-md-1">shortcode</th> <th class="col-md-1">keyword</th> <th class="col-md-1">session based</th> <th class="col-md-1">application sms endpoint</th> <th class="col-md-2">application mms endpoint</th>

java - How can I align these JPanels on the bottom of the surrounding JPanel? -

Image
i learning use swing please bear me. have @ attached screenshot: these jlabels within jlabel within jframe. move these inner jlabel (which randomly generated in size , color @ runtime) bottom though books on shelf. know layout managers, though can't quite seem find proper 1 want. screenshot shows result of specifying none, should default flowlayout. the inner jlabels .add()ed without placement done. setlocation appears nothing whatsoever. can me out? if i'd add put jlabels inside of jpanel boxlayout align border layout. here code out: jlabel outer = new jlabel(); outer.setlayout(new borderlayout(0,0)); /** add inner jlabels here. other add them order appear right**/ jpanel bookshelf = new jpanel(); bookshelf.setlayout(new boxlayout(toolbar, boxlayout.x_axis)); //add jlabels bookshelf outer.add(bookshelf, borderlayout.south); here great tutorial on layout managers. here ui designed similar think want. hope helps out.

javascript - call function inside $ (function () {...}) jquery -

call function inside $ (function () {...}) example: $ (function () {      makealert function (text) {          alert (text)      } }); i want call "makealert" function block. makealert call () not work. please help! you can't. you've scoped function function declared within. move outside global. there no need delay definition until ready event fires. alternatively, create global reference within outer function. window.makealert = makealert; it wouldn't recommend unless have other reason keep function being declared until ready event fires more complicated.

user interface - Jump to next code cell (IPython notebook) -

i use ipython 2.0 notebook teaching. the notebooks created before teaching session, , used as-is during session. sure, when prepare notebook, has sense access cells in sequence (actually, don't). back in class, while present concepts , code students, don't need focus put on next cell, need cursor wait in next code cell... the best can hope has been able change default behaviour of shift-enter, executes current cell, , jump next executable cell. has been done? redefining keyboard shortcuts in 2.x described in ipython notebook examples: http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/notebook/user%20interface.ipynb here use have shift-enter go next codecell , stay in edit mode: var add_edit_shortcuts = { 'shift-enter' : { : 'run cell, select next codecell', help_index : 'bb', handler : function (event) { ipython.notebook.execute_cell_and

jquery - Chrome HTML Inspector: Copy original source (and not modified DOM) -

Image
i'm working quite lot html templates. many of display more 1 visualization within 1 page. therefore use chromes html inspector copy needed html source table/div template. copy this: but : found out, copying html inspector copies code dom, means copy of code contains jquery modifications made scripts , not original source html-element. is there way copy element sub-items , source not contain modifications of javascript dom manipulation!? thanks lot edit : solution found deactivating execution of javascript temporarly in inspector under "settings", reloading page , copying html-source node. it's cumbersome , not nice... might seem bit of workaround, although if use chrome's console logging, can print contents of <div> upon load & before jquery starts it's dom modifications. for getting post's .post-text before modification: console.log( $$('.post-text')[0].innerhtml ); $(document).ready(function(){ /** jav

c++ - Passing reference of parameter's (being itself a reference) target -

i have chained methods that: purecommand hasher::nametopure(commandname& commandname) { return this->commandhash.find(commandname).value(); } bytecommand hasher::nametobyte(commandname& commandname) { return this->puretobyte(this->nametopure(commandname)); } the 2nd method passing commandname wrong type 1st method needs reference, not object. i've tried this: bytecommand hasher::nametobyte(commandname& commandname) { return this->puretobyte(this->nametopure(*&commandname)); } as stated here: how cast/convert pointer reference in c++ - because &commandname gives me pointer... it's passing object again. doing silly way? it's trivial... there nothing wrong original code. reference can bind object. (and in fact, no expression ever has reference type. expressions can lvalues, xvalues, or prvalues, , commandname here lvalue, lvalue reference can bind it.)

ember.js - ember store.find promise not being fulfilled in time -

i'm using arraycontroller itemcontroller i'm having problems getting store.find promise fulfilled before hotelname , hoteladdress properties in itemcontroller used. idea on how can unsure store find fulfilled before returning? know store.find works. i'm able see results timing off. thank you. export default ember.arraycontroller.extend({ itemcontroller: ..., }); export default ember.objectcontroller.extend({ init: function() { this._super(); }, hotelname: function() { var self = this; self.store.find('hotel', this.get('hotelid')).then(function(hotel) { self.set('hotelname', hotel.get('name')); }); }.property('hotelid'), hoteladdress: function() { var self = this; self.store.find('hotel', this.get('hotelid')).then(function(hotel) { self.set('hoteladdress', hotel.get('street')); }); }.p

linux - Joining a pair of lines with specific starting points -

i know sed can print cat current.txt | sed 'n;s/\n/,/' > new.txt b c d e f to a,b c,d e,f what following: a b c d e f to a,d b,e c,f i'd join 1 4, 2 5, 3 6 , on. possible sed? idea how achieved? thank you. try printing in columns: pr -s, -t -2 current.txt

math - How to write a spirial function in python? -

Image
i'm trying write function in python takes 2 arguments (x,y) , , returns angle in degrees in spiraling direction. suppose center of spiral @ location (x0,y0) . given (0,0) , returns 45 . given other point (0,90) second intersection top on y axis, angle around 170 . point not touching red line, should return angle of expect direction be. spiral general thing show direction of angles. does know how write such function? thanks that's archimedean spiral curve . page says in polar coordinates formula of curve r = aθ, scalar a 1 i.e. r = θ. polar cartesian conversion is x = r cos θ, y = r sin θ hence x = θ cos θ, y = θ sin θ varying θ 0 6π give curve you've. when vary parameter θ , x , y values relative origin (0, 0). case, you've translate i.e. move points x , y offset position accordingly. if want bigger version of same curve you've scale (before translation) i.e. multiply both x , y values constant scalar.

javascript - SetInterval Form Submit with AJAX Rails -

i want .edit_canvas submit every 5 seconds via ajax. right seems nothing happening. have no console errors though. javascript: setinterval(function(){ // html content of canvas element var canvascontent = $('.canvas').html(); // populate hidden field canvas content $('#canvas-content').val(canvascontent); // submit form ajax $('.edit_canvas').submit(function() { var valuestosubmit = $(this).serialize(); $.ajax({ url: $(this).attr('action'), //sumbits given url of form type: 'post', data: valuestosubmit, datatype: "json" // want difference between normal , ajax-calls, , json standard }).success(function(json){ $('.canvas').css('background', 'pink'); }); // prevent normal behaviour return false; }); }, 5000); form: <%= form_for @canvas |f| %> <%= f.hidden_field :content, value: &quo

angularjs - Injecting $scope into an angular service function() -

i have service: angular.module('cfd') .service('studentservice', [ '$http', function ($http) { // data via $http var path = 'data/people/students.json'; var students = $http.get(path).then(function (resp) { return resp.data; }); //save method create new student if not exists //else update existing object this.save = function (student) { if (student.id == null) { //if new student, add in students array $scope.students.push(student); } else { //for existing student, find student using id //and update it. (i in students) { if (students[i].id == student.id) { students[i] = student; } } } }; but when call save() , don't have access $scope , , referenceerror: $scope not defined . logical step (for me), provide save() $scope , , must provide/inject service . if so: .service('studentservice',

JavaScript HTML5-Canvas - Drawing an Arc with SetInterval Causes Jagged Edges -

i'm trying draw donut chart, , far i've been successful. problem when trying animate arc combining stroke() setinterval() , works, not smooth, , produces jagged edges. tried using clearrect() clear canvas after animation done , re-add final version of animation, must have been using clearrect() wrong, because did nothing. if have ideas on how looking good, i'd appreciate it. you can see current code on jsfiddle: http://jsfiddle.net/4mjcy/ , below: body: <canvas id="donutchart" width="215" height="500" style="border:1px solid #000;"> browser not support html5 canvas tag. please upgrade latest version of chrome, firefox, or safari.</canvas> javascript: var canvas=document.getelementbyid("donutchart"); var maincircle=canvas.getcontext("2d"); maincircle.beginpath(); maincircle.arc(107,107,100,0,2*math.pi); maincircle.fillstyle="#ff0000"; maincircle.fill(); var currentendan

c++ - When writing to a file, only the last line saves to my output file -

im trying write file last line gets written file. i've tried opening , closing file outside loop nothing writes file void getvalues (double totalenergy, double meanpowerconsumption, double maxpowerconsumption); int main() { double totalenergy, meanpowerconsumption, maxpowerconsumption; getvalues(totalenergy, meanpowerconsumption, maxpowerconsumption); return 0; } void getvalues(double totalenergy, double meanpowerconsumption, double maxpowerconsumption) { int x = 0; int c = 0; double p = 0; int = 0; ifstream infile; infile.open("data.txt"); if (infile.fail()) { cerr << "error opening file." << endl; exit(1); } // declaring variables. double power1, power2, time1, time2, totalpower, timeconstant, changeinpower, totaltime, time, coloumns; double year, month, day, hour, minute, second, voltage, current, frequency; double accumulatedpower=0; while(!infile.eof())

css - Servlet reflected cross site scripting vulnerability -

i've analyzed code findbugs , reported warning servlet reflected cross site scripting vulnerability. code , 3rd line throws warning: string tickname = request.getparameter("ticko"); printwriter w = response.getwriter(); w.println("unable perform tickonem '" + tickname +"' because no tick name active!"); //this line throws warning. what real reason , how fix it? reason appending user provided data response without escaping. vulnerable injecting javascript executed in user browser. avoid such vulnerabilities should html escape every user supplied data before sending back. can use existing libraries perform escaping example stringescapeutils

capture output from c++ in java without returning -

i'm working on java swing make gui c++ programming . need c++ program executed in loop without returning java. during loop want capture output without stepping through return 0; in c++ program can capture output c++ file without returning java gui ?? out , in process in code try { int out = 0; string line; outputstream stdin = null; inputstream stderr = null; inputstream stdout = null; // calling exe file process process = new processbuilder("unpattern.exe").start(); stdin = process.getoutputstream(); stderr = process.geterrorstream(); stdout = process.getinputstream(); // input process // "write" parms stdin line = "1"; stdin.write(line.getbytes()); stdin.flush(); //line = "tx.gette

javascript - jQuery Random Item from Array Not Working -

i trying assign random background color reach td. have array: var randomcolor = ["red","blue","green","mint","yellow","lightpurple"]; and function: function setrandomcolor(){ return randomcolor[math.floor(math.random() * randomcolor.length)]; } here jsfiddle: http://jsfiddle.net/2j8yq/16/ you'll notice every 2-3 times run program, td cell random white. know why is? not have white in array option. not sure why td cell's generating white background. any appreciated! thanks lightpurple , mint not valid color keywords. error such expected color found 'mint'. error in parsing value 'background-color'. declaration dropped. note "declaration dropped." @ end. means browser doesn't understand rule , hence doesn't assign background color element. the valid keywords listed in specification : the list of color keywords is: aqua, black, blue, fu

c# - Possible to Use FTP With Amazon S3/Google Drive/ OneDrive? -

i have websites backup daily, right have go every day ftp grab backup , upload google drive. i looking @ amazon s3 , hoping maybe have ftp access upload files not seeing it. my control panel has schedule option tranfer files on server server through ftp. make use of somehow can't find allow this. otherwise can write sort of c# web app on schedule access hosting companies ftp , transfer somehow 1 of these storage providers? you can use "cloud gateway" services like: https://cloudgates.net/ http://storagemadeeasy.com/cloudftp/ http://www.ftp2cloud.com/ or, set own gateway server using webdrive map s3, , filezilla server. details can see post here: amazon s3 webdav access

c# - SpecFlow building steps out of existing steps -

i have set of base steps in specflow simple things enter text , validate fields. want these base steps can used non technical testers in creating higher level steps made out of these base steps. should not need know how code or how implement step definitions or how use selenium @ all. need define step in english calls other base steps. can repeat process , make more steps out of ones defined. how want automation occur non technical testers can create tests in english only, while coding can done else. does specflow support this? can see can define step use other steps in code (in step definition bindings), cant see in feature file itself, no code involved? tools fitnesse when offering kind of functionality. many thanks. specflow doesn't support this. you construct test uses many simple steps, there no way map single step many (unless use code).

AES Encryption: [1][1] and [1][2] in Round 1, [1][1] in Round 2 erronous, the rest is correct -

i trying implement aes cipher according specification: http://techheap.packetizer.com/cryptography/encryption/spec.v36.pdf according example (page 20 onwards) results state after mixcolumns rounds 1 , 2 erronous: round 1 after mixcolumns example state state 04 e0 48 28 04 e0 48 28 66 cb f8 06 66 60 f8 06< 81 19 d3 26 81 28 d3 26< e5 9a 7a 4c e5 9a 7a 4c ^^ if correct 2 different bytes , go on calculate round 2 [1][1] still incorrect whereas [1][2] correct: example state state 58 1b db 1b 58 1b db 1b 4d 4b e7 6b 4d 17 e7 6b< ca 5a ca b0 ca 5a ca b0 f1 ac a8 e5 f1 ac a8 e5 ^^ if again correct [1][1] , continue calculating state after mixcolumns round 3 identical example. these mix-column values [1][1] [1][2] in round 1: ffmul(2, t[1] = b4) = d8 ffmul(3, t[(1 + 1) % 4] = t[2] = 52) = f6 t[(1 + 2) % 4] = t[3] = ae t[(1 + 3) % 4] = t[0] = e0 => 60 ffmul(2, t[2] = 52) = 95 ffmul(3