Posts

python - Basemap drawparallels tick label color -

i have possibly simple question. simplified version of code below: # rid of white stripe on map ionst, lons=addcyclic(ionst, lons) #setting figure attributes fig=plt.figure(figsize=(15,15),frameon=false, facecolor='gray') #map settings m=basemap(llcrnrlon=-180, llcrnrlat=-87.5, urcrnrlon=180, urcrnrlat=87.5,rsphere=6467997, resolution='l', projection='cyl',area_thresh=10000, lat_0=0, lon_0=0) #creating 2d array of latitude , longitude lon, lat=np.meshgrid(lons, lats) xi, yi=m(lon, lat) #plotting data onto basemap cs=m.imshow(varcor, interpolation=none, alpha=.8, cmap='seismic', vmin=-.02, vmax=.02) vert=plt.axvline(x=-75, color='black', linewidth=5) #drawing grid lines m.drawparallels(np.arange(-90.,90.,30.),labels=[1,0,0,0],fontsize=20) m.drawmeridians(np.arange(-180.,181.,45.), labels=[0,0,0,1],fontsize=20) #drawing coast lines m.drawcoastlines() when call drawparallels , drawmeridians argument, labels set according array specify....

serialization - How can I store instances of TabItem and load the instances on Application start (VB.NET) -

i'm storing instances of tabitem retrieving selected tab item tabcontrol's "selecteditem" property dictionary of type (string, tabitem) on button click 1 1. after few clicks have dictionary containing lots of tabitems. store entire dictionary permanently such can load on application start. suggestions on how , can store instances? know file option there other alternative? i tried serializing dictionary , store in file gives me error stating tabitem not serializable.

annotations - How to annotate helper class to be visible inside JSF? -

i have helper class, neither stateful managed bean , nor stateless ejb , nor entity mapped table via jpa or hibernate . collection of static methods simple things return date formats , similar. given that, in order java class visible inside jsf, class must annotated in way container assigns visible jsfs, there way annotate helper class not match of standard jsf visible categories becomes visible? alternative, of course, have conduit method in managed bean passes call jsf helper class prefer not clutter managed bean if can call directly jsf. understand doing stateless ejb jsf considered anti-pattern methods in class wish use simple , non-transactional. mark class @applicationscoped . make sure has public no-arg constructor , class doesn't have state , methods thread safe. e.g. managed bean (pure jsf) //this important import javax.faces.bean.applicationscoped; @managedbean @applicationscoped public class utility { public static string foo(string anoth...

ember.js - Ember Dynamically Generated HTML -

i have requirement need add html after dom has been rendered. wondering if possible manipulate dom after creation , dynamically add html , specifying associated ember action. e.g. intension of want achieve: $('.add').on("click", function(e){ e.preventdefault(); += 1; var content = "<div class=\"item dodgerblue\"><h1>"+i+"</h1></div>"; var content + "{{action "owlitemclicked" titlemodel.id titlemodel.index titlemodel on="click" }}" owl.data('owlcarousel').additem(content); }); specifically want add item carousel: http://owlgraphic.com/owlcarousel/demos/manipulations.html i'm not sure triple-stash, includes content without escaping it, work {{action}}. in case, looks me you'd better off defining html within each block , letting ember handle content addition. {{#each model |titlemodel index|}} <div class=\"item dodgerbl...

java - Static initializer runs after the constructor, why? -

i have 2 classes: class a: public class { static b b = new b(); static { system.out.println("a static block"); } public a() { system.out.println("a constructor"); } } class b: public class b { static { system.out.println("b static block"); new a(); } public b() { system.out.println("b constructor"); } } i create main class creates new a: public class main { public static void main(string[] args) { new a(); } } the output is: b static block constructor b constructor static block constructor as can see, constructor of invoked before static initializer. i understand got cyclic dependency created under impression static initializer should run before constructor. what reason happen (technically in java implementation) ? is recommended avoid static initializers ? static b b = new b(); is before static { ...

Excel recorded SQL database query not working -

i've recorded macro query database, , when record macro, query runs properly. however, when try run macro again on same sheet or on different one, error: runtime error 1004, "sql syntax error" on line .refresh backgroundquery:=false". below recorded macro. sub macro3() activesheet.querytables.add(connection:= _ "odbc;dsn=substation prod;srvr=subp;uid=u326357;", destination:=range("a1")) .commandtext = array( _ "select fact_monthly.time_stamp, fact_monthly.system_number_val0, fact_monthly.substation_number_val0, fact_monthly.mva_max_out_val0, fact_monthly.mw_max_out_val0, fact_monthly.mvar_max_out_val0, fact_" _ , _ "monthly.mw_min_out_val0, fact_monthly.mvar_min_out_val0, fact_monthly.pf_max_val0, fact_monthly.pf_min_val0, fact_monthly.top_oil_tank_max_val0, fact_monthly.load_factor_val0, fact_monthly.ph1_tap_max" _ , _ "_drag_val0, fact_...

c# - Entity Framework SaveChanges() not reflecting on entities -

i have winforms project , database running on sql server has 2 tables, student , standard . first created ado.net entity data model database wizard thing. have datagridview control has bindingsource datasource. note: databindingprojection class created able populate datagridview properties both student , standard entities i have code: var query = context.students .include(s => s.standard) .select(s => new databindingprojection { studentid = s.studentid, studentname = s.studentname, dateofbirth = s.dateofbirth, height = s.height, weight = s.weight, standardname = s.standard.standardname, standard_standardid = s.standard.standardid }).tolist(); mylist = new bindinglist<databindingprojection>(query.tolist()); dat...