closer changed the topic of #ruby-core to: check the latest release candidate for 1.9.1 release ftp.ruby-lang.org:/home/yugui/ruby-1.9.1-r26021+1.tar.bz2
<zzak>
[ben z rf, irc.freenode.net] (py3, that is)
<zzak>
[arahael, irc.freenode.net] benzrf: but locale!
<zzak>
[arahael, irc.freenode.net] Ox0dea: how can it, without the locale?
hsbt_away is now known as hsbt
<zzak>
[Tariq Ali, irc.freenode.net] I am building a web server for a class, and every time the user goes to a website, I send them a Header telling the browser to create a new cookie with certain characteristics
<zzak>
[Tariq Ali, irc.freenode.net] But Chrome adds a new cookie value, called rack.session.
<zzak>
[Tariq Ali, irc.freenode.net] So the web server's cookie gets messed up...
<zzak>
[Tariq Ali, irc.freenode.net] Also, when people go to a page, they send me their cookie, I process it in memory, and then send them a new cookie with new updated values...
<zzak>
[Tariq Ali, irc.freenode.net] This is how I get "rack.session"
<zzak>
[Tariq Ali, irc.freenode.net] What should I do with rack.session? Just don't process it?
<zzak>
[Tariq Ali, irc.freenode.net] Well, I guess that worked then. Thanks Rubby Duckies.
<zzak>
[Tariq Ali, irc.freenode.net] *Rubbe
<zzak>
[Tariq Ali, irc.freenode.net] *Rubber
<zzak>
[the method of tikt, irc.freenode.net] question: I'm trying to figure out how to best organize this hash. The associations are like this (using example names): "Account" has one value, which has an array "patients", and under patients there are two arrays that belong to patients, "billable_items" and "products"
<zzak>
[the method of tikt, irc.freenode.net] so starting with "patients", I need patients to be an array, where each entry has two sub-arrays, "billiable_items" and "products"
<zzak>
[the method of tikt, irc.freenode.net] what's the best way to design that?
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] and this solution : http://lpaste.net/161374
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] Can I improve my solution somehow : http://lpaste.net/161374
toretore has joined #ruby-core
<zzak>
[Zarthus, irc.freenode.net] roelof: the challenge link doesn't work / requires authorization, what is the challenge?
<zzak>
[Zarthus, irc.freenode.net] roelof: also, you might like 'codewars', challenges made by users that also (once solved or given up) show you other people their solutions. I'm pretty sure it supports ruby
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] Elysia: I apolize. in 2 sentences the challenge is this : Write a program that prints the temperature closest to 0 among input data. If two numbers are equally close to zero, positive integer has to be considered closest to zero (for instance, if the temperatures are -5 and 5, then display 5).
<zzak>
[Zarthus, irc.freenode.net] the solutions by other users are not always the best (some of them are incredibly obscure exploiting the language), but it might give you some cool ideas
<zzak>
[Zarthus, irc.freenode.net] oh, are you still on about that issue?
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] which isssue, this code solves all cases presented
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] I only want to know if I can do it a "better" way
<zzak>
[Zarthus, irc.freenode.net] issue as in question; you came here yesterday with the same thing
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] correct, but now I solved it
<zzak>
[Zarthus, irc.freenode.net] took you a while :P
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] Elysia: yep, I still need soeme time to find out which function can do the job and I do also not work full time on it
<zzak>
[Zarthus, irc.freenode.net] one thing you might be cautious about is that it's often better to reject user input if it doesn't match your criteria (which may not be the feedback you're looking for - but programs that don't account for bad user input aren't well written programs. For this challenge, it might suffice, but personally I'd put a string in the test cases just to mess with users)
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] for me these are challenges to learn ruby and learn how to solve "real" problems
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] you mean something like "1 2 -4 b 8 7 " ??
<zzak>
[Zarthus, irc.freenode.net] yeah, b will be 0
<zzak>
[Zarthus, irc.freenode.net] you can just use "puts temp" on line 10
<zzak>
[Zarthus, irc.freenode.net] unless you want "the temperature is #{temp}", but your current code does not do that
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] oke, so something like if .. then temp = temp * - 1 end ?
<zzak>
[Zarthus, irc.freenode.net] use newlines
<zzak>
[Zarthus, irc.freenode.net] it helps you expand the code in the future (easier to maintain) and it makes it easier to read (catch errors quickly)
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] of course, I was checking if I understand what you mean
<zzak>
[Zarthus, irc.freenode.net] if you want to chain some more things, there's room for that too (depends on what you want)
<zzak>
[524ACD6D.cm-4-3d.dynamic.ziggo.nl/82.74.205.109, irc.freenode.net] I like readable code not putting everything on one line
<zzak>
[Zarthus, irc.freenode.net] the 'temp' variable might be misleading (is it a temporary variable, or a temperature?)