2,040 Posted Topics

Member Avatar for glamourhits

Also, why are you using [] instead of real dynamic array like ArrayList? This "Arrays.copyOf(collection, capacity); collection = newCollection;" is an inefficient way of implementing dynamic collection (too much of trouble). Is it in your requirement to do so? Also, why do you have to multiply the capacity by 2 …

Member Avatar for Taywin
0
589
Member Avatar for needhelpinjav

Please use "code" tag around your code... Not easy to read your code right now :( For applet samples, you may look at this link [URL="http://oreilly.com/catalog/javanut/examples/"]http://oreilly.com/catalog/javanut/examples/[/URL] (especially the 2nd applet example code).

Member Avatar for mKorbel
0
251
Member Avatar for Panathinaikos22

You are adding it wrong... I can't remember whether Matlab has a built-in function for factorial. If not, you need to implement it yourself. Shouldn't be that difficult. Actually x^1/1! is not always equal to 1. If it is wrong, you may need to do it differently as... Let see …

Member Avatar for Panathinaikos22
0
330
Member Avatar for theadjectivenou

As Stevanity said, the syntax of printf is [CODE] printf(String format, Object... args) // for example, with 1 argument System.out.printf("My print out string %s", "one"); // result is to display "My print ouf string one" on the console // with 2 arguments System.out.printf("And here is %s with another %s"), "one …

Member Avatar for Taywin
0
114
Member Avatar for paulsoncall

You are on the right track. However, why do you need to print white space afterward? You just need to go to the next line after you finish printing out the * for each row... You need to start the row from 1, not right at Max. Also, you should …

Member Avatar for paulsoncall
0
263
Member Avatar for persianprez

Hmm... No, I don't think you are on the right track. Do you remember the diagram of number? Something like... [CODE] Number | +------------------+-----------+ | | | Real Integer Imaginary / \ | rational irrational | ---+--- / | \ neg 0 pos [/CODE] That's just from the top of …

Member Avatar for persianprez
0
146
Member Avatar for Shinku

The reason is that the "Cd" class is not a String class. the next() method return a String if I remember correctly. What is your Cd constructor? Possible solution (depending on your Cd constructor) is as follows... [CODE] liste.add(new Cd(input.next())); [/CODE]

Member Avatar for Taywin
0
141
Member Avatar for HASHMI007

Does makeStr() append the existing list or it just creates a new list over the existing list? What you are doing now is none of the above but create nodes with links... Then the created list is discarded and becomes memory leak after the function ends.

Member Avatar for raptr_dflo
0
100
Member Avatar for jQuery

I understand that JQuery is a nice library. Though I could use pure JavaScript to do the same job even though it would be longer due to JQuery hides most of the code for you. However, it seems that your code has a flaw. What do you think if I …

Member Avatar for Ezzaral
0
167
Member Avatar for Hikari123

I'm confused a bit... Could you actually give a sample input that you did? And what the value displayed? To me, the "terms" looks fine, but why do you need to input the value of error? Is the value something like + or - 0.000001??? Because if it is, you …

Member Avatar for Hikari123
0
442
Member Avatar for danthevan

You may, but it would be easier to find the bug because the GUI part is extracted from the core. :)

Member Avatar for danthevan
0
162
Member Avatar for dandeliondream

Does it need to be in Java? Anyway, what's the problem with specify a URL for the crawler? Can you obtain the content from the crawler? If so, there is no need to worry about. You can easily parse all the links in a page content, save them somewhere in …

Member Avatar for Taywin
0
128
Member Avatar for MargateSteve

A couple questions... How does the hosting company analytic counts a page visit? Does it count via HTTP request or else? Do you have an authority to change the rule of visited page counter?

Member Avatar for MargateSteve
0
364
Member Avatar for rimilbadal

No one would know how you create the page. There could be too many images, image files loaded on the page are big, using a lot of JavaScript to write document instead of use HTML, etc. There are also many factors besides the page implementation: server is slow, the Internet …

Member Avatar for aquilawebs
0
171
Member Avatar for cgen

It means that if you randomly pick a number from 1~7, you should get a different binary tree when you do an insertion. For example, if you draw a number from 1~7 and the result of the order is 1, 2, 3, 4, 5, 6, 7, you will get a …

Member Avatar for Taywin
0
326
Member Avatar for drogba123

I believe when you talk about "travelling distance" means "Dijkstra's algorithm"? If so, this will depend on application and how you apply an algorithm to it.

Member Avatar for Taywin
0
102
Member Avatar for djmonster

Watch out if you hard-code your String parsing... If the file contain even an empty line in the middle or something else, it could easily screw up your code. You need to first define how each data you are expecting should look like before you do that type of parsing.

