Posts

visual studio 2013 - using for loop for a textbox in selenium C# -

for(int i=0;i<=10;i++) { driver.instance.find element(by.id("id of element")).send keys("auto"+i); } i used code not work 1 10 numbers printing in 1 attempt i searching code dynamically increment in each run out changing sendkeys values again , again your question not clear. trying enter value in 10 different edit boxes in single run or trying enter different values in same edit box in multiple runs (if can use random class generate random integers generate different values in different runs). random random = new random(); int = random.next(0, 10); driver.instance.find element(by.id("id of element")).send keys("auto"+i); you can increase bucket random.next(0, 10); random.next(0, 100); decrease probability of having same no in 10 runs.

objective c - SKEffectNode shader bug -

i'm developing game using sprite kit , liquid fun (google's implementation of box2d liquids). after applied threshold shader make liquid more real, stumbled in strange behavior can seen on video: current behavior the way should behave can seen on video: normal behavior i'm applying shader on skeffectnode contains particles ( skspritenodes ) that's code on threshold shader: void main() { vec4 color = texture2d(u_texture,v_tex_coord); if(color.w > 0.4) { color = vec4(18.0/255.0, 122.0/255.0, 232.0/255.0, 1.0); } else { color = vec4(0.0, 0.0, 0.0, 0.0); } gl_fragcolor = color; } does have clue of going on?

javascript - Hide referrer header in API request -

i need make requests google translate text-to-speech api. have enabled key keep getting blocked no access-control-allow-origin. i've posted more here: google translate api - no access control origin text speech the following sources, http://weston.ruter.net/2009/12/12/google-tts/ , request google text-to-speech api google returns 404 error if http request contains referer header other empty string. given request like: $.get('https://translate.google.com/translate_tts?key='+mykey+'&ie=utf-8&tl=en&q=hello+world', function (returned_data) { how hide or remove referrer header i'm not blocked? this source says put https://href.li/... in front. changed to: $.get('https://href.li/?https://translate.google.com/translate_tts?key='+key+'&ie=utf-8&tl=zh-cn&q=你好', and still blocked. server-side attempt: no response. this blog provides server-side script sets referrer empty string. ...

cloud code - Function not updating on Parse.com -

Image
i have function, working normally, on parse.com: parse.cloud.job ("mybgfunction", function(request, status) { console.log("entering mybgfunction."); }); but strange may seem, if update (saving , using parse deploy) usual following: parse.cloud.job ("mybgfunction", function(request, status) { console.log("entering mybgfunction (aaaa)."); }); the next time try execute, old function executed (in log), if update did go through, though got no error message after running: parse deploy has seen before? one more tiny question: there way clear old logs (on parse)? basic useful feature. looking bit more details @ happens classes, seems "all fine" except can see in log outdated. wrote earlier, logs previous versions. makes extremely difficult debug function, because trace-log becomes impossible. please go "cloudcode" section, , check if code same expected.

Displaying contents of String array in Swing component as iterations using Time delay. JAVA -

i have array of strings i'm trying display (one one) slideshow in java swing component. trying add delay time between iterations. i attempted using jtextarea, action listener added it. here code have right now: private class myactionlistener implements actionlistener { public void actionperformed(actionevent e) { // bunch of text processing //note: myinfo.getcontents() returns arraylist<mytype>. iterator<mytype> iterator = myinfo.getcontents().iterator(); int = 0; while (iterator.hasnext()) { mytextarea.settext(iterator.next().tostring()); // add time betweeen iterations wanted use thread // delay method. } } } my code not working because jtextarea doesn't have action listener. update note: many replies stated should use actionlistener jtextarea; however, eclipse not showing me jtextarea has method called addactionlistener. i'm kind of stuck here, which j...

math - Why we use CORDIC gain? -

i'm studying cordic. , found cordic gain. k=0.607xxx. from cordic, k_i = cos(tan^-1(2^i)). as know k approched 0.607xxx.when going infinity this value come k multiplying. i understand reason of exist each k. curioused used ? why use value k=0.607xx? the scale factor rotation mode of circular variant of cordic can established first principles. idea behind cordic take point on unit circle , rotate it, in steps, through angle u sine , cosine want determine. to end define set of incremental angles a 0 , ..., a n-1 , such a k = atan(0.5 k ). sum these incremental angles appropriately partial sum of angles s k , such s n ~= u . let y k = cos(s k ) , x k = sin(s k ). if in given step k rotate a k , have y k+1 = cos (s k+1 ) = cos (s k + a k ) x k+1 = sin (s k+1 ) = sin (s k + a k ) we can compute x k+1 , y k+1 x k , y k follows: y k+1 = y k * cos (a k ) - x k * sin (a k ) x k+1 = x k * cos (a k ) + y k * sin (a k ) considering may both...

jquery - Simple Automatic Refresh using JavaScript in a Razor Page -

i want know how simple refresh of html table, without re-loading whole page. i timer set refresh every 5 seconds. the razor code is: <table class="table trim-list search-results" id="res"> <tbody> @foreach (record record in model.results) { var renditionuri = getrendition(record); <tr style="float:left;"> <td class="row-icon"> <div id="thumb_col" style="margin-right:10%;"> <img class="thumbnail" style="padding:3px;" src="~/record/@record.uri/recordrendition/@renditionuri"/> </div> </td> <td class="prop-val"> <label style="font-we...