Posts

c# - How to ensure a struct with a string array as a field would follow value semantics while assigning to another variable -

in msdn documentation mentioned " structs copied on assignment. when struct assigned new variable, data copied, , modification new copy not change data original copy. " i have struct has string array field inside it. struct myvar { private readonly string[] value; myvar(string[] ival) { value = ival; } } when assign 1 struct variable how ensure string array copied (deep copy) assigned variable. you can't in c# because there's no way intercept compiler-generated code copy struct's data 1 another. the thing can make struct immutable. that means: when create struct, make defensive copy of mutable reference types store inside struct (such string array in example). do not pass mutable reference type objects can mutate them. do not expose mutable reference types struct. mean couldn't expose string array struct. don't mutate reference types held in struct. in example, couldn't change contents of string arr...

vb.net - How to use .Net dll in Java -

i have dll created in vb.net. how can use functions in java. i found jni while searching on google , not getting it. there simple documentation example. i recommend java native access (jna) easier using jni. lets have dll functions, create java interface has same method signatures functions in dll. for example public interface nativeexample{ public int method1(string param1); public boolean mehthod2(); } now following way load dll (assuming name nativelib.dll) nativeexample nativeexample= (nativeexample) native.loadlibrary("nativelib", nativeexample.class); once have this, can call method dll via java methods. `nativeexample.method("test");` `nativeexample.method2();` for mappings of datatypes between java , native, please refer the link above. here one more example .

javascript - Three.js Mesh animation and texture mapping -

i did research , learn how export obj file .js file can imported json model of three.js. how can animated such model ? have bird model in .js format need learn flap wings. further more when downloaded obj file internet free model contains texture images object when import obj in 3d modelling software blender 3d, cannot load texture has location right inside obj file when open text editor. when convert .js format has right location located bmp images texture mapping, fail load when load model in webgl, using json model. can please point me in right direction can learn thinks, great if know , me right away in answer. please, need form guys . code of js model file { "metadata" : { "formatversion" : 3, "generatedby" : "blender 2.66 exporter", "vertices" : 2652, "faces" : 4798, "normals" : 2652, "colors" : 0, "uvs" : [1202], ...

c# - dropdown list item selection in asp.net -

i using below code bind dictionary object dropdown list , select value dropdown list. protected void page_load(object sender, eventargs e) { dictionary<int, string> dict = new dictionary<int, string>(); dict.add(1, "apple"); dict.add(2, "bat"); dict.add(3, "cat"); ddl.datasource = dict; ddl.datavaluefield = "key"; ddl.datatextfield = "value"; //will display in ddl ddl.databind(); } protected void btn_click(object sender, eventargs e) { string key = ddl.selectedvalue; string value = ddl.selecteditem.text; } whatever value selected in ddl getting '1' in key , "apple" in value. wrong in code? that because binding list on each post back, should check ispostback like protected void page_load(object sender, eventargs e) { if(!page.ispostback) // better if refactor binding code method ...

shell - Execute Windows scripts from a remote Rundeck server -

i installed rundeck server in 1 linux machine. tomcat running in windows 7 machine. now, want stop , start tomcat service in windows machine creating job in rundeck (on linux machine). is possible? yes, possible. install cygwin, including openssh-server windows machine. generate public key rundeck server user , add .authorized_hosts file on windows machine. ensure have port 22 or alternate port accessible ssh. in rundeck, create new job fires tomcat executable or commands prefer starting/stopping service. it may prefix rundeck job command $path variables if connecting user account has trouble locating executables in windows/cygwin environment.

machine learning - Weka - Adding a unique identifier -

i running logistic regression using weka on set of values unique identifiers. run historical data training data. in case, don't care values classified categories. once done, run current data test data , need keep track of values classified categories. how can maintain unique identifiers each category not them included variable in regression?

objective c - Angel.co API for IOS -

i trying connect angel.co api using ios/objective-c? but not know how start. can please me? how integrate angel.co api in ios? i don't know api is, assuming web site, have send get, post, put or delete http requests. that, set nsurlrequest http method, url, , optionally filling in body data, hand nsurlconnection send request off server , give return data. to correctly, you'll have api documentation whatever web server you're talking to, or if can't find (i.e. provide no api), view source of web pages using "view source" in browser , reverse-engineer requests looking @ form fields, link urls etc.