Posts

java - Radio Button Project with null point errors -

how fix it? -------------------configuration: questions - jdk version 1.8.0_25 - -------------------- exception in thread "main" java.lang.nullpointerexception @ question3.(question3.java:103) @ question2.(question2.java:51) @ questions.main(questions.java:17) //////////////\ output of whole program hey need project, don't know how fix it. i'm new @ this, in advance helping. this first class, named questions /** * @(#)questions.java * * questions application * * @author * @version 1.00 2015/5/22 */ import java.awt.*; import java.awt.event.*; import javax.swing.*; public class questions { public static void main(string[] args) { question2 frame = new question2(); frame.setsize(800,600); frame.setvisible(true); } } this 2nd class, name question2 /** * @(#)question2.java * * * @author * @version 1.00 2015/5/22 */ import java.awt.*; import java.awt.event.*; imp...

sql server 2012 - table created in SQL management studio will not show up in Visual studio -

table created in sql management studio not show in visual studio when try create light switch app. added new table appendix existing database existing tables. native tables show up, except new one. idea? table exist in server explorer not in solution explorer

how to dynamically choose row labels using tabulate in python -

i have dictionary keys strings , values lists of integers. created follows: table_dict_of_lists = {} label in return_dict_keys: temp_list = [] dict_list in stats_list_dict_list: temp_list.append(len(dict_list[label])) table_dict_of_lists[label] = temp_list when run following: for k, v in table_dict_of_lists.iteritems(): print k, v i following: agentsgtx [566, 0, 0, 69, 134] pure_user_dict [11818, 0, 0, 627, 1910] inv_a_id_user_id [857, 0, 0, 73, 135] user_email_id_dict [18005, 0, 0, 800, 2669] ruurl_set [1288, 0, 0, 107, 247] user_id_invite_dict [9772, 0, 0, 473, 1578] pure_users_with_agents_dict [11060, 0, 0, 580, 1825] user_id_email_dict [18066, 0, 0, 800, 2682] this in service of trying dynamically print data table using tabulate . i've got: first_table = table_dict_of_lists f.write(tabulate(first_table, headers = "keys")) needless say, puts the keys column headers. i've looked here don't see answer. how keys l...

javascript - Window.onload Scope -

let's have following code: var x; window.onload = function(){ x=4; }; console.log(x); the console doesn't output 4, undefined. does know how able access changed x variable outside of window.onload function? thanks in advance! this has javascript's async behavior. console.log doesn't happen after window.onload has fired. they're separate events. if want output x, need var x; window.onload = function(){ x=4; console.log(x); };

javascript - Animate Header based on different scroll positions -

currently have header animates (squishes) smaller version different logo , different nav after scrolling amount of pixels. if user scrolls past pixel amount (170 in case), header expands normal state. (because there long pages on site) client wants header 'expand' time the user scrolling in up. think getting close, events firing zillion times when begin scroll page. here current javascript: function squishheader() { compactheader = true; header.animate({height: '48px'}, 500); mainnav.fadeout("fast"); logo.fadeout("fast"); scrolllogo.delay(300).slidedown("fast"); if (overlayisvisible == true) { overlay.fadeout("slow"); overlayisvisible = false; } } function expandheader() { compactheader = false; header.animate({height: '130px'}, 100); scrolllogo.css("display", "none"); logo.fadein("slow"); mainnav.delay(300).fadein(...

javascript - Find the substrings in a string and put them in an array -

so have string (line-breaks added): var str = '[{"id":1,"type":"one","status":"pending","user_id":2}, {"id":2,"type":"two","status":"pending","user_id":14}, {"id":3,"type":"three","status":"queue","user_id":5}, {"id":4,"type":"four","status":"queue","user_id":8 }]'; what algorithm can use type values in 1 array? result "one", "two", "three", "four" . if you're writing es6, following @arunpjohny: array.map(elt => elt.type) or [ (elt of array) elt.type ]

python - Optimizing py2neo's cypher insertion -

i using py2neo import several hundred thousand nodes. i've created defaultdict map neighborhoods cities. 1 motivation more efficiently import these relationships having been unsuccessful neo4j's load tool . because batch documentation suggests avoid using it, veered away implementation op of this post . instead documentation suggests use cypher. however, being able create nodes defaultdict have created. plus, found difficult importing information first link demonstrates. to reduce speed of import, should create cypher transaction (and submit every 10,00) instead of following loop? for city_name, neighborhood_names in city_neighborhood_map.iteritems(): city_node = graph.find_one(label="city", property_key="name", property_value=city_name) neighborhood_name in neighborhood_names: neighborhood_node = node("neighborhood", name=neighborhood_name) rel = relationship(neighborhood_node, "in",...