Member Avatar for hiddepolen
0
589
Member Avatar for trektrak

What content in the 'geojavascript.php' file? If it is the page itself, you would have a problem. You need a HTML portion/page that should not be its own page because you may create multiple same div id/name when the page calls itself.

Member Avatar for trektrak
0
306
Member Avatar for harveylester

Hmm... Actually it is how you place the "div" in your HTML. When I look at it, the hidden "div" of each list item is in another "li" tag. I believe you are supposed to put the "div" in the same "li" similarly to the "share/save" one.

Member Avatar for Dandello
0
149
Member Avatar for ilovejava

I am not sure what output you want here. You have duplicated computation in your loop. If you put [CODE]System.out.println(i+" and "+j+" is checked");[/CODE] under line 7, you will see what I mean about duplicated value (for i). Also, your line 28 can be reduced to return n(a)==n(b); because n(b) …

Member Avatar for Taywin
0
686
Member Avatar for meme dreame

1)You keep changing the value of "val" variable which is set to the number of loop you want to go through. As a result, your loop is likely to be be unstable. You need to create another variable and use it inside the loop. Don't be too thrifty to create …

Member Avatar for meme dreame
0
166
Member Avatar for nasimalotaibi

You aren't following the for-loop format... for(initial; upper bound; step) You have initial correct but not your upper bound. Get rid of ";" before && and see what happen. PS: You shouldn't use "for" loop in this case. You should use "while" loop instead...

Member Avatar for nasimalotaibi
0
151
Member Avatar for ilovejava

The code portion below is showing how to access a 2 dimension array... [CODE] // assume that your "grid" variable is type int for (int row=0; row<grid.length; row++) { for (int column=0; column<grid[row].length; column++) { // could simply use grid[0].length int value = grid[row][column] // accessing the "grid" variable at …

Member Avatar for ilovejava
0
180
Member Avatar for Heinz Stapff

Don't know what you mean by "not working"? There are tons of possibility... Anyway, have you checked that "rowsubtotals" variable consists of HTML elements you are looking for? That may be the starting point for your debugging.

Member Avatar for Taywin
0
576
Member Avatar for mrjillberth

Even using label is not a proper way to do because the code is very inconsistence. You should construct your code to be properly nested or not nested loop. [CODE] // for example if(!done){ main:for(int x = 1; x <= 3; x++){ int same = 0; for(int y = 1; …

Member Avatar for JamesCherrill
0
157
Member Avatar for blackrobe

Actually the solution is very simple. You need to think out of the box... What you need to do is the "key" of the Hash, not its value. Use arithmetic in computation and you get the result. [CODE] For example. Let a = [1, 6, 7, 9, 11] (length n) …

Member Avatar for Taywin
0
543
Member Avatar for alex8206

Function name crashing? You should give meaningful function names instead of a, b, c, etc. Then you will have the same function name when you try to include all pages together.

Member Avatar for Taywin
0
188
Member Avatar for TheComputerGuy

When you run, how did you run it? If you use IDE (not command line execution), you may not pass the argument in the command to the method. As a result, your args[] array is size 0. [CODE] // correct command line java ClientForNoDupCollection myfile.ext // if the myfile.ext exists, …

Member Avatar for masijade
0
197
Member Avatar for rayidi

The alert() function does nothing to check whether your xmlhttp is working. Is your xmlhttp variable global? In other words, do you declare it somewhere and is being used somewhere else too? The reason is that I do not see you declare the object inside your function at all. In …

Member Avatar for rayidi
0
2K
Member Avatar for caswimmer2011

