Posts

vb.net - How would I use a for loop to edit multiple labels in Visual basic for visual studios -

here code: private sub button1_click(sender object, e eventargs) handles button1.click dim randval integer dim label string dim val integer dim stringval string integer = 1 256 step 1 val = stringval = cstr(val) label = "label" + stringval randval = cint(math.floor((20 - 1 + 1) * rnd())) + 1 label.backcolor = color.green next end sub i error string has no property backcolor. how able edit strings without calling them individually? the error message correct: there isn't property called backcolor on string. there backcolor property on button, however, , looks if you're perhaps trying set background color of button object when it's clicked. if so, need hold of button object before can set color. event handler has made (moderately) easy, passing object handler parameter "sender". problem it's sent object, not button, first have cast type want, this: dim button button ...

java - RxJava. Observable.delay work strange (lacks some items at the end) -

i'm trying understand rxjava. test code is: import rx.observable; import rx.subscriber; import rx.functions.action1; import java.util.concurrent.timeunit; public class hello { public static void main(string[] args) { observable<string> observable = observable.create(new observable.onsubscribe<string>() { @override public void call(subscriber<? super string> subscriber) { try { thread.sleep(1000); subscriber.onnext("a"); thread.sleep(1000); subscriber.onnext("b"); thread.sleep(1000); subscriber.onnext("c"); thread.sleep(1000); subscriber.onnext("d"); thread.sleep(1000); subscriber.onnext("e"); thread.sleep(1000); sub...

ajax - CasperJS: capturing JSON sent response to javascript onClick() -

in casperjs, working site has button this: <a id="showbills" onclick="javascript:{showbills(); return false;}" href="#">show bills</a> clicking generates xmlhttprequest post message massive form full of magic numbers , state. server responds sending json data structure want capture. in case, can't call casper.getpagecontent() json data, since it's interpreted client , incorporated dom. nor can call casper.download(...) since can't manually reconstruct form data required post request. the question how can 'intercept' json data sent in response onclick()-backed click? half idea there may way subvert showbills() method on client, example send json response ordinary page (rather xmlhttprequest). that's beyond understanding of casperjs, phantomjs , http protocols.

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

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

opengl - Will memory leak if do multiple glBindBuffers on same buffer object, before call glDeleteBuffers? -

update discovered question duplicate of if call glbufferdata after calling on buffer, there memory leak? hopefully question still useful someone, give code samples, rather merely mentioning gl function calls, in q&a. i don't understand relationship between glgenbuffers / glbindbuffer / glbufferdata , gldeletebuffers . consider drawing sequence of lines (a line strip). original sequence drawn on number of frames, new user input increases number of lines. my first thought re-use buffer object name assigned glgenbuffers , when size changes. since buffer size needs larger, can't use existing buffer as-is. note: @ time, rather not assume "maximum size", allocate that, , sub-data calls size need. consider code based on example: when should call gldeletebuffers()? if had done these lines in initialization function before drawing first frame (code may not compile -- i'm concerned call sequence, not exact parameters pass -- i'm working in c# u...

mysql - Spark DataFrame InsertIntoJDBC - TableAlreadyExists Exception -

using spark 1.4.0, trying insert data spark dataframe memsql database (which should interacting mysql database) using insertintojdbc(). keep getting runtime tablealreadyexists exception. first create memsql table this: create table if not exists table1 (id int auto_increment primary key, val int); then create simple dataframe in spark , try insert memsql this: val df = sc.parallelize(array(123,234)).todf.todf("val") //df: org.apache.spark.sql.dataframe = [val: int] df.insertintojdbc("jdbc:mysql://172.17.01:3306/test?user=root", "table1", false) java.lang.runtimeexception: table table1 exists. this solution applies general jdbc connections, although answer @wayne better solution memsql specifically. insertintojdbc seems have been deprecated of 1.4.0, , using calls write.jdbc(). write() returns dataframewriter object. if want append data table have change save mode of object "append" . another issue example in ques...

javascript - Is there any way to gain access to this JSON feed purely from a browser client? -

i'd create client last.fm. music "station" feed here, in json format: http://www.last.fm/player/station/user/skeftomai/mix . however, when try access via $.getjson() , get no 'access-control-allow-origin' header present on requested resource. origin ' http://my.exampledomain.com ' therefore not allowed access. so unfortunately have cors issue on last.fm's end. i'd work around this. here things i've tried: ajax . fails access-control-allow-origin error. an iframe document.domain set "www.last.fm" or "last.fm". fails sameorigin iframe error. jsonp . unfortunately jsonp doesn't seem supported feed. a <script> tag src pointing feed link . unfortunately $('#scripttagid').html() empty. flash. unfortunately suffers same cross-origin issue. java applet. heavy, might not have jvm installed, , might suffer same cross-origin issue. i'm sure away web proxy whereby client utilizes server...