fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
emmanuelux has joined #ruby
jorge has joined #ruby
dagnachewa has quit [Quit: Leaving]
zodiak has joined #ruby
tigris_ has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
<tigris_>
hey all, anyone know the story behind null character and UTF8? according to ruby and wikipedia, null char is valid unicode... according to postgres, it's not
<tigris_>
they're real stubborn about it too, i asked them flat out, why can't a char that is valid ascii and unicode be stored in a text field, and they're all like "no one in their right mind thinks null is valid utf8"
<Norrin>
if they're the only ones not supporting it, you showed them as many references are possible of other people supporting it?
<reactormonk>
tigris_: they use null-terminated strings?
gmci has quit [Read error: Connection reset by peer]
Banistergalaxy has joined #ruby
<fowl>
negative affects of cannibalism for humans
<fowl>
wrong window
<kiyoura>
lol
SCommette has joined #ruby
verto|off is now known as verto
gmci has joined #ruby
<tigris_>
Norrin: the only info I have on it is that wikipedia says null char is valid ascii (character 0) and valid unicode "\u0000"... ruby accepts it as valid utf8, as does mysql (not that mysql is reknowned for following standards)
<fowl>
>> "\u0000\u0000".size
<al2o3cr>
(Fixnum) 2
<tigris_>
reactormonk: perhaps they use null internally for terminating text, i've no idea.... i guess it may come down to sql spec
<Norrin>
^
SCommette has quit [Client Quit]
LennyLinux has quit [Remote host closed the connection]
freeayu has joined #ruby
mrdodo has joined #ruby
Takehiro has joined #ruby
robbyoconnor has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby
kaushik_ has joined #ruby
robbyoconnor has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby
noyb has quit [Ping timeout: 276 seconds]
robbyoconnor has quit [Read error: Connection reset by peer]
jasonkuhrt has joined #ruby
robbyoconnor has joined #ruby
qwerxy has quit [Quit: offski]
c0rn_ has joined #ruby
noyb has joined #ruby
Takehiro has quit [Ping timeout: 272 seconds]
fyolnish has joined #ruby
warrenv has joined #ruby
sonamos has joined #ruby
TheNullByte has quit [Quit: TheNullByte]
TheNullByte has joined #ruby
CarlB_the_great has quit [Remote host closed the connection]
Markvilla has quit [Quit: Computer has gone to sleep.]
<reactormonk>
aces1up: what's the composite pattern?
<reactormonk>
aces1up: bit too many ()
<burgestrand1>
aces1up: if block is a block, it calls the block with self as the only argument
burgestrand1 is now known as burgestrand
Takehiro has joined #ruby
<burgestrand>
although technically the block must be either a proc or a lambda, and since both lambda and proc are procs, the block must be a proc
rll has joined #ruby
Takehiro has quit [Remote host closed the connection]
<rll>
anybody tell me what ":&" mean?
noyb has joined #ruby
<reactormonk>
rll: context?
<rll>
?
<rll>
still don't get it...
<burgestrand>
rll: it’s a symbol, nothing more
stepnem has joined #ruby
<burgestrand>
rll: also, he asks for context
<burgestrand>
rll: where did you get :& from
<rll>
:& start
<burgestrand>
it also probably means somebody is not very happy with you, it looks like a very sad and disfigured smiley
SCommette has joined #ruby
<burgestrand>
rll: not that’s just invalid syntax
SCommette has quit [Client Quit]
<rll>
it's from cloudfoundry
hemanth has quit [Ping timeout: 246 seconds]
<burgestrand>
rll: you’re probably quoting it wrong
<burgestrand>
most likely it says something more along the lines of something(&:start)
gtuckerkellogg has quit [Ping timeout: 244 seconds]
SCommette has joined #ruby
<rll>
i see, i'll look it over again
franksort has joined #ruby
<rll>
thx, burge :-)
<burgestrand>
rll: and if so, that’s a special kind of method call
mrdodo has quit [Remote host closed the connection]
<rll>
i guess so
<burgestrand>
rll: when you prefix something with & during a method call, ruby recognizes you wanting to pass that something as the block to that method
adeponte has joined #ruby
yoklov has quit [Quit: computer sleeping]
<burgestrand>
rll: but before ruby does that, ruby will call something.to_proc, and the resulting value is passed as the methods block
<franksort>
If I have an array like arr = ['a', 'b', 'c'], is there a way to do arr.delete(['b', 'a'])?
<burgestrand>
rll: in the case of symbol, :start.to_proc returns a block that calls start on it’s first argument, so something(&:start) becomes something { |x| x.start }
<bnagy>
which, again, doesn't help when you're reading code. In your editor.
<banisterfiend>
bnagy: but i dont actually need to use an editor, show-source is enough for me when exploring code, if i really want an editor i can use edit-method (but that's rare)
<polysics>
you people all such, real programmers read data off the HD with a magnetized needle
<bnagy>
fowl: no, it doesn't, which is one of the reasons I never use it
workmad3 has joined #ruby
<banisterfiend>
bnagy: But that's my point, using an editor for reading code is not the best approach, I use pry to navigate the code base and then when i find something i want to examine i show-source it OR if i really want an editor i use edit or edit-method instead.
nim__ has quit [Ping timeout: 246 seconds]
chendo_ has quit [Ping timeout: 246 seconds]
<banisterfiend>
bnagy: i dont think an editor is a natural way to navigate a code base as it divides things up into files and directories, rather than the natural units of the code itself which is classes and methods
<bnagy>
banisterfiend: how well does that work for you with say a few hundred files in your codebase?
t73276 has quit [Remote host closed the connection]
<bnagy>
anyway this is a braindead discussion
<bnagy>
busy
t25078 has joined #ruby
baphled has joined #ruby
fearoffish has quit [Ping timeout: 246 seconds]
<banisterfiend>
bnagy: easy, because the number of files is irrelevant as it's not organized by file it's organized by classes and methods
hemanth has quit [Read error: Connection reset by peer]
M- has quit [Quit: This computer has gone to sleep]
mneorr has joined #ruby
dimday has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
cascalheira has joined #ruby
<matti>
Hi banisterfiend
fearoffish has joined #ruby
<matti>
shevy alseep, I see ;]
<banisterfiend>
matti: Hey Girl.
Takehiro has quit [Remote host closed the connection]
rohit has quit [Ping timeout: 255 seconds]
Takehiro has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<Hanmac>
hemanth an gem could be installed in diferent ways Gem maybe cant find
<hemanth>
Hanmac, true, so it boils down to rescue block ...:|
<matti>
banisterfiend: Is this the one that drops you down to a debugger on an exception?
darkf has quit [Ping timeout: 264 seconds]
<banisterfiend>
matti: drops you into pry when an exception would bubble out of the block yeah
<matti>
Nice
tatsuya_o has quit [Ping timeout: 246 seconds]
<banisterfiend>
matti: i would like to get it to a point it could be used in production
chimay has quit [Ping timeout: 276 seconds]
timonv has quit [Remote host closed the connection]
<matti>
banisterfiend: I would only keep it as a feature of anything that runs in production.
<matti>
banisterfiend: Things dropping to CLI on exception.
<banisterfiend>
matti: what does "keep it as a feature of anything that runs in production" ?
<matti>
banisterfiend: As a half-Systems-person, I would burn you on a stake if everytime something goes wrong I have to go and manually exit Pry to get production going.
<banisterfiend>
i can't parse than sentence ;)
<matti>
banisterfiend: Fail-fast and recover.
<banisterfiend>
matti: of course it wouldn't be naive like that
<matti>
:)
jchild has joined #ruby
Takehiro has joined #ruby
<matti>
Hi Takehiro
<banisterfiend>
matti: the likely use case would be forking at the point of the exception, to allow later connections over a socket to figure out what went wrong
<Takehiro>
hey!
timonv has joined #ruby
justinmcp has joined #ruby
<matti>
banisterfiend: Fork... I'd prefer getting a process snapshot / image.
<matti>
banisterfiend: So I can use it like I'd do with gdb.
<banisterfiend>
matti: well once u write the technology to do that, we can use it :)
<banisterfiend>
matti: i spend about 1 week figuring out how to take a snapshot of a running ruby process, it's not easy and i didnt solve it
<matti>
banisterfiend: Fork. Sometimes a bad idea. Especially if service will go into a rampage and start to flip all the time.
<matti>
banisterfiend: One possible thing.
<matti>
banisterfiend: Would be to marry LXC with Ruby VM.
<matti>
banisterfiend: You get a serious exception.
<matti>
banisterfiend: You contact upper-layer, and immediately save LXC container state.
<banisterfiend>
What is LXC?
<matti>
banisterfiend: And spun a new one.
<hoelzro>
Linux containers
<matti>
hoelzro: +1
<banisterfiend>
ah
<matti>
Its what Heroku uses.
<matti>
As well.
<banisterfiend>
"marry LXC with Ruby VM" ---> you say that like it's easy :)
<matti>
banisterfiend: Why it would be hard?
<matti>
banisterfiend: It is just a matter of working our how to dispatch such request to an upper-layer.
poppiez has joined #ruby
<banisterfiend>
matti: because i'm assuming it would require spelunking the depths of the ruby vm source
<matti>
Even simple PING-PONG solution from the host to guest would do.
sepp2k has joined #ruby
robozahn has joined #ruby
<matti>
For instance -- application in a container is not responding? Save state.
<matti>
banisterfiend: I meant Ruby VM as Ruby interpreter running there serving something.
wargasm1 has quit [Ping timeout: 246 seconds]
<banisterfiend>
brb
Gesh has joined #ruby
<hemanth>
gem list | grep ?
chimay has joined #ruby
gyre007 has joined #ruby
<matti>
?
Takehiro has quit [Remote host closed the connection]
omry has joined #ruby
s1n4 has joined #ruby
timonv has quit [Read error: Connection reset by peer]
s1n4 is now known as Guest69498
timonv has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
timonv has quit [Remote host closed the connection]
<banisterfiend>
matti: sorry, got called away (had to look for my flatmates sleeping pills)
Guest69498 has quit [Changing host]
Guest69498 has joined #ruby
<banisterfiend>
matti: so you can just tell LXC to clone a process state and copy it into another 'linux container' or whatever?
Guest69498 has quit [Client Quit]
arturaz has quit [Remote host closed the connection]
gloomer has quit []
_s1n4_ has joined #ruby
arturaz has joined #ruby
t25078 has quit [Remote host closed the connection]
t5630 has joined #ruby
<matti>
banisterfiend: No. Not sure if this is possible.
<matti>
banisterfiend: You could, IIRC, save state of a particular container, and then spun a new one.
Xeago_ has quit [Remote host closed the connection]
<matti>
banisterfiend: If you have RR LB in front of your backends, for instance. Then it should not upset too much.
<matti>
banisterfiend: Provided that data your work with is state-less / session-independent.
snearch has joined #ruby
wargasm has joined #ruby
<banisterfiend>
matti: problem is even if that works, it seems a very specific solution tied to a very specific technology that not everyone might be using
<matti>
banisterfiend: If you have Linux kernel which is modern.
<banisterfiend>
matti: one solution i was playing with was generating core files on demand
x0F_ has joined #ruby
x0F_ has quit [Changing host]
x0F_ has joined #ruby
x0F has quit [Disconnected by services]
<matti>
banisterfiend: That is not hard as well.
<matti>
banisterfiend: You can use gdb to do it.
x0F_ is now known as x0F
<hemanth>
how about? install_gem(gem) if !installed?(gem)
<matti>
banisterfiend: For instance, you can have small server / process running in the background.
gmci has joined #ruby
<banisterfiend>
matti: i've done it, but the difficulty is bringing it back to life
<banisterfiend>
matti: since a core file is just post-mortem
<matti>
banisterfiend: And if an application will misbehave, you ask this little server to get gdb and save your memory.
snearch has quit [Client Quit]
<matti>
banisterfiend: Yeah.
<matti>
banisterfiend: There wound not be a perfect solition here.
<matti>
banisterfiend: Unless your process that crashes is self-confined.
<matti>
banisterfiend: Anything else, which for instance interacts with a database, or something external.
<matti>
banisterfiend: If you save its state and then resume it. There is no guarantee that corrupted data will not get into your database.
mneorr has joined #ruby
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
<matti>
banisterfiend: Unless everything is API-driven and everything is validated... but that also does not protect against logical errors.
<banisterfiend>
matti: not quite sure what you're talking about, resuming what?
<banisterfiend>
matti: you are talking about a fix + continue work flow?
<banisterfiend>
the gem doesn't allow for that, even. It's just for post mortem debugging
<banisterfiend>
i would like to add fix + continue but it's difficult
Xeago has joined #ruby
<hemanth>
Gem::Specification::find_by_name() itself is throwing gem load error!
<hemanth>
D:
<matti>
banisterfiend: I was talking about saving execution state of entire LXC container.
<banisterfiend>
matti: ah, it wasn't clear you were talking about that since we had discussed a couple of other techniques too :)
TheFuzzball has quit [Disconnected by services]
<banisterfiend>
i know nothing about LXC so i know nothing of the potential pitfalls, too
timonv has joined #ruby
<banisterfiend>
matti: for generating corefiles, there are 3rd part libraries that do that too btw, rather than shoe-horning gdb into the process
TheFuzzb_ has joined #ruby
<shevy>
matti yeah almost, was sleeping before, but just got back on the library. I have to ignore the only person here to spam me with horse p0rn so I can't see or care what this stupid person does
<Xeago>
anyone with an abundance english knowledge who wants to share? I feel there is a bit too much "I will" in the following paragraph..
<Xeago>
"During my internship at VideofyMe I shall fulfill a request by the users: search. The current search system is inadequate as it does not fullfill the users' desires, does not find items reliably and is as hard to extend as it is slow. I will develop, and implement, search in a distributed manner. I will design and deploy a distributed architecture for future extensibility and scalability. The search index will not be open to the public, so as
<Xeago>
to not forget about security and search scraping. Accessing the index will happen through the internal API of VideofyMe. "
<Xeago>
I will/shall
<bnagy>
will / shall is complicated and there's not even a clear consensus
<bnagy>
just use will in all cases
<banisterfiend>
Xeago: the first sentence isn't particularly well expressed as there already is a search system right? so you shouldn't just say 'search' you should say 'improving the search system'
Guest5516 has joined #ruby
<banisterfiend>
"I shall address a common user request: improving the search system" or such, or perhaps "For my internship at VideofyMe I aim to overhaul the search system. The current search system has been a source of many user complaints: it does not find items reliably ..." etc
<banisterfiend>
Xeago: ^
hekin has joined #ruby
bhavesh_a_p has joined #ruby
freeayu has quit [Quit: This computer has gone to sleep]
aristidesfl has joined #ruby
pingfloyd has quit [Quit: pingfloyd]
chendo_ has quit [Ping timeout: 260 seconds]
Shrink has joined #ruby
Shrink has quit [Changing host]
Shrink has joined #ruby
chendo_ has joined #ruby
nilg has quit [Read error: Connection reset by peer]
nilg has joined #ruby
nilg has quit [Read error: Connection reset by peer]
heftig has quit [Ping timeout: 245 seconds]
mneorr1 has joined #ruby
nilg has joined #ruby
bradhe has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
nilg has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
diegoviola has quit [Ping timeout: 244 seconds]
jchild has quit [Quit: WeeChat 0.3.8]
nilg has joined #ruby
wallerdev has quit [Quit: wallerdev]
heftig has joined #ruby
bradhe has quit [Ping timeout: 246 seconds]
Foxandxss has joined #ruby
jarek has joined #ruby
machty_ has joined #ruby
machty has quit [Read error: Connection reset by peer]
machty_ is now known as machty
nim_ has joined #ruby
Taichou has joined #ruby
Takehiro has joined #ruby
resure has joined #ruby
bluebie has joined #ruby
resure has quit [Client Quit]
resure has joined #ruby
kyb3r has quit []
<bluebie>
yo dudes
twinturbo has joined #ruby
jjang has quit [Remote host closed the connection]
<banisterfiend>
hey blue
<bluebie>
sup banisterfiend?
dynamix has joined #ruby
BiHi_ has quit [Quit: Computer has gone to sleep]
<banisterfiend>
bluebie: waching botfly extraction vids on youtube :)
Taichou has quit [Remote host closed the connection]
Takehiro has joined #ruby
t8182 has quit [Remote host closed the connection]
nari has joined #ruby
t58371 has joined #ruby
Taichou has joined #ruby
carloslopes has joined #ruby
Floydzy has quit [Quit: Floydzy]
pskosinski has quit [Read error: Connection reset by peer]
Nathandim has quit [Quit: Leaving]
pskosinski has joined #ruby
freeayu has joined #ruby
sthulbourn has joined #ruby
<sthulbourn>
Hey guys, does anyone know if I can specify the remote ip address in rack::test?
jimeh has joined #ruby
<carloslopes>
sthulbourn: hmm iirc you can do this.. but, why don't you stub the method that get this value.. something like: request.stub(:remote_ip).and_return('192.168.1.101')
tatsuya_o has quit [Remote host closed the connection]
<hoelzro>
wereHamster: you probably should prefix the newlines with \
<hoelzro>
or not use leading commas
<hoelzro>
trailing > leading ;)
bd0 has joined #ruby
<wereHamster>
ruby isn't whitespace-sensitive, is it?
<JonnieCache>
not in the full on python way, no
<JonnieCache>
but that doesnt mean you can put whitespace whereever you like
<JonnieCache>
i understand why some people put commas first but personally i hate it :)
<hoelzro>
JonnieCache: imo, there's no reason to do it in Ruby
<hoelzro>
Ruby allows commas as a list terminator, doesn't it?
<hoelzro>
>> [ 1, 2, 3, ]
<al2o3cr>
(Array) [1, 2, 3]
<hoelzro>
\o/
emmanuelux has quit [Quit: @+]
<Hanmac>
wereHamster it works when you add the , before the line break and not after
TPFC-SYSTEM has joined #ruby
<sepp2k>
wereHamster: It matters where you put your linebreaks because ruby uses them to infer semicolons. And of course space is used as a token separator ("foo bar" is not the same as "foobar").
olrrai has quit [Quit: Saliendo]
niklasb has joined #ruby
<Hanmac>
another sample whitepace samples:
<Hanmac>
>> p 1,2
<al2o3cr>
(Array) [1, 2], Console: 1, 2
<Hanmac>
>> p(1,2)
<al2o3cr>
(Array) [1, 2], Console: 1, 2
<Hanmac>
>> p (1,2)
<al2o3cr>
-e:1:in `eval': (eval):1: syntax error, unexpected ',', expecting ')' (SyntaxError), p (1,2), ^, from -e:1:in `<main>'
KevinSjoberg has joined #ruby
machty has quit [Read error: Connection reset by peer]
machty_ has joined #ruby
<canton7>
to be fair, I would have expected ruby to parse wereHamster's example. it's pretty clear that, at the end of each line, the statement hasn't finished yet
TPFC-SYSTEM has left #ruby [#ruby]
<hoelzro>
it's probably just a quirk in the parser
chussenot has quit [Remote host closed the connection]
chussenot has joined #ruby
<canton7>
s/statement/expression
pepijndevos has left #ruby [#ruby]
a_a_g has quit [Quit: Leaving.]
n1x has joined #ruby
TPFC-SYSTEM has joined #ruby
josh^ has quit [Remote host closed the connection]
TPFC-SYSTEM has left #ruby [#ruby]
johnjohnson has quit []
<Hanmac>
canton7 if her had did the "," at the right place, then ruby could have parsed right
<canton7>
Hanmac, I'm aware. I just don't think his placement of the commas needs to be considered 'wrong'
neku has joined #ruby
Takehiro has quit [Remote host closed the connection]
jarek has quit [Quit: jarek]
Takehiro has joined #ruby
jrajav has joined #ruby
Rochefortes has joined #ruby
Rochefort has quit [Ping timeout: 246 seconds]
zodiak has joined #ruby
justinmcp has quit [Remote host closed the connection]
linoj has joined #ruby
cascalheira_ has joined #ruby
gfontenot has joined #ruby
seanwash has joined #ruby
mneorr has quit [Quit: Leaving.]
gfontenot has quit [Client Quit]
Taichou has quit [Remote host closed the connection]
Taichou has joined #ruby
justsee has quit [Quit: Leaving...]
Taichou has quit [Remote host closed the connection]
Takehiro has quit [Remote host closed the connection]
CarlB_the_great has quit [Remote host closed the connection]
tagrudev has quit [Remote host closed the connection]
Takehiro has joined #ruby
namidark has joined #ruby
mercwith1mouth has joined #ruby
erichmenge has joined #ruby
CarlB_the_great has joined #ruby
hekin has quit [Quit: hekin]
dpk has joined #ruby
elitheeli has joined #ruby
tonini has quit [Remote host closed the connection]
CarlB_th_ has joined #ruby
johnjohnson has joined #ruby
rubious has joined #ruby
<elitheeli>
Given a character class thing from a regex, like "[^A-Z]", is there a better way to get a list of what it matches besides (0..255).map(&:chr).select {|x| /#{char_class}/ =~ x}?
CarlB_the_great has quit [Ping timeout: 272 seconds]
<hoelzro>
elitheeli: more like (0..UNICODE_MAX) ;)
<elitheeli>
ugh
<elitheeli>
that's way too big
<hoelzro>
mhmm
<elitheeli>
so is there a non-brute-force way?
<hoelzro>
learn the definitions =P
<elitheeli>
how does the internal ruby regex algo do it?
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
dhruvasagar has quit [Ping timeout: 276 seconds]
<shevy>
long live ruby!
joepheus is now known as joephelius
t56222 has quit [Remote host closed the connection]
t85467 has joined #ruby
<hoelzro>
does anyone know of a way I can use minitest and generate TAP output?
emmanuelux has joined #ruby
<lupine_85>
File.read("/usr/dict/words").split
<lupine_85>
oh dear
joephelius has quit [Quit: WeeChat 0.3.8]
dpk has quit [Quit: Asleep at the keyboard.]
<elitheeli>
banisterfiend, that doesn't handle character classes :(
<banisterfiend>
what a pity :)
uris has quit [Ping timeout: 268 seconds]
<shevy>
hmm matti ... what is better ... some_dir = '/tmp/foo/' or ... some_dir ='/tmp/foo' ... as in, always keep the trailing / or never keep it, for directories
cascalheira81 has quit [Ping timeout: 246 seconds]
Tearan has quit [Quit: Sleepy Badger....]
groupcat has quit [Quit: Reconnecting]
matrixise has quit [Ping timeout: 272 seconds]
SCommette has quit [Quit: SCommette]
resure has joined #ruby
groupcat has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
heynerds has joined #ruby
Rochefort has joined #ruby
bluenemo has quit [Remote host closed the connection]
machty has joined #ruby
cascalheira has joined #ruby
Rochefortes has quit [Ping timeout: 246 seconds]
otters has quit [Ping timeout: 244 seconds]
mahmoudimus has joined #ruby
Rochefort has quit [Remote host closed the connection]
TheNullByte has quit [Quit: TheNullByte]
elitheeli has quit [Quit: elitheeli]
ananthakumaran1 has joined #ruby
mneorr has joined #ruby
ananthakumaran has quit [Ping timeout: 244 seconds]
fidel has joined #ruby
sailias has joined #ruby
Vert has quit [Read error: Connection reset by peer]
elico has quit [Remote host closed the connection]
<fidel>
hi - i am new to gems - how would i update a specific installed gem? i see there is an update command - but that seems to be global if i am right - so may i be forced to always update all gems?
<lupine_85>
even if it's already installed, that will install either the latest available version, or the version you specify
cascalheira has quit [Ping timeout: 246 seconds]
freeayu has quit [Quit: This computer has gone to sleep]
<fidel>
lupine_85: oh - thanks
<Hanmac>
shevy depending what you do with the strings
baroquebobcat has joined #ruby
sonkei has joined #ruby
baroquebobcat has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
<Hanmac>
fidel: "gem update <gem-name>" should work too
CarlB_th_ has quit []
chimay has joined #ruby
neku is now known as neku|away
<fidel>
Hanmac: thanks to you too - worked
gfontenot has joined #ruby
resure_ has joined #ruby
<fidel>
i somehow expected an update-speciic cmd ;)
sthulbourn has left #ruby [#ruby]
zigomir has quit [Ping timeout: 264 seconds]
<lupine_85>
with rubygems, all bets are off
hernerdies has joined #ruby
Bosox20051 has joined #ruby
paralelepipedo has quit [Ping timeout: 264 seconds]
jastix has quit [Ping timeout: 246 seconds]
linoj has joined #ruby
jastix has joined #ruby
heynerds has quit [Ping timeout: 260 seconds]
sailias has quit []
heynerds has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
chimay has quit [Changing host]
chimay has joined #ruby
paulovittor23 has quit [Remote host closed the connection]
cdepue has quit [Remote host closed the connection]
elico has joined #ruby
hernerdies has quit [Ping timeout: 260 seconds]
chimay has quit [Quit: reconnecting]
ciopte7 has quit [Quit: ciopte7]
chimay has joined #ruby
chimay has quit [Changing host]
chimay has joined #ruby
<shevy>
Hanmac and what do you do with a variable that points to a directory usually?
<shevy>
fidel, btw via "gem help commands" you get the commandline help commands
groupcat has quit [Disconnected by services]
sepp2k has quit [Ping timeout: 246 seconds]
paralelepipedo has joined #ruby
adeponte has quit [Remote host closed the connection]
xorigin has quit [Quit: leaving]
rs-ix has joined #ruby
jgrevich has joined #ruby
linoj has quit [Quit: linoj]
gfontenot has quit []
sonkei has quit [Quit: Computer has gone to sleep.]
sailias has joined #ruby
ringotwo has joined #ruby
fidel has left #ruby [#ruby]
<Hanmac>
when you do File.join(some_dir,"file") then its unimportant if you have / at the end or not
mrmist_ has joined #ruby
manolo has quit [Remote host closed the connection]
Spooner_ has joined #ruby
mrmist_ is now known as groupcat
xorspark has joined #ruby
Spooner has quit [Ping timeout: 245 seconds]
djbender has joined #ruby
ph^ has joined #ruby
ciopte7 has joined #ruby
`brendan has joined #ruby
mr_dynamix has quit [Quit: mr_dynamix]
Axsuul has joined #ruby
macmartine has joined #ruby
sepp2k has joined #ruby
shevy has quit [Ping timeout: 264 seconds]
diegoviola has joined #ruby
jasonkuhrt has joined #ruby
macmartine has quit [Client Quit]
<Hanmac>
timeout does shevy-picking again :(
djbender has quit [Quit: djbender]
<rking>
shadoi: I always leave the trailing slash off, because it's the responsibility of whatever dconcats a file onto it to put a '/' in between.
<rking>
And then you end up with those un-pro /foo/bar//baz's
<rking>
s/dcon/con
levieraf has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
nim__ has joined #ruby
Beoran__ has quit [Ping timeout: 240 seconds]
EPIK has quit []
jwbuurlage has joined #ruby
voodoofish has quit [Quit: Leaving]
bd0 has joined #ruby
nim_ has quit [Ping timeout: 244 seconds]
codespectator has joined #ruby
Progster has joined #ruby
shevy has joined #ruby
<Hanmac>
shevy when you do File.join(some_dir,"file") or something similar then you would not get a problem with a ending "/"
<rking>
Hanmac: That's true, but my general point is the trailing slash should never do anything good anyway.
jwbuurlage has quit [Remote host closed the connection]
jwbuurlage has joined #ruby
<rking>
To assume it is there is brittle, so you have to add it every time, and then you might as well leave them all off.
<Hanmac>
when you do dir + "file" then its important (or you play in C(++))
<shevy>
rking uh
<shevy>
rking why is it brittle to assume state a or state b? you say that no states can be assumed, as in no standards can be used
<shevy>
state a: foo = '/tmp/test'
<shevy>
state b: foo = '/tmp/test/'
<shevy>
it's easy to use a method like File.join to ensure consistency, but this sidesteps both states anyway
<shevy>
why can't there be simple answers :(
<rking>
If that dir is coming from anywhere except a very-nearby line, it will eventually end up not having the slash.
chussenot has quit [Quit: chussenot]
<rking>
Like if you accept user input. config_dir: /home/shevy/foo
AlbireoX has joined #ruby
<shevy>
yeah, that's a point
<rking>
So I've learned to always File.join (or equivalent) everywhere. So I've learned I'll never need to put the trailing slash.
<shevy>
lazy users
Takehiro has quit [Remote host closed the connection]
<rking>
Hanmac: But that's a wrongish bit of code. I'd always do dir + "/file"
<rking>
In C{,++}/Ruby/Shell/etc.
yxhuvud has joined #ruby
<rking>
Because it never hurts, anyway, even if you have user input that isn't in on the meme. config_dir: /home/shevy/foo/ would produce /home/shevy/foo//file, which is equivalent.
cakehero has joined #ruby
zodiak has joined #ruby
ciopte7 has quit [Quit: ciopte7]
<shevy>
I hate the two /
<shevy>
but you are right, it is not as brittle as zero /
yasushi has quit [Remote host closed the connection]
<rking>
Yes.
Beoran__ has joined #ruby
yasushi has joined #ruby
CarlB_th_ has joined #ruby
yoklov has joined #ruby
macmartine has joined #ruby
yasushi has quit [Ping timeout: 246 seconds]
Virunga has joined #ruby
jgrevich_ has joined #ruby
Virunga is now known as LennyLinux
<shevy>
hmm
<shevy>
if I package all my .rb files, I end up with a 6.5M .tar.bz2 file
jgrevich has quit [Ping timeout: 248 seconds]
jgrevich_ is now known as jgrevich
<rking>
You're very prolific. =)
baroquebobcat has quit [Quit: baroquebobcat]
Takehiro has joined #ruby
<Hanmac>
shevy i hope i do not count the *.so size of my bindings ...
khakimov has joined #ruby
<shevy>
rking hmm... I thought it would be more
eldariof has joined #ruby
mercwith1mouth has quit [Ping timeout: 272 seconds]
<shevy>
3.5K rails-3.2.6.gem
kerframil has quit [Ping timeout: 252 seconds]
BiHi has quit [Quit: Computer has gone to sleep]
<Hanmac>
in some of my bindings 500kiB => ~37MiB
ciopte7 has joined #ruby
<davidcelis>
rails-3.2.6.gem is mostly just railties
<davidcelis>
it doesn't package activesupport, activerecord, activemodel, etc. inside that gem
skanev has joined #ruby
adeponte has joined #ruby
td123 has joined #ruby
neku|away is now known as neku
skanev has left #ruby [#ruby]
c0rn_ has joined #ruby
baroquebobcat has joined #ruby
adeponte has quit [Remote host closed the connection]
ananthakumaran1 has quit [Quit: Leaving.]
gfontenot has joined #ruby
hipertracker has quit [Quit: hipertracker]
qwerxy has quit [Quit: offski]
poppiez has joined #ruby
Cache_Money has joined #ruby
Bosox20051 has quit [Remote host closed the connection]
mercwith1mouth has joined #ruby
TheNullByte has joined #ruby
baphled has joined #ruby
t85467 has quit [Remote host closed the connection]
t11134 has joined #ruby
Xeago has joined #ruby
hernerdies has joined #ruby
<Hanmac>
my gems make a size increase to 7500% :P
heynerds has quit [Ping timeout: 260 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
ZachBeta has joined #ruby
otters has joined #ruby
emmanuelux has quit [Remote host closed the connection]
savage- has quit [Remote host closed the connection]
CarlB_th_ has quit [Remote host closed the connection]
carloslopes has quit [Quit: Leaving.]
<gyre007>
guys, I'm trying to figure out one thing...I have an embedded ruby installed ie in its own environment ie it has its own gems...i need to write a script which will be using that embedded environment including its gems...not the one which is installed on the server...
<gyre007>
i keep getting errors that some gems can't be loaded...;(
<xorgnak>
have you installed the gems on the host?
<Morkel>
no
<Morkel>
only bundle install
<yxhuvud>
try prepend your crontab entry with bundle exec?
<xorgnak>
install them with gem
sterex has joined #ruby
haxrbyte has quit [Ping timeout: 246 seconds]
Takehiro has quit [Remote host closed the connection]
<Morkel>
with bundle exec it works fine. Thanks
<gyre007>
i think the problem might be RVM
elaptics is now known as elaptics`away
aristidesfl has joined #ruby
Xeago has joined #ruby
eldariof has quit [Ping timeout: 248 seconds]
jasonkuhrt has quit [Quit: Leaving...]
xorgnak has quit [Remote host closed the connection]
seanwash has quit [Quit: Computer has gone to sleep.]
ph^ has joined #ruby
flak has joined #ruby
flak is now known as Guest35822
jasonkuhrt has joined #ruby
SCommette has quit [Quit: SCommette]
Bosox20051 has joined #ruby
bradhe has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
bradhe has joined #ruby
LennyLinux has joined #ruby
Bosox20051 has quit [Remote host closed the connection]
CarlB_the_great has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
<stretchlimo>
I am experiencing a problem with loading yaml files in 1.9.3-p194. Running lsof against my irb session shows that ./x86_64-linux/enc/utf_16be.so is loaded...but every time I load a file like YAML.load('example.yaml') strace shows dozens of failed open attempts looking for ./enc/utf16_be.so.so in each gem folder
rippa has quit [Ping timeout: 276 seconds]
<stretchlimo>
It appears to be killing the performance of YAML.load
saschagehlich has quit [Read error: Operation timed out]
<rking>
stretchlimo: Stracing gem loading will not lead to ☺iness.
<rking>
It's pretty inefficient with the syscalls.
<stretchlimo>
I had a perf problem that led to using strace...not the other way around! :)
<stretchlimo>
the gems are loaded already...and the behaviour I describe happens for every YAML.load
c0rn_ has joined #ruby
Squarepy has joined #ruby
CannedCorn has joined #ruby
cdepue has left #ruby [#ruby]
phrame has quit [Ping timeout: 246 seconds]
duard has quit [Ping timeout: 246 seconds]
machty has joined #ruby
TheShadowFog has quit [Ping timeout: 246 seconds]
chimay has quit [Quit: WeeChat 0.3.9-rc1]
TheShadowFog has joined #ruby
Squarepy has quit [Read error: Connection reset by peer]
Squarepy_ has quit [Read error: Connection reset by peer]
<rking>
stretchlimo: Yeah. I actually had this weird leap-second glitch on one of my VPS machines, and everything was very noticably sluggish. I started stracing things and there was all this gem-related I/O.
qwerxy has joined #ruby
Squarepy_ has joined #ruby
<rking>
I posted an Issue and got summarily shut down, saying, "That's the way rubygems works"
Squarepy has quit [Read error: Connection reset by peer]
<rking>
stretchlimo: But your particular case sounds particularly odd in that it's looking for something it already loaded.
TheNullByte has quit [Quit: TheNullByte]
phrame_ is now known as phrame
frogprince_mac has joined #ruby
<stretchlimo>
rking: but that's the problem...the file name its looking for is very slightly different. I think somebody made a typo in the patch to the psych interface back in April
<stretchlimo>
the file loaded is utf_16be.so. The file being search for is utf16_be.so.so
<rking>
Hehe
Kwpolska has quit [Quit: Changing server]
Squarepy_ has quit [Read error: Connection reset by peer]
Squarepy has joined #ruby
<stretchlimo>
subtle...but the file system doesn't do subtlety very well in my experience
aristidesfl has quit []
Squarepy has quit [Read error: Connection reset by peer]
<stretchlimo>
I thought I would pop in here to see if AaronP. happened to hang out here...since he made the changes (according to the changelogs)
<rking>
stretchlimo: Maybe you should Pull Request ext4 to equate .so.so to .so?
Squarepy has joined #ruby
<rking>
One-up FAT's case insensitivty.
<stretchlimo>
have to move the '_' as well?
<rking>
Yep.
<rking>
Just s/_//
<rking>
g
Takehiro_ has joined #ruby
Squarepy has quit [Read error: Connection reset by peer]
DDAZZA has joined #ruby
mrck has joined #ruby
Squarepy has joined #ruby
qwerxy has quit [Client Quit]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
Kwpolska has joined #ruby
<stretchlimo>
...in the ruby sources? Sorry...I'm a pretty hardcore ruby user but I never thought about rolling a custom build. If that is that what you're proposing.
aristidesfl has joined #ruby
LennyLin_ has joined #ruby
LennyLinux has quit [Read error: Connection reset by peer]
<rking>
No, so sorry, I'm being totally ridiculous.
<rking>
It's a problem with the psych stuff you're talking about. I wouldn't patch EXT4. =)
<stretchlimo>
not outside of my skillset...but...I was trying to help find a problem while staying on target with my own work
LennyLin_ is now known as LennyLinux
<stretchlimo>
:)
<rking>
stretchlimo: You could symlink it if you're in a rush.
CannedCorn has quit [Ping timeout: 248 seconds]
<stretchlimo>
actually...I'm about to abandon YAML for the work I'm doing.
Guest35822 is now known as rippa
<stretchlimo>
We build embedded device data collection systems...and I *was* using YAML as the scratchpad/scorecard for reporting external devices as they 'check-in'...
Squarepy has quit [Read error: Connection reset by peer]
<rking>
In favor of what?
<stretchlimo>
we're upgrading to Rails3x and Ruby 1.9.3 from 1.8.7. In 1.8.7 the performance was fine
Squarepy has joined #ruby
<stretchlimo>
hundreds of little YAML files all being happily updated...
Squarepy has quit [Read error: Connection reset by peer]
billyoc has joined #ruby
<rking>
What I'd actually do is first symlink, then if it fixed the perf problem, Fork & Pull Req.
<stretchlimo>
the system simply doesn't run on 1.9.3...and we're down to YAML (and probably the issue I outlined above) as the prime culprit
Squarepy has joined #ruby
<rking>
Are you even using UTF16?
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<stretchlimo>
no
<rking>
Hehe
qwerxy has joined #ruby
<stretchlimo>
plain ole ascii
<rking>
Encoding problems have such an awesome way of reaching outside of the scope of encoding problems.
<stretchlimo>
BUT...it appears that the latest version of pysch tries to assume one of the UTF-* formats
Squarepy has quit [Read error: Connection reset by peer]
<stretchlimo>
another "fix" would be to instruct the YAML engine what encoding each load is going to use
<stretchlimo>
but that's not apparently possible either
LennyLinux has quit [Remote host closed the connection]
<eridani>
have you tried loading ./x86_64-linux/enc/utf_16be.so before anything else?
Squarepy has joined #ruby
<eridani>
wait, sorry i'm coming in late
<eridani>
what encoding are the files in?
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<stretchlimo>
like I said...we had over 400 devices reporting their state to this little rails app...which wrote the state to a little YAML file...and the load factor on the machine was roughly 0.01 for 3 years
<stretchlimo>
then we decide...because of some new features...and security issues in 1.8.7 to move up to the current...
ZachBeta has quit [Read error: Connection reset by peer]
Squarepy has quit [Read error: Connection reset by peer]
xorigin has joined #ruby
<stretchlimo>
and this simply does not work...the machine finally panics and shuts down when the load reaches 10.0!
Squarepy has joined #ruby
Squarepy has quit [Read error: Connection reset by peer]
<stretchlimo>
and strace indicates 100,000+ failed open calls
<stretchlimo>
eridani: ascii
ZachBeta has joined #ruby
DDAZZA has quit [Ping timeout: 252 seconds]
rippa is now known as spinagon
LennyLinux has joined #ruby
<eridani>
code used to read the file/parse the yaml?
<stretchlimo>
eridani: and lsof tells us that the utf_16be.so is already loaded
Squarepy has quit [Read error: Connection reset by peer]
sambio has joined #ruby
<stretchlimo>
was implemented as an inexpensive schema-free database system
<eridani>
are the strings inside my_scorecard.yaml stringly ascii?
<stretchlimo>
absolutely
<eridani>
strictly
<stretchlimo>
understood
qwerxy has joined #ruby
<stretchlimo>
I speek fluent typolish
<stretchlimo>
:)
<eridani>
i think i ran into this problem before. try YAML.load(File.read(filename))
qwerxy has quit [Client Quit]
FrostyAcres has joined #ruby
cuci has joined #ruby
nim__ has quit [Ping timeout: 248 seconds]
deryl has quit [Quit: Time To Go, Too Bad, So Sad!]
c0rn_ has quit []
<cuci>
hi guys! I'm trying to do a select on a sqlite db like so: db.execute("select name from table") but I get some weird chars like so: ["\u7574\u7472\u7275\u6165"], ["\u686A\u6E6F"]. Seems like some coding missmatch
<cuci>
any ideas how to fix this?
xorgnak has joined #ruby
<stretchlimo>
I have a simple test set up to try different things...to see if anything actually works...
<stretchlimo>
...and...
nicoulaj has joined #ruby
<stretchlimo>
YAML.load(File.read('my_scorecard.yaml')) yields the same result as the other
qwerxy has joined #ruby
TheShadowFog has quit [Quit: pls respond]
<stretchlimo>
rking: 'git-ing' the sources now. If I'm lucky a simple grep for '.so.so' will find smething
<eridani>
can you post the file somewhere? or split the file into pieces
mahmoudimus has quit [Quit: Computer has gone to sleep.]
canton7 has joined #ruby
araujo has quit [Ping timeout: 246 seconds]
<eridani>
you're probably looking for dlopen, not .so which is automatically appended
<eridani>
i think
<eridani>
maybe not
<stretchlimo>
I'm actually watching all file activity on the process with strace
<stretchlimo>
and it is 'open' that it appears to be hunting for a link to the file in every gem directory...and every other directory in the project actually
diegovio1a has joined #ruby
diegoviola has quit [Ping timeout: 240 seconds]
diegovio1a is now known as diegoviola
DDAZZA has joined #ruby
t22296 has quit [Remote host closed the connection]
fantazo has quit [Remote host closed the connection]
t57601 has joined #ruby
vlad_starkov has joined #ruby
<eridani>
try this: File.open(path, encoding: 'utf-8') do |file|
ylluminate has joined #ruby
qwerxy has quit [Quit: offski]
<stretchlimo>
Hey! That worked!
<stretchlimo>
That gets me back to work...BUT the issue remains
TheNullByte has joined #ruby
<eridani>
i'm pretty sure you have something non-ascii in your file. the file class is trying to guess what the encoding is
deryl has joined #ruby
<stretchlimo>
and I don't think I've ever seen any examples of loading YAML objects that way...so its only a matter of time til someone else suffers
Cache_Money has quit [Read error: Connection reset by peer]
cuit has joined #ruby
<cuit>
rubygems is builtin to ruby1.9?
Cache_Money has joined #ruby
<stretchlimo>
I'm 100% sure I created the file with the same text editor I use for every other
<stretchlimo>
I believe the problem is in the psych interface assuming one of the utf16 decoders
FrostyAcres has joined #ruby
chimkan_ has quit [Quit: chimkan_]
<stretchlimo>
and then not looking in the right place for it
qwerxy has joined #ruby
<eridani>
did you see the auto loading in File.open or the yaml parser?
FrostyAcres has quit [Client Quit]
gfontenot has quit []
EweR has joined #ruby
<stretchlimo>
When I attempt YAML.load(...) I see 100's of failed open calls in strace. every one of them trying to load a file that doesn't exist on my system.
<stretchlimo>
a very similarly named file does exist and is loaded when the environment starts up
hipertracker has quit [Quit: hipertracker]
<stretchlimo>
utf16_be.so <> utf_16be.so.so
<stretchlimo>
oops...sorry...losing it...should have been utf16_be.so.so <> utf_16.so
<stretchlimo>
looks like a dumb typo to me.
hipertracker has joined #ruby
paralelepipedo has quit [Quit: Lost terminal]
yxhuvud has quit [Ping timeout: 245 seconds]
burgestrand has joined #ruby
jimeh2 has quit [Ping timeout: 248 seconds]
nim__ has joined #ruby
jimeh2 has joined #ruby
s1n4 has left #ruby ["leaving"]
<mneorr>
is there a quick way to change the Hash keys on the fly?
<rking>
mneorr: Yeah, that seems like quite a few steps.
<rking>
Can you give us a before/after pair of Hashes?
<mneorr>
rking: yeah, sure
<mneorr>
sorry, the first line shouldn't be pasted (it isn't a problem),. but that's the input, let me paste it
DDAZZA has joined #ruby
pingfloyd has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
<stretchlimo>
rking: 100% sure that something screwy in the build now...I symlinked the utf libs into lib/enc in a test Rails app and the error is gone gone gone
pingfloyd has left #ruby [#ruby]
havenn has joined #ruby
<rking>
stretchlimo: Cool man. I hope you have enough time to contribute this knowledge back to the community.
<stretchlimo>
I wouldn't even be here if that weren't the case.
<stretchlimo>
I'm just trying to hand the knowledge to the right shepherd
<stretchlimo>
thanks to rking and eridani for taking the time to talk through the problem
<rking>
stretchlimo: Thanks for working on it! =)
<stretchlimo>
I have two ways to 'patch'...now to fix it properly
<rking>
stretchlimo: What's the other way?
<stretchlimo>
rking: eridani suggested I open the file with the encoding clearly stated and then hand the handle to YAML...that works too...and I don't need to do the symlink thing
<stretchlimo>
both solutions help me point out the problem correctly
<stretchlimo>
I'm just going to email Aaron and see what comes of that
dpk has joined #ruby
jjbohn has quit [Quit: Leaving...]
TheNullByte has quit [Quit: TheNullByte]
<stretchlimo>
intimate knowledge of the source...especially this deep...and encoding...yeech...can do...would rather not. :)
brianpWins has joined #ruby
TheNullByte has joined #ruby
pettsson has joined #ruby
<rking>
stretchlimo: Aha, cool.
Xeago has quit [Remote host closed the connection]
ninegrid has quit [Read error: Connection reset by peer]
maletor has joined #ruby
<stretchlimo>
at the end of the day...the pysch engine is failing to detect the encoding...so forcing the handle to have the correct encoding stops pysch from even trying...and away we go
DDAZZA has quit [Ping timeout: 252 seconds]
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
philcrissman has joined #ruby
<stretchlimo>
as for what would happen if the file is actually utf_16be...well...that's going to be equally tough
<rking>
mneorr: Hook me up with that input.
<rking>
mneorr: I could guess but I'd rather work with a test case (as I always rather do)
<mneorr>
rking: pasting it up, pastie.org crashed :(
<rking>
Now's when Hanmac or somebody could golf it down to goodness.
yoklov has quit [Quit: computer sleeping]
<stretchlimo>
nevermind...rking's solution is one better than mine... I had to preset an empty hash to start
<stretchlimo>
but you don't have to do all that testing for HTTP if you just use gsub(/HTTP_/, ''). It would only alter the key if HTTP_ was found...otherwise it passes straight through
cantonic has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
prath has joined #ruby
snearch has joined #ruby
<mneorr>
yeah, testing is not needed at this point, seems like rking's solution is a oneliner 8)
<Hanmac>
rking, i think your code cant be more golfed
<rking>
Hanmac: K, thanks.
levieraf has quit [Quit: Saliendo]
<mneorr>
rking: thanks!
erichmenge has joined #ruby
schaerli has quit [Remote host closed the connection]
cantonic has quit [Quit: cantonic]
nim__ has quit [Ping timeout: 240 seconds]
<mneorr>
rking: #.compact removes the nil entries?
cantonic has joined #ruby
<rking>
mneorr: Yes. gem install pry-full && pry then do ? [].compact
eldariof has joined #ruby
<Hanmac>
rking: env.each_with_object({}){|(k,v),h|h[$1.downcase]=v if k[/^HTTP_(.+)/] }
mercwith1mouth has quit [Ping timeout: 248 seconds]
<rking>
Hanmac: Oh, coolness. I didn't know about the |(k,v)…| bit.
imami|afk is now known as banseljaj
takamichi has joined #ruby
<rking>
mneorr: See that? ☝
<TTilus>
rking: is that a finger?
<rking>
Yeah.
<TTilus>
=D
<mneorr>
lol
<Hanmac>
rking you could chain it more: env.each_with_object({}).with_index {|((k,v),h),i| ... }
<rking>
stretchlimo: That's not going to filter out vars that don't start with HTTP_
<stretchlimo>
ah..I thought he wanted to clean the env without losing keys
<stretchlimo>
sorry
maletor has quit [Quit: Computer has gone to sleep.]
<stretchlimo>
shoulda read the spec! :)
heisenmink has quit [Remote host closed the connection]
wallerdev has joined #ruby
<TTilus>
ok, it really is a finger, with about 3x my normal font size it is clear, but with ordinary size it is barely visible, let alone recognizable :)
cuci has quit [Quit: leaving]
<rking>
stretchlimo: It's actually not in the example input, so yours may be right after all… it just seemed to me that the "env" hash would normally have anything.
<Hanmac>
TTilus can you read this?
<mneorr>
thanks guys
<rking>
TTilus: I have a pretty small font as well, so I've sort of memorized some of the Unicode ones based on their blobshape.
qwerxy has joined #ruby
<mneorr>
rking: strechlimo has used the ugly_headers, they were already filtered out :)
<TTilus>
Hanmac: it shows up as a hexagon with question mark inside it, just as if my terminal detected illegal utf sequence or the font is missing the glyph
philcrissman has quit [Remote host closed the connection]
Guest5516 has quit [Read error: Connection reset by peer]
havenn has quit [Remote host closed the connection]
kaushik_ has quit [Ping timeout: 246 seconds]
CarlB_the_great has joined #ruby
johnjohnson has joined #ruby
maletor has joined #ruby
bradhe has quit [Remote host closed the connection]
jbw has quit [Ping timeout: 244 seconds]
statarb3 has quit [Quit: Leaving]
elaptics is now known as elaptics`away
johnjohnson has quit []
SegFaultAX has quit [Quit: Lost terminal]
billyoc has quit [Remote host closed the connection]
xorgnak has quit [Remote host closed the connection]
answer_42 has quit [Quit: WeeChat 0.3.8]
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
keppy has quit [Ping timeout: 245 seconds]
machty_ has joined #ruby
machty has quit [Read error: Connection reset by peer]
machty_ is now known as machty
philcrissman has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
jbw has joined #ruby
ringotwo has quit [Remote host closed the connection]
specialGuest has quit [Ping timeout: 276 seconds]
TheNullByte has quit [Quit: TheNullByte]
<Paradox>
hrm
<Paradox>
highline seems to have shit a brick with a recent update to something
<fowl>
Good morning to you too ;)
Goles has joined #ruby
erichmenge has joined #ruby
CarlB_the_great has quit [Remote host closed the connection]
macmartine has joined #ruby
cakehero has quit [Ping timeout: 272 seconds]
prath has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
<rking>
Hanmac: It's a bummer that you can do |(k,v)| but not def initialize @foo
<rking>
(Then Obj.new 1 would be like @foo = 1)
Azure|dc has joined #ruby
macmartine has quit [Client Quit]
<takamichi>
Anyone around who would like to convert a short python script to ruby. I need it for a custom puppet function. $20 via Paypal
mrck has quit [Read error: Connection reset by peer]
<rking>
takamichi: Gist it.
aristidesfl has quit []
<Paradox>
takamichi, i could give it a try
<Hanmac>
rking that what Struct is for :P
<takamichi>
rking: Give me a sec
Azure|dc is now known as Valkyrie^
kokainepizza has joined #ruby
jarred has quit [Quit: jarred]
adeponte has joined #ruby
<rking>
Hanmac: Hrm, you're probably right. The one I actually one is CoffeeScript's hashy ones. E.g. def f {:name, :age} then f name: 'Hanmac', age: 12
specialGuest has joined #ruby
marienz_ has joined #ruby
clj_newb has joined #ruby
<rking>
But then in Ruby it gets messy because you're saying ":name" there, and it's not clear if that should be "@name" or a lexical "name" or what.
specialGuest has quit [Changing host]
specialGuest has joined #ruby
<Hanmac>
i had a little script that allows you to use the hash arguments on a stuct ...
<rking>
It's not really the end of the world. I'm glad we now have nice keyword args for callers, but it's one of those things that Smalltalk has always had that we're begrudgingly catching up to only now.
<Paradox>
rking, still, better than java
TheNullByte has joined #ruby
hbob has joined #ruby
<rking>
takamichi: Hehe, you're going to have a very hard time getting someone to write that error-free, because it's so tied to an untestable SQL DB. And the $20 is probably on the line of "token thanks, but no thanks"
qwerxy has joined #ruby
<rking>
Paradox: Being better than Java is like __This_analogy_censored_due_to_ableism_Political_correctness__.
<Paradox>
lol
<hbob>
Haha
<takamichi>
rking: fair enough. the db schema could be exported and is super simple. Anyway, I guess I'll have to stay up tonight and do it myself...
<takamichi>
rking: Thanks for taking the time to look at it anyway, cheers!
snearch has quit [Quit: Verlassend]
<rking>
takamichi: I'd do it just for fun but I'm already way overdue on my tasks today.
<rking>
takamichi: But yeah, dump the schema plus some test data if you want to get a taker.
emmanuelux has joined #ruby
<takamichi>
rking: It doesn't require any test data to start, the script generates it. Cheers for the advice.
<blazes816>
@ refers to an instance variable inside the current object. planet is a local variable, not an instance var
<tpd>
gotcha!
qwerxy has quit [Quit: offski]
<tpd>
neat, it's working now!
<tpd>
thanks!
<blazes816>
congrats!
<tpd>
so, basically now I no longer need a full array with names
<tpd>
["p1", "p2" ... ]
<tpd>
for my planets
<blazes816>
you'll be getting corrected by mon_ouie in no time
<tpd>
all I need is an empty array
<blazes816>
nice, yeah and array of planet instances is much cleaner
<blazes816>
an*
specialGuest has quit [Quit: WeeChat 0.3.8]
<tpd>
yeah, you're right
<tpd>
I thought I needed an array for the diff. object names :-)
Takehiro has joined #ruby
t84226 has quit [Remote host closed the connection]
havenn has joined #ruby
t83823 has joined #ruby
cascalheira has joined #ruby
bradhe has quit [Remote host closed the connection]
<wuwoot>
i'm learning ruby. can't quite figure out why i'm getting a syntax error keyword_end in my code. somebody mind taking a look? (http://pastebin.com/tF5syD6s)
<jae>
wow so many ppl like me, guess im not alone :D
ciopte7 has joined #ruby
<heftig>
wuwoot: needs to be elsif, not "else if"
johnjohnson has joined #ruby
<wuwoot>
heftig: ah!
Takehiro has quit [Ping timeout: 244 seconds]
<DebianUT>
I have a question
<DebianUT>
What does the "Using" keyword does?
<DebianUT>
what's the difference with the "require" keyword?=
<heftig>
DebianUT: that's not a keyword
<DebianUT>
I have seen code using it
<blazes816>
DebianUT: that's a python construct
<DebianUT>
no really
Criztian has quit [Read error: Connection reset by peer]
<fowl>
interesting a new keyword, right under our noses
<DebianUT>
I saw it, let me check
<blazes816>
link to the code?
<DebianUT>
one sec
<blazes816>
k
<heftig>
DebianUT: still not a keyword. the code you've seen defines a method by that name somewhere
bradhe has joined #ruby
<blazes816>
grep -Rn 'def using' .
<heftig>
or 'def self.using'
<heftig>
well, \.
<koshii>
>> array = ["fish", "and", "chips"] ; result = [] ; for item in array ; result << item.upcase ; end ; result
<al2o3cr>
(Array) ["FISH", "AND", "CHIPS"]
<koshii>
^ why does this happen? I thought << was "pop into array" ?
havenn has quit [Remote host closed the connection]
<koshii>
Shouldn't it pop capitalized versions into the array?
CaLXhaS has joined #ruby
<blazes816>
koshii: pop means to remove the last element. << means 'push' into array
<koshii>
Oh. Shoot.
<heftig>
>> array = ["fish", "and", "chips"] ; result = [] ; for item in array ; result << item.capitalize ; end ; result
<al2o3cr>
(Array) ["Fish", "And", "Chips"]
<koshii>
Push means replace?
Xeago has quit [Remote host closed the connection]
<heftig>
no, push means append to end
<koshii>
I'm not understanding why it replaces the existing ones.
<heftig>
it doesn't replace
CaLXhaS has left #ruby [#ruby]
<koshii>
Oh. Never mind. I see my dumb error. :)
<koshii>
Thanks!
CaLXhaS has joined #ruby
<heftig>
>> array = ["fish", "and", "chips"] ; for item in array ; array << item.upcase ; end; array
<heftig>
wee infinite loop
<heftig>
>> array = ["fish", "and", "chips"] ; for item in array.dup ; array << item.upcase ; end; array
<fowl>
mztriz: because pass = .. pass << you're modifying the string in the array
Xeago has joined #ruby
<fowl>
thats an array btw not a dict/hash
Chryson has joined #ruby
<mztriz>
fowl: I know this is only a very small part of my code
<mztriz>
fowl: why is it modifiying the dict array? what can I do to fix it?
cascalheira has quit [Quit: qicr for android: faster and better]
<heftig>
def gen_pass(d,s) d.sample(2).join(s.sample) end
josh^ has joined #ruby
<fowl>
>> x = %w(A B C); x.each { |z| z << "herro" }; x
<al2o3cr>
(Array) ["Aherro", "Bherro", "Cherro"]
<fowl>
>> x = %w(A B C); x.each { |z| z.dup << "herro" }; x
<al2o3cr>
(Array) ["A", "B", "C"]
macmartine has joined #ruby
havenn has joined #ruby
<mztriz>
thanks fowl and heftig
davecow_ has joined #ruby
bier has quit [Ping timeout: 246 seconds]
davecow_ has left #ruby [#ruby]
havenn has quit [Remote host closed the connection]
jasonkuhrt has joined #ruby
jasonkuhrt has quit [Client Quit]
ciopte7 has quit [Quit: ciopte7]
machty has quit [Ping timeout: 276 seconds]
Taichou has joined #ruby
qwerxy has joined #ruby
LennyLinux has quit [Remote host closed the connection]
chimkan has quit [Ping timeout: 244 seconds]
chimkan__ has joined #ruby
Azure has joined #ruby
Valkyrie^ has quit [Quit: ¦]
Taichou has quit [Ping timeout: 248 seconds]
ringotwo has joined #ruby
bier has joined #ruby
freeayu has joined #ruby
naturehack has joined #ruby
gfontenot has joined #ruby
ciopte7 has joined #ruby
<wuwoot>
another newbie programming question: i'm trying to write a simple product method that puts/prints the product of all the values in an array. this is what i've got (http://pastebin.com/0uCxRY8F). any help would be greatly appreciated.
g_rotbart has joined #ruby
Xeago has quit [Remote host closed the connection]
statarb3 has quit [Ping timeout: 246 seconds]
Russell^^ has joined #ruby
<heftig>
wuwoot: [1,2,3].inject(:*)
Xeago has joined #ruby
justsee has quit [Quit: Leaving...]
<davidcelis>
^
<atmosx>
wuwoot: what were you expecting? 10 instead of 0?
<sepp2k>
atmosx: He was expecting what he wrote in the comments. Those aren't the actual results of his code.
qwerxy has quit [Quit: offski]
ZachBeta has joined #ruby
<blazes816>
wuwoot: [1,2,3].inject(1){|current_value, total| current_value * total} is a slightly more verbose version that may help to understand what's happening
<atmosx>
sepp2k: ah ok
juarlex has quit [Ping timeout: 248 seconds]
<davidcelis>
blazes816: you flipped them there block args broseph
Azure has joined #ruby
<sepp2k>
wuwoot: array(x-1) is a function call (to an undefined function). To index an array use square brackets, not parentheses. That said it makes no sense to index the array with x-1 as the index. x is an element of the array, there's no reason x-1 should be a valid index.
<sepp2k>
wuwoot: Also note that each returns the array it is called on. So your product method will also always return the array it was given - not a number.
<blazes816>
good call, did it backwards. luckily multiplication is combative
<davidcelis>
blazes816: YOU WONT BE SO LUCKY NEXT TIME
<blazes816>
communitive*
<blazes816>
:(
<wuwoot>
blazes816: thanks, however, i'm not permitted to use inject in my exercise
<blazes816>
wuwoot: sounds contrite
<wuwoot>
blazes816: i'm asked to use array#each
<davidcelis>
blazes816: also you mean commutitive
<davidcelis>
commutative*
Cache_Money has quit [Read error: Connection reset by peer]
<sepp2k>
And having an each block that just prints something on each iteration without doing anything else is not helpful. You want to somehow keep track of the product of the numbers.
<sepp2k>
(You really don't want to print at all)
adeponte has joined #ruby
<davidcelis>
wuwoot: asked by... who
Cache_Money has joined #ruby
<davidcelis>
wuwoot: because lolz
lkba has quit [Read error: Operation timed out]
<davidcelis>
sounds like whoever asked you to use #each doesn't know its return value, or they want you to be overly verbose
dv_ has quit [Read error: Connection reset by peer]
DebianUT has quit [Quit: Page closed]
Advocation has quit [Quit: Advocation]
gtuckerkellogg has quit [Ping timeout: 240 seconds]
CarlB_the_great has quit [Remote host closed the connection]
c0rn_ has quit []
TheNullByte has quit [Quit: TheNullByte]
bradhe has joined #ruby
Beoran__ has joined #ruby
dv_ has joined #ruby
koshii has quit [Quit: leaving]
TheNullByte has joined #ruby
jjang has joined #ruby
ezyang has joined #ruby
<ezyang>
Hey guys, if I omit an argument for a native function like IO::select, is that equivalent to passing null?
<Mon_Ouie>
Usually yes (and in that specific example, yes)
maletor has joined #ruby
justsee has quit [Quit: Leaving...]
mercwith1mouth has joined #ruby
devnull_ has joined #ruby
wuwoot has quit [Read error: Operation timed out]
chimkan__ has quit [Quit: chimkan__]
<devnull_>
hello :) could anyone help me with parsing an error code that I am getting using a net/http class ? https://gist.github.com/3614866 thanks a lot in advance much appreciated
ezyang has left #ruby [#ruby]
statarb3 has quit [Quit: Leaving]
xbayrockx has quit []
<shevy>
devnull_ hmm that looks highly specific to couchdb
<devnull_>
shevy: no let me clarify if the record is not there it will return a 404 that is a simple net/http call on a "page" so if is 404 means record is not there..409 is like conflict
Cache_Money has quit [Ping timeout: 246 seconds]
<devnull_>
shevy: so is just on how to parse the error.. I know why I get the error :D
mahmoudimus has quit [Quit: Computer has gone to sleep.]
mahmoudimus has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
clj_newb has quit [Ping timeout: 264 seconds]
Russell^^ has quit [Quit: Russell^^]
ZachBeta has quit [Quit: Computer has gone to sleep.]
<sepp2k>
horofox: A class will take the name of the first constant its assigned to. So simply assign the class to the constant you want (using const_set if you don't know the name until runtime)
<sepp2k>
Btw: you can pass the block directly to Class.new - you don't need class_eval
seanyo has quit [Read error: Connection reset by peer]
justsee has joined #ruby
techsurvivor has joined #ruby
<horofox>
sepp2k: not my project, I'm trying to fix a issue
saikobee has left #ruby [#ruby]
k04n has joined #ruby
<k04n>
If I have a Ruby gem that is capable of loading data from a URL, but I want it to load from a variable instead, is there any "magic" URL I can use that will load from a variable
<k04n>
something like "memory://myvar"
<horofox>
sepp2k: i can't marshal a instance of this mounter
<k04n>
alternatively, does anyone know how to get Dragonfly to load an image contained in a variable (binary data stored in a variable)
<horofox>
sepp2k: because the class is anonymous, so I want to name it