Search Results

Search found 14591 results on 584 pages for 'scripting language'.

Page 123/584 | < Previous Page | 119 120 121 122 123 124 125 126 127 128 129 130  | Next Page >

  • How to define trees with more than one type in ML programing language

    - by user550413
    Well, I am asked to do the next thing: To define a binary tree which can contain 2 different types: ('a,'b) abtree and these are the requirements: Any inner vertex (not a leaf) must be of the type 'a or 'b and the leafs have no value. For every path in the tree all 'a values must appear before the 'b value: examples of paths: 'a->'a->'a-'b (legal) 'a->'b->'b (legal) 'a->'a->'a (legal) 'b->'b->'b (legal) 'a->'b->'a (ILLEGAL) and also I need to define another tree which is like the one described above but now I have got also 'c and in the second requirement it says that for every path I 'a values appear before the 'b values and all the 'b values appear before the 'c values. First, I am not sure how to define binary trees to have more than 1 type in them. I mean the simplest binary tree is: datatype 'a tree = leaf | br of 'a * 'a tree * 'a tree; And also how I can define a tree to have these requirements. Any help will be appreciated. Thanks.

    Read the article

  • Patterns for wrapping a command line tool in another language

    - by Tom Duckering
    I'm currently writing some Java to wrap around an extensive command line tool. It feels like I'm writing a lot of similar code. I'm wondering if there are any established patterns for wrapping command line tools - passing arguments and handling output and so on. Specific examples in Java would obviously be great, but any general suggestions or pointers are welcome too.

    Read the article

  • HIbernate query language problem.....

    - by mslatf
    I have a Project class that has a Set of userstories called userStories12many. I'm having troubles trying to get the project that has a certain userstory in its set getComponent(int userStoryID) I think im on the right track but i dont know what i did wrong public Projects getComponent(int userStoryID) { Session session = SessionFactoryHelper.getSessionFactory() .getCurrentSession(); session.beginTransaction(); List<Projects> compo = session.createQuery("select p " + "from Projects as p inner join fetch p.userStories12many as u " + "where u.storyId='" + userStoryID + "'").list(); session.getTransaction().commit(); return compo.get(0); }

    Read the article

  • Rule of thumb for capitalizing the letters in a programming language

    - by William
    I was wondering if anyone knew why some programming languages that I see most frequently spelled in all caps (like an acronym), are also commonly written in lower case. FORTRAN, LISP, and COBOL come to mind but I'm sure there are many more. Perhaps there isn't any reason for this, but I'm curious to know if any of these changes are due to standards or decisions by their respective communities. Or are people just getting too lazy to hit the caps lock key? (I know I am)

    Read the article

  • Problem with keyboard language

    - by user300484
    Hello you all! I just made an application which purpose is to find an x result using the rule of three. It runs fine and everything but there is a small problem. I am using WinXP Europpean Spanish version. As we all know, in many europpean countries the decimal dot is changed by a " , " comma. When I use my application, it turns out that when I press the dot key on my keyboard´s number pad, my application doesnt take it as a normal decimal dot and it ignores it... so I need to manually press the comma key so it can give me the right answer. How can I solve this problem?

    Read the article

  • Java language convention; getters/setters

    - by Skogen
    Public class Example { private int number; public Example(int number){ this.number = number; } public int getNumber(){ return number; } public void setNumber(int number){ this.number = number; } public static void main(String[] args){ Example e = new Example(5); What is preffered when accessing a variable within its own class; "e.number" or "e.getNumber()" ?

    Read the article

  • Is F# a poor choice for a functional language

    - by dagda1
    Hi, To me, I think F# is a bad choice due to the fact that it uses threads behind the scenes. To me, threads are too "heavy" due to things like context switching. I can see why Erlang is a good choice because it uses light weight processes. Am I wrong? Cheers Paul

    Read the article

  • What language is this???

    - by Misha Koshelev
    Dear All: I thought this was Javascript... but parser is giving me trouble. Any ideas? Thank you! Misha for (;;); {"error":0,"errorSummary":"","errorDescription":"","errorIsWarning":false,"silentError":0,"payload":{"collections": [{"name":"bcm","type":"flp","filter":"flp_662923563701","value":"662923563701","editable":true,"deletable":true,"members": ["1319651388","539562714","710814793","569071038","1553739575","2413243"]}, {"name":"mstp","type":"flp","filter":"flp_715806870131","value":"715806870131","editable":true,"deletable":true,"members": ["1263807225","1159429816","508447486","508005223","1234906348","642723993","552875889","23401888","10701320","8302901","7931988","3007490","1286522890","1128447272","1076062553","775679867","737520202","640799498","224400055","224400048","14211567","7909445","3005965","2404364","218216","660037273","224400089","73306230","9603033","1111694","1034418884","775680513" ,"704526828","518753881","512477182","224400016","24904610","19000876","5403952","3005641","2100348","100000421128298","1445411167","691445174","1020020100","795471177","683724539","682441089","532450522","224400129","224400005","3006522","2246813","1302265","7197","1900494", "100000474978266","2533582","1205125","1384091677","1260996959","710814793","514951289","224400164","224400156","173601800","13304723","7938844","3004783","3001379","302817","716739950 ","706849","1418109424","562676898","82501644","3007569","13173"]}, {"name":"mystery","type":"flp","filter":"flp_687949656211","value":"687949656211","editable":true,"deletable":true,"members": ["100001286464748","508123007","100001161894460","1148567030","1048974191","769992391","831734347","15347","1297180076","756692945","3005266","733396195","34410910","100000940154241"," 748426280","569417581","1318922027","100000164920046","1475269609","1436536592","10000016210 8385","754095305","100000421128298","537833189","100000692471928","7920231","673753496","3006217","1221878","8365333","1128447272","224400133","218216","505457123","1421958541","183829 5926","2349408","1622810085","1201640391","510959992","23429895","542118016","1017385668","586225579","625100539","100000474886633","26404148","1384091677","224400156","806908635","843 187401","400435","768261176","7901808","748496482","1541469473","2511982","25401573","503715 506","1226000844","559195162","41400094","1099436201","409816","1584400985","1577092523","100000349351880","199301581"]},{"name":"SMS Subscriptions","type":"ms","filter":"ms","value":"3","editable":true,"deletable":false,"members":[]}],"current_view":false}}

    Read the article

  • What do you call this functional language feature?

    - by Jimmy
    ok, embarrassing enough, I posted code that I need explained. Specifically, it first chains absolute value and subtraction together, then tacks on a sort, all the while not having to mention parameters and arguments at all, because of the presense of "adverbs" that can join these functions "verbs" What (non-APL-type) languages support this kind of no-arguments function composition (I have the vague idea it ties in strongly to the concepts of monad/dyad and rank, but its hard to get a particularly easy-to-understand picture just from reading Wikipedia) and what do I call this concept?

    Read the article

  • ClassCastException in iterating list returned by Query using Hibernate Query Language

    - by Tushar Paliwal
    I'm beginner in hibernate.I'm trying a simplest example using HQL but it generates exception at line 25 ClassCastException when i try to iterate list.When i try to cast the object returned by next() methode of iterator it generates the same problem.I could not identify the problem.Kindly give me solution of the problem. Employee.java package one; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Employee { @Id private Long id; private String name; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Employee(Long id, String name) { super(); this.id = id; this.name = name; } public Employee() { } } Main2.java package one; import java.util.Iterator; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; public class Main2 { public static void main(String[] args) { SessionFactory sf=new Configuration().configure().buildSessionFactory(); Session s1=sf.openSession(); Query q=s1.createQuery("from Employee "); Transaction tx=s1.beginTransaction(); List l=q.list(); Iterator itr=l.iterator(); while(itr.hasNext()) { Object obj[]=(Object[])itr.next();//Line 25 for(Object temp:obj) { System.out.println(temp); } } tx.commit(); s1.close(); sf.close(); } }

    Read the article

  • language specific virtual keyboard with java

    - by user343285
    Hello everyone! I have to make an on-screen keyboard using JAVA on linux. the problem is it has to work on the most languages. for start, i need to et the current locale, that's clear, but after that, is there any way of getting the keyboard layout and maping of that locale? i searched for hours, but couldn't find a thing, so i really hope you can help me. Thanks in advance, Adam!

    Read the article

  • Why my print current date time (C language) gives different answer

    - by vodkhang
    I want to get the current date (day, mon and year). I found out there are some functions in C to do that like ctime (get the string of time), localtime and gmtime. I tried with following code but the output are different. I get this output: The date and time is Tue Apr 20 2010 (which is correct) The year is : 110 The year is : 110. Does anybody know why? int main(int argc, char** argv) { time_t now; if((now = time(NULL)) == (time_t)-1) { puts("Failure in getting time"); } else { printf("The date and time is: %s\n", ctime(&now)); printf("The year is: %ld\n", localtime(&now)->tm_year); printf("The year is: %ld\n", gmtime(&now)->tm_year); } getchar(); }

    Read the article

  • Does the concept of "magic number" change from language to language?

    - by Gerardo Marset
    Take the following code in C/C++, for example: int foo[] = {0, 0, 0, 0}; No magic numbers, right? Now, the Python "equivalent" of that would be: foo = [0, 0, 0, 0] Still no magic numbers. However, in Python, that same thing can be written like this: foo = [0] * 4 And now we DO have a magic number. Or do we? I'm guessing this and other similar things are present on these and other languages.

    Read the article

  • File listing application on Windows : what language ?

    - by Studer
    I need to create a simple application/script able to list the hierarchy of a folder containing subfolders and files (mostly PDF), so that a user can browse easily these files and maybe have a quick preview of them. The files are all on an internal file server, so the dynamic aspects should all be client-sided. My goal (and what my boss want) is to provide some sort of an HTML page listing, to have something like this. The only problem I have now is that I cannot install anything on computers, so I cannot use PHP, Python, ... This application will only runs on Windows in Internet Explorer. What are the different possibilities I have ? I don't know if I can do this but I was thinking of using HTML + Flex. Thanks for helping.

    Read the article

  • how to assign value to EIP with C language in ubuntu

    - by user353573
    where is wrong? how to assign value to eip to change the location of running in program? Please help !!!! error: cannot convert ‘mcontext_t*’ to ‘sigcontext*’ in assignment struct ucontext { unsigned long uc_flags; struct ucontext *uc_link; stack_t uc_stack; struct sigcontext uc_mcontext; sigset_t uc_sigmask; /* mask last for extensibility */ }; #include <stdio.h> #include <signal.h> #include <asm/ucontext.h> void handler(int signum, siginfo_t *siginfo, void *uc0){ struct ucontext *uc; struct sigcontext *sc; uc = (struct ucontext *)uc0; sc = &uc->uc_mcontext; sc->eip = target; //uc->uc_mcontext.gregs[REG_EIP] } int main (int argc, char** argv){ struct sigaction act; act.sa_sigaction = handler; act.sa_flags = SA_SIGINFO; sigaction(SIGTRAP, &act, NULL); asm("movl $skipped, %0" : : "m" (target)); asm("int3"); // cause SIGTRAP printf("to be skipped.\n"); asm("skipped:"); printf("Done.\n"); }

    Read the article

  • Usage of atoi in the c language

    - by maddy
    I don't understand the results of the following C code. main() { char s[] = "AAA"; advanceString(s); } void advanceString(p[3]) { int val = atoi(p); printf("The atoi val is %d\n",val); } Here the atoi val is shown as 0. But I could not figure out the exact reason. As per my understanding, it should be the summation of decimal equivalent of each values in the array.? Please correct me if I am wrong.

    Read the article

  • Constraint to array dimension in C language

    - by Summer_More_More_Tea
    int KMP( const char *original, int o_len, const char *substring, int s_len ){ if( o_len < s_len ) return -1; int k = 0; int cur = 1; int fail[ s_len ]; fail[ k ] = -1; while( cur < s_len ){ k = cur - 1; do{ if( substring[ cur ] == substring[ k ] ){ fail[ cur ] = k; break; }else{ k = fail[ k ] + 1; } }while( k ); if( !k && ( substring[ cur ] != substring[ 0 ] ) ){ fail[ cur ] = -1; }else if( !k ){ fail[ cur ] = 0; } cur++; } k = 0; cur = 0; while( ( k < s_len ) && ( cur < o_len ) ){ if( original[ cur ] == substring[ k ] ){ cur++; k++; }else{ if( k == 0 ){ cur++; }else{ k = fail[ k - 1 ] + 1; } } } if( k == s_len ) return cur - k; else return -1; } This is a KMP algorithm I once coded. When I reviewed it this morning, I find it strange that an integer array is defined as int fail[ s_len ]. Does the specification requires dimesion of arrays compile-time constant? How can this code pass the compilation? By the way, my gcc version is 4.4.1. Thanks in advance!

    Read the article

  • ruby language syntax(how platform_info variable is used

    - by amit singh tomar
    class EncodeDemoTest < Test #inheritance in ruby def setup(platform_info, logdir) @telnet_ip = platform_info["telnet_ip"] @telnet_login = platform_info["telnet_login"] @telnet_password = nil @filesys_path = platform_info["filesys_path"] @host_files_path = platform_info["host_files_path"] @host_machine_ip = platform_info["host_machine_ip"] @linuxserver_ip = platform_info["linuxserver_ip"] @target_prompt = platform_info["target_prompt"] @demo_execuable_path = platform_info["demo_execuable_path"] @mts4ea_machine_ip = platform_info["mts4ea_machine_ip"] @mts4ea_files_path = platform_info["mts4ea_files_path"] @ffmpeg_machine_ip = platform_info["ffmpeg_machine_ip"] @ffmpeg_service_machine_ip = platform_info["ffmpeg_service_machine_ip"] @ffmpeg_files_path = platform_info["ffmpeg_files_path"] @ffmpeg_login = platform_info["ffmpeg_login"] @ffmpeg_password = platform_info["ffmpeg_password"] @ffmpeg_prompt = platform_info["ffmpeg_prompt"] @platform_info = platform_info could anyone tell me how argument passed in setup method .means what does that syntax means platform["telnet_ip"]

    Read the article

  • C Language - \n - creating virus

    - by sagar
    #include<stdio.h> #include<conio.h> union abc { int a; int x; float g; }; struct pqr { int a; int x; float g; } ; void main() { union abc b; struct pqr c; clrscr(); b.a=10; textbackground(2); textcolor(6); cprintf(" A = %d",b.a); printf("\nUnion = %d",sizeof(b)); printf("\nStructure = %d",sizeof(c)); getch(); } Now, Save this program as virus.cpp ( or any name that you like ) I am using Turbo C comiler to complie this program & run from trubo c. ( Ctrl + F9 ) I don't know weather to ask this question at stack over flow or at super user. I am using Windows 7 & I have installed Avira AntiVir virus system. I am not here for any kind of advertisement of microsoft or antivirus system. I am just here for solution of my query. When I tried to run above program - It creates a worm (DOS/Candy). I believe there is nothing wrong in program. Oke.. Now here is something special. Execute the same program with following difference. Here the only difference is space between \n #include<stdio.h> #include<conio.h> union abc { int a; int x; float g; }; struct pqr { int a; int x; float g; } ; void main() { union abc b; struct pqr c; clrscr(); b.a=10; textbackground(2); textcolor(6); cprintf(" A = %d",b.a); printf("\n Union = %d",sizeof(b)); printf("\n Structure = %d",sizeof(c)); getch(); } The difference is only \n and space. Question is "Why my simple program is detected as virus?? " Thanks in advance for sharing your knowledge. Sagar.

    Read the article

  • How to write own DLL in Visual Studio, C language (not C++)

    - by oneee
    Dear all, I'm trying to create my own DLL... I used wizzard in VS2008 to create template for DLL. This works fine and the dll builds successfully (Test.dll is created). BUT, when I rename the file from Test.cpp to Test.c (which I guess causes compilation in C-mode), solution rebuilds also successfully, but no .dll is created. The list of all created files follows: mt.dep BuildLog.htm vc90.idb Test.dll.embed.manifest Test.dll.intermediate.manifest Test.obj MySecondCFile.obj vc90.pdb Test.dll.embed.manifest.res For my purposes it's essential that the dll be in C not C++, while I already have a lot of code written in C, which does not compile as C++. Do you know, why .dll is not created? What should I do?

    Read the article

< Previous Page | 119 120 121 122 123 124 125 126 127 128 129 130  | Next Page >