Posts

java - Date time and simple date time format results are different -

i have following code fragment: datetime datetime = new datetime().withzone(datetimezone.forid("america/chicago")) .withyear(2016) .withmonthofyear(8) .withdayofmonth(25) .withhourofday(12) .withminuteofhour(37); system.out.println("datetime: "); system.out.println(datetime.todate().gettime()); string str = "2016-8-25 12:37 cst"; simpledateformat sdf = new simpledateformat("yyyy-m-dd hh:mm z"); system.out.println("sdf: "); try { system.out.println(sdf.parse(str).gettime()+""); } catch (parseexception e) { // todo auto-generated catch block e.printstacktrace(); } according understanding, both represent same date (and hence epoch should same well). result is: datetime: 1472146669119 sdf: 1451198220000 if change timezone cdt, ge...

reactjs - How can I call forceUpdate on the root element in React? -

i need call forceupdate on app root of react app or on component 1 in. know call forceupdate on current component this.forceupdate() , how call on component? you can pass this.forceupdate() function vis props child component root.js var root = react.createclass({ render: function() { return ( <updatecomponent rootupdate={this.forceupdate.bind(this)} /> ); } }); then can access call this.props.rootupdate() in updatecomponent whenever need root force updated.

ios - why the stack view's frame is (0.0, 0.0)? -

i'm trying autolayout stack views , create arrangedsubview(2 labels , 1 image) in code, 1 set of stack view appear in simulator. when print results in console, labels , image have values, except stack view's frame 0.0;0.0 . why happen this? why stack view not appear? please see code below: code let contentview: uiview = uiview() let stackview: uistackview = uistackview() var singlestack = array(count: 6, repeatedvalue: uistackview()) var timelabel = array(count: 6, repeatedvalue: uilabel()) var iconimage = array(count: 6, repeatedvalue: uiimageview()) var templabel = array(count: 6, repeatedvalue: uilabel()) override func viewdidload() { super.viewdidload() index in 0...5 { timelabel[index].text = "0\(index):00" iconimage[index].image = uiimage(named: "sunny")! templabel[index].text = "0\(index)°" singlestack[index].addarrangedsubview(timelabel[index]) singlestack[index]...

unity3d - How can I render two transparent objects as one continuous object? -

i'm struggling transparency right 2 objects overlap , work 1 layer. ideally i'd have 1 big red field on skybox instead have moments transparency adds up. there effective way around this? what want (from angles): http://imgur.com/sn8sotz what looks (from angle see them intersect): http://imgur.com/q7an21v current shader code: shader "mobile/particles/ballshader" { properties { _color("main color", color) = (1,1,1,.1) } category { tags { "queue"="transparent" "rendertype"="transparent" } blend oneminusdstcolor 1 // soft additive lighting off zwrite on ztest lequal subshader { color [_color] pass { } } } } edit: got closer solving things without real understanding of how. unity's built in particles/additive deals problem.

c++ - ==15341==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb59007e0 at pc 0x8048ca7 bp 0xbfb47388 sp 0xbfb4737c -

i'm pretty new dynamic memory management , using fsanitise flag find problems memory management. cannot use vector store data - need use primitive arrays, "new" , "delete" manage heap objects. i got following error when try run euclideanvectortester compiled program not sure problem is, enlighten me please? weill % make g++ -std=c++14 -wall -werror -o2 -fsanitize=address -c euclideanvectortester.cpp g++ -std=c++14 -wall -werror -o2 -fsanitize=address -c euclideanvector.cpp g++ -fsanitize=address euclideanvectortester.o euclideanvector.o -o euclideanvectortester weill % ./euclideanvectortester 1 ================================================================= ==15341==error: addresssanitizer: heap-buffer-overflow on address 0xb59007e0 @ pc 0x8048ca7 bp 0xbfb47388 sp 0xbfb4737c write of size 8 @ 0xb59007e0 thread t0 #0 0x8048ca6 in main (/tmp_amd/kamen/export/kamen/3/z3386180/cs6771/evec/euclideanvectortester+0x8048ca6) #1 0xb6ecae45 in __libc_sta...

emacs - Can I turn off highlighting of TODO keywords? -

i using several normal verbs todo keywords. example, 'fix' todo keyword, , when gets done turns 'fixed'. works except find highlighting distracting. can turn off? ideally task simple sentence "fix ..." no special highlighting, recognised todo item. todo keywords have org-todo face default, changing face doesn't trick. reinstates default if turn off 1 of attributes, , in case foreground should match current level, there no 1 colour work. if it's org-level-x want org-level-x.

database design - link subform to mainform access 2007 -

mainform: has read textboxes reference table (tblemployee) hold flatfile upload data. subform: linked "id" field in tblemployee table. subform input data input tblemployeechangeover table. subform acting "update" tool. user @ mainform, , if data needs updated, interact subform so. tblemployee not modified, , tblemployeechangeover can used email new data , used run reports. both forms: --have field named id, supposed linked on. example, if flat file has id of "3", subform should "3" well. --field names identical both main form , sub form, except subform has "_changeover" on them. id id both forms. "employeeschedule" on mainform "employeeschedule_changeover" on subform table , textboxes. problem: upload of flatfile seems fine. need able input data in subform saved tblemployeechangeover table. whenever try input data subform , advance new record in mainform: -cannot input id in id textbox in subform -w...