184 Posted Topics

Member Avatar for Rahul47

1st of all , your `goto`'s make it not only uncomfortable to read the code , but also , if you get into a habit of using them , i dont think thats gonna be a good idea. 2nd , give [this](http://mathforum.org/library/drmath/view/57074.html) a read.

Member Avatar for somjit{}
0
368
Member Avatar for Muhammad Waqar_1

printf("Enter Height of Student %d : ",i+1); scanf("%d",&height); fwrite(&height,2,1,fp); i++; your incrementing i twice in the same loop . i havent run your code yet , but i dont think thats how it should work.

Member Avatar for Muhammad Waqar_1
0
201
Member Avatar for cool_zephyr

you can use methods of the java [String class](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) to extract hello world out of the string above. the methods are all listed there. i dont know much about web stuff , but feed the above into a string , and apply the methods you think will be best from …

Member Avatar for cool_zephyr
0
683
Member Avatar for jagvllead

welcome to daniweb :) apart from scanner , you can also try out a BufferedReader . i dont really see console being used for this kind of stuff. any particular reason you're using it ? also , whatever you choose to use , its a good practice to close the …

Member Avatar for JamesCherrill
0
1K
Member Avatar for somjit{}

whats even more is that if i create any new file in the "src" folder of the project , it doesnt create any new bin folder to place the class file. i dont know where the class files are of the compiled source code . only when i manually `javac …

Member Avatar for somjit{}
0
4K
Member Avatar for <M/>

also , it is a better practice to write like `int main(void){}` when your not passing any arguments. when you write even something like `main(){..}` it works because in C , when ever the compiler sees a name that has not yet been seen , in this case `main` , …

Member Avatar for somjit{}
0
163
Member Avatar for moone009

[this](http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html) and [this](http://javarevisited.blogspot.in/2011/06/comparator-and-comparable-in-java.html) should give you some ideas. basically , expanding what stultuske already said : have a class for comparing your values , it will implement comparator (or comparable) . Hence by rules if interface implementation , you have to override the interface's method : `compare(T o1, T o2)` …

Member Avatar for JamesCherrill
0
194
Member Avatar for diptipan

what malloc does is basically frees you from having to think too hard about what the size of your array should be during its definition , as it lets you modify memory space on the fly.[this](http://en.wikipedia.org/wiki/C_dynamic_memory_allocation) and [this](http://www.cplusplus.com/reference/cstdlib/malloc/) should get you started.

Member Avatar for somjit{}
0
216
Member Avatar for laguardian

to add to what James had already mentioned , you have defined your Team class' constructor to take an argument of type `game` , but in `game.addTeam(new Team(teamName));` your passing a string to the constructor. Also , your trying to use ArrayList , but you have to import them first …

Member Avatar for somjit{}
0
138
Member Avatar for somjit{}

while trying to compare times between two different ways of determing whether a number is odd/even without using modulo, i thought of using `long long int`s which my codeblocks compiler aint supports . and so i installed pelles c.( supports c99/c11 which inturn supports long long stuff.. ) and im …

Member Avatar for somjit{}
0
2K
Member Avatar for globaladchennai

naive , idiotic posts like these not only make you look stupid , but also invites bias from the global audience towards people from your part of the world. im not far from where you are , and if you want a job after what your doing now , i …

Member Avatar for somjit{}
-3
197
Member Avatar for somjit{}

for a basic ascii checker code of less than 10 lines , i want to print out stuff immediately , instead of after a newline. i understand that stdout is a bufferedstream , and so it will by default wait for a '\n'. i was looking at [this](http://stackoverflow.com/questions/1716296/why-does-printf-not-flush-after-the-call-unless-a-newline-is-in-the-format-strin) page for …

Member Avatar for rubberman
0
2K
Member Avatar for somjit{}

im trying to do this : alter table project_info change column number proj_id int not null auto_increment, add primary key (proj_id); but mysql tells iv got an error. any help with whats wrong here ? i followed this from head first sql book (page 210 if anyone's interested ) .

Member Avatar for somjit{}
0
301
Member Avatar for sathya88

> XXX@YYYY i think what your looking for is regexes. and i get the feeling that you are yet to use them. in that case , [this](http://www.vogella.com/articles/JavaRegularExpressions/article.html) and [this](http://docs.oracle.com/javase/tutorial/essential/regex/) should give you a good start.

Member Avatar for somjit{}
0
293
Member Avatar for game06

have three states (variables) : str1 ,str2 , op; create a textfeild tf; set an accelerator to it for the "ENTER" key event, see [this](http://docs.oracle.com/javase/7/docs/api/javax/swing/JMenuItem.html#setAccelerator(javax.swing.KeyStroke)) and [this](http://docs.oracle.com/javase/7/docs/api/javax/swing/KeyStroke.html#getKeyStroke(java.lang.Character, int)) now , when you type something in tf , and press enter , text of tf gets stored as str1; when you …

Member Avatar for stultuske
0
226
Member Avatar for MrXortex

perhaps this should be posted on the javascript forums. youd find the right people there.

Member Avatar for somjit{}
0
91
Member Avatar for somjit{}

im on win 8. neither can i find the bin folder as i could on my xp machine , nor do i get any command line. googleing didnt help much either. either i got some really hard to understand mysql doc page , with no specific answer to my problem …

Member Avatar for somjit{}
0
346
Member Avatar for somjit{}

my `display()` method is public and looks to be defined , however eclipse says that its not defined. this is a code for an amortized time resizing circular array. can someone help me out here ? also , please do point out if you see something else wrong with the …

Member Avatar for somjit{}
0
289
Member Avatar for cool_zephyr
Member Avatar for rubberman
0
7K
Member Avatar for sirlink99

[this](http://stackoverflow.com/questions/6381348/how-to-easily-display-korean-characters-in-a-java-program) might help... the part about converting the encoding standard to UTF-8. unless of course you have already tried that.

Member Avatar for sirlink99
0
432
Member Avatar for benjo.s.lucas

if your sorting numbers , instead of the complicated looking stuff you did there , why not just use the nextInt() method of Scanner instead of nextLine() ? but if you want to stick to reading line and parsing it , better just use readLine() from BufferedReader and .split() the …

Member Avatar for somjit{}
0
301
Member Avatar for guy40az

make your class extend JFrame , then create a jpanel , that will be your own custom Contentpane , which you can add to the JFrame , then inside the contenpane , have two textfeilds , and a button in between them , 1st one takes in input , and …

Member Avatar for JamesCherrill
0
262
Member Avatar for somjit{}

[This](http://docs.oracle.com/javase/tutorial/essential/concurrency/deadlock.html) is the example i was looking at. The docs say that trying to access the bowBack() method is creating the deadlock , but im new to threads , and i really dont understand why this is happening. In need of some guidance here...

Member Avatar for JamesCherrill
0
335
Member Avatar for somjit{}

1st of all , let me mention my hardware : **HP G6 laptop with win8** : amd a4 4300M, radeon graphics : 512 MB 7420G + 1GB 7670M , 4 gb 1600 Mhz ram. **4 yr old Desktop running xp sp2** : amd athlon x2 250 , inbuilt graphics : …

Member Avatar for gerbil
2
311
Member Avatar for <M/>

what i felt from the instructions : 1. create a student class 2. write the private instance variables 3. overload the default constructor with social security number and GPA arguments 4. write the public getters/setters etc , and also , override toString() and equals() 5. then write a main method …

Member Avatar for rubberman
1
309
Member Avatar for somjit{}

doing this works : contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, 0)); textArea = new JTextArea(); scrollPane = new JScrollPane(textArea); contentPane.add(scrollPane,BorderLayout.CENTER); setContentPane(contentPane); however this doesnt : contentPane = new JPanel(); textArea = new JTextArea(); scrollPane = new JScrollPane(textArea); contentPane.add(scrollPane,BorderLayout.CENTER); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, …

Member Avatar for somjit{}
0
353
Member Avatar for somjit{}

my string (str2) = "aaaabbaacc" i wanted to parse out the two a groups. some trials had worked according to plan , while a few , are giving me outcomes i dont understand. im hoping the members could help me out :) problematic regexp 1 : `console.log(str2.match(/a+(a+(?=c))/).toString());` this gives "aa …

Member Avatar for pritaeas
0
162
Member Avatar for somjit{}

i was looking up some websites for small scale companies around my area, during which i found a few websites that didnt really look much. i saw the html code , and also , seemed fairly easy and simple to me , a newbie html learner. i was wondering if …

Member Avatar for somjit{}
0
201
Member Avatar for somjit{}

i just learnt that code school is giving away free hall passes. i got in through a coursemate's distributed pass on coursera's forum. this is my pass , i thought id share it here if anyone is interested in getting an all access pass to code school. http://go.codeschool.com/lCxAPA ps: each …

Member Avatar for somjit{}
0
220
Member Avatar for somjit{}

[this](http://docs.oracle.com/javase/tutorial/uiswing/examples/components/TextComponentDemoProject/src/components/TextComponentDemo.java) is the code i was looking at.Its about how to use JTextPane and related swing text Components along with actions and keymaps. my question is that in this part textPane = new JTextPane(); textPane.setCaretPosition(0); textPane.setMargin(new Insets(5, 5, 5, 5)); StyledDocument styledDoc = textPane.getStyledDocument(); if (styledDoc instanceof AbstractDocument) { doc …

Member Avatar for somjit{}
0
219

The End.