Posts

c# - Update Graph (chart control) on another form -

i have c# windows form application contains mainform , graphview form . main form continuously receive current , temperature values usb port , stored in structure array list<> . during these process when click button in main form, form (graphview) form chart control open , plot graph , x-axis : time in minute, y-axis : current in ma, y2-axis : temperature in °c, what can do? in mainform public struct record { public byte chanelnumber; public uint16 serialnumber; public byte samplenumber; public string chanelvoltage; public string chanelcurrent; public string channeltemparature; } list<record>[] channelrecords = new list<record>[12]; channelrecords store received data usb port . private void btngraph_click(object sender, eventargs e) { g = new graphview(); g.show(); task task = new task(sendtograph); task.start(); } private void sendtograp...

ios - Reloading UITableView on Main Thread does not always work -

i have problem when reload data of uitableview on main queue doesn't reload data of time. reloads data around 3 out of 5 times when launch app streaks of reloading (3 5 launches) , streaks of not-reloading (2 3 launches). i'm testing app on iphone 6 ios 8.4 , xcode 7 beta 4 using swift 2. this code uiviewcontroller holding uitableview, initial screen app after launching. import uikit class tablecontroller: uiviewcontroller, cllocationmanagerdelegate { let rowtitles = ["date", "temp", "humidity", "wind"] var tabledata = [string : string]() override func viewdidload() { self.setuplocationmanager() } func setuplocationmanager() { // setting location manager self.locationmanager.startupdatinglocation() } func locationmanager(manager: cllocationmanager, didupdatelocations locations: [cllocation]) { locationdata.ownlocation = locations.last! self.locationmanage...

how to plot data from a csv in matlab -

i have csv file following data structure: p1_1,p2_1,p3_1 p1_2,p2_2,p3_2 p1_3,p2_3,p3_3 and want plot p2 againt p3 in matlab, wrote code: function plotdata dbstop if error filename='c:\\temp\\out100-2.csv'; m=csvread(filename); plot(m(2),m(3)); but plot empty. checked , m has data, way using plot not right. how can fix problem can plot it? m(2) , m(3) 2 scalar values, hence plot single point. you need supply vectors plot , e.g.: plot(m(:,1),m(:,2)) this plots data first , second columns of csv file.

ruby - Can't create variable on base object in 'self.included' hook in Opal -

it's question title says, have included hook in module: def self.included(base) puts 'included' base.extend api end my api requires variables on object exists none of them being created. i've tried: base.variable_name = [] %x|#{base}.variable_name = []| base.instance_variable_set(:@variable_name,[]) base.instance_exec{@variable_name = []} 1-2 inside of base.instance_exec using self instead of base yet none of them work, console complains variable_name= doesn't exist. what.the.hell? how variable exist on base object inside of included hook? in end, had use @variable_name ||= [] inside of function definitions work, don't works. if want know why don't it's because defining object attributes in once places means can find they're defined , change initial value, whereas here have track down change (not hard it's principle). personal preference guess.

javascript - Is it possible to trigger a datasource read of a kendo scrollview when scrolling to the left? -

the datasource in kendo scrollview (with serverpaging) trigger read (with skip & pagesize) when scrolling right. view notice when close end of dataset , update when end of full list not yet reached. is possible trigger same datasource read when scrolling left? datasource not start @ beginning of full list, want update when close beginning of dataset, while not having reached beginning of full list yet.

Run (Cygwin)C generated exe file using in Netbeans java with process -

i have c file called generator.c , using cygwin64 run make , generator.exe gets created bhulku-parvat@dasnadas /cygdrive/c/users/bhulku-parvat/desktop/bloom-filter $ make make: nothing done 'all'. $ ./bloomgenerator.exe test 4 0.0003 'c:\users\bhulku-parvat\desktop' 'c:\users\bhulku-parvat\desktop\rawdata.txt' and when run in cygwin give 5 parameter ,it succesfully runs , generate desired ouput new file in specified loaction following java code public class bloomtest { public static void main(string[] args) { runtime run = runtime.getruntime(); process p; system.out.println("----sart----"); string cmmd[] = new string[3]; try { cmmd[0] = "c:/cygwin64/bin/bash.exe"; cmmd[1] = "-c"; cmmd[2] = "'c:\\users\\bhulku-parvat\\desktop\\bloom-filter\\bloomgenerator.exe' 'testqw', '4', '0.0003', 'c:/users/bhulku-parvat/desktop' ,'c:/use...

Java Sockets Game error -

i followed tutorial( https://www.youtube.com/watch?v=xkbyce59y9w ) , has left me error: unable start client java.net.socketexception: connection reset @ java.net.socketinputstream.read(unknown source) @ java.net.socketinputstream.read(unknown source) @ java.net.socketinputstream.read(unknown source) @ java.io.datainputstream.readint(unknown source) @ client.client.init(client.java:39) @ sun.applet.appletpanel.run(unknown source) @ java.lang.thread.run(unknown source) code: client package client; import java.applet.applet; import java.awt.graphics; import java.awt.event.keyevent; import java.awt.event.keylistener; import java.io.datainputstream; import java.io.dataoutputstream; import java.io.ioexception; import java.net.socket; public class client extends applet implements runnable, keylistener { private static final long serialversionuid = 1l; static socket socket; static datainputstream in; static dataoutputstream out;...