toastynerd has quit [Remote host closed the connection]
houhoulis has quit [Remote host closed the connection]
<john____>
hello everyone
<centrx>
quite
<john____>
i have a ruby/postgres question
<john____>
any ruby expert in the room...i'm a ruby newbie
<|jemc|>
john____: just presenting your question is the best way to get it answered
<centrx>
If you have a question, just ask!
ikrima has quit [Ping timeout: 252 seconds]
<john____>
question: how can i write a ruby script to do the following: psql -h localist -p 5432 -U mouser my_db_name -c “select * from table_name order by description” -o export_filename.csv
kramsee has joined #ruby-lang
<john____>
export the data from a table to a csv file without using rails
<centrx>
john____, I'm not sure what that does, but if it exports a database query to a CSV, it's usually fastest to have the RDBMS do it
<john____>
ok...i will check the links out...thank you centrx
<centrx>
john____, Give those a whirl and come back with follow-up questions!
<john____>
great info...much appreciated centrx
<john____>
will do
<john____>
how much of my original select statement can i feed to con.exec("SELECT statement")?
<centrx>
john____, All of it
houhoulis has joined #ruby-lang
<centrx>
john____, SQL queries are used in toto. Sometimes there are different method calls for selecting, updating, deleting, etc. but the SQL string remains complete
<john____>
psql -o option to output to csv...i have to use csv class to loop through each record and save it to a file?
<john____>
i have to use a loop for -o option of the psql statement?
toastynerd has joined #ruby-lang
<centrx>
john____, Yes, that's usually how it's done
<john____>
ok...centrx...i will give it a go...thank you a ton
imperator has quit [Quit: Valete!]
<zenspider>
john____: system("psql -h localist -p 5432 -U mouser my_db_name -c 'select * from table_name order by description' -o export_filename.csv")
<zenspider>
that's totally valid ruby and will work better than anything you come up with
<john____>
zenspider----: is system a class too?
<centrx>
john____, system is a method in Kernel, which can be used anywhere
<john____>
do i have to do a require 'system'?
<centrx>
no
<centrx>
john____, You can test things out with irb, which you can run from the command-line
<centrx>
john____, It gives you a Ruby command-line (REPL) where you can test programming constructs in a Ruby environment
toastynerd has quit [Remote host closed the connection]
<john____>
export data from postgres to a csv file using ruby....i'm installing postgresql right now to try both centrx and your suggestions
fuhgeddaboudit has quit [Ping timeout: 255 seconds]
<centrx>
john____, Yes, but why are you doing this?
ratmav has joined #ruby-lang
danguita has quit [Remote host closed the connection]
<zenspider>
john____: why are you requiring ruby when pg does this just fine?
<zenspider>
ie, what BS notion do you have in your head that we need to unstick?
<john____>
i need to automate the process of exporting data from postgres and compare the output without another file
<centrx>
Is this on a Unix system?
<john____>
with not without
<john____>
yes
<zenspider>
john____: you're talking about a 2 line shell script. or a 2 line ruby script if you do the system calls I was talking about
<centrx>
Use postgresql to output the CSV, then use diff to compare the files
elliotec has quit [Remote host closed the connection]
<john____>
ruby...learning ruby so why i'm trying to use it more
<zenspider>
I don't see why ruby is a requirement
<centrx>
You can use Ruby as the glue for that, but there are ready-made executables for doing sysadmin things like this
<zenspider>
do the simplest thing that could possibly work. in this case: use the tools you have
toastynerd has joined #ruby-lang
<centrx>
john____, What are the requirements for comparing the files?
nathanstitt has quit [Quit: I growing sleepy]
<whitequark>
john____: COPY products_273 to '/tmp/products_199.csv' delimiters',';
<whitequark>
that's all you need
<zenspider>
you're fine using ruby to make those calls... string interpolation is cleaner/easier in ruby than it is in bash/zsh... but still
<centrx>
john____, Writing the CSV and pg script in Ruby would be a good exercise
<whitequark>
or COPY table TO '.../file' WITH CSV;
<centrx>
john____, but ultimately the best tools to use are the postgresql csv output
<zenspider>
I imagine that the cmdline is equivalent to the latter
twright has joined #ruby-lang
<centrx>
*good exercise for learning Ruby
vlad_starkov has joined #ruby-lang
<centrx>
Reading from databases and writing to CSVs are common tasks, but usually there is some meat in between that has to be done with a programming language.
elliotec has joined #ruby-lang
<zenspider>
dinner...
<centrx>
*meat
<centrx>
*dinner
instantaphex has quit [Ping timeout: 255 seconds]
elliotec has quit [Remote host closed the connection]
elliotec has joined #ruby-lang
ratmav has quit [Quit: Leaving]
<john____>
so guys...what's best...system or csv?
<centrx>
system will tell the database to do it, which is faster and most reliable
<whitequark>
neither, use the pg driver to ask postgres to save the csv to you
<centrx>
the pg driver can do that?
<whitequark>
the pg driver can send queries. COPY is a query.
<john____>
@baseline = “COPY(SELECT * FROM table ORDER BY Description) TO STDOUT ~/test/outfile.csv” do
<john____>
result = conn.exec(@baseline)
<john____>
while row=conn.get_copy_data(result)
<john____>
mem_out.puts(row)
<john____>
end
<john____>
result.clear()
<john____>
end
<john____>
whiteQuark...i'm not sure what i'm doing...but is this better than before?
<whitequark>
no, this doesn't make any sense at all.
<john____>
any issues with @baseline line?
<john____>
up to .csv
alexju has joined #ruby-lang
axv has joined #ruby-lang
<whitequark>
yes. read the documentation for the COPY command
<whitequark>
to begin with
<john____>
ok...cool...sounds good...let me do that first...thanks for the feedback
jonathanmarvens has joined #ruby-lang
wyman has quit [Quit: wyman]
wyman has joined #ruby-lang
RobertBirnie has joined #ruby-lang
wyman has quit [Client Quit]
Barrin6 has joined #ruby-lang
RobertBirnie has quit [Client Quit]
vlad_starkov has joined #ruby-lang
yfeldblum has joined #ruby-lang
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby-lang
Speed has quit [Ping timeout: 252 seconds]
yubrew has joined #ruby-lang
axv has quit []
Guest65219 has quit [Ping timeout: 255 seconds]
hahuang65 has quit [Ping timeout: 252 seconds]
yubrew has quit [Ping timeout: 264 seconds]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
danguita has joined #ruby-lang
havenn has joined #ruby-lang
havenwood has quit [Ping timeout: 276 seconds]
robbyoconnor has quit [Excess Flood]
rwk1 has joined #ruby-lang
elliotec has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
elliotec has joined #ruby-lang
michaeldeol has joined #ruby-lang
rwk1 has quit [Ping timeout: 252 seconds]
elliotec has quit [Remote host closed the connection]
hahuang65 has joined #ruby-lang
Guest65219 has joined #ruby-lang
ssb123 has quit [Remote host closed the connection]
houhoulis has quit [Remote host closed the connection]
elliotec has joined #ruby-lang
Speed has joined #ruby-lang
hahuang65 has quit [Ping timeout: 252 seconds]
psycho_one has joined #ruby-lang
Guest65219 has quit [Ping timeout: 276 seconds]
vlad_starkov has quit [Remote host closed the connection]
karamazov has joined #ruby-lang
sdouglas has joined #ruby-lang
sdouglas has quit [Remote host closed the connection]
sdouglas has joined #ruby-lang
ratmav has joined #ruby-lang
RobertBirnie has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonathanmarvens has quit [Remote host closed the connection]
ratmav has quit [Quit: Leaving]
robbyoconnor has quit [Ping timeout: 252 seconds]
ssb123 has joined #ruby-lang
Speed has quit [Ping timeout: 240 seconds]
elliotec has quit []
yubrew has joined #ruby-lang
toastynerd has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
ssb123 has quit [Ping timeout: 252 seconds]
willmarshall has quit [Ping timeout: 252 seconds]
Speed has joined #ruby-lang
yubrew has quit [Ping timeout: 265 seconds]
ssb123 has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
ssb123 has quit [Read error: Connection reset by peer]
karamazov has quit [Remote host closed the connection]
karamazov has joined #ruby-lang
ssb123 has joined #ruby-lang
ikrima has joined #ruby-lang
willmarshall has joined #ruby-lang
ssb123 has quit [Read error: Connection reset by peer]
havenn has quit [Remote host closed the connection]
ssb123 has joined #ruby-lang
havenwood has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
Lewix has joined #ruby-lang
karamazov has quit [Ping timeout: 264 seconds]
ta has quit [Remote host closed the connection]
ta has joined #ruby-lang
Barrin6 has quit [Quit: Leaving]
havenwood has quit [Ping timeout: 276 seconds]
ssb123 has quit [Ping timeout: 252 seconds]
ta has quit [Ping timeout: 240 seconds]
rwk1 has joined #ruby-lang
karamazov has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
apeiros has quit [Read error: Connection reset by peer]
relix has joined #ruby-lang
apeiros has joined #ruby-lang
heftig has quit [Quit: Quitting]
pixelhandler has quit [Quit: pixelhandler]
<apeiros>
whitequark: should be a 1:1 reimplementation (unless I made mistakes)
<apeiros>
it's 3 classes in rails, though, and a bit of manual work
<apeiros>
whitequark: this code in rails: encrypted_data = ActiveSupport::MessageEncryptor.new(ActiveSupport::KeyGenerator.new('password').generate_key(SecureRandom.random_bytes(64))).encrypt_and_sign('my secret data')
jonathanmarvens has joined #ruby-lang
<apeiros>
is this code with mine: encrypted_data = Encryption.encrypt(data: 'my secret data', password: 'password')
rwk1 has quit [Ping timeout: 276 seconds]
allomov has joined #ruby-lang
<whitequark>
looks moderately ok to me, although I'd prefer someone like tarcieri to look at it
stardiviner has joined #ruby-lang
<apeiros>
he did. though his only comment was "looks better" :)
jonathanmarvens has quit [Ping timeout: 240 seconds]
<apeiros>
I updated it to the latest state from yesterday. mostly cosmetical changes (e.g. kwargs are now required - they were optional because I want to provide other means to pass the data - e.g. streaming it in - but that's not a priority)
psycho_one has quit [Remote host closed the connection]
allomov has quit [Ping timeout: 252 seconds]
mistym has joined #ruby-lang
[spoiler] has joined #ruby-lang
ta has joined #ruby-lang
nisstyre has quit [Quit: WeeChat 0.4.3]
symm- has quit [Ping timeout: 240 seconds]
* apeiros
off for commute
apeiros has quit [Remote host closed the connection]
JoshuaPaling has joined #ruby-lang
apeiros has joined #ruby-lang
apeiros has quit [Ping timeout: 252 seconds]
kitak_ has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
karamazov has quit []
Mon_Ouie has quit [Ping timeout: 264 seconds]
|jemc| has quit [Quit: WeeChat 0.4.1]
ozzloy has quit [Quit: leaving]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yubrew has joined #ruby-lang
mistym has quit [Remote host closed the connection]
ta has quit [Ping timeout: 276 seconds]
ozzloy has joined #ruby-lang
ozzloy has quit [Changing host]
ozzloy has joined #ruby-lang
yubrew has quit [Ping timeout: 252 seconds]
toastynerd has joined #ruby-lang
arBmind has joined #ruby-lang
arBmind has quit [Client Quit]
amclain has quit [Quit: Leaving]
Lewix has quit [Remote host closed the connection]
ta has joined #ruby-lang
mehlah has joined #ruby-lang
kitak_ has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
<apeiros>
whitequark: I'm curious. when you say 'moderately ok', it means to me that some things are not good with it. anything concrete?
ssb123 has joined #ruby-lang
<whitequark>
'moderately ok' means that I'm not competent to say 'fully ok'
<whitequark>
the fact that you've invented your own scheme (ok, reused whatever rails invented and poked the code) is concerning
<whitequark>
it is probably fine for your use case, but still
<apeiros>
whitequark: I'd prefer to use openssl and have it do automatically/transparently what rails/I do manually
<apeiros>
but that seems to fail :-/
<apeiros>
I will retry with an updated openssl, though
<apeiros>
but when I see things like `encrypted_data = ActiveSupport::MessageEncryptor.new(ActiveSupport::KeyGenerator.new('password').generate_key(SecureRandom.random_bytes(64))).encrypt_and_sign('my secret data')`
<apeiros>
then I don't wonder why people mess up crypto
<apeiros>
I mean… srsly wtf?
<whitequark>
yes, it's a big problem
<whitequark>
why not use e.g. rbnacl? a dependency?
_ht has joined #ruby-lang
<apeiros>
yes. but still pondering.
ddv has quit [Changing host]
ddv has joined #ruby-lang
<apeiros>
openssl can be assumed to be "just there"
<apeiros>
then again, I'm not sure it can be assumed that an up-to-date version is there
<apeiros>
which doesn't make it any better
ssb123 has quit [Ping timeout: 276 seconds]
rahul_j has joined #ruby-lang
karamazov has joined #ruby-lang
ritek has quit [Quit: Connection closed for inactivity]
jsullivandigs has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
symm- has joined #ruby-lang
sdouglas has quit [Remote host closed the connection]
willmarshall has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qba73 has quit [Read error: Connection reset by peer]
rwk1 has joined #ruby-lang
saschaheld has quit [Ping timeout: 265 seconds]
saschaheld has joined #ruby-lang
saschaheld_ has quit [Ping timeout: 255 seconds]
xiaoguo has joined #ruby-lang
rwk1 has quit [Ping timeout: 240 seconds]
Kuda_ has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
elia has joined #ruby-lang
sarkyniin has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
saschaheld_ has joined #ruby-lang
hahuang65 has joined #ruby-lang
rahul_j has joined #ruby-lang
saschaheld has quit [Ping timeout: 240 seconds]
saschaheld_ is now known as saschaheld
twright has joined #ruby-lang
rwk1 has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
relix has joined #ruby-lang
relix has quit [Client Quit]
hahuang65 has quit [Ping timeout: 240 seconds]
Fushi has joined #ruby-lang
twright has quit [Ping timeout: 264 seconds]
yubrew has joined #ruby-lang
bin7me has quit [Quit: Leaving]
cnivolle has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
alex-quiterio has joined #ruby-lang
workmad3 has joined #ruby-lang
alex-quiterio1 has joined #ruby-lang
yubrew has quit [Ping timeout: 255 seconds]
nofxx has quit [Ping timeout: 255 seconds]
xiaoguo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alex-quiterio has quit [Ping timeout: 276 seconds]
sdouglas has joined #ruby-lang
workmad3 has quit [Ping timeout: 255 seconds]
touzine has joined #ruby-lang
cnivolle has quit [Remote host closed the connection]
workmad3 has joined #ruby-lang
cnivolle has joined #ruby-lang
relix has joined #ruby-lang
sdouglas has quit [Ping timeout: 252 seconds]
rwk1 has quit [Remote host closed the connection]
rwk1 has joined #ruby-lang
relix has quit [Client Quit]
kitak_ has quit [Ping timeout: 240 seconds]
qba73 has joined #ruby-lang
rwk1 has quit [Ping timeout: 252 seconds]
touzine has quit [Ping timeout: 240 seconds]
elia has joined #ruby-lang
elia has quit [Client Quit]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
relix has joined #ruby-lang
relix has quit [Client Quit]
benlovel1 has joined #ruby-lang
francisfish has joined #ruby-lang
benlovell has quit [Ping timeout: 252 seconds]
kitak has quit [Ping timeout: 240 seconds]
john____ has quit [Remote host closed the connection]
elia has joined #ruby-lang
marr has joined #ruby-lang
<yorickpeterse>
whitequark: ok I have a rant
<yorickpeterse>
why the fuck does rspec have let()
<yorickpeterse>
people abuse it too much then wonder why the heck their test suite takes 20 decades to complete
<yorickpeterse>
"OH THIS TEST SUITE IS SLOW, TOTALLY THE FAULT OF <insert framework>
<yorickpeterse>
though yes, Rails certainly doesn't make things faster
<yorickpeterse>
also Ruby should restrict people from creating locals with single letter names
<yorickpeterse>
"f"
<yorickpeterse>
what the fuck is "f"
ssb123 has joined #ruby-lang
<yorickpeterse>
I guess only scientists will get super wet when they see "f"
elia has quit [Quit: Computer has gone to sleep.]
toretore has joined #ruby-lang
<yorickpeterse>
saschaheld: what are you trying to use rubyinline for>
<yorickpeterse>
* ?
<saschaheld>
yorickpeterse: we are doing some heavy lat long distance calculations (using the haversine-formula) which are much faster using c than plain ruby
kitak has joined #ruby-lang
<yorickpeterse>
Is there a particular need for rubyinline opposed to regular C extensions?
ssb123 has quit [Read error: Operation timed out]
<yorickpeterse>
The latter are not that difficult to set up
<yorickpeterse>
I have no idea how well they work on *BSD though
<saschaheld>
actually we traced our problem down to a compiler mismatch between the actual ruby version and the generated shared libraries by rubyinline. This only happens when we install ruby 2.0.0 via rbenv. If we use the version from the freebsd ports (with is slighly older) than everthing works fine
ayonkhan has joined #ruby-lang
benlovel1 has quit [Quit: leaving]
benlovell has joined #ruby-lang
saschaheld_ has joined #ruby-lang
kitak has quit [Remote host closed the connection]
saschaheld has quit [Ping timeout: 252 seconds]
dsaint-pierre has joined #ruby-lang
saschaheld_ is now known as saschaheld
kitak has joined #ruby-lang
elia has joined #ruby-lang
rwk1 has joined #ruby-lang
ayonkhan has quit [Remote host closed the connection]
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
Arnvald has quit [Remote host closed the connection]
dsaint-pierre has quit [Ping timeout: 252 seconds]
jonathanmarvens has joined #ruby-lang
kitak has quit [Ping timeout: 240 seconds]
psycho_one has quit [Remote host closed the connection]
JoshuaPaling has quit [Read error: Connection reset by peer]
francisfish has quit [Remote host closed the connection]
jonathanmarvens has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby-lang
yubrew has joined #ruby-lang
allomov has joined #ruby-lang
MartynKeigher has joined #ruby-lang
saschaheld_ has joined #ruby-lang
rwk1 has quit [Ping timeout: 255 seconds]
yubrew has quit [Ping timeout: 252 seconds]
tomkadwill has joined #ruby-lang
saschaheld has quit [Ping timeout: 240 seconds]
saschaheld_ is now known as saschaheld
hahuang65 has quit [Ping timeout: 252 seconds]
tomkadwill has left #ruby-lang [#ruby-lang]
allomov has quit [Ping timeout: 276 seconds]
francisfish has joined #ruby-lang
saschaheld_ has joined #ruby-lang
skade has joined #ruby-lang
Kuda_ has quit [Quit: Byebye!]
saschaheld has quit [Ping timeout: 252 seconds]
saschaheld_ is now known as saschaheld
MartynKeigher has quit [Ping timeout: 245 seconds]
bin7me has joined #ruby-lang
francisfish has quit [Remote host closed the connection]
francisfish has joined #ruby-lang
rwk1 has joined #ruby-lang
retro|cz has quit [Ping timeout: 240 seconds]
skade has quit [Ping timeout: 276 seconds]
ironhide_604 has quit [Quit: ironhide_604]
MartynKeigher has joined #ruby-lang
skade has joined #ruby-lang
ssb123 has joined #ruby-lang
elia has quit [Quit: (IRC Client: textualapp.com)]
elia has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
bin7me has quit [Ping timeout: 255 seconds]
ssb123 has quit [Ping timeout: 265 seconds]
elia has quit [Client Quit]
banister_ has joined #ruby-lang
banister has quit [Ping timeout: 252 seconds]
rwk1 has quit [Remote host closed the connection]
rwk1 has joined #ruby-lang
machuga has joined #ruby-lang
dsaint-pierre has joined #ruby-lang
MartynKeigher has quit [Ping timeout: 265 seconds]
yubrew has joined #ruby-lang
dsaint-pierre has quit [Ping timeout: 255 seconds]
jonathanmarvens has joined #ruby-lang
canton7-mac has joined #ruby-lang
yubrew has quit [Ping timeout: 252 seconds]
jonathanmarvens has quit [Ping timeout: 276 seconds]
stamina has joined #ruby-lang
twright has joined #ruby-lang
benlovel1 has joined #ruby-lang
twright has quit [Ping timeout: 258 seconds]
benlovell has quit [Ping timeout: 264 seconds]
rwk1 has quit [Remote host closed the connection]
rwk1 has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
rwk1 has quit [Ping timeout: 240 seconds]
jonathanmarvens has joined #ruby-lang
saschaheld_ has joined #ruby-lang
saschaheld has quit [Ping timeout: 240 seconds]
saschaheld_ is now known as saschaheld
allomov has joined #ruby-lang
saschaheld_ has joined #ruby-lang
saschaheld has quit [Ping timeout: 276 seconds]
saschaheld_ is now known as saschaheld
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
bf4 has quit [Ping timeout: 252 seconds]
saschaheld_ has joined #ruby-lang
mikecmpbll has quit [Ping timeout: 252 seconds]
saschaheld has quit [Ping timeout: 264 seconds]
saschaheld_ is now known as saschaheld
bf4 has joined #ruby-lang
mikecmpbll has joined #ruby-lang
saschaheld has quit [Quit: saschaheld]
elia has joined #ruby-lang
ssb123 has joined #ruby-lang
Pupeno has joined #ruby-lang
yfeldblum has joined #ruby-lang
rahul_j_ has joined #ruby-lang
bin7me has joined #ruby-lang
ssb123 has quit [Ping timeout: 265 seconds]
symm- has quit [Ping timeout: 252 seconds]
rahul_j has quit [Ping timeout: 264 seconds]
rahul_j_ is now known as rahul_j
yann_ck has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
yubrew has joined #ruby-lang
Lewix has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
d4rkr4i has joined #ruby-lang
automationaddict has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
dsaint-pierre has joined #ruby-lang
Sirupsen has joined #ruby-lang
yubrew has quit [Ping timeout: 265 seconds]
benlovel1 has quit [Ping timeout: 255 seconds]
ironhide_604 has joined #ruby-lang
dsaint-pierre has quit [Ping timeout: 276 seconds]
jperry has quit [Remote host closed the connection]
<banister_>
yorickpeterse A.U.B
<banister_>
yorickpeterse did u have a merry king's day?
<yorickpeterse>
Yeah it was allright, celebrated it at a friend's place in Amsterdam
<banister_>
yorickpeterse liberation day is soon, is that also a big thing?
<yorickpeterse>
Not as big, it's also not an official holiday this year
<yorickpeterse>
(only once every 5 years I believe)
<surrounder>
banister_: depends on where in the country
Lewix has joined #ruby-lang
<surrounder>
here it's huge
retro|cz has joined #ruby-lang
<banister_>
surrounder where you from?
<surrounder>
small town called wageningen
Lewix has quit [Remote host closed the connection]
<yorickpeterse>
Ah, the peasant east of the country
<surrounder>
this is the place where the germans surrendered to the canadians though ending the war in this country
<surrounder>
yorickpeterse: indeed, thankfully
<yorickpeterse>
:>
<banister_>
yorickpeterse leiden has a crazy celebration (all to itself) that is about 2x the size of king's day
<banister_>
yorickpeterse something something about kicking out the spaniards
<ironhide_604>
liberation day for me is special as both my parents lived through the war (and my grandfather was executed)
<surrounder>
banister_: hah nice, didn't know that
<yorickpeterse>
banister_: Yeah there's some places where it is celebrated
<yorickpeterse>
But not similar to King's day where the entire country grinds to drunken halt
<yorickpeterse>
and everything turns orange
<banister_>
surrounder ya there's a huge parade through the streets, everybody gets the day off work (except for me, of course :/) and there's live bands down every little alleyway
<surrounder>
banister_: sounds like 5th of may here :)
<banister_>
singing godawful dutch folk music ;)
<surrounder>
ah, not that
<surrounder>
:P
jperry has joined #ruby-lang
mehlah has quit [Quit: Leaving...]
d4rkr4i has quit [Quit: Leaving.]
kitak has joined #ruby-lang
<whitequark>
yorickpeterse: is that you at the left on the rgsoc photo?
<yorickpeterse>
whitequark: ha no
<yorickpeterse>
I don't usually look that sad
<yorickpeterse>
not sure what's up with that either
<yorickpeterse>
either way, no
kitak has quit [Read error: Connection reset by peer]
<bougyman>
i don't think there's going to be a method to do that for you
<DefV>
so 1..20 would generate /^[1-2]?[0-9]$/
<Johndothr>
How come everyone looks at Ruby as an easy language
<bougyman>
making one would be... ugh.
<Johndothr>
To me it appears harde rthan php/html
<bougyman>
Johndothr: because it's easy to learn.
jsrn has quit [Ping timeout: 264 seconds]
<Johndothr>
It looks to me much complicated. And also, how can you try out the stuff you wrote in Ruby? I'm using Aptana.
<maloik>
DefV: I'm stating the obvious I'm sure, but the ipaddr lib doesn't have anything that can be of use?
<bougyman>
I don't know what Aptana is.
<DefV>
maloik: nope
<yorickpeterse>
Johndothr: write it to a file with ".rb" as the extension, then run said file using "ruby FILE_HERE.rb"
<Johndothr>
Alright, one more thing. What is the main purpose of Ruby? What does a Ruby developer create?
<bougyman>
or try it interactively in pry or irb
<bougyman>
Johndothr: solutions.
ironhide_604 has quit [Quit: ironhide_604]
ironhide_604 has joined #ruby-lang
<Johndothr>
What do you mean with solutions, give me some examples.
<yorickpeterse>
That's like asking what a programmer in general does
<yorickpeterse>
You'll have to be a bit more specific
<Johndothr>
Well, Java can be used for creating mobile apps, CSS is used in order to change the design of a website, etc.
<Johndothr>
Ruby is..?
<yorickpeterse>
A general purpose programming language, you can use it for web apps, desktop apps, mobile apps to some degree, quick shell scripts, etc
ritek has joined #ruby-lang
<Johndothr>
alright, thanks
ritek has quit [Changing host]
ritek has joined #ruby-lang
ritek has joined #ruby-lang
ritek has quit [Changing host]
karamazov has joined #ruby-lang
sferik has joined #ruby-lang
<ljarvis>
dammit someone pinged me and the message is too far away
iTrojan has joined #ruby-lang
elia has joined #ruby-lang
jgpawletko has joined #ruby-lang
dsaint-pierre has joined #ruby-lang
automationaddict has quit [Ping timeout: 240 seconds]
qba73_ has joined #ruby-lang
diegoviola has joined #ruby-lang
qba73 has quit [Ping timeout: 240 seconds]
banister_ is now known as banisterfiend
dsaint-pierre has quit [Remote host closed the connection]
<yorickpeterse>
YAY IMAGEMAGICK
<yorickpeterse>
Update ImageMagick? Bro, enjoy recompiling those C-exts
john___ has joined #ruby-lang
<yorickpeterse>
ABI? wot ABI?
dsaint-pierre has joined #ruby-lang
<surrounder>
lol
davidstump has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
enebo has joined #ruby-lang
danijoo has joined #ruby-lang
iTrojan has quit [Quit: Leaving.]
cored has joined #ruby-lang
cored has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
ta has quit [Remote host closed the connection]
ta has joined #ruby-lang
momomomomo has joined #ruby-lang
alexju has joined #ruby-lang
yubrew has joined #ruby-lang
|jemc| has joined #ruby-lang
ta has quit [Ping timeout: 240 seconds]
ssb123 has joined #ruby-lang
tbuehlmann has quit [Ping timeout: 252 seconds]
iTrojan has joined #ruby-lang
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yubrew has quit [Ping timeout: 252 seconds]
beef-wellington has joined #ruby-lang
ssb123 has quit [Ping timeout: 252 seconds]
Kuda_ has joined #ruby-lang
sferik has joined #ruby-lang
beef-wellington has quit [Ping timeout: 276 seconds]
ryez has quit [Quit: Page closed]
AncientAmateur has joined #ruby-lang
ta has joined #ruby-lang
jds has quit [Quit: Connection closed for inactivity]
tbuehlmann has joined #ruby-lang
skade has quit [Ping timeout: 252 seconds]
thmzlt has joined #ruby-lang
beef-wellington has joined #ruby-lang
psycho_one has joined #ruby-lang
diegoviola has quit [Read error: Connection reset by peer]
iTrojan has quit [Quit: Leaving.]
jcs222 has quit [Quit: leaving]
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta has quit [Ping timeout: 240 seconds]
skade has joined #ruby-lang
nisstyre has quit [Quit: WeeChat 0.4.3]
Kuda_ has quit [Quit: Byebye!]
psycho_one has quit [Ping timeout: 265 seconds]
hahuang65 has joined #ruby-lang
sferik has joined #ruby-lang
Johndothr has quit [Ping timeout: 276 seconds]
loincloth has joined #ruby-lang
hahuang65 has quit [Ping timeout: 264 seconds]
SilkFox has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 252 seconds]
ta has joined #ruby-lang
cored has quit [Ping timeout: 264 seconds]
beef-wellington has quit [Ping timeout: 252 seconds]
karamazov has quit []
ecnalyr has joined #ruby-lang
nathanstitt has joined #ruby-lang
shinnya has quit [Ping timeout: 240 seconds]
herpless has quit [Quit: Connection closed for inactivity]
yubrew has joined #ruby-lang
developerjustin has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
|jemc| has quit [Quit: WeeChat 0.4.1]
ta has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby-lang
skade has quit [Quit: WeeChat 0.4.3]
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vpretzel is now known as vpretzel|998
tharindu has joined #ruby-lang
developerjustin has left #ruby-lang ["Leaving..."]
sdouglas has joined #ruby-lang
sferik has joined #ruby-lang
ssb123 has joined #ruby-lang
ssb123 has quit [Remote host closed the connection]
ssb123 has joined #ruby-lang
root_____ has joined #ruby-lang
<root_____>
buenas
root_____ has left #ruby-lang ["WeeChat 0.4.3"]
cable has joined #ruby-lang
enkristoffer has joined #ruby-lang
ta has joined #ruby-lang
yfeldblum has joined #ruby-lang
wallerdev has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
psycho_one has joined #ruby-lang
cable has quit [Ping timeout: 276 seconds]
simono has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
elia has joined #ruby-lang
rwk1 has joined #ruby-lang
yfeldblum has quit [Ping timeout: 265 seconds]
achal has quit [Quit: Connection closed for inactivity]
michaeldeol has joined #ruby-lang
michaeldeol has quit [Client Quit]
rwk1 has quit [Ping timeout: 255 seconds]
ta has quit [Ping timeout: 265 seconds]
ecnalyr has quit [Ping timeout: 246 seconds]
[spoiler] has quit [Quit: Leaving]
mistym has joined #ruby-lang
jsullivandigs has joined #ruby-lang
|jemc| has joined #ruby-lang
iTrojan has joined #ruby-lang
iTrojan has quit [Max SendQ exceeded]
sdouglas has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
ta has joined #ruby-lang
iTrojan has joined #ruby-lang
ta has quit [Remote host closed the connection]
d4rkr4i has joined #ruby-lang
ta has joined #ruby-lang
ta has quit [Read error: Connection reset by peer]
sdouglas_ has joined #ruby-lang
maoko has joined #ruby-lang
rubybytes has joined #ruby-lang
<rubybytes>
Hey guys, I understand that ASCII-8BIT is a kinda fake encoding for ruby, but I need to be able to Base58 encode some binary data (RSA signatures and other things). Performance is not a concern. My first attempt was to use pack and unpack (to binary, then to int, then to Base58), but it seems that with ASCII-8BIT this doesn't reliably convert back and forth. What should I do?
dik_dak has joined #ruby-lang
ssb123 has quit [Remote host closed the connection]
yann_ck has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<lianj>
rubybytes: example?
kitak has quit [Remote host closed the connection]
<apeiros>
rubybytes: ascii-8bit is not a fake encoding. it's binary.
<apeiros>
it's just a bad name for binary.
cable has joined #ruby-lang
<apeiros>
base58 or base85? (never seen the former, hence I ask)
<apeiros>
and I've just checked Array#pack, I don't see anything for base58 there either…
<rubybytes>
so with that binary file, if I set it as a string then do string.unpack('b*').pack('b*')
<rubybytes>
I get something different
<rubybytes>
I assume that this is because pack assumes a character encoding
jonathanmarvens has quit [Remote host closed the connection]
<apeiros>
"You need permission"
<rubybytes>
oh shit, sorry apeiros, stupid google
<rubybytes>
I made it public
<yorickpeterse>
rubybytes: FYI you can use gist.github.com for easier sharing of code snippets
<rubybytes>
ahh, thanks yorickpeterse
<apeiros>
rubybytes: how do you read it?
<rubybytes>
one sec making gist
<apeiros>
a = File.read('foo', encoding: 'binary'); b = a.unpack('b*').pack('b*'); b == a => true
<apeiros>
no issues here
psycho_o_ has joined #ruby-lang
pskosinski has joined #ruby-lang
<lianj>
pack always returns binary encoding
<lianj>
rubybytes: just take the link a pasted and be done.
psycho_one has quit [Ping timeout: 255 seconds]
<apeiros>
I've got to go, but rubybytes, you probably have a.encoding not as binary
<apeiros>
so a.unpack("b*").pack("b*") != a because a.unpack("b*").pack("b*").encoding != a.encoding
<apeiros>
if you handle binary data, read it as binary data (`encoding: 'binary'` in my code)
* apeiros
off, commute
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has quit [Remote host closed the connection]
* yorickpeterse
is deploying stuff to MRI 2.1.1
<yorickpeterse>
babby steps
mistym has joined #ruby-lang
<rubybytes>
dammit, I had the asterixes on the wrong side of the b in pack
<rubybytes>
thanks guys
apeiros has joined #ruby-lang
malconis_ has joined #ruby-lang
francisfish has quit [Remote host closed the connection]
iTrojan has quit [Ping timeout: 264 seconds]
<lianj>
rubybytes: why b at all? sounds not needed
malconis has quit [Ping timeout: 252 seconds]
sferik has joined #ruby-lang
SilkFox has quit [Ping timeout: 252 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
apeiros has quit [Ping timeout: 276 seconds]
sdouglas_ has quit [Remote host closed the connection]
sdouglas has joined #ruby-lang
twright has joined #ruby-lang
jonathanmarvens has joined #ruby-lang
<yorickpeterse>
"Skipped json-1.8.1, it is a default gem" what the fuck Rubygems
<yorickpeterse>
do as I tell you
<yorickpeterse>
grrr
sdouglas has quit [Read error: Connection reset by peer]
mykoweb has joined #ruby-lang
sdouglas has joined #ruby-lang
rwk1 has joined #ruby-lang
<yorickpeterse>
"gem "json" cannot be uninstalled because it is a default gem" what the fuck is this
albertgrala has joined #ruby-lang
bin7me has quit [Quit: Leaving]
<yorickpeterse>
oh great, this also totally fucks up my packaging process
rippa has joined #ruby-lang
djbkd has joined #ruby-lang
simono has joined #ruby-lang
rwk1 has quit [Ping timeout: 276 seconds]
psycho_o_ has quit [Remote host closed the connection]
toastynerd has joined #ruby-lang
RobertBirnie has joined #ruby-lang
nertzy2 has quit [Quit: This computer has gone to sleep]
saarinen has joined #ruby-lang
ssb123 has joined #ruby-lang
ratmav has joined #ruby-lang
dwknoxy has joined #ruby-lang
michaeldeol has joined #ruby-lang
jcs222 has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
d4rkr4i has quit [Quit: Leaving.]
rubybytes has quit [Ping timeout: 252 seconds]
qba73_ has quit []
rwk1 has joined #ruby-lang
ecnalyr has joined #ruby-lang
Lewix has joined #ruby-lang
dsaint-pierre is now known as dsp___
Sirupsen has joined #ruby-lang
rubybytes has joined #ruby-lang
apeiros has joined #ruby-lang
dstynchula has joined #ruby-lang
SilkFox has joined #ruby-lang
rwk1 has quit [Ping timeout: 240 seconds]
saarinen has quit [Quit: saarinen]
havenwood has joined #ruby-lang
ecnalyr has quit [Remote host closed the connection]
ecnalyr has joined #ruby-lang
mishoch has joined #ruby-lang
john___ has quit [Remote host closed the connection]
ecnalyr has quit [Ping timeout: 246 seconds]
kitak has joined #ruby-lang
x0f_ has joined #ruby-lang
<mishoch>
Hi people, using Ruby 2.1.0's openssl library when I upload a file using net/https generates [Errno::ECONNRESET: Connection reset by peer from /home/deployer/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/openssl/buffering.rb:326:in `syswrite'] and so on. This does not happen on Ruby 1.9.3 - I run the same code. Does anyone have a clue?
<centrx>
The so on is important
<elia>
mishoch, no clue, but try linking the stacktrace pasted in a gist
mykoweb has quit [Remote host closed the connection]
mykoweb has joined #ruby-lang
x0f has quit [Ping timeout: 252 seconds]
SilkFox has quit [Ping timeout: 252 seconds]
mykoweb has quit [Ping timeout: 255 seconds]
cout is now known as Teck1a
AncientAmateur has quit [Remote host closed the connection]
<yorickpeterse>
apeiros: please, no panties throwing
mykoweb has quit [Ping timeout: 240 seconds]
MartynKeigher has joined #ruby-lang
<apeiros>
yorickpeterse: you think I wear panties? how cute :o)
<yorickpeterse>
wait, you mean I'm the only one?
<yorickpeterse>
fuc
<yorickpeterse>
* fuck
<apeiros>
wtf, it's already 20.50? when did that happen? :-S
<apeiros>
at least, tomorrow is friday
ikrima has quit [Ping timeout: 264 seconds]
Coincidental has quit [Remote host closed the connection]
solars has quit [Ping timeout: 255 seconds]
rwk1 has quit [Ping timeout: 276 seconds]
WishBoy has joined #ruby-lang
<wallerdev>
wtf timezone do you live in where tomorrow is friday haha
momomomomo has quit [Quit: momomomomo]
<yorickpeterse>
GMT +72
<yorickpeterse>
with or without DST?
<apeiros>
wallerdev: in the timezone where I have 2 days off, turning wednesday into friday :D
<wallerdev>
haha lucky you :p
<apeiros>
I have to get rid of those ~40 holidays someday ;-)
<wallerdev>
that's a lot
<wallerdev>
don't people in europe get like a month of vacation every year or something crazy
<apeiros>
I started the year with ~60
pixelhandler has joined #ruby-lang
<apeiros>
it kind of piled up last year ^^
<apeiros>
I regularly get 27 days per year
<wallerdev>
that's pretty cool
<apeiros>
yeah, I like it
<wallerdev>
i heard that used as a downside for things like startups in europe
<wallerdev>
have to give a lot of vacation time to people, and it's hard to fire people or something
<apeiros>
meh, I think the crazy "you must work 200h/week in a startup!!!" is bullshit
<apeiros>
you don't get more work done
<wallerdev>
agreed haha
<apeiros>
heck, I wouldn't wonder if working *less* was more efficient for tech-work
<eam>
most successful startups aren't like that
<apeiros>
after all, the currently established work week times have mostly been established based on research of factory work
<apeiros>
which is quite a different kind of challenge
<wallerdev>
i did some 60 hour work weeks at my previous job
<apeiros>
problem is - factory work output can easily be measured. programming? difficult.
<wallerdev>
which is part of the reason it's a previous job haha
<apeiros>
heh, good riddance :)
<eam>
programming can be fairly easily measured at the product level, the problem is in correlating back to the individual
<yorickpeterse>
wallerdev: yeah a month or so is common
<apeiros>
eam: unless you produce the same product all the time, it's difficult to make a comparative study
<wallerdev>
only way to measure programming is bugs/hour
<yorickpeterse>
neg
<yorickpeterse>
That way you don't measure anything if you're adding features
<yorickpeterse>
LOC/minute is the real deal
<yorickpeterse>
(either additions or removals)
<apeiros>
WTFs/minute of a peer reading the code
Lewix has quit [Remote host closed the connection]
<apeiros>
more is better, obviously
SilkFox has quit [Ping timeout: 255 seconds]
solars has joined #ruby-lang
<eam>
apeiros: one of my favorites is to swag loe by group consensus, then let people pick tasks and measure against the projected duration
<apeiros>
"swag loe"?
<eam>
simple wild ass guess, level of effort
rofel has joined #ruby-lang
<apeiros>
ah, lol, never heard that expression :)
SilkFox has joined #ruby-lang
<eam>
eg "feature x should take 5 hours" (other votes 3, 8, 16)
<wallerdev>
the best feeling is when you commit a new feature and git shows more removed lines than additions
<eam>
and then you let everyone pick from a pool
<eam>
the ones that are last to be chosen probably have bad estimates
<apeiros>
interesting approach
<yorickpeterse>
I suppose a good measurement of productivity for me is the amount of frustration
alexju has quit [Remote host closed the connection]
<yorickpeterse>
or the amount of swear words per minute
<eam>
just a small tweak on normal sprint planning really
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
toastynerd has quit [Remote host closed the connection]
<apeiros>
I'm usually rather silent if I enjoy my task
<apeiros>
oh, and "enjoy task" == "wildly productive"
<yorickpeterse>
it depends a bit on the project, sometimes I'm super frustrated even though I'm coding happily along (usually because of what was there before me)
<yorickpeterse>
But there are also plenty of days where I hum along with my music
centrx has joined #ruby-lang
ledestin has quit [Ping timeout: 265 seconds]
ratmav has quit [Quit: Leaving]
iTrojan has joined #ruby-lang
_djbkd has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vpretzel is now known as vpretzel|1211
jsullivandigs has quit [Remote host closed the connection]
<wallerdev>
yorickpeterse: i probably wouldnt reference people.last but otherwise looks fine to me
iTrojan has quit [Quit: Leaving.]
<wallerdev>
seemes like there should be a better way to parse it together as one thing
jsullivandigs has joined #ruby-lang
Fushi has quit [Quit: Connection closed for inactivity]
<yorickpeterse>
This is a pull parser, so once you are at a text node you don't have access to the surrounding element anymore
<yorickpeterse>
I'm mostly looking at the use of `parser.on(....)`
<yorickpeterse>
what the actual body of those blocks does is just an example
<yorickpeterse>
Point being, traditionally pull parsers have APIs straight from Satan's backside
mistym_ has joined #ruby-lang
<yorickpeterse>
I'm trying to make a "context" based API where you can dispatch code based on w/e the parser is in atm
Squarepy has quit [Quit: Leaving]
<yorickpeterse>
without manually having to add a bunch of if statements
<yorickpeterse>
(don't get me started on SAX)
digs has joined #ruby-lang
digs is now known as Guest29656
<apeiros>
what's the difference between sax and pull?
jsullivandigs has quit [Ping timeout: 264 seconds]
<yorickpeterse>
so in pull parsing you pull in one XML node at a time
<yorickpeterse>
in SAX you basically get the raw data (e.g. just the name and attributes)
<bougyman>
sax has access to the whole stream it has parsed up til then
<yorickpeterse>
bougyman: not strictly
<apeiros>
yorickpeterse: whole node?
<apeiros>
yorickpeterse: so it must have reached the end tag before yielding?
<yorickpeterse>
right, so there are 3 ways of parsing things:
<yorickpeterse>
1. DOM: builds a massive tree at once
<yorickpeterse>
2. Pull parsing: parses incrementally and gives back one XML node at a time (e.g. using a Ruby yield or something like that)
<yorickpeterse>
3. SAX: basically you define a bunch of callbacks and they get just, for example, the element name and attributes (opposed to a proper object)
<yorickpeterse>
In case of Nokogiri the SAX API is completely retarded
<yorickpeterse>
and the pull parsing API only works with XML
fijimunkii has joined #ruby-lang
<yorickpeterse>
code wise that looks a bit like ...
<bougyman>
for speed I always used the sax parser of libxml/libxml2
<yorickpeterse>
pull parsing doesn't keep a tree around
<yorickpeterse>
it basically emits events at the start of elements
rwk1 has joined #ruby-lang
<yorickpeterse>
so at most it only keeps around the name and attributes
<yorickpeterse>
(of the current element)
MindfulMonk has quit [Ping timeout: 252 seconds]
<yorickpeterse>
it's basically like node-js callbacks :P
* yorickpeterse
runs
cnivolle has joined #ruby-lang
<apeiros>
ok, odd, that's how I understood sax to work
djbkd has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
* apeiros
doesn't get the difference anymore then :-(
jonathanmarvens has joined #ruby-lang
<yorickpeterse>
No, so neither SAX and pull parsing keep around anything
<yorickpeterse>
they only know about what they are currently at, not what comes or what came before
elia has joined #ruby-lang
<yorickpeterse>
so for example, say you have a nesting of foo -> bar -> baz
<yorickpeterse>
in case of a pull parser you'd have 3 events emitted: foo, bar and baz
<yorickpeterse>
in all those cases whatever callback is registered only has access to info about the current node (e.g. bar)
<yorickpeterse>
SAX is the same, except a bit more low level usage wise and, potentially,
<yorickpeterse>
* more memory efficient
solars has quit [Ping timeout: 255 seconds]
MindfulMonk has joined #ruby-lang
_ht has quit [Remote host closed the connection]
nanno77__ has joined #ruby-lang
djbkd has quit [Ping timeout: 240 seconds]
dstynchula has joined #ruby-lang
<dvorak>
with pull parsing, the parser keeps track of the context for you, and tells you when it calls you back where you are in the tree
<dvorak>
with a sax parser you just get a stream of tags and you have to keep track of where you are on your own
ironhide_604 has joined #ruby-lang
<apeiros>
dvorak: ah
<apeiros>
so pull parser could tell you that your baz node which was emitted is embedded in foo -> bar
iTrojan has joined #ruby-lang
<dvorak>
yeah, typically
iTrojan has quit [Max SendQ exceeded]
iTrojan has joined #ruby-lang
<apeiros>
ok. what's the big selling point of pull over sax? because keeping track of context is IMO trivial
dstynchu_ has quit [Ping timeout: 276 seconds]
vpretzel|1211 is now known as vpretzel
Lewix has joined #ruby-lang
thmzlt has quit [Remote host closed the connection]
rwk1 has quit [Ping timeout: 252 seconds]
thmzlt has joined #ruby-lang
solars has joined #ruby-lang
djbkd has joined #ruby-lang
<yorickpeterse>
No it's not trivial at all actually
<yorickpeterse>
at least not on SAX level
<yorickpeterse>
it's a fucking pain unless the SAX API emits events both on and after a node
fijimunkii has quit [Quit: Lost terminal]
<apeiros>
yorickpeterse: oh, I only have known that kind then
<yorickpeterse>
SAX parsers are a spawn of Satan when it comes to usability
simono has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
i have kind of troubles imagining a sax parser without emitting tag-end events
<apeiros>
I mean… that'd limit it to a tiny subset of use-cases
iTrojan has quit [Quit: Leaving.]
<apeiros>
what I have seen is different handling of <foo/> self closing tags
loincloth has quit [Remote host closed the connection]
<apeiros>
some create start-tag and end-tag event, others only start-tag. the latter are IMO broken, unless they somehow pass the information that it's self-closed.
loincloth has joined #ruby-lang
<Lewix>
/join #scala
toastynerd has joined #ruby-lang
<yorickpeterse>
apeiros: welcome to Nokogiri's SAX API
<yorickpeterse>
it only has a "start_element" callback if I'm not mistaken
<yorickpeterse>
oh hm, it also has end_element actually