Posts

java - How to write event class for a customized listener? -

i'm making game in java need character listen on time event handled in class. i been using this answer make own listener it. so fare have defined interface this: public interface timelistener { public void ontick(timeevent event); } and the timeevent this: public class timeevent { private int time; public timeevent(int time) { this.time = time; } public int gettime() { return time; } } in answer wrote eatevent simple wrapper class food. not quite how that. timeevent cover this? my timeevent, unlike eatevent, needs give time along time class listeners. proper way send time along? simply use observer design pattern it

java - failed to load the JNI shared library "C:\Windows\system32\..\jre\bin\client\jvm.dll\" ECLIPSE -

i working on stuff few days ago , today went open eclipse got error: "failed load jni shared library "c:\windows\system32\..\jre\bin\client\jvm.dll\" " could please help. have looked on 20 stack overflow things , none of them have worked me. looks eclipse cannot find proper jre. make sure have jre or jdk installed , java_home environment variable set valid jre installation path. note 32-bit eclipse work 32-bit jre , same applies 64-bit version. if nothing works can point eclipse jre manually editing eclipse.ini file. see this article details.

c# - Scrolling Background Animation in WPF -

Image
this code: <drawingbrush viewport="0,0,16,16" viewportunits="absolute" stretch="none" tilemode="tile" x:key="dbcheckerboard"> <drawingbrush.drawing> <drawinggroup> <geometrydrawing brush="lightgray"> <geometrydrawing.geometry> <geometrygroup> <rectanglegeometry rect="0,0,8,8"/> <rectanglegeometry rect="8,8,8,8"/> </geometrygroup> </geometrydrawing.geometry> </geometrydrawing> <geometrydrawing brush="white"> <geometrydrawing.geometry> <geometrygroup> <rectanglegeometry rect="8,0,8,8"/> <rectanglegeometry rect="0,8,8,8"/> ...

python - Wordnet Synonyms not returning all values nltk -

i trying synonyms or similar words using nltk's wordnet not returning. i doing: >>> nltk.corpus import wordnet wn >>> wn.synsets('swap') [synset('barter.n.01'), synset('trade.v.04'), synset('swap.v.02')] i tried doing (from 1 of stackoverflow page): >>> ss in wn.synsets('swap'): sim in ss.similar_tos(): print(' {}'.format(sim)) but not getting synonyms. not want add synonyms wordnet. expecting return exchange,interchange, substitute etc. how achieve this? thanks abhi to synonyms using wordnet , this: >>> nltk.corpus import wordnet wn >>> synset in wn.synsets('swap'): lemma in synset.lemmas(): print lemma.name(), barter swap swop trade trade swap swop switch swap # note overlap between synsets to obtain of words mentioned, may have include hypernyms well: >>> synset in wn.synsets('swap'): hypernym i...

c# - How to Add rows to DataGrid containing a combox column -

i have datagrid defined follows: <datagrid autogeneratecolumns="false" height="200" horizontalalignment="left" margin="44,39,0,0" name="datagrid1" verticalalignment="top" width="277"> <datagrid.columns> <datagridtextcolumn header="id" /> <datagridcomboboxcolumn header="value" /> </datagrid.columns> </datagrid> how can bind list of strings datagrid , include items "yes", "no", "maybe" datagridcomboboxcolumn each row? var fruit new list<string> {"apple","orange","banana"}; public class fruit { public string id {get;set;} public string name { get; set; } } xaml <datagrid autogeneratecolumns="false" name="mygrid" margin="10"> <datagrid.columns> ...

windows - ETW Provider stopped working -

we using etw tracing activities in our applications. when server applications under heavy work, , start tracing our runtime tracing application, our provider doesn't work. , restarting tracing application , server application doesn't , , solution restart windows server! tried xperf , logman commands stop or delete had other problems (we coudn't delete provider after stopping , direct delete wasn't possible because "data collector running"). how can fix without restarting windows? etw has command resetting logs?

vb.net - how to keep the selected checkbox when the form is close? -

i got checkbox , want retain selected ones when reopen form. here's done returns first selected checkbox only.. for each stritm string in str each ctl control in me.controls if typeof ctl checkbox if ctl.text = stritm dim cb checkbox = directcast(ctl, checkbox) cb.checked = true end if end if next next and me out. tnx in advance. more power. an easy way create global bool variable each check box holds true when check box checked , false when it's not. when close form variables keep values. once re-open form can set checked property matching variables through form load event private sub frmmain_load(sender object, e eventargs) handles mybase.load checkbo1.checked = globalvar1 checkbo2.checked = globalvar2 checkbo3.checked = globalvar3 end sub