Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Koldo Urrutia

Ranch Hand
+ Follow
since Dec 16, 2011
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 Koldo Urrutia

fred rosenberger wrote:Hi Koldo,

I'm sorry nobody here was able to help you. To be honest, I did read your original post, but found it hard to understand. It wasn't clear to me what you were trying to accomplish, or what the problem was.

You may want to read some of the item on our HowToAskQuestionsOnJavaRanch FAQ. These may help you get a better response the next time you have a question here. In particular, I'd suggest reading the articles AvoidRedHerrings and IsolateTheProblem.

Remember, when you ask a question here, the easier you make it for someone to help you, the more likely you are to get that help from them.


Thank you for your good reply.

Well, Im not sure but what I was trying to accomplish was pretty on point to me. I tried to describe it with as much detail as possible. I even mentioned that if anyone had questions, please ask; I told members that please ask questions if they dont understand something.

I tried showing my main as a example of what my program does exactly. The problem was not there so maybe you are correct that I should have pointed that out.
9 years ago
This is my main:

9 years ago
Hello

Ive tried this over and over again (with about already 1000 lines of code) and it seems to fail at the last step....Hope you guys can help me.


I want to do the following:

I only have two functions right now: createfolder (Function A) and insertfile (Function B). Nothing else.

My requirements are the following:

Random number is a number common to function A and B
My main path is C:/ we base everything off that.
In C:/, we see if a folder called "webfolder" exists. If it does, we enter it. If it doesnt, we created it.
Once it is created and found, we enter it.

Function A: Counter is a local variable that equals 1. It is local to Function A. I make a folder with the current date and "" and the counter ONLY if there are less than 44 file inside this webfolder. If there is more than 44 files, I add one to a counter and then make a folder with the current date and the "" and the counter as long as it has less than 44 files inside. If not function A is repeated until counter is 9.

Once Function A is completed, I change to that that current date and "_" and the counter folder and inside make a folder with a random number.

Next, we have to insert some files into these folders. I once again start my path off C:/ then enter Webfolder (Webfolder at this point always exists because I call the folder creating function ALWAYS before inserting a file).

Function B: Counter is a local variable that equals 1. It is local to Function B. I search for a folder with the current date and "_" and the counter. If I find it, I search if it has less than 44 files inside. If it does have more 44, I add to counter plus one to look for the next folder which does (or doesnt) have more than 44 files.
If it doesnt, I insert a random number BMP inside of it.

Also if it doesnt, I create a folder with the name of random number, same as Function A. I go into that folder and create whatever file I pass to the function (most likely a file with the name of the random number I passed it).

Basically, I believe that it is.

Any questions, please ask. Ive been with this for about 3 weeks. The most I get is that it inserts everything correctly but transitioning between folder 1 of the date and folder 2, one folder/file set is lost.

Any help, thank you very much.
9 years ago
Hello

Im using org.apache.commons.net's FTP object to make FTP transfers. The problem is that when the IP is down (example, the PC is turned off) a exception saying "No route to host" pops up and not only delays my program but gives a nasty error. How can I avoid this?

Thank you
9 years ago
Hey

How do I run my web service as root? Yes, I know the security implecations of this.

Thanks
9 years ago
I currently have this:


Which works if I put the alert. If I dont put it, its always the same value.
Ive tried already a few different ways but to no avail. I need some help

Koldo Urrutia wrote:
Thank you for putting a example at least

My main "issue" is what is "callback(a)"??? That isnt declared anywhere. Thats where I think Im getting lost.

That said, you are telling me to do something like this:






Would that code work???



Did not work....

Eric Pascarello wrote:Basic example of what you expect to happen



What is actually happening:


What you need to do is break it up into two parts.




Thank you for putting a example at least

My main "issue" is what is "callback(a)"??? That isnt declared anywhere. Thats where I think Im getting lost.

That said, you are telling me to do something like this:






Would that code work???

Eric Pascarello wrote:You need to break up your code into two parts, request to get the variable and than when the callback is returned fire off the next step.

Eric


I have no idea where to even start or what to look for.

Do you mind helping me out please?

Eric Pascarello wrote:Appears to be asynchronous callback so it is not possible to read it inline, JavaScript does not have wait.

Eric


Well there has to be some way to get it, right? What method can I use to get the value?


Thank you!
Hello

I have the following and I want to access the variable outside of that function.

The code is:



Ive tried two solutions, neither of them work:








Thanks!