Posts

Showing posts from March, 2011

java - How do I read a CSV file into my local Oracle Database table? -

my goal read csv file, loading sample database table (oracle) have . far , have following java code : public class parsingcsv { public static void main(string[] args) { parsingcsv obj = new parsingcsv(); obj.run(); } @suppresswarnings("oracle.jdeveloper.java.nested-assignment") public void run() { string csvfile = "c:\\users\\ibm_admin\\desktop\\work\\connectone_bancorp\\database_work\\book1.csv"; bufferedreader br = null; string line = ""; string cvssplitby = ","; try { br = new bufferedreader(new filereader(csvfile)); while ((line = br.readline()) != null) { // use comma separator string[] country = line.split(cvssplitby); system.out.println("country [code= " + country[4] + " , name=" + country[5] + "]"

c# - ServiceStack RequiredRole is resetting my expiry (time to live) to 2 weeks -

i using servicestack redis store sessions. session expiry set on per user basis. it's working expect these specific service methods, having side effect of changing ttl (time live) default of 2 weeks when use [requiredrole(roles.admin)] , using [authenticate] isn't problem. using repositories.dto; using servicestack; using servicestack.auth; namespace webapi.controllers { public class registrationservice : registerservice { private readonly registrationrepo _repo; public registrationservice(registrationrepo repo) { _repo = repo; } [authenticate] // no problems public object put(registrationrequest registration) { var result = _repo.updateuser(registration.user); return new { user = result }; } [authenticate] [requiredrole(roles.admin)] //problems. expiry resets 2 weeks public object post(registrati

jquery - Javascript animation ontop of a image -

Image
is possible javascript animation ontop of image? if so, how? this image, want add multiple stickmen walking around departments in map. tried using css , javascript failed, not able add stickmen ontop of picture. the approach tried creating div elements stickmen pictures inside of them in img tags. tried using javascript animate specific divs. did not work. there many ways this. here's simple example shows 2 ways: blue dot: using absolute positioning , jquery's animate() red dot: using css keyframe animations function doanimate() { $("#animate").css({top: "76px", left: "204px"}).animate({top: "110px", left: "208px"}, 1000).animate({top: "110px", left: "97px"}, 1500).animate({top: "76px", left: "104px"}, 1000).animate({top: "76px", left: "204px"}, 1500); }; doanimate(); setinterval(doanimate, 5100); #image { height: 200px; wi

Matlab - Image Formation - Matrix -

i doing interesting computer vision project talks how "create manually" images matlab. the teacher gave me 3 matrices: illuminant matrix (called e) , camera sensitivity matrix (called r) , finally, surface reflectance matrix (called s) . matrix dimensions follows: s: 31x512x512 (reflectance samples x x-dimension x y-dimension ) r: 31x3 e: 31x1 the teacher gave me following relationship: p=transpose(c)*r=transpose(s)*diagonal(e)*r where c color matrix . p sensor response matrix . the goal display image formed previous matrices. therefore, have compute p matrix. the class of matrices double . this have done: diag_d=diag(d);% diagonal matrix of d s_reshaped= reshape(s,31,[512*512]);% reshape surface reflectance matrix s_permute=permute(s_reshaped,[2 1]);% output matrix 262144x31 matrix color_signal_d65_buffer=s_permute*diag_dd; color_signal_d65=reshape(color_signal_d65_buffer,[512 512 31]);% final color matrix image_d65_buffer= (reshape(color_signal_d

web services - SOAP API parameter best practice -

i have set of soap webservices tightly coupled application within same architecture need api other applications hook into. at moment, services use parameter (and method) structure this entity getentity(int entityid) entity getentitybyname(string entityname) .... etc. in case of creates use: void createentity(entity entity) i wondering though better this: entityresponse getentity(entityrequest requestobj) ..... and in requestobj have id, entityname , depending user supplies, can perform either function. and create be: createentityresponse createentity(createentityrequest requestobj). my thinking doing this, api can change internally...add new parameters etc without breaking integration has been done. i think there several design principles may want consider: 1) database entity vs data transport object dto looks entities come directly database mapping? exposing entities api, fancy sql query browser. it's not wrong achieve better de-coupling if exp

Java NIO read large file from inputstream -

i want read large inputstream , return file. need split inputstream(or should read inputstream in multiple threads). how can this? i'm trying this: url url = new url("path"); urlconnection connection = url.openconnection(); int filesize = connection.getcontentlength(); inputstream = connection.getinputstream(); readablebytechannel rbc1 = channels.newchannel(is); readablebytechannel rbc2 = channels.newchannel(is); fileoutputstream fos = new fileoutputstream("file.ext"); filechannel filechannel1 = fos.getchannel(); filechannel filechannel2 = fos.getchannel(); filechannel1.transferfrom(rbc1, 0, filesize/2); filechannel2.transferfrom(rbc2, filesize/2, filesize/2); fos.close(); but not affect on performance. you can open multiple (http) connections same resource (url) use range: header of http make each stream begin read @ point. can speed data transfer, when high latency issue. should not overdo

security - Python: securing sensitive variable contents within a script -

i need user input password script can use password perform ldap operation on account. it's simple: password = getpass.getpass() ldapconn.simple_bind_s(binddn, password) even though password never leaving script , never displayed in plain text, isn't still vulnerable memory dump? what's best way secure password within script, still make use of it? this post interesting: https://security.stackexchange.com/questions/29019/are-passwords-stored-in-memory-safe primarily because answers confirm suspicion passwords stored in ram not safe. question is, how 1 supposed work requires sensitive information stored in ram? no 1 on post posts practical real-world solution, lot of confirmation , details why ram not safe. using short example of ldap connection above, concrete changes make better secure password variable? using short example of ldap connection above, concrete changes make better secure password variable? none. either: need have plain tex

swift - TI SensorTag 2 CC2650 Servis Calculations (IR temperature - MPU9250) -

how can calculate ir temperature in cc2650. ti temperature : f000aa00-0451-4000-b000-000000000000 temperature data: f000aa01-0451-4000-b000-000000000000 i try calculate object , ambient based on data in temperature data characteristic. object data higher ir temperature showed in ti application. swift code: static func calculateobjectandambient(objectraw:int16, ambientraw:int16) -> (double, double) { let ambient = double(ambientraw)/128.0; let vobj2 = double(objectraw)*0.00000015625; let tdie2 = ambient + 273.15; let s0 = 6.4*pow(10,-14); let a1 = 1.75*pow(10,-3); let a2 = -1.678*pow(10,-5); let b0 = -2.94*pow(10,-5); let b1 = -5.7*pow(10,-7); let b2 = 4.63*pow(10,-9); let c2 = 13.4; let tref = 298.15; let s = s0*(1+a1*(tdie2 - tref)+a2*pow((tdie2 - tref),2)); let vos = b0 + b1*(tdie2 - tref) + b2*pow((tdie2 - tref),2); let fobj = (vobj2 - vos) + c2*pow((

Compiling C++ with MongoDB -

i getting bunch of error when try compile c++ code connect mongodb. using command: directories refer mongoclient lib , boost libs. g++ tutorial.cpp -o tutorial -i/usr/include/mongo/client -l/usr/lib -l/usr/lib/i386-linux-gnu/ any suggesttion how fix error labuser@labuser:~/mdbtest$ g++ tutorial.cpp -i/usr/include/mongo/client -l/usr/lib -l/usr/lib/i386-linux-gnu/ -o tutorial /tmp/cc9l7bcw.o: in function __static_initialization_and_destruction_0(int, int)': tutorial.cpp:(.text+0x23f): undefined reference to boost::system::generic_category()' tutorial.cpp:(.text+0x249): undefined reference boost::system::generic_category()' tutorial.cpp:(.text+0x253): undefined reference to boost::system::system_category()' /tmp/cc9l7bcw.o: in function mongo::dbexception::dbexception(std::string const&, int)': tutorial.cpp:(.text._zn5mongo11dbexceptionc2erkssi[_zn5mongo11dbexceptionc5erkssi]+0x17): undefined reference to vtable mongo::dbexception' tutorial.cpp:(.te

spring mvc - Tuckey URL Rewrite Filter Java Class Configuration -

i have been researching how perform url rewrites on tomcat 8 , keep running same 2 suggestions. 1) use tuckey urlrewritefilter. 2) run apache on top of tomcat use mod_rewrite. in regards former, urlrewritefilter doesn't appear have documentation how configure in java format opposed xml. spring mvc application not make use of web.xml file - configuration done via java classes - , i'm not in position configure xml. is there way configure in way or there alternatives other trying run apache on top of tomcat? for example, there way achieve in java opposed xml: <filter> <filter-name>urlrewritefilter</filter-name> <filter-class>org.tuckey.web.filters.urlrewrite.urlrewritefilter</filter-class> </filter> <filter-mapping> <filter-name>urlrewritefilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>request</dispatcher> <dispatcher>forward</dispatcher> <

order - How to keep observations match after value label modified? -

i'm doing basic data processing stuff stata. however, stuck on how keep observations of other variables matching, after modifying variable's value label. for example, say, have raw dataset follows: var1 var2 var3 1000 15 china 500 20 uk 800 10 the var1 string variable. need convert numeric one. typed encode var1, gen(country) // new variable country numeric the variables want future work var2 , var3 , country . when new variable generated, automatically has value label. specific, if click on in column of country , shows 3 in cell on top of column. var1 var2 var3 country 1000 15 china 500 20 china uk 800 10 uk so far it's good. mean each row observations match. however, automatically generated value label not want. need make 1 denote uk, 2 , 3 china. modified by: label define country 1 "uk" 2 "us" 3 "china", modify as shown

java - Have I used the this keyword correctly in my class? -

i'm new programming, 1 of our first object oriented programs doing in class. feel have used "this." more need to, program works , correct output. in getters, can return variable without using this ? guess question this.variablename refer parameter variable or data field declared @ top of class? import java.util.date; public class account{ private int id = 0; private double balance = 0; private static double annualinterestrate = 0.00; private date datecreated; public account(){} public account(int id, double balance){ this.id = id; this.balance = balance; } public int getid(){ return this.id; } public void setid(int id){ this.id = id; } public double getbalance(){ return this.balance; } public void setbalance(double balance){ this.balance = balance; } public double getannualinterestrate(){ return this.annualinterestrate; } public

java - Implementing splay() method for Binary Search Tree -

i trying implement splay(node x) method binary search tree. have leftrotation(node x) , rightrotation(node x) methods implemented correctly (atleast, think are...), when try implement them in splay(node x) method, calls in infinite loop. now, know why it's doing that, can't seem figure out how fix it. here leftrotation(node x) method: public void leftrotation(node<e> x) { if (x.getrightchild() == null) { return; } node<e> y = x.getrightchild(); x.setrightchild(y.getleftchild()); if (y.getleftchild() != null) { y.getleftchild().setparent(x); } y.setparent(x.getparent()); if (x.getparent() == null) { root = y; } else { if (x == x.getparent().getleftchild()) { x.getparent().setleftchild(y); } else { x.getparent().setrightchild(y); } } y.setleftchild(x); x.setparent(y); } here's rightrotation(node x) method: public void rightrotati

ElasticSearch autocomplete for keywords from a string -

my document looks like: "hits": { "total": 4, "max_score": 1, "hits": [ { "_index": "test_db2", "_type": "test", "_id": "1", "_score": 1, "_source": { "name": "very cool shoes", "price": 26 } }, { "_index": "test_db2", "_type": "test", "_id": "2", "_score": 1, "_source": { "name": "great shampoo", "price": 15 } }, { "_index": "test_db2", "_type": "test", "_id": "3",

Parsing file in Lua for specific value in table -

i new lua programming , trying parse local file on pc , save elements of table/array strings. i have been able data , print each line of file, except having problems when trying specific value , save them strings or print line. appreciated. here code sample: function file_exists(file) local f = io.open(file, "rb") if f f:close() end return f ~= nil end function lines_from(file) if not file_exists(file) return {} end lines = {} line in io.lines(file) lines[#lines + 1] = line end return lines end local file = 'stats.txt' local lines = lines_from(file) k,v in pairs(lines) print('line[' .. k .. ']', v) end your code works expected. copied code file named temp.lua . here output: line[1] function file_exists(file) line[2] local f = io.open(file, "rb") line[3] if f f:close() end line[4] return f ~= nil line[5] end line[6] line[7] line[8] function lines_from(file) line[9] if not file_exists

r - Rstudio auto-completion, undefined options for data columns -

with rstudio, let's create data frame called data. data = data.frame(a=rep(0,100),b=rep(1,100)) then, if input data$ , click tab auto-completion, shows options as: a , b (column names defined in data expected) can choose from. but if input data$ within function, input unique(data$ , click tab, shows options as: germancredit , cars , dhfr ,... (which not expected. don't know from.) in global environment, there no such data germancredit or cars . if create data using different name say data2 = data.frame(a=rep(0,100),b=rep(1,100)) then, don't trouble. q: wondering going on here , how can address issue once click on tab, show columns defined in data. just in case, have installed following packages in rstudio: grid stats graphics grdevices utils datasets methods base pryr_0.1.2 e1071_1.6-7 caret_6.0-52 gridextra_2.0.0 boot_1.3-17 lmtest_0.9-34 zoo_1.7-12 paireddata_1.0.1 ggplot2_1.0.1 latt

How can I access the array values in php? -

this question has answer here: how can access array/object? 4 answers my array this: [name] => array ( [0] => mark ) since array name value array called "category": category = array(name); i'm having trouble getting value of name[0] = "mark" pls me out! $result = $myarray['name'][0]; since array 2-dimensional need use 2 indexes reach bottom-layer of values.

java - I'm almost finished, but how to loop the entire program? -

my cash register program complete, can process sales , returns , adds or subtracts money in register. my problem once i'm done adding values example, program closes , cant figure out how loop choice menu. tried using loop , while loop yelled @ me saying had invalid input (probably because have press f stop when you're checking out). how can loop whole thing? import java.util.scanner; import java.util.arraylist; public class assignment3_000848913 { public static void main(string[] args) { scanner in = new scanner(system.in); arraylist<integer> prices = new arraylist<integer>(); arraylist<integer> returnprices = new arraylist<integer>(); int totalregistermoney = 0; int choice = 0; system.out.print("what do?"); system.out.println(); system.out.print("press 1. process sale"); system.out.println(); system.out.print("press 2. process re

android - How should i reflect the incremented values of a textview ,in a custom listview,after the user restarts the application? -

i making music player in android. data mp3 files accessed mediastore.audio.media. have added additonal textview field , assigned 0,this textview displays how many times song has been listened. everytime user plays song, textview value incremented 1. i load data, increment textview, works in scenarios , oncompletion,next,previous,play,onitemclick updates value of textview. i close down app , restart it.after restarting in oncreate method of main activity listview gets popluated,and incremented values of textview set 0. incrementd values not stored. how should store values , reflect when user restarts app, or after user uninstalls app , decides download ? how should store incremented values ? if u want values after user uninstalls app shared preferences of no use cleared. you can write data file on disk , retrieve value when activity starts. here's link on android developers site data storage : data storage cheers : )

javascript - How do I select an element that matches a .text() == "" condition? -

this want do: <label class="myclass"></label> <!-- want hide --> <label class="myclass">some text here</label> <!-- don't hide --> $('label.myclass').text() == "" ) { $('this').hide(); } of course, $(this) points window, not label.myclass meets condition. how rewrite i'm selecting labels nt have text inside it? var label = $('label.myclass').filter(function (index) { if ($(this).text() == "") { return $(this) } }) console.log(label.attr('class')) console.log(label.text()) console.log(label.length) use .filter() demo

joptionpane - Error in Java application -

code in action listener of save button: i= integer.parseint(txt_userid.gettext()); s= txt_pass.gettext(); n = txt_name.gettext(); try { if(txt_userid.gettext().isempty() || (txt_pass.gettext().isempty() || txt_name.gettext().isempty()))) { joptionpane.showmessagedialog(null, "incomplete input!"); } else{ rs.movetoinsertrow(); rs.updateint("userid", i); rs.updateint("password", s); rs.updateint("name", n); rs.insertrow(): joptionpane.showmessagedialog(useraccountform.this, "record saved"): } } catch(sqlexception err) { system.out.println(err.get message()); } my problem when 1 or 2 text field left empty information typed must not save , must pop message dialog "incomplete input". works fine txt_pass , txt_name both string, whenever left text field ( txt_userid ) empty gives me error. why that? i have had same issue, can av

c++11 - C++ segmentation fault binary trees using pointers -

i have come implementation of binary tree ensures fillable positions in particular level filled ( number of nodes @ level k must 2^k before proceeding next level). unfortunately getting segmentation fault. #include <iostream> #include <math.h> #define ll long long int using namespace std; struct node { int value=0; node* left=null; node* right=null; int height=0; int numnodes(); node() { } node(int val,node* l=null,node* r=null) : value(val),left(l),right(r) {} int getheight(); node* operator=(node* n) { this->value=n->value; this->right=n->right; this->left=n->left; } }*binrooter; int node::numnodes() { if(this->left==null && this->right==null) return 0; return this->left->numnodes()+this->right->numnodes()+1; } int node::getheight() { return max(this->left->getheight(),this->right->getheight())+1; } node* insertbintree(node* binroo

c# - How Bitwise AND "&" Works Logically? -

i need understand bit of code please 1 have experience operators, have open source code , need understand part: public static bool containsdestroywholerowcolumn(bonustype bt) { return (bt & bonustype.destroywholerowcolumn) == bonustype.destroywholerowcolumn; } and bonustype enum: [flags] public enum bonustype { none, destroywholerowcolumn } please, explain how part works ? return (bt & bonustype.destroywholerowcolumn) == bonustype.destroywholerowcolumn; why not write : return bt == bonustype.destroywholerowcolumn; ? thanks in advance [testclass] public class enumtest { [testmethod] public void flagstest() { var test1 = bonustype.none; assert.that(containsdestroywholerowcolumn(test1), is.false); var test2 = bonustype.destroywholerowcolumn; assert.that(containsdestroywholerowcolumn(test2)); var test3 = bonustype.none | bonustype.destroywholerowcolumn; assert.t

java - Add Values from JTextFied to JTable -

public class billdetailspanel implements actionlistener { jpanel panel; int flag = 0; jlabel litemname, lprice, lqty, ltax, ldisprice; jtextfield price, qty, tax, disprice; jcombobox<string> itemname; string[] booktitles = new string[] { "effective java", "head first java", "thinking in java", "java dummies" }; jbutton addbtn public billdetailspanel() { panel = new jpanel(); panel.setpreferredsize(new dimension(900, 50)); flowlayout layout = new flowlayout(flowlayout.center, 5, 15); panel.setlayout(layout); // panel.setbackground(color.green); litemname = new jlabel("item name"); lprice = new jlabel("price"); lqty = new jlabel("quantity"); ltax = new jlabel("tax"); ldisprice = new jlabel(&quo

Simple print string array -

please let me know mistake simple code. #include<stdio.h> #include<conio.h> void main() { int i,n; char a[100]; clrscr(); printf("\n enter size of array"); scanf("%d",&n); printf("\n enter array"); for(i=0;i<n;i++) scanf("%s",a[i]); printf("\n array \n"); for(i=0;i<n;i++) printf("%s",a[i]); getch(); } my input enter size of array 2 enter array apple banana array (null) (null) can explain why is? going wrong? if input single characters or s, same output. thanks in advance you not declaring array of string itself. by char a[100]; means declaring array can hold 100 characters (one of them should null proper string termination). in other words declaring 1 string. whereas want array of strings, need char a[10][100]; . declare array of 10 strings, every string can hold 100 characters. after updating code char a[10][100]; , getting fol

php - Laravel 5 form model binding with hasMany -

i have 2 models: category , categoryvalue . inside category model have: public function values() { return $this->hasmany('app\categoryvalue'); } inside categoryvalue have: function category() { return $this->belongsto('app\category'); } in edit view, have form model binding so: {!! form::model($category, ['route' => ['category.update', $category->slug], 'method' => 'patch']) !!} @include('partials.categoryform') {!! form::close() !!} where $category chosen category model. the categoryform partial looks like: <div class="form-group {{ $errors->has('name') ? 'has-error' : '' }}"> {!! form::label('name', 'name') !!} {!! form::text('name', null, ['class' => 'form-control']) !!} {!! $errors->first('name', '<span class="help-block">:message</span>'

java - How to configure javadb in eclipse(part2)? -

this continuation of previous question how configure javadb in eclipse? . able made changes on code giving me error -> error: java.net.connectexception : error connecting server localhost on port 1527 message connection refused: connect . hope guys can me one. here code: import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.statement; public class test { public static void main(string[] args) { try { class.forname("org.apache.derby.jdbc.clientdriver").newinstance(); } catch (instantiationexception e) { e.printstacktrace(); } catch (illegalaccessexception e) { e.printstacktrace(); } catch (classnotfoundexception e) { e.printstacktrace(); } final string db_url = "jdbc:derby://localhost:1527/coffeedb;create=true"; try{ connection conn = drivermanager.getconnection(db_url); statement stmt = conn.createstatement(); string sql

python - I do not understand this piece of tutorial code? -

i'm learning python book michael dawson. clear , concise except when got exercise called 'word jumble game'. code confusing me. import random # create sequence of words choose words = ("python", "jumble", "easy", "difficult", "answer", "xylophone") # pick 1 word randomly sequence word = random.choice(words) # create variable use later see if guess correct correct = word # create jumbled version of word jumble ="" while word: position = random.randrange(len(word)) jumble += word[position] word = word[:position] + word[(position + 1):] what don't understand how while:word works. explanation given: i set loop way continue until word equal empty string. perfect, because each time loop executes, computer creates new version of word 1 letter “extracted” , assigns word. eventually, word become empty string , jumbling done.

java - Android MediaPlayer sometimes skips or fails when playing two sounds simultaneously -

i've made method play sounds in mp3 format (max file size 145kb). when event happens in game send file method. creates new mediaplayer instance whenever called, releases instance on completion. problem both emulator , phone, when play 2 sounds near simultaneously, sounds either skip (like scratched cd), or 1 sound doesn't play @ all, or works. is thread getting overloaded or something? have samsung galaxy s3. should use soundpool instead? i've heard has own problems public class mediasimultaneous { private mediaplayer[] mediaplayerarray = new mediaplayer[10]; private audiomanager maudiomanager; int playernum = -1; // array index of player instance. public void playsound(context context, int audioid) { if (maudiomanager == null) { maudiomanager = (audiomanager) context.getsystemservice(context.audio_service); } playernum += 1; mediaplayerarray[playernum] = mediaplayer.create(context, audioid); mediaplayerarray[playernum].se

android - After Getting object/array from json, how can i shuffle it (Randomize) -

i got json data using this `` private void loadquestions() throws exception { try { inputstream questions = this.getbasecontext().getresources() .openrawresource(r.raw.questions); breader = new bufferedreader(new inputstreamreader(questions)); stringbuilder quesstring = new stringbuilder(); string ajsonline = null; while ((ajsonline = breader.readline()) != null) { quesstring.append(ajsonline); } log.d(this.getclass().tostring(), quesstring.tostring()); jsonobject quesobj = new jsonobject(quesstring.tostring()); queslist = quesobj.getjsonarray("questions"); log.d(this.getclass().getname(), "num questions " + queslist.length()); } catch (exception e){ } { try { breader.close(); } catch (exception e) { log.e("", e.getmessage().tostring(), e.getcause

Saving image which is displayed using peek() in python -

import matplotlib.pyplot plt import sunpy.spectra import sunpy.data.sample sunpy.spectra.sources.callisto import callistospectrogram image = callistospectrogram.read(sunpy.data.sample.callisto_image) image.peek() then how save image using command? i don't have sunpy environment test on, can give following shot? import matplotlib matplotlib.use('agg') import matplotlib.pyplot plt import sunpy.spectra import sunpy.data.sample sunpy.spectra.sources.callisto import callistospectrogram image = callistospectrogram.read(sunpy.data.sample.callisto_image) image.plot() plt.savefig('myfig') based on generate images without having window appear : the easiest way use non-interactive backend (see backend?) such agg (for pngs), pdf, svg or ps. in figure-generating script, call matplotlib.use() directive before importing pylab or pyplot: import matplotlib matplotlib.use('agg') import matplotlib.pyplot plt plt.plot([1,2,3]) plt.sav

java - Encountering problems with Thread.sleep in Swing -

this program written count 0 1000 goes straight 1000 without displaying counting process. have written similar code using progress bar , thread.sleep() method , works perfectly. import javax.swing.jframe; import javax.swing.jbutton; import javax.swing.jtextfield; import javax.swing.jpanel; import java.awt.gridlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; public class project extends jframe implements actionlistener { jbutton countupbutton = new jbutton("count up"); jbutton countdownbutton = new jbutton("count down"); jbutton resetbutton = new jbutton("reset"); jtextfield numberfield = new jtextfield(); int count = 0; public project(){ setlayout(new gridlayout(1, 4)); setsize(500, 300); add(numberfield); add(countupbutton); add(countdownbutton); add(resetbutton); countupbutton.addactionlistener(this); countdownbutton.addaction

jquery - Google Line chart With Refresh - Not working after refresh -

Image
i trying create google line chart ajax . and want set interval refreshing data , want chart drawn each time after page resized. so, have done is- index.html- <html> <head> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> </head> <body> <div class="container"> <div class="row"> <div class="col-sm-12"> <!-- <div id="piechart"> --> <div id="chart_div" style="width: 100%; height: 100%;"> <!-- chart goes here --> </div> </div> </div> </div> </body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js">