Why is this code not working.

Put your programming skills to the test in these challenges.

Why is this code not working.

Post by BrandonHeat on Tue Mar 01, 2011 2:49 pm
([msg=54527]see Why is this code not working.[/msg])

I'm trying to connect to HTS using this java code, but for some reason it deosn't work. Can anyone tell me what it is that I'm doing wrong? Any help will be appreciated.

http://pastebin.com/ed4SBvLf
Last edited by BrandonHeat on Tue Mar 01, 2011 4:17 pm, edited 1 time in total.
BrandonHeat
New User
New User
 
Posts: 7
Joined: Tue Mar 01, 2011 2:44 pm
Blog: View Blog (0)


Re: Why is this code not working.

Post by Phantom Wolf on Tue Mar 01, 2011 4:14 pm
([msg=54531]see Re: Why is this code not working.[/msg])

I don't know anything about Java, but it doesn't look like you're sending a referer, HTS won't let you log in without one.
Phantom Wolf
Poster
Poster
 
Posts: 271
Joined: Wed Mar 03, 2010 8:45 pm
Blog: View Blog (0)


Re: Why is this code not working.

Post by BrandonHeat on Tue Mar 01, 2011 4:19 pm
([msg=54534]see Re: Why is this code not working.[/msg])

Thanks, Phantom Wolf. I added a referer, but it still isn't working. I don't get an error or anything, just no result at all.
BrandonHeat
New User
New User
 
Posts: 7
Joined: Tue Mar 01, 2011 2:44 pm
Blog: View Blog (0)


Re: Why is this code not working.

Post by insomaniacal on Tue Mar 01, 2011 5:39 pm
([msg=54543]see Re: Why is this code not working.[/msg])

I too am not a Java programmer.

If you have general code-related questions, as in, "I just need to figure out what part of my syntax is wrong!!" you'll probably have better luck going over stack overflow or similar sites dedicated specifically with helping people with code.

We're usually happy to look over and comment on code, but we're definitely more prone to discussions than timely help.
It's not who votes that counts, it's who counts the votes
insomaniacal.blog.com
User avatar
insomaniacal
Addict
Addict
 
Posts: 1210
Joined: Sun May 24, 2009 10:21 am
Blog: View Blog (0)


Re: Why is this code not working.

Post by BrandonHeat on Wed Mar 02, 2011 12:41 pm
([msg=54604]see Re: Why is this code not working.[/msg])

I've aksed at stack overflow, made a few changes and now I've managed to connect to HTS. However, when I move to a URL different than the homepage(the programming challenges), it says I'm not logged in. I'm passing the PHPSESSID in a cookie, is there something else other than the session id I need to pass?

Here is the code I'm using now: http://pastebin.com/5BPi5FAL
BrandonHeat
New User
New User
 
Posts: 7
Joined: Tue Mar 01, 2011 2:44 pm
Blog: View Blog (0)


Re: Why is this code not working.

Post by conscience on Sun Nov 04, 2012 8:47 pm
([msg=70554]see Re: Why is this code not working.[/msg])

Aaarrrgh! My eyes! Refactor!
I was going to take a look and try to point you in the right direction, but... C'mon, what the hell are you doing there??? :o
A whole god-object with the static entry point main() containing everything? And wtf is at line 83? :shock:

https://www.google.hu/search?q=clean+code%3A+a+handbook+of+agile+software+craftsmanship&oq=clean+code%3A+a+handbook+of+agile+software+craftsmanship&sugexp=chrome,mod=0&sourceid=chrome&ie=UTF-8

Do yourself a favor: Read this book and then try again. It will be a lot easier.

No offense (okay, maybe a bit :P) but you make your own job a lot more difficult.
Let him who has understanding recount the number of the beast, for it is a human number: His number is 0x029A.
conscience
Poster
Poster
 
Posts: 248
Joined: Thu Jan 08, 2009 9:05 pm
Location: 127.0.0.1
Blog: View Blog (0)


Re: Why is this code not working.

Post by LoGiCaL__ on Tue Nov 06, 2012 9:15 pm
([msg=70584]see Re: Why is this code not working.[/msg])

The OP hasn't been active in over a year.
User avatar
LoGiCaL__
Addict
Addict
 
Posts: 1060
Joined: Sun May 30, 2010 12:33 pm
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests

cron