This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of React Cookbook: Recipes for Mastering the React Framework and have David Griffiths & Dawn Griffiths on-line!
See this thread for details.
Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!

mandlar suurla

Ranch Hand
+ Follow
since Jun 11, 2008
mandlar likes ...
PHP Debian Linux
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by mandlar suurla

I am being read lot of articles how to implement the OO in javascript, but i havent seen the one standard way to do it. The latest ES5 way to do the OO too verbose, what to you thin what is the heading of OO style in JS ?
Currently there is no syntax problems so the code runs.
Problems what i am having now are
*When client connects and i add it to ActiveSessions, there will be added two instances at the same time(should be only one)

* On client side, pushing button send the object sending and receving works, but the client get's always the same Board object somehow. Like the turns count increases on server side but on client side the counter stays same, always 1 1 1.

As on the server side there's object Board and i share only objects reference to other sessionhandlers this should avoid the problem of making somewhere two different instances.

server main


Client side

Campbell Ritchie wrote:What sort of data structure is that? It looks to me like a binary tree. So what is the algorithm for a depth first search? If you are getting the wrong result you are using the wrong algorithm. What do you mean by path? Are you going to have a linked list of nodes to the number sought? Or a String?

You will have to use the very expensive hardware I so often recommend: a Cray occupying a building the size of a cinema pencil, eraser, and sheet of paper. ?Write down how you are going to tell whether you have found a value, and how you are going to add it to a path. Since it is recursive, start with a little tree, like this oneThen take your recursion one level higherand work out how you are to handle something likeGet that sort of thing working, and it becomes easy to scale up for recursion over any kind of tree. You can work out the depth at which you found the value, from the length of the path.

I am sorry that i draw the binary tree, i forgot to mention the cycles are allowed like node 5 and 10 could be connected. It needs to find path between 2 nodes, no dijkstra and A* algorithms( i dont need to find shortest). Currently my code traverses all the nodes and doesn't deal with path finding. So i tought i need Stack to hold path, but how i know which element is part of path.
10 years ago
Well i got graph and i have to get path to the number what is searched. Like in example n1.dfs(visited, 15); should end on when 15 is found but it wont currently. As you can see it visits all nodes, but how would i extract from visited nodes the path.
Also when i reach end it keeps visiting sub nodes.

Full graph is here http://img19.imageshack.us/i/graphsz.png/

Node.java


Test.java

10 years ago

Stephan van Hulst wrote:Hey there! Can you explain in your own words what the difference is between:

++counter;
and
counter++?

If you don't know the difference, look up what the difference is between prefix increment and postfix increment.

Take note that the correct words are "recursion" and "recursive", not "recrusion" and "recrusive".


prefix increment, the statement value is increased first before use, but postfix increment takes value and then increases.

example
counter = 0;

if (++counter) -- the counter is increased first and then the boolean check if (1)

if (counter++) -- counter is increased after use in statement if (0) and then make +1

Am I right ? But the problem still lies in recursion.
10 years ago
I am struggling with this problem for long time and i haven't found any simple solutions.

As you can see i have made simple list to store numbers from 0 to 4, but the problem it gets the stackOverFlowError.
The result should be list.get(0) = 0 ... and list.get(3) = 4

10 years ago
So as far i have seen that Android is really clean and well documented SDK. What about blackberry, how easy would be starting from scratch blackberry.
11 years ago
I am sorry for upping old thread, but i try to implement also MVC pattern in my Swing app. So i made simple examples which should follow simple rules, like all are independent.

Model


Controller and View. As you can see the controller is inner class which you can make as separate class also you can add sub-controllers, like you got there 5 buttons and all are doing something difficult, you can actually make sub-controllers for that.

One thing what i think should be done a bit differently. View should be class which extends from JPanel and then make the Application creation class where you add view. What you think ?

I dont want to make new topic so i use my old one. So i tried to make use of my own configure class but that wasn't good idea. I am going to use pref API, but there is one little problem, as you insert or get the data you need to provide default data, but when i am using same fields in my app many times and in some other classes its like over typing same thing.

So my idea is to use "" empty string for default. If anyone got any good solution, then please help.
13 years ago
I made before your post singleton class which writes in the same method to log and textarea, but i need to say that i used textarea object as static variable, i think is should pass by parameter.
13 years ago
I am logging program with log4j and I want to show the logged information in JTextArea is it possible and if it is, is it hard to make? Or got any tutorial for it? I would like to make them both be synchronous so when information is logged then it displays it at same time in textarea.
13 years ago
Here is current layout of folders:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\WebTest\WebRoot - main dir made by eclipse web project, here are jsp files

C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\WebTest\WebRoot\META-INF

C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\WebTest\WebRoot\WEB-INF - here are classes located, also lib folder, and off curse web.xml
13 years ago
JSP
k i made project under C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\WebTest

and web acces is from http://localhost/WebTest/WebRoot/loginBean.jsp, but still same error.
13 years ago
JSP
k here is the full path to class file
13 years ago
JSP
classes is under WEB-INF folder its put there automatically as I use MyEclipse it makes the class file from src folder.
13 years ago
JSP