Conversation
Notices
-
@redenchilada http://pastebin.com/dnmzXAtg There you go :)
Sunday, 27-May-12 16:16:06 UTC from web-
@ironwill Try replacing out.write("status=" + URLEncoder.encode(msg, "UTF-8")); with out.write("status=" + URLEncoder.encode(msg, "UTF-8") + "&source=" + URLEncoder.encode("ham is delicious", "UTF-8"));
-
@redenchilada Thanks, i'll try that now.
-
@redenchilada Aha! It worked! You are a genius, thank you :P
-
@redenchilada *clap*
-
@minti *clop*
-
@redenchilada WHY ARE YOU MANUALLY CONCATENATING REQUEST PARAMETERS #coderage
-
@ironwill Here you go. My background. I made it for myself, but im giving it to you because minecraft. http://ur1.ca/9e1g8
-
@bitshift BECAUSE I DON'T KNOW HOW ELSE TO. I AM VERY VERY NEW AT THIS YOU SEE.
-
@techdisk42 That's pretty awesome. xD
-
@bitshift WHY DON'T _YOU_ SHOW HIM HOW TO DO IT BETTER
-
@techdisk42 :O Is so pretty!
-
@redenchilada Well, in fairness, I don't know whether there's a better way built into Java. But at the very least, you could put parameters in a hash (with name as key, value as... well, value), and have one function that urlencodes values, puts strings along the lines of "{KEY}={URLENCODED VALUE}" into a list and joins the whole list together with "&" as a separator. More complex, but removes the need to repeat concatenation and urlencoding everywhere.
-
@techdisk42 xD Well it definitely turned out to be awesome. Too bad it's too small and not poni or I'd use it as mine too. #totallynotbaised
-
@redenchilada But like I said, I don't know that aspect of Java. For all I know, it already has something that does that for you. Either way, manual concatenation seems like a lot of extra typing for nothing. :/
-
@bitshift >select >copy >paste
-
@bitshift @redenchilada I'm not gonna lie, the way I've got this going _works_ - surely that's all that matters?
-
@ironwill Generally as a coder, the idealology of "It works, don't change it." is very bad but, eh. xD
-
@ironwill If you don't plan to come back and make changes to it later, sure.
-
@minti Yeah, I know. But it's really hot today, and I have a short patience xD
-
@ironwill xD Good enough of a reason for me.
-
@ironwill To elaborate on that: for big or long-running projects, you should make sure it's possible to change things later without going slowly mad. (For example, if you needed to change to a different encoding function, your current approach would need you to change several different places.) But for small enough, or write-once-and-then-just-let-it-keep-running-how-it-is projects (both sound like they fit what you're doing), there's much less reason to care. :)
-
@bitshift I also must inquire why I haven't gotten any flak from you for manually coding my requests with Sockets instead of finding a better method :p
-
@redenchilada Mainly because I've not seen the code, I suspect. :P
-
@bitshift That's okay. I'm already mostly mad. :3
-
@redenchilada Not sure why you would, though, given that java has such a thing as a java.net.HttpURLConnection (http://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html)?
-
@bitshift I think I tried to use that and didn't have the willingness to figure it out before going back to the Sockets that I'm oh-so-familiar with.
-
@bitshift Also looking at an implementation of it, it looks like more code even without adding authentication. :x
-
@redenchilada Fair enough, but it just seems... wrong, for lack of a better term... to me to use sockets and manually assemble requests, when the library has something that already builds requests (and most likely can also do other things). :/
-
@bitshift I'm infuriatingly stubborn about doing everything in the most difficult way possible. Plus I can use Sockets for other things (like if I write an online game at some point!)
-