2,040 Posted Topics

Member Avatar for LadyQuietB

Because you are trying to modify other people code and you completely have no idea at all. This is a bad start. What you need to do is to step back and look at the problem again. Now, [Monte Carlo method](en.wikipedia.org/wiki/Monte_Carlo) is used to estimate a value using randomized samples. …

Member Avatar for Taywin
0
1K
Member Avatar for mcbentz

The problem is we do not know what the encoding algorithm used in the encryption. Your post implies that you know the algorithm and need only a key value between 0 to 255 in order to decrypt (decode) it. It seems that may be wrong. Anyway, to try to do …

Member Avatar for Taywin
0
331
Member Avatar for babi.meloo

Line 58 & 59, what do you think the value that *nextInt()* method will return? Read its [API](http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextInt()) and you will find out that the range of returned value (which will be between 0 to 2^32). It is obvious that it will be out of display range you are trying …

Member Avatar for babi.meloo
0
1K
Member Avatar for subramanya.vl

It doesn't seem to break your block, but it may give you an unintentional result if you allow modification of the class without synchronize the process anywhere. You need to watch out for that when dealing with multiple threads.

Member Avatar for subramanya.vl
0
1K
Member Avatar for ben1996123
Member Avatar for PalashBansal96
0
300
Member Avatar for eharrell

Or are you talking about this [Raptor](http://raptor.martincarlisle.com/)? If so, maybe this [link](http://cgs1000spc.blogspot.com/2011/12/arrays-in-raptor.html) could explain how you access an array element in Raptor.

Member Avatar for Reverend Jim
0
322
Member Avatar for vipmo

scrager is correct on declaring a string on multiple lines. A string, however, can contain new line character, and that should not be confused with the multiple line span. //i.e. var test = "<p>rajnas asdjhsadnmdas dasjads jmsad dasndsaads bnas</p> <p>ahdndsa</p>"; // error var test = "<p>rajnas asdjhsadnmdas dasjads jmsad dasndsaads …

Member Avatar for Taywin
0
164
Member Avatar for green-script

1)Are you talking about comparing 2 array elements, or 1 item with another array? If it is only 1 item with another array, you simply go through each element in the array and compare each item with the value you want to compare. If it is equal, do the iframe …

Member Avatar for Taywin
0
230
Member Avatar for aramil daern
Member Avatar for Echo89
1
485
Member Avatar for sobias