You may search the Google for keylogger virus, and key listener... They are somewhat similar in functionality (capture user's key stroke), but they have different purposes in use.

Member Avatar for Vreality
0
446
Member Avatar for cecsFTL

[QUOTE]if SideAB + SideBC > SideAC.. it's invalid.[/QUOTE] Where did you get that from? That's wrong. It should be that all of the below is true, it is a triangle. AB+AC > BC AB+BC > AC BC+AC > AB

Member Avatar for hiddepolen
0
1K
Member Avatar for guidely

They are likely to be wrong because you are not supposed to have 2 "where" clauses in the same query (without grouping or certain keywords) I don't know the syntax from the top of my head here. But I will tell you what should be done... #1 - You may …

Member Avatar for Taywin
0
146
Member Avatar for gahhon

Hmm... Do you know the keyword 'volatile' in C++? In Java, static is very similar... To align your printout, this is a part of your design. You could try to arrange by programmatically add a correct number of white spaces. Using \t is a simple way but could screw your …

Member Avatar for gahhon
0
123
Member Avatar for moonL!ght

Start from i=[COLOR="Red"]0[/COLOR], end with i[COLOR="Red"]<[/COLOR]colors.length, increased i by 1 each step... Not Start from i=[COLOR="Red"]1[/COLOR], end with i[COLOR="Red"]<=[/COLOR]colors.length, increased i by 1 each step.

Member Avatar for hiddepolen
0
209
Member Avatar for gahhon

You can't access the speed value that way. Also, those variables are local to the Fan class. You need to make them public and be static if you are going to use it that way... [CODE] public static final int SLOW = 1; public static final int MEDIUM = 2; …

Member Avatar for gahhon
0
229
Member Avatar for xanawa

As Aviras said, there is no real clear screen in Java. Supposed you are doing it on a console, if you want, you could try... [CODE] System.out.println("\u001b[2J"); [/CODE] That should have an effect similar to clear() but not exactly the same.

Member Avatar for Taywin
0
147
Member Avatar for ilovejava

What do you mean by "not working"? I tried your code and it returned false and added "M" to the grid when it is missed. Though, I only tried once. There are reasons I don't try again because... 1)I have to redo the whole set up again if the program …

Member Avatar for ilovejava
0
2K
Member Avatar for xinwei

Hmm... How about you keep 3 shortest path values. Each time you get to the end of the search, check with them. If it is shorter than any of the values, replace the value. At the end of all search, you print out these values? Sorry that I can't help …

Member Avatar for xinwei
0
628
Member Avatar for badllama

You are calling another function which removes only the "head" node (so called "start") and that's it? The destructor is supposed to remove "all" nodes created in the list. It shouldn't throw any error if your "head" is null in the first place. It simply goes through each node and …

Member Avatar for jmichae3
0
244
Member Avatar for PSP1202

You need to think about what to do here. Your loop does not extend to cover the whole requirement -- program keeps accepting and counting user's input until a "0" is entered. What you are doing now is to keep accepting until it is not "0" which results in 0 …

Member Avatar for MandrewP
0
436
Member Avatar for stereomatching

In the real world, codes are different compared to academic codes. There are many reasons for that. 1)Academic projects are often much smaller than real world projects. Expecting a huge codes to be well designed would take a long time to finish. I mean, you wouldn't start coding right away. …

Member Avatar for stereomatching
0
250
Member Avatar for lbgladson

If you want to print something without adding a new line at the end, use System.out.print() instead (notice it is print, not println). Also, you could add a comma or white space as many as you want in the print. That's your decision of formatting the print out.

Member Avatar for lbgladson
0
387
Member Avatar for Sorcher

If you want it that way, then you need to modify the page you are displaying, not Ajax part. You just load the "Recent" data to the page and remove the "Select Album" option from the list.

Member Avatar for Taywin
0
95
Member Avatar for programing

You cannot access obj.approxipi because it is "private" variable to the object. If you want, you need to either change it to public or implement a method that returns the variable value.

Member Avatar for Taywin
0
1K
Member Avatar for soham.m17

Not sure if the "iterator" is the problem for you. How about modify your code to use a simple loop instead of the "iterator"? You want the index of "or" which is the same as iterating through a loop using real integer. [CODE] // from for(or_data or : counts.or_gates) { …

Member Avatar for soham.m17
0
222
Member Avatar for Mopikope

Watch out for numOfChar value. You could create segmentation fault while running. Anyway, you should not simply cast a char array to an int array (if you can do... can't remember C++ syntax). You need to go through each value in the char array and convert to int. Also, there …

Member Avatar for Mopikope
0
120
Member Avatar for queendaedra

OK, if you want help... Why do you think that using Integer.parseInt() will verify that the input is a string? When do you think that Integer.parseInt() would throw an exception? Would an input "Mimi" is an acceptable string name for you? If it is, then you are off the track …

Member Avatar for JamesCherrill
0
155
Member Avatar for Mawethu

The script is way too many hard-coded. As a result, it is very lengthy and redundant. How about an easier approach? Using the same HTML input field you have... [CODE] <script type="text/javascript"> function bin2dec() { var elem = document.getElementById("text") if (elem) { // ensure the element exists var a = …

Member Avatar for Taywin
0
101
Member Avatar for newcountry

Could you please stop pulling old threads back up? This one is over 3 years old already...

Member Avatar for Netcode
0
530
Member Avatar for havoc433

What do you mean by "words"??? If you are talking about A-Za-z, then you may use [^A-Za-z]... It means "not" A-Za-z in the reqex. Remember that the "^" must be inside []. If it is outside, it means "start with"...

Member Avatar for havoc433
0
166

The End.