The reason is the [algorithm](http://en.wikipedia.org/wiki/AVL_tree) of node deletion. "If the node is a leaf or has only one child, remove it. Otherwise, replace it with either the largest in its left sub tree (in order predecessor) or the smallest in its right sub tree (in order successor), and remove that …

Member Avatar for Taywin
0
7K
Member Avatar for crownedzero

In Producer class inside messageConsume() method, did a call from consumer go through the loop down to the checking for region? If so, did it actually get through inside the checking region if-condition? Try to print out each line of your process to pin point where exactly is wrong. Anyway, …

Member Avatar for crownedzero
0
264
Member Avatar for gkaran487
Member Avatar for Taywin
0
135
Member Avatar for McLaren

The problem is that the library is a hard-coded library which expects a certain type of object to be passed to the function without handling any invalid case. In JavaScript, there is no type checking, so you could pass any thing (including null or undefined) to the function. The function …

Member Avatar for McLaren
0
168
Member Avatar for Goldfinch

OK, are you required to do it with 2 queues in the implementation? Are you allowed to use recursive methods instead? Does your queue class has a peek() method -- a method to look at the value of the last item in the queue and not dequeue the queue. Anyway, …

Member Avatar for Goldfinch
0
160
Member Avatar for riahc3

I'm not looking at how it works, but I will give you some thought about what may happens.. 1)Line 13, do you know that a file name can contain most character (if not all)? For example, you could have a file name "abcd.efg.doc" especially on Windows. The way you extracting …

Member Avatar for riahc3
0
461
Member Avatar for sobias

@deepecstasy, there is no (visible) pointers in Java. There is NO need to manually deallocate memory in Java because the GC will automatically do it for you. Simply stop referring to the created object for a while, and the GC will wipe it out from the memory. If you comes …

Member Avatar for sobias
1
231
Member Avatar for alikhandro

Here are steps if the node is in the middle of the list (not head or tail). 1)Update the point-to *next* node of its previous node to its *next* node. 2)Update the point-to *previous* node of its next node to its *previous* node. /* Assuming nodeX0 is the head. Removing …

Member Avatar for NormR1
0
353
Member Avatar for Despairy

Not so sure what you want to do. Anyway, have you read this [Matlab](http://www.mathworks.com/help/matlab/ref/imread.html) page about reading image? It also talks about tiff image format as well.

Member Avatar for Taywin
0
147
Member Avatar for newbiecoder

If there is no weight of traveling time for each person, any permutation is correct. However, once you add weight values, then you will see whether or not your algorithm is correct.

Member Avatar for Taywin
0
124
Member Avatar for PriteshP23

>summary = text.replaceAll( ("<[^>]*>", " ").substring(0, 150)" , "..."); Your code syntax is still wrong. Also, even if it is correct, your logic could fail again. The reason is that you *modify the String* before you take its substring. If you are going to modify a string, do it **before** …

Member Avatar for PriteshP23
0
187
Member Avatar for taylor.mitchell.353

The reason you need compareTo() because you need to know which branch you are going to work when 1)the key is not found at the current searching node and 2)the direction you will go down the tree (either left or right). The compareTo() will give you all information at once …

Member Avatar for NormR1
0
219
Member Avatar for crownedzero

>Queue<ProductMessage> prodQueue = new ConcurrentLinkedQueue<>(); Are you sure that it is supposed to instantiate that way???

Member Avatar for ~s.o.s~
0
284
Member Avatar for laguardian

You need to read about [method declaration syntax](http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html) before you can go any further. The reason you are not getting it is because you declare it wrong. You need to know which part means what... public static int[] printElements(int num) ^ ^ ^ ^ ^ | | | | | …

Member Avatar for NormR1
0
141
Member Avatar for mattsearle

In the function called by onclick, pass in the div ID. Then in the function, reassign the value you want to the div ID. @JorgeM, the OP said "*Require 4 buttons each one to change the text within the div* **--> ie <--** *button "info 1" to change the text …

Member Avatar for mattsearle
1
9K
Member Avatar for riahc3

Your requirement is oddly worded... I assume that you are talking about adding "bye" file if there are less than 44 files... Before going to the for-loop, outside the whole try-catch portion you posted, you need to create a flag and may name it as *found*, and then assign it …

Member Avatar for Taywin
0
485
Member Avatar for Violet_82

To explain why the script portion doesn't appear in Firefox, you need to briefly understand how the JQuery internally works. The script will detect which browser is being viewed by the client, and then create a proper object which should be compatible (functionalities) with the current viewing browser. The issue …

Member Avatar for Violet_82
0
204
Member Avatar for coolbeanbob

>Am I using too many classes? No, you don't. A good way to do OOP is to break down a big object into smaller objects. Your classes look fine to me. If you feel that there are too few classes, you could still break it down further in the future. …

Member Avatar for JamesCherrill
0
196
Member Avatar for gotto

Stealing code? Well, if you put anything on the Internet, you have to sacrifice your privacy. If you don't want it to be stolen/copied, you don't put it online. It is similar to putting your nice painting in a show room and let others see and take pictures. Then you …

Member Avatar for Aladinone
0
226
Member Avatar for asiawilliams

Hmm... How about this... I am guessing you implement all your classes in the same file? Even though they all are in the same file, each of them has its own space. In other words, each class has its own visibility and they sees only whatever implementation inside themself. There …

Member Avatar for Taywin
0
473
Member Avatar for fabzster

I'm sorry, but I would love to see a better comment that just that. The reason is the function name explains itself, but what does it mean... I would like to see comment somewhat similar to below. Do not be too shy about commenting script/code. It will save your behind …

Member Avatar for AleMonteiro
0
217
Member Avatar for Malymieczek

OK, your problem is about using random number generator. When you think about staying in a middle of a 7-foot bridge, it means the precision is important! Do not use *int* data type to represent where you are. Currently, you place yourself at location 3 which is NOT the middle …

Member Avatar for Taywin
0
949
Member Avatar for BryantFury

Edited. I think the table is as follows? Current: P1 3 1 0 0 P2 0 0 1 2 P3 0 2 3 4 Max: P1 3 4 4 0 P2 0 0 1 3 P3 3 4 4 6

Member Avatar for Taywin
0
3K
Member Avatar for ttkh2011

You may read [this](http://www.chromium.org/Home/chromecompatfaq) around the bottom of the page. It states the bug about how IE read object tag instead of embeded tag. Also, it is about Google Chrome browser.

Member Avatar for Taywin
0
187
Member Avatar for sapure

The ability to programmatically think and to find a solution to a problem are not the same. You can find a solution using different aproach which is not by programming. In programming, you may need to apply maths to solve a problem; however, many problems do not require maths in …

Member Avatar for sapure
0
181
Member Avatar for vjjohnson04

You should read stultuske links. They will help you to understand the language. There are a lot more involved in the reason. To give you a short answer, a class can inherit from only 1 class at a time. You cannot inherit more than 1 class unless you inherit from …

Member Avatar for Taywin
0
311
Member Avatar for McLaren

Not to read your code but from what I see, the location of the ball is the center. Your script is checking the location of the red line against the center of the ball, not the edge of the ball. As a result, the location which is supposed to be …

Member Avatar for McLaren
0
257
Member Avatar for anonb

Did you check what is added to your *test* variable? That would help you understand what is added and why it is not found. for (String item : test) { System.out.println(item); } PS: *stultuske* is faster :(

Member Avatar for stultuske
0
347
Member Avatar for jalpesh_007

Simply declare *number* outside the 2 for-loops and may initiate a value that will never expect to be seen from the return inside the inner loop (a negative number maybe?). Also, declare another variable and may name it *numberToSkip* outside the 2 loops too. Inside the first loop layer right …

Member Avatar for jalpesh_007
0
186
Member Avatar for pjh-10

You may read one of matlab tutorials [here](http://www.math.ufl.edu/help/matlab-tutorial/) or this [official site](http://www.mathworks.com/academia/student_center/tutorials/launchpad.html). The given code is to generate a horizontal array (dimension 1xL) value from 0 up to L-1, and then store it in variable *nn*. Then create an vertical array size of Lx1 filled with all 0 except the …

Member Avatar for Taywin
0
139
Member Avatar for deadsolo

>"^In our tests, downloads on port 6881\D+(\d+)\D+(\d+)" If that string works for you, you could easily do... "^In our tests, downloads on port 6881\D+\d+\D+(\d+)\D+\d+\D+(\d+)" Anything inside the parentheses are the group you are caturing from the match.

Member Avatar for deadsolo
0
183
Member Avatar for jamesperkins0

When you see nothing happens in an interactive GUI, the first thing you should look for is the *actionPerformed()* method. The method is from *ActionListener* which is a class that keep listening any event from the frame/panel your program is being displayed. Currently, your method definition is calling to exit …

Member Avatar for jamesperkins0
0
233
Member Avatar for Dane2259

From a quick glance on your program, line 75 is not needed. Also, line 76 will cause a problem because you are not counting nodes after you have already initialise the list once. Also, you may need to implement the swap() method before you could go further. The sort requires …

Member Avatar for Taywin
0
730
Member Avatar for sheushen

You do it exactly the same way as sorting a String array. The only different is the way you traverasal the list and the way you swap the items. If you still don't get the idea, I will come back and check on it later...

Member Avatar for Taywin
0
205
Member Avatar for BLuv

No, I think lines 48~50 are causing the problem (in main()). The reason is that all of those variable being passed to methods are not declare/initialised anywhere inside the main(). I believe the professor asks the OP to enter a real number, not a variable. // i.e. Sphere.volumn(5); ... But …

Member Avatar for Taywin
0
185
Member Avatar for IcyFire

Are you talking about the display inside the grid? If so, you simply display a panel inside that row. Then manipulate (repaint or swap out) the panel for different content display.

Member Avatar for IcyFire
0
219
Member Avatar for Monkey101

Do you understand the closest distance equation between 2 points on 2D? It is... distance = square root of ( (x2-x1)^2 + (y2-y1)^2 ) The distance() method is done exactly what the equation is. When you do normalization, you are converting a vector it its unit vector (magnitude of 1). …

Member Avatar for Taywin
0
110
Member Avatar for sobias

You need to create a table of double value and at the same time keeping track of the value you need for the total sum. The maximum value of the double value will never go above the multiplication value you want it to be. /* i.e. You want to do …

Member Avatar for sobias
0
1K
Member Avatar for Monkey101

>The program has to randomize the array indexs. What does that sentence mean??? If your program generate a random index of an array, what's next? Your program is importing *Random* class, but you instead use *Math.random()* method to generate a number? What you need to do is to follow the …

Member Avatar for Nutster
0
90
Member Avatar for AliHurworth

The double and single quotation marks are often times interchangeable. In this case, you must distinguish which quotation marks you are using. You could use an escape character (backslash) to make this happen. document.write("<input type=radio name=\"overall\" value=\""+i+"\">"+i);

Member Avatar for adam.adamski.96155
0
212
Member Avatar for somjit{}

Whenever you got an error saying *Symbol not found*, you need to check the name given by the error. There are usually 2 causes of this type of exception. One, Java language is case-sensitive. In other words, a variable name *Number* is not the same as a variable name *number*. …

Member Avatar for somjit{}
0
261

The End.