Cheezebox has quit [Remote host closed the connection]
mdarby has joined #ruby
<tmoore>
I think the honest answer is "because it runs in web browsers"
mdarby has quit [Max SendQ exceeded]
<jenrzzz>
tmoore: it runs pretty much anywhere! it's the lingua franca of the 2010s
<tmoore>
maybe, but I think that's an effect, not a cause
<jenrzzz>
yeah, of course
<omosoj>
tmoore, yeah that seems like a big reason, but i've also heard that "anything that can be coded in js will be", so it seems to extend beyond browsers
jdj_dk has quit [Ping timeout: 244 seconds]
<tmoore>
lots of languages/runtimes can run in different places, but JS is the only one that can run in most web browsers
ghormoon has joined #ruby
mdarby has joined #ruby
<tmoore>
so, since it is a given that people will need to know JS, some people think it's better to use the same language everywhere, warts and all
icarus_ has quit [Ping timeout: 265 seconds]
<omosoj>
i see
<zenspider>
horseshit. beyond browsers (and servers) js has NOT taken over in the slightest
mdarby has quit [Max SendQ exceeded]
snath has joined #ruby
_whitelogger has joined #ruby
<jenrzzz>
Davey: no. there isn't an equivalent construct in any other language than PHP
<Davey>
jenrzzz: thanks
mikecmpbll has quit [Quit: i've nodded off.]
<jenrzzz>
(AFAIK)
<JDHankle>
Rack handles POST, I believe.
rshetty has joined #ruby
<zenspider>
I don't think github is a good indicator of much
drPoggs has joined #ruby
<zenspider>
knowing that bootstrap has 28k forks means what exactly?
ptrrr has joined #ruby
<omosoj>
zenspider, what do you think is the reason for js's supposed fame? just that it will run on client browsers?
<jenrzzz>
zenspider: it doesn't mean anything, really. but do you have any data that indicates a different trend?
goodenough has quit [Remote host closed the connection]
beef-wellington has joined #ruby
chipotle has joined #ruby
<JDHankle>
JS isn't as popular as Github would make it seem. Most JS stuff is open source because well, you can't compile JS and it ends up in a browser where anyone can read it anyway.
Peleus has joined #ruby
<JDHankle>
Not to say there isn't closed source JS.
<jenrzzz>
Davey, JDHankle: it's a bit different in Rack. classic PHP without FPM runs a new interpreter for each request and the web server will set variables like $_POST with the request parameters
mattstratton has joined #ruby
<JDHankle>
jenrzzz: right, you have to implement some sort of server interface before you can handle POST in ruby.
gr33n7007h has quit [Ping timeout: 265 seconds]
gr33n7007h has joined #ruby
northfurr has joined #ruby
rshetty has quit [Read error: No route to host]
<JDHankle>
Which is what I was getting at.
rshetty has joined #ruby
<Peleus>
Hey all, trying to use rvm. In one directory I'm showing ruby version as 1.9.3p547, in another directory it's showing 1.9.3p550. I want to use p550 everywhere but when I say rvm --default use 1.9.3p550 it's coming up with ruby 1.9.3p550 isn't installed. Ideas?
ghostmoth has quit [Quit: ghostmoth]
<jenrzzz>
rvm implode
<jenrzzz>
brew install rbenv
<jenrzzz>
brew install ruby-install
<northfurr>
how can i use the value of an array as the index of another array? I was trying array1[array2[0]] for example…
<JDHankle>
Peleus: you have a .ruby-version file in those dirs
<Peleus>
JDHankle, cheers
<jenrzzz>
northfurr: what's not working?
<Davey>
am I wrong that the bcrypt gem doesn't support the new $2y$ version of the algorithm ?
<zenspider>
jenrzzz: you ask me for counter data? you stated "I *IMAGINE* there are a greater number of programmers that know JS than any other language". Do _you_ have any data?
ghormoon has quit [Ping timeout: 256 seconds]
<jenrzzz>
zenspider: yeah, i just cited the github data and my personal experience
<JDHankle>
jenrzzz: that brew install rbenv made me lol
<zenspider>
jenrzzz: JDHankle stated it well. open source isn't indicative of much.
<zenspider>
northfurr: that indexes array1 at the index indicated in the first entry of array2
<zenspider>
if array2[0] was 42, it'd return with array1[42]
<zenspider>
what are you trying to do?
<northfurr>
that’s what I thought it should be doing but it’s acting weird Oo
<zenspider>
well... what is it doing?
balazs has quit [Ping timeout: 258 seconds]
jottr has quit [Ping timeout: 255 seconds]
<zenspider>
the plural of anecdote is not data
mikepack has quit [Remote host closed the connection]
<northfurr>
zenspider: Okay so the first array is, stocks = [17,3,6,9,15,1,10] and the second is [1,4]
<zenspider>
I'd expect 3 given your code above
<northfurr>
zenspider: when I call puts prices[best_prices[0]] it gives me 6
rshetty has quit [Ping timeout: 265 seconds]
<northfurr>
errr… prices = stocks
<northfurr>
best_prices is [1,4]
ghormoon has joined #ruby
<zenspider>
I don't think you have the data you think you do
<jenrzzz>
i'm not trying to prove this obviously unprovable claim
<jenrzzz>
do you think there is another language that more developers know? maybe Java or C?
<zenspider>
everyone has at least one shell command processor on their computer. doesn't make shell scripting the most popular language either.
ghormoon has quit [Ping timeout: 255 seconds]
<JDHankle>
Everyone on Unix has a BASH interpreter. How many OSX users know that? The data on github is no more creditable to the popularity of something than google trends
_maes_ has quit [Ping timeout: 272 seconds]
<northfurr>
why does sell_prices.shift cause me to lose the first value in prices as well?
<zenspider>
northfurr: `ri Array.shift`
<zenspider>
because that's what it does
<northfurr>
i know
<northfurr>
but if i store sell_prices = prices then call sell_prices.shift I figured it wouldn’t effect the original argument
pietr0 has quit [Quit: pietr0]
<northfurr>
:(
finisherr has quit [Quit: finisherr]
<JDHankle>
It's like saying "Windows is less popular than OSX because everyone on Google is searching more for OSX" is it? Or is everyone on Windows using Bing?
<tmoore>
northfurr: saying sell_prices = prices doesn't copy the array, it just gives it two names
<tmoore>
try sell_prices = prices.dup if you want a separate copy
<wallerdev>
lol
<wallerdev>
just bing it
<zenspider>
JDHankle: that's kinda my point. jenrzzz suffers from confirmation bias and isn't owning up to it.
<zenspider>
conflating "developers" with "web developers" is not helping matters at all
<zenspider>
wallerdev: hah! then you can have some porn with your code!
<pipework>
My preferences are the popular ones, I know because I live in an echo chamber.
<jenrzzz>
i'm not arguing it's popularity though. i'm just saying JS has a unique position in programming language market/mindshare due to the fact that it runs in browsers and many web devs who use other languages also need to know javascript to build shit
jasooon has quit [Ping timeout: 245 seconds]
<jenrzzz>
but you're right zenspider, i should have been clearer about that
jottr has joined #ruby
<wallerdev>
i feel like js is the next big thing right now for what its worth
<jenrzzz>
also, all humans suffer from confirmation bias :)
<northfurr>
Ah i didn’t know that
<wallerdev>
not sure how long thatll last though
<northfurr>
thanks tmoore and zenspider
<northfurr>
:)
<pipework>
I feel like JS isn't a big thing, really.
ghormoon has joined #ruby
<wallerdev>
it seems pretty big here, but i live in the bubble of SF lol
charliesome has quit [Quit: zzz]
<zenspider>
jenrzzz: a unique position in **WEB** programming language market share
<JDHankle>
jenrzzz: I'm actually popping into this argument a bit late. It's really that you used Github that put a bad taste in my mouth. People seem to think Github is this amazing source of programming trends and it's not.
<pipework>
It's surely popular, I'll admit to that, but being a big thing and just having a lot of fuss about it might not be the same.
<JDHankle>
I'll tell you the trend in my area is not JS or even Ruby for that matter.
<jenrzzz>
zenspider: what makes a *web* programming language?
<wallerdev>
well i do JS full time so the more hyped JS gets the better
<wallerdev>
:p
<zenspider>
jenrzzz: jesus christ. quite being obtuse.
<pipework>
jenrzzz: It being used by webmasters.
<zenspider>
consider the bozo bit flipped. I'm done.
<pipework>
wallerdev: JS was my first programming language. Good stuff, but I don't like a lot of the rubbish out there now.
<wallerdev>
JS was my first language too!
<jenrzzz>
any language can be a web programming language if you build a webapp with it
<pipework>
Unless it doesn't have networking.
<wallerdev>
back in middle school i was amazed that i could make the numbers 1-1000 appear on a webpage by typing like 3 lines of code
<pipework>
Then it's not a web programming langauge.
<wallerdev>
thats what got me into programming
<jenrzzz>
and on the flip side, people build non-webapps with JS. so i don't think that's a particularly useful distinction
moritzs has quit [Remote host closed the connection]
<omosoj>
JDHankle, what is the trend in your area?
<omosoj>
JDHankle, i'm in philly. seems like there's a lot of php here too
<jenrzzz>
zenspider: i'm interested in finding the truth. i can only speak from what I know, though
nateberkopec has quit [Quit: Leaving...]
mostlybadfly has joined #ruby
<tmoore>
there's a big gap between what gets the most use and what gets the most hype/buzz/press/blog posts
tlarevo has quit [Remote host closed the connection]
<JDHankle>
omosoj: yeah I'm having a hard time finding any data that has pointed me to say anything other than PHP is the big kid in town, but I can't speak for everywhere.
<pipework>
Yeah, I mean people make a big deal out of meteor.
<tmoore>
but when I say that, it's not to discount the latter, because it's often a leading indicator of what will be popular in use a few years down the line
<wallerdev>
when i lived in michigan .NET / java were the big ones for web dev
<tmoore>
so, yeah, sure PHP is popular and will surely remain so, but it's not leading any trends IMO
<wallerdev>
lots of insurance companies too
<omosoj>
.NET/java are big in philly too. heh
tlarevo has joined #ruby
<JDHankle>
Of course there is a scoping issue there as well. In my area enterprise is not a big thing.
robustus has quit [Ping timeout: 250 seconds]
lw has joined #ruby
<JDHankle>
Most firms do websites for small businesses or simple web applications. Very few are tailoring to the .NET and Java enterprise infrastructures.
<JDHankle>
Again, in my area.
jonr22 has joined #ruby
<JDHankle>
you can go 4 hours south of here and get a _completely_ different story.
<omosoj>
lots of job postings around here are actually for rails devs who can convert a php dev to rails.
<JDHankle>
good ol NYC
robustus has joined #ruby
<pipework>
omosoj: Rewrite!
tokik has joined #ruby
<wallerdev>
rewrites are fun
TinkerTyper has joined #ruby
<omosoj>
yeah, seems like they do it piece by piece. seems like a stressful project
<wallerdev>
til you have to release them
<JDHankle>
Now that I think about it, the number of users in a channel on IRC is probably a better statistic than Github's lol.
<jenrzzz>
hahaha
<jenrzzz>
it doesn't really matter. i think these things only become clear in hindsight anyways
tkuchiki has joined #ruby
<JDHankle>
It's just too much of a black area to really put into a number.
gr33n7007h has quit [Changing host]
gr33n7007h has joined #ruby
<JDHankle>
I can tell you one thing though, JS is more popular than POWER ASM.
jonr22 has quit [Ping timeout: 255 seconds]
<JDHankle>
lol
Spami has quit [Quit: This computer has gone to sleep]
<jenrzzz>
should CS programs still be teaching intro classes in java?
<benzrf>
nu
mdarby has joined #ruby
<omosoj>
jenrzzz, what is their reason for doing that?
<mdarby>
wasamasa: No doubt! chat.freenode is freaking out
<jenrzzz>
they've been doing it that way since circa-2000 :P
<omosoj>
i've heard criticisms of it but never heard the justification
<wallerdev>
my intro to CS course from my school switched to python after i graduated
<mdarby>
JS is a shined turd.
axl_ has joined #ruby
mdarby has quit [Max SendQ exceeded]
<JDHankle>
I saw one professor has moved to Python in his CS course.
<wallerdev>
but that class was taken by lots of people, not just CS majors
<JDHankle>
Which isn't a bad idea.
<omosoj>
rofl mdarby
mdarby has joined #ruby
thagomizer has quit [Quit: Leaving.]
Channel6 has joined #ruby
<jenrzzz>
pedagogically, it's a OO language with simple and verbose syntax, which I guess is a reasonable way to introduce basic programming constructs?
Timgauthier has joined #ruby
<wallerdev>
i think java or c# are great for learning things like inheritance, interfaces, OO in general
<mdarby>
I teach it with Ruby.
<omosoj>
i see
rpag has joined #ruby
<wallerdev>
ruby seems too flexible for learning the basics
mdarby has quit [Max SendQ exceeded]
<rpag>
basics of?
<JDHankle>
I think Java teaches you a lot about CS. Something that JavaScript any ruby don't really do.
<jenrzzz>
i think MIT used to do Scheme in it's intro course but switch to python a couple years ago
<wallerdev>
programming concepts
sparr_ has quit [Changing host]
sparr_ has joined #ruby
skolman has quit [Remote host closed the connection]
hephaestus_rg has quit [Ping timeout: 245 seconds]
mdarby has joined #ruby
sparr_ is now known as sparr
<rpag>
imo ruby makes you hate other languages especially the older ones
<zenspider>
SICP was amazing
<jenrzzz>
oh, was that the textbook they usewd?
<jenrzzz>
used*
<omosoj>
yeah
<JDHankle>
Ruby will teach you about Objects and stuff sure, but you're there to learn about memory and WHY things like ruby work.
Wolland_ has joined #ruby
mdarby has quit [Max SendQ exceeded]
<JDHankle>
That's what is important. WHY things in CS work.
<JDHankle>
not teaching you how to program
fabrice31 has joined #ruby
TPBallbag has joined #ruby
<JDHankle>
Programming is just the application of your understanding of a computer.
mdarby has joined #ruby
<JDHankle>
Any dope can program, I mean, I can do it.
<zenspider>
CS? A computer has nothing to do with it.
<JDHankle>
and I'm a moron.
mdarby has quit [Max SendQ exceeded]
reinaldob has quit [Remote host closed the connection]
<rpag>
my mum can't program or even use a computer
<JDHankle>
bet she can make a mean apple pie though
<rpag>
haha
<JDHankle>
lol
<rpag>
yeah :)
mdarby has joined #ruby
axl_ has quit [Ping timeout: 265 seconds]
VanillaGoat_ has joined #ruby
Wolland has quit [Ping timeout: 258 seconds]
jasooon has joined #ruby
kireevco1 has joined #ruby
mary5030_ has joined #ruby
<pipework>
I love the SICP book. We've got a book club on it at work.
mdarby has quit [Max SendQ exceeded]
<pipework>
It's the most refreshing stuff because it makes me think about the more pure theory of computer science.
Juanchito has quit [Quit: Connection closed for inactivity]
mdarby has joined #ruby
<pipework>
zenspider might be able to confirm this: Computer Science is all about redstone and minecraft.
kireevco has quit [Read error: Connection reset by peer]
TPBallbag has quit [Ping timeout: 256 seconds]
Kricir has joined #ruby
Fire-Dragon-DoL has quit [Ping timeout: 250 seconds]
<zenspider>
SICP, the (little|seasoned|reasoned) schemer series, and nand2tetris have been the best books I've read / worked through in decades
mdarby has quit [Max SendQ exceeded]
VanillaGoat has quit [Ping timeout: 258 seconds]
<JDHankle>
I was just saying that programming itself is just an application on your understanding of computer science and theory much like you speaking English is just an application of your knowledge of the English.
omosoj has quit [Quit: leaving]
mdarby has joined #ruby
<JDHankle>
I butchered that sentence. but you get my point.
louism2wash has joined #ruby
<Toba>
___ is just applied ___
mdarby has quit [Max SendQ exceeded]
<jenrzzz>
JDHankle: by programming, do you mean typing words into a computer to make it do things, or solving problems with software?
<Toba>
is the oldest slippery slide in the book
dmyers has quit [Ping timeout: 264 seconds]
<pipework>
Doing a thing is just the application of knowledge of a thing to achieve some thing you're doing
mdarby has joined #ruby
Timgauthier is now known as timgauthier_away
mdarby has quit [Max SendQ exceeded]
eka has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ghormoon has quit [Ping timeout: 256 seconds]
Spami has joined #ruby
mdarby has joined #ruby
Wolland has joined #ruby
danman has quit [Quit: danman]
arescorpio has joined #ruby
mdarby has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby
robbyoconnor has quit [Client Quit]
<jenrzzz>
has anyone used typhoeus with sidekiq? i'm not sure if it will destroy the universe
<jenrzzz>
probably just gonna play it safe with resque
Wolland_ has quit [Ping timeout: 255 seconds]
ghormoon has joined #ruby
<JDHankle>
jenrzzz: I'm not sure I understand the question. What's the difference between making a computer do things or solving problems with software? They're inclusive of one another are they not?
marr has quit [Read error: Connection reset by peer]
<rpag>
jenrzzz, i haven't but im not sure why it would break anything?
<wallerdev>
software only involves the soft part of the computer like the silicon
<JDHankle>
you obtain one by doing the other, no?
<jenrzzz>
JDHankle: the latter involves other people
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jenrzzz>
rpag: i'm not sure how a Typhoeus::Hydra, which is a wrapped libcurl multi will cope in a multithreaded environment
<JDHankle>
jenrzzz: ah, I was speaking to the 'typing nonsense into a text editor to make the computer do the damn thing it's supposed to' bit.
<jenrzzz>
also the sidekiq docs say not to usei t
renderful has joined #ruby
gsd has joined #ruby
doug1 has quit [Ping timeout: 245 seconds]
<rpag>
ah if the docs say avoid it there's a reason then id guess
<jenrzzz>
that was like 2 years ago, though, so i'm not sure if it's been fixed in the meantime
beef-wellington has quit [Ping timeout: 265 seconds]
eka has joined #ruby
porfa has joined #ruby
bafbomb has joined #ruby
djbkd has quit [Remote host closed the connection]
renderful has quit [Ping timeout: 265 seconds]
djbkd has joined #ruby
skolman_ has joined #ruby
djbkd_ has quit [Ping timeout: 264 seconds]
Joufflu has joined #ruby
apeiros has quit [Remote host closed the connection]
i_s has quit [Remote host closed the connection]
lw has quit [Quit: s]
apeiros has joined #ruby
kireevco1 has quit [Ping timeout: 256 seconds]
devdazed has joined #ruby
moritzs has joined #ruby
ptrrr has quit [Quit: ptrrr]
bklane has quit []
Kricir has quit [Remote host closed the connection]
Kricir has joined #ruby
ptrrr has joined #ruby
banister_ has quit [Read error: Connection reset by peer]
banister has joined #ruby
stunder has quit [Quit: Screw you guys I'm going home]
tier has joined #ruby
kobain has quit [Quit: Changing server...]
Cheezebox has joined #ruby
KC9YDN has joined #ruby
lw has joined #ruby
bricker has quit [Ping timeout: 258 seconds]
KC9YDN has quit [Remote host closed the connection]
doug1 has joined #ruby
Kricir has quit [Ping timeout: 256 seconds]
kobain has joined #ruby
jamto11 has joined #ruby
jshultz has quit [Quit: Connection closed for inactivity]
TinkerTyper has quit [Ping timeout: 250 seconds]
KC9YDN has joined #ruby
louism2wash has quit [Quit: This computer has gone to sleep]
Takle has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
Joufflu has quit [Read error: Connection reset by peer]
<hakunin>
why would sidekiq threads randomly fail to find a bin file to execute…
<hakunin>
at some point they all just lose PATH or osmething
aspires has quit []
<hakunin>
convert: command not found type of thing, after a while
<hakunin>
has someone ever run into it
mistermocha has quit [Remote host closed the connection]
hamakn has joined #ruby
MrSamuel has quit [Quit: MrSamuel]
arup_r has joined #ruby
ghormoon has quit [Ping timeout: 255 seconds]
<jenrzzz>
hakunin: how are you invoking `convert'?
<hakunin>
jenrzzz: via posix-spawn, simply "convert" (no path) and eventually start getting /bin/sh: 1: convert: not found
siwica has quit [Quit: siwica]
siwica has joined #ruby
Kilobyte|StupidC has joined #ruby
<hakunin>
jenrzzz: i kind of suspect that having too many parallel threads might exacerbate the problem, since this problem very rarely occurs in normal production, but became frequent when i filled up 40 threads per machine with non stop convert
Kilo`byte has quit [Ping timeout: 260 seconds]
Cheezebox has quit [Remote host closed the connection]
<hakunin>
jenrzzz: (almost 100k jobs of convert)
<hakunin>
jenrzzz: just tried reducing limit from 40 to 20, and seeing if it will happen less, but the question remains
<hakunin>
jenrzzz: nope, just started happening again on one of the machines
<jenrzzz>
yeah, that's pretty weird
hippyphysicist has joined #ruby
<jenrzzz>
can you check what the value of ENV['PATH'] is when you see the issue?
<hakunin>
jenrzzz: with some kind of trace thing?
lampd1 has joined #ruby
ghormoon has joined #ruby
louism2wash has joined #ruby
<jenrzzz>
hakunin: or just write it to a log file
Hijiri has joined #ruby
hippyphysicist has quit [Read error: Connection reset by peer]
<siwica>
I want to have a method foo that can be called with or without a symbol, e.g. foo or foo(:green). Is it possible to only allow for a certain set of symbols (e.g. :red, :green, :blue) to be passed to foo?
<jenrzzz>
rescue the call to posix-spawn and dump the env to a file or something
<siwica>
jenrzzz: Now I need a variable color to take different strings depending on what symbol was passed. How do I do that?
<porfa>
what would be best? trying to join all my puts requests to output what i want in the format i want, or formating the text output after? if so, what could i use to format it after?
doug1 has quit [Ping timeout: 245 seconds]
<porfa>
i need to make every ruby newline into a ; but i dont know how.
mdarby has joined #ruby
<mdarby>
Damn LAN, I WILL CONQUER YOU
<siwica>
jenrzzz: e.g. color = "1.0 1.0 1.0 1.0" if :white is passed, "1.0 0.0 0.0 1.0" if :red is passed, ...
<jenrzzz>
hakunin: well, we know that ruby starts with the correct environment since it works sometimes. that doesn't necessarily explain why forking from some worker threads doesn't inherit the whole environment
Scotteh has quit [Ping timeout: 260 seconds]
tlarevo has quit [Remote host closed the connection]
skolman_ has quit [Remote host closed the connection]
<hakunin>
jenrzzz: right it might modify it in ruby's PATH, which probably wouldn't reflect in process env
<jenrzzz>
siwica: color = case sym; when :white then "1.0 1.0 1.0 1.0"; when :red then "1.0" .... should do the trick
tlarevo has joined #ruby
<jenrzzz>
do you mutuate PATH anywhere?
wallerdev has quit [Quit: wallerdev]
<hakunin>
jenrzzz: definitely would never myself, and this happens randomly. i'm trying to change code directly on server now to investigate
<jenrzzz>
sounds like fun!
ValicekB has quit [Ping timeout: 272 seconds]
Cat_1 has quit []
oleo is now known as Guest29468
oleo__ has joined #ruby
dkb20k has joined #ruby
<hakunin>
jenrzzz: yeah… what's more fun is that i'm stuck with 80k jobs that are enqueued and must be processed, and workers start failing randomly forcing me to manually restart when i notice retries showing up, and this could take days
<hakunin>
jenrzzz: so i have 2 options - spend days by the computer, or figure out a fix or a hack
rshetty has joined #ruby
<jenrzzz>
can you hard-code the path to convert?
tuelz has joined #ruby
amclain has joined #ruby
<hakunin>
looking into that
banister is now known as banister_
devdazed has quit [Ping timeout: 272 seconds]
Guest29468 has quit [Ping timeout: 272 seconds]
ghormoon has quit [Ping timeout: 256 seconds]
krz has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
Virtualize|away has joined #ruby
zorak8 has quit [Ping timeout: 240 seconds]
allcentury has joined #ruby
reinaldob has joined #ruby
ValicekB has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
sepp2k has quit [Read error: Connection reset by peer]
<pipework>
siwica: Don't need the color_string = part, just use puts with it.
<pipework>
Also, instead of having a local, use a constant.
<siwica>
pipework: yes, ok
<pipework>
In the class do COLORS = {}.freeze; where you fill in the hash with the white and whatnot.
yetanotherdave has quit [Ping timeout: 258 seconds]
<pipework>
Then just puts COLORS.fetch(color) { raise ... }
<pipework>
One-line method :D
tier has quit [Remote host closed the connection]
chrishough has quit [Ping timeout: 255 seconds]
jimmyhoughjr has joined #ruby
wallerdev has quit [Ping timeout: 265 seconds]
<siwica>
pipework: actually I am using the string later, but in the minimal example you are right :)
<siwica>
thank you!
axl_ has quit [Ping timeout: 255 seconds]
<pipework>
I'd also call #to_sym on color when you pass it to #fetch
<pipework>
Just so you can have some win there.
<siwica>
pipework: why that?
<siwica>
in case sb passes a string?
<pipework>
siwica: So that you can support being passed any object that knows #to_sym. Hopefully it returns a symbol.
<pipework>
String supports #to_sym
<siwica>
oh ok
<siwica>
is this common to do it?
<pipework>
Yeah, supporting strings and symbols interchangeably?
<siwica>
I thought I would want to prevent unconsistent use of the method?
TinkerTyper has quit [Ping timeout: 272 seconds]
<siwica>
ok, guess thats a question of philosophy :)
<pipework>
siwica: Egh, strings and symbols aren't a big deal to use interchangeably in most things.
<siwica>
probably true
<siwica>
and as a ruby beginner, I'll just do it:)
Scotteh__ has joined #ruby
chudler has quit [Ping timeout: 260 seconds]
ryao has quit [Ping timeout: 260 seconds]
ryao__ has joined #ruby
skolman_ has joined #ruby
Scotteh_ has quit [Ping timeout: 260 seconds]
fuhgeddaboudit has quit [Remote host closed the connection]
<pipework>
Usually you'll want to depend on the interface of objects and not their types, but in the case of indexing into a hash, you can have some fun with it by returning the same value for :white as well as 'white'
<pipework>
benzrf: It might make things easier, but all things have their own benefits and drawbacks.
<benzrf>
whats it bad
livingstn has quit []
Soda has joined #ruby
RastaqWhere has joined #ruby
RastaqWhere has quit [Client Quit]
Areessell_ has quit [Quit: (null)]
jottr has quit [Ping timeout: 245 seconds]
magic_ has joined #ruby
Takle has joined #ruby
xenomorph is now known as {xenomorph}
Aranshada|W has left #ruby [#ruby]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
serena has joined #ruby
{xenomorph} is now known as xenomorph
serena has left #ruby [#ruby]
luriv has quit [Ping timeout: 250 seconds]
Takle has quit [Ping timeout: 255 seconds]
Lutece has joined #ruby
gsd has joined #ruby
<benzrf>
bye
northfurr has quit [Quit: northfurr]
benzrf is now known as benzrf|offline
aewffwea has joined #ruby
michael3 has quit [Ping timeout: 265 seconds]
Virtualize|away has quit [Quit: Leaving...]
siwica has quit [Ping timeout: 256 seconds]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bmurt has quit []
kotk has quit [Read error: Connection reset by peer]
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kotk has joined #ruby
rshetty has joined #ruby
tenseiten is now known as seitensei
Joufflu has joined #ruby
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
louism2wash has quit [Quit: This computer has gone to sleep]
echooo1 has joined #ruby
rshetty_ has joined #ruby
hexaphixylix has joined #ruby
balazs has joined #ruby
ndrei_ has joined #ruby
ndrei has joined #ruby
echooo has quit [Ping timeout: 258 seconds]
rshetty has quit [Ping timeout: 255 seconds]
jaequery has joined #ruby
jaequery has quit [Max SendQ exceeded]
jerius has joined #ruby
KC9YDN has joined #ruby
jaequery has joined #ruby
mesamoo has quit [Quit: Konversation terminated!]
mikepack has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
o0oo0o has quit [Quit: WeeChat 0.4.3]
tlarevo_ has quit [Remote host closed the connection]
tlarevo has joined #ruby
aspires has joined #ruby
oo_ has quit [Remote host closed the connection]
rshetty_ is now known as rshetty
oo_ has joined #ruby
mikepack has quit [Ping timeout: 244 seconds]
radic has quit [Disconnected by services]
radic_ has joined #ruby
j_mcnally has joined #ruby
tlarevo has quit [Remote host closed the connection]
<pontiki>
hola
tlarevo has joined #ruby
TinkerTyper has quit [Ping timeout: 250 seconds]
mary5030 has joined #ruby
<Lutece>
o/
wallerdev has joined #ruby
daed has quit [Ping timeout: 240 seconds]
j_mcnally has quit [Client Quit]
axl_ has joined #ruby
hexaphixylix has left #ruby [#ruby]
tlarevo has quit [Ping timeout: 256 seconds]
braincrash has joined #ruby
axl_ has quit [Ping timeout: 240 seconds]
wallerdev has quit [Ping timeout: 240 seconds]
reinaldob has joined #ruby
jrhorn424 is now known as zz_jrhorn424
red_horned_rihno has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chishiki has quit [Remote host closed the connection]
red_horned_rihno has quit [Max SendQ exceeded]
TinkerTyper has joined #ruby
dh64 has joined #ruby
red_horned_rihno has joined #ruby
rshetty has quit [Remote host closed the connection]
x1337807x has joined #ruby
reinaldob has quit [Ping timeout: 264 seconds]
red_horned_rihno has quit [Max SendQ exceeded]
parabolize has joined #ruby
hmsimha_ has joined #ruby
arup_r has quit [Quit: Leaving.]
red_horned_rihno has joined #ruby
aspires has quit []
jusmyth has joined #ruby
Joufflu has quit [Read error: Connection reset by peer]
red_horned_rihno has quit [Max SendQ exceeded]
jenrzzz has quit [Ping timeout: 265 seconds]
aspires has joined #ruby
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mattmcclure has quit [Quit: Connection closed for inactivity]
red_horned_rihno has joined #ruby
red_horned_rihno has quit [Read error: Connection reset by peer]
TinkerTyper has quit [Ping timeout: 250 seconds]
triple_b has joined #ruby
aspires has quit [Client Quit]
magic is now known as magical_mystery
jerius has quit []
maestrojed has quit [Quit: Computer has gone to sleep.]
rshetty has joined #ruby
ramfjord has quit [Ping timeout: 244 seconds]
triple_b has quit [Client Quit]
chishiki has joined #ruby
spastorino has quit [Quit: Connection closed for inactivity]
Takle has joined #ruby
jaequery has joined #ruby
TinkerTyper has joined #ruby
mdarby has joined #ruby
Joufflu has joined #ruby
maestrojed has joined #ruby
mdarby has quit [Max SendQ exceeded]
supermanBlack has joined #ruby
Soda has quit [Remote host closed the connection]
supermanBlack is now known as shortCircuit__
shortCircuit__ is now known as supermanPlasticP
supermanPlasticP is now known as supermanYellow
Musashi007 has joined #ruby
Takle has quit [Ping timeout: 272 seconds]
maestrojed has quit [Client Quit]
<porfa>
heya
<porfa>
can i use ruby to follow links? for ie: doc.xpath('//*[contains(concat( " ", @class, " " ), concat( " ", "image", " " ))]//a ')[1]["href"] Outputs "/doc.ashx?211787" but i want it t?o give me this ?KB-7499_a.jpg"
jenrzzz has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
goodenough has joined #ruby
dc_ has joined #ruby
x1337807x has joined #ruby
fuhgeddaboudit has quit [Ping timeout: 244 seconds]
redjack1964 has quit [Remote host closed the connection]
goodenough has quit [Remote host closed the connection]
<porfa>
ohoh mechanize..!
swilr has quit [Read error: Connection reset by peer]
swilr has joined #ruby
ramfjord has joined #ruby
mbytes has joined #ruby
mbytes has quit [Remote host closed the connection]
pontiki has quit [Quit: "Poets have been mysteriously silent on the subject of cheese." -- G.K.Chesterson]
rshetty has quit [Remote host closed the connection]
sinequanon has joined #ruby
kyb3r_ has joined #ruby
jonr22 has joined #ruby
louism2wash has joined #ruby
j_mcnally has joined #ruby
psy_ has quit [Remote host closed the connection]
michaeldeol has joined #ruby
jonr22 has quit [Ping timeout: 250 seconds]
mdarby has joined #ruby
ARCADIVS has joined #ruby
mdarby has quit [Max SendQ exceeded]
siwica has joined #ruby
adriancb has quit [Remote host closed the connection]
mbytes has joined #ruby
mbytes has quit [Remote host closed the connection]
mdarby has joined #ruby
TPBallbag has joined #ruby
oo_ has quit [Remote host closed the connection]
rshetty has joined #ruby
it0a has quit [Ping timeout: 256 seconds]
Channel6 has quit [Quit: Leaving]
oo_ has joined #ruby
mistermocha has joined #ruby
dkb20k_ has joined #ruby
goodenough has joined #ruby
louism2wash has quit [Quit: This computer has gone to sleep]
TPBallbag has quit [Ping timeout: 265 seconds]
dkb20k has quit [Ping timeout: 265 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mistermocha has quit [Ping timeout: 244 seconds]
oo_ has quit [Ping timeout: 272 seconds]
Channel6 has joined #ruby
wallerdev has joined #ruby
allcentury has joined #ruby
mbytes has joined #ruby
mbytes has quit [Remote host closed the connection]
earfin has quit [Ping timeout: 265 seconds]
jottr has joined #ruby
oo_ has joined #ruby
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
"One longstanding weakness with the Ruby community is subpar documentation."
<ddellacosta>
I am having trouble installing riemann-tools, not sure how to deal with this, any tips? "Make: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin13/ruby/config.h', needed by `yajl.o'. Stop."
dseitz has joined #ruby
<ddellacosta>
not sure where to begin with it
<sevenseacat>
start with gisting the command you ran and the full error
jimmyhoughjr has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
freerobby has quit [Quit: Leaving.]
swilr has quit [Read error: Connection reset by peer]
arup_r has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
swilr has joined #ruby
<ddellacosta>
sevenseacat: sorry, I wasn't sure what to google, I did in fact try beforehand though.
<sevenseacat>
i googled the error message :P
<ddellacosta>
I did as well
<ddellacosta>
anyways, thanks
akamel has quit [Quit: Leaving.]
<sevenseacat>
yw
<ddellacosta>
good to see #ruby hasn't changed
ddellacosta has left #ruby [#ruby]
arup_r_ has joined #ruby
<sevenseacat>
christ, you help people and they still hate you
chrishou_ has joined #ruby
Sgeo has quit [Read error: Connection reset by peer]
Sgeo has joined #ruby
<ericwood>
:D
Musashi007 has quit [Quit: Musashi007]
godd2 has joined #ruby
mbytes has quit [Ping timeout: 244 seconds]
<godd2>
When would you pass a block to a method and then call it vs yielding and vice versa?
<porfa>
i need help with ruby synthax.. :( my specs = specs = ?doc.xpath(' //*[(@id = "Gegevens")]//li').collect {|node| node.text.strip}? when i ?puts specs? the text comes out perfect andhow i need it, but if i ?puts ?#{specs}? it comes out missing some special characters like ?e, o? .. how can i bypass this? i would be fine with just ?puts specs? but it spits out all the text in new lines and i want it alltogheter
<godd2>
Or are they jsut two ways of doing the same thing?
arup_r has quit [Ping timeout: 264 seconds]
psyprus has quit [Ping timeout: 258 seconds]
chrishough has quit [Ping timeout: 250 seconds]
arup_r has joined #ruby
<porfa>
goddamit, even my irc client is all crap, sorry
Lutece has quit [Quit: .]
mdarby has quit [Remote host closed the connection]
Scotteh has joined #ruby
Alina-malina has joined #ruby
<shevy>
godd2 you only have to yield specifically when you need to write a method
<shevy>
if you use something like array.each then obviously you can just use the block without having to burden yourself with yield
<shevy>
godd2 a block is available to every method in ruby all the time, but by default if you have not used yield in your method, it won't care about the block
<shevy>
it is like an additional argument to your methods
chrishough has joined #ruby
CustosLimen has quit [Ping timeout: 265 seconds]
mdarby_ has joined #ruby
<shevy>
I should also like to point out that people like apeiros at one point in the life wanted to be able to use more than one block :)
arup_r_ has quit [Ping timeout: 264 seconds]
Scotteh__ has quit [Ping timeout: 260 seconds]
mdarby_ has quit [Max SendQ exceeded]
Axy has joined #ruby
Axy has joined #ruby
klaut has joined #ruby
DarkCthulhu has joined #ruby
psyprus has joined #ruby
<porfa>
why doesn?t this work? ? specs2 = "#{specs}".text.strip ?
<DarkCthulhu>
Does ruby mix in the Enumerable mixin into every class by default?
<godd2>
DarkCthulhu no
<DarkCthulhu>
godd2: Why did the sort method work for me just after defining the spaceship operator?
<DarkCthulhu>
without including the Enumerable mixni
<DarkCthulhu>
*mixin
<shevy>
DarkCthulhu I think either Kernel or Object has it
<godd2>
DarkCthulhu in irb type Array.ancestors to see what's in the ancestor chain, and then do Object.ancestors and you will see that Enumerable is missing
Mia has quit [Ping timeout: 244 seconds]
<shevy>
cool
<DarkCthulhu>
ahh
<DarkCthulhu>
So, array has it mixed in by default
<DarkCthulhu>
Why does it show up as an ancestor? Isn't it technically a module, which isn't a part of some inheritance chain?
rshetty_ has joined #ruby
<shevy>
Hash also has it mixed in
<shevy>
probably most of those ruby core classes
<shevy>
DarkCthulhu but that is how it always works
<shevy>
>> module Bar; end; class Foo; include Bar; end; Foo.ancestors
<shevy>
but they are not worth equal as you have to require 'english' :(
wallerdev has quit [Ping timeout: 244 seconds]
<shevy>
>> require 'english'; $PROCESS_ID
<eval-in__>
shevy => cannot load such file -- english (LoadError) ... (https://eval.in/216957)
<shevy>
gah
<shevy>
is it capitalized?
<DarkCthulhu>
I was looking at poetry mode just now. It's awesome and all, but there is good reason why we don't program in natural languages like English, so why are we trying to turn it into that?
<ericwood>
there's a nice middleground
<shevy>
DarkCthulhu well - fully written English can be quite verbose
<DarkCthulhu>
and imprecise
<shevy>
ruby is a bit like terse english
<ericwood>
it's all about whatever fits your brain the best...I found ruby gels really well with mine
<shevy>
or japanese english ... hahahaha
jenrzzz has joined #ruby
<shevy>
"if object responds to this, call that method, else call this method"
<shevy>
if object.respond_to? :bla then foo() else bla() end
<shevy>
I guess that won't work in one line hmm
ndrei_ has joined #ruby
<DarkCthulhu>
yeah, that is nice
<shevy>
it would be interesting to see a programming language that would support branching based on syntax
Channel6 has quit [Quit: Leaving]
<shevy>
make condition check here
<shevy>
/ \
<shevy>
here comes true condition here comes false condition
<DarkCthulhu>
but with something like RSpec and the ".should be > something". I'd much rather write .should(be() > 5) so I know what the components of that line are
<shevy>
damn... my spacing sucked
mistermocha has joined #ruby
<DarkCthulhu>
haha.. I understand what you mean
<shevy>
aha
<shevy>
rspec is a bit strange
<sevenseacat>
rspec is awesome
<godd2>
DarkCthulhu go get your hands/eyes on Metaprogramming Ruby
<godd2>
It's not as advanced as it sounds.
louism2wash has joined #ruby
<godd2>
It's where I learned about the nuances of Ruby's inheritance and a bunch of other good stuff
<DarkCthulhu>
godd2: Looks interesting. Will try :) ty
<godd2>
that's odd, lowercase english worked in my irb...
<DarkCthulhu>
I'm using Rails for one of my projects coming up. Coming from the PHP/CodeIgniter/Framework of the week side, convention over configuration is a little irksome at times :/
<sevenseacat>
its awesome
<shevy>
this cat is like a cheering one
<sevenseacat>
there is absolutely no comparison between something like codeigniter, and rails
Takle has joined #ruby
<ericwood>
some of the convention takes a little getting used to but it flows very naturally after that
<ericwood>
and of course you can go in and muck with things if you really want to
<shevy>
godd2 have you been using the & syntax to pass blocks to different methods in your code yet?
axl_ has joined #ruby
goodenough has quit [Remote host closed the connection]
<godd2>
I haven't quite found the need yet. Nothing I've built has been that involved, but I have yielded in my code
<DarkCthulhu>
sevenseacat: Yeah, rails does a lot more, but I'd like it more if it did it up front.
<godd2>
I have a Sound::Device class that can yield the opened device to a block and closes it automatically after the block finishes. I took after the File class behavior.
<ericwood>
tbh I don't write a lot of methods on my own that require blocks being passed in...
<ericwood>
it's more something I found I do when *writing* frameworks for stuff
oo_ has quit [Remote host closed the connection]
chipotle_ has joined #ruby
oo_ has joined #ruby
psy_ has joined #ruby
oo_ has quit [Read error: Connection reset by peer]
mostlybadfly has quit [Quit: Connection closed for inactivity]
oo_ has joined #ruby
Takle has quit [Ping timeout: 256 seconds]
reinaldob has joined #ruby
axl_ has quit [Ping timeout: 255 seconds]
chipotle has quit [Ping timeout: 250 seconds]
mary5030 has quit [Remote host closed the connection]
<DarkCthulhu>
Have you guys written Python as well? How would you say it compares?
<DarkCthulhu>
to Ruby
<DarkCthulhu>
(controversial but bear with me :)0
<godd2>
never learned it; don't have an opinion
chipotle_ has quit [Ping timeout: 250 seconds]
mistermocha has quit [Remote host closed the connection]
<aewffwea>
DarkCthulhu: I havent, but the small python I've seen, I prefer ruby
<DarkCthulhu>
aewffwea: Why?
mistermocha has joined #ruby
<ericwood>
I started out on python
bluehavana has joined #ruby
<ericwood>
I found both comparable but Ruby gelled better with me and I enjoyed writing it more
<DarkCthulhu>
Open classes are the most awesome thing I've seen so far in Ruby. I don't know of any other language that has them the same way
IceDragon has quit [Quit: Space~~~]
<DarkCthulhu>
But again, the downside would be that you don't really know for sure what even a core class does
<aewffwea>
DarkCthulhu: I like brackets
sevenseacat has left #ruby [#ruby]
sevenseacat has joined #ruby
<DarkCthulhu>
aewffwea: Does idiomatic ruby code have that many brackets? Most of the code I've seen does not
<aewffwea>
DarkCthulhu: Almost all scripting and dynamic languages have an equivalent feature
reinaldob has quit [Ping timeout: 256 seconds]
<aewffwea>
DarkCthulhu: You can also use do and end...
<DarkCthulhu>
aewffwea: Which ones? Python does not for one.
<DarkCthulhu>
Yeah, do..end is what I've seen and was what I thought was more ruby-ish.
<DarkCthulhu>
ruby-style
skolman_ has quit [Remote host closed the connection]
<ericwood>
I only use brackets when chaining
<aewffwea>
anyway, I told you I don't know python, so mine might not be the best opinion ever
<DarkCthulhu>
Hmm..
<aewffwea>
Ruby seems nicer than Python
<godd2>
erichmenge you can chain off end also
<ericwood>
yeah but it's ugly
<ericwood>
also that's the wrong person
<godd2>
ah dammit
rshetty_ has quit [Remote host closed the connection]
<DarkCthulhu>
yeah, map do ... end.something works. Just looks a little weird at first, chaining from "end".
<ericwood>
just use brackets for that
<ericwood>
it conveys what's happening better
<DarkCthulhu>
yep.. definitely one place I'd use brackets
CustosLimen has joined #ruby
CustosLimen has quit [Changing host]
CustosLimen has joined #ruby
wallerdev has joined #ruby
VanillaGoat__ has joined #ruby
rshetty has joined #ruby
<ericwood>
tbh it's best to only use them there and on one-liners
<ericwood>
but those are just my opinions
klaut_ has joined #ruby
x1337807x has joined #ruby
Morkel_ has joined #ruby
amclain has quit [Quit: Leaving]
mumm_ra has quit [Quit: leaving]
josephndenton has quit [Ping timeout: 244 seconds]
Morkel has quit [Ping timeout: 240 seconds]
Morkel_ is now known as Morkel
zartoosh has joined #ruby
catfishlar_ has joined #ruby
Spami has joined #ruby
<parabolize>
for me python had better GUI libraries but it uses so much of its line space with 4 space indentation and references to self. Also, the python folks seem to hate marcos.
<porfa>
can anyone help me out with this please? https://gist.github.com/anonymous/7a4f066918088001c9fc the output i get form specs is wrong, i need to get ?Botoeso maos-livres? instead of ?Bot\u00E3o m\u00E3os-livres?
<DarkCthulhu>
parabolize: Aren't macros almost always evil?
<aewffwea>
parabolize: I like references to self :)
emmesswhy has joined #ruby
<aewffwea>
DarkCthulhu: Macros aren't evil... Some people that use macros are...
Sp4rKy__ has joined #ruby
wallerdev has quit [Ping timeout: 245 seconds]
<DarkCthulhu>
porfa: Looks like an issue with encoding. Those look like unicode escape sequences.
BadQuanta has joined #ruby
skolman_ has joined #ruby
<shevy>
DarkCthulhu I preferentially use {} because it is visualize easier to distinguish it for me
oo_ has quit [Remote host closed the connection]
<shevy>
def foo
<shevy>
bla.each {
<shevy>
}
<shevy>
end
<shevy>
*visually
<shevy>
nokogiri is so ugly
<DarkCthulhu>
shevy: Hmm.. With the right indentation, I don't mind do..end or the brackets.
<shevy>
I hate using lots of indented end's
<shevy>
there was a troll suggestion once to introduce enddd as a keyword
n3b_ has joined #ruby
lorn_ has joined #ruby
kartouch_ has joined #ruby
goshdarnyou has quit [Quit: Connection closed for inactivity]
dreamfighter has joined #ruby
<DarkCthulhu>
porfa: Nokogiri::HTML(..) takes an additional encoding argument that you can pass in as 'utf-8'. That may work for you
oo_ has joined #ruby
qz has joined #ruby
klaut has quit [*.net *.split]
catfishlar has quit [*.net *.split]
djbkd has quit [*.net *.split]
VanillaGoat_ has quit [*.net *.split]
DTSCode has quit [*.net *.split]
Azure has quit [*.net *.split]
AlexRussia has quit [*.net *.split]
drkyro has quit [*.net *.split]
rostam has quit [*.net *.split]
keen_________ has quit [*.net *.split]
larsam has quit [*.net *.split]
lorn has quit [*.net *.split]
Sp4rKy_ has quit [*.net *.split]
20WAAC7EF has quit [*.net *.split]
aboudreault has quit [*.net *.split]
n3b has quit [*.net *.split]
kartouch has quit [*.net *.split]
havenwood has quit [*.net *.split]
DrCode has quit [*.net *.split]
St_Marx has quit [*.net *.split]
atmosx has quit [*.net *.split]
end_guy has quit [*.net *.split]
catfishlar_ is now known as catfishlar
JBreit has joined #ruby
djbkd has joined #ruby
<DarkCthulhu>
and we have netsplit.
Abhijit has joined #ruby
<qz>
heya. is .instance_eval {} still changing object somehow? i get different results with JSON.pretty_generate(obj) and obj.instance_eval {} ; JSON.pretty_generate(obj)
Spami has quit [Ping timeout: 258 seconds]
mistermocha has quit [Remote host closed the connection]
n_blownapart has joined #ruby
mistermocha has joined #ruby
djbkd_ has joined #ruby
sinequanon has quit [Remote host closed the connection]
BadQuanta1 has joined #ruby
sigurding has joined #ruby
yfeldblum has quit [Ping timeout: 272 seconds]
aboudreault has joined #ruby
kaspergrubbe has joined #ruby
BadQuanta has quit [Ping timeout: 265 seconds]
mistermo_ has joined #ruby
djbkd has quit [Ping timeout: 260 seconds]
DTSCode has joined #ruby
atraylen has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
AlexRussia has joined #ruby
jusmyth has left #ruby [#ruby]
keen_________ has joined #ruby
<n_blownapart>
hello I'm learning about array elements. why does line 8 return an empty [] and line 10 returns nil ? thanks http://pastie.org/9694716
kaspergrubbe has quit [Ping timeout: 260 seconds]
oleo__ has quit [Quit: Verlassend]
catfishlar has quit [Quit: catfishlar]
mistermo_ has quit [Ping timeout: 265 seconds]
yfeldblum has joined #ruby
<porfa>
DarkCthulhu: it was my terminal.app that come ?wrongly? configure for ssh..
<porfa>
it?s working now!
<DarkCthulhu>
ah.. okay :)
sinequanon has joined #ruby
jusmyth1 has joined #ruby
Alina-malina has quit [Ping timeout: 265 seconds]
Alina-malina has joined #ruby
tagrudev has joined #ruby
synergyz_ has joined #ruby
<DarkCthulhu>
n_blownapart: :-o that i some crazy behavior. I'd like to know as well why that is happening.
arup_r has quit [Remote host closed the connection]
<DarkCthulhu>
shevy: err.. It seems correct. Yields random numbers below the supplied "limit", "num" times
Spleeze has joined #ruby
<shevy>
aha
jusmyth has left #ruby [#ruby]
<DarkCthulhu>
Something fishy about it though. it always seems to be yielding numbers in increasing order
parabolize has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<DarkCthulhu>
oh wait
<DarkCthulhu>
nvm
<DarkCthulhu>
I'm stupid :)
<Abhijit>
how to install ruby headers in fedora?
Macaveli has joined #ruby
bigmac has quit [Ping timeout: 244 seconds]
AndChat| has quit [Quit: Bye]
dkb20k_ is now known as dkb20k
fabrice31 has joined #ruby
<shevy>
DarkCthulhu yeah I did not grok it but something looked really weird there
<shevy>
Abhijit usually you must uncripple it; it often is in a dev- package. on debian based it should be like ruby-dev or something
dyu has quit [Quit: Leaving.]
Darryl_ has joined #ruby
<diegoviola>
I have an array of hashes with a date key/values and some other key/values that are not duplicates, how do I merge them?
emmesswhy has quit [Quit: This computer has gone to sleep]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
best build a new one
goodenough has joined #ruby
arup_r has joined #ruby
fabrice31 has quit [Ping timeout: 265 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<diegoviola>
right
<Abhijit>
shevy, ok
rshetty has quit [Ping timeout: 244 seconds]
<shevy>
diegoviola I guess you could also use .map or .map! on your array to yield the desired structure, but I often found it easier to understand if I re-build my data structure little by little until I have what I want
<shevy>
if you need to throw out stuff you don't want to, you can use .select or .reject prior to rebuilding
<leslie2>
rubyonrails channel disappeared? I have some questions to ask
<sevenseacat>
it didnt disappear.
<diegoviola>
shevy: thanks
<shevy>
leslie2 /join #RubyOnRails
<leslie2>
I could not join it, I do not know why shevy!
<Hijiri>
requires registration maybe?
<Hijiri>
I was able to join
<leslie2>
maybe
aspires has joined #ruby
jottr has joined #ruby
<sevenseacat>
it does require registration, as the alert tells you.
<shevy>
leslie2 yeah you must be identified + registered
<shevy>
leslie2 stay here with us, we don't force you to lower your pants like they do :>
<shevy>
it's their way of telling you that they don't want you!
<shevy>
if you do /join #python and are not identified then you get redirected to #python-unregistered
pontiki has joined #ruby
<shevy>
where there are more people than on #ruby
nopoliti1a has joined #ruby
<shevy>
:\
<shevy>
:/
<sevenseacat>
works for me.
<leslie2>
haha, nicely you guys
<shevy>
I guess there must be +1500 on #python but I don't know as I am an ILLEGAL IRC RESIDENT without registration
DjDeaf has joined #ruby
<sevenseacat>
1467 actually.
ptrrr has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
ack :(
<DjDeaf>
Hi, Any way I can put conditional statements inside an API call? (Using hashes)
<shevy>
DjDeaf probably you can use the ternary operator
Alina-malina has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
<DjDeaf>
@shevt ternary won't help as I cannot use it inside Faraday's put call
<shevy>
so you can build up your Hash before you send it into some other method
Xeago has joined #ruby
<DjDeaf>
Yes, In the code I first build the Hash using tap
<pontiki>
i can't even read that
<DjDeaf>
The second action is to use the values and send them to the API
<DjDeaf>
but if a value is not set, How can I "Remove" it from the call?
<shevy>
.delete(:key_here) on your Hash
wallerdev has joined #ruby
<shevy>
I dont know why you must do this all inside the {} - can't you rebuild your hash exactly how you want to have it?
bal has joined #ruby
<DjDeaf>
I'm using tap so no need for delete. At the end, I get a hash build up of only keys I need
<shevy>
good, so you have the final Hash already
<pontiki>
why not set up options with the parameters you want, and just pass that into the call?
<DjDeaf>
Yes
<DjDeaf>
because, I need the API call to pass all values that has been inserted.
<pontiki>
looks like you just need to add checkid and encryption
<pontiki>
and?
<shevy>
it only confuses me because a few lines before you said that you don't know how to remove a value if it is not set, yet you also just now said that the hash is final, and thus ready ;)
<DjDeaf>
If someone passed more parameters, i will pass them too
<DjDeaf>
Ok, a few remarks:
<pontiki>
you're building it right there, who else is going to put in parameters?
<DjDeaf>
1) 'options' hash is building my hash, and working perfect - at the end, i get a hash of only the things I need
<shevy>
DjDeaf what I would do is use a method which will ensure that my hash is valid, before I then put it into the next method call
<shevy>
good
<DjDeaf>
2) @conn.put part where I send this values to the API, and if I don't have a value in one parameters (or key is not exist) it will pop an error.
<DjDeaf>
I want to know how to do a selective API call, but still dynamic
<shevy>
then use a second hash that is valid for that @conn.put line
leslie2 has quit [Ping timeout: 244 seconds]
SouL has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
<DjDeaf>
what do you mean?
wallerdev has quit [Ping timeout: 240 seconds]
theRoUS has quit [Ping timeout: 265 seconds]
<DjDeaf>
the user is going to put parameters
<DjDeaf>
This is used to modify a check on Pingdom, and most values are optional
<pontiki>
oh, well *that* is new information you haven't said before
Xeago has quit [Remote host closed the connection]
<DjDeaf>
sorry :)
<shevy>
I still don't see the problem
leslie1 has joined #ruby
<shevy>
you are in full control of the code that is sent to @conn.put
<shevy>
so build up the Hash precisely how you want it?
<pontiki>
it still doesn't make sense to me that you have to create two hashes where one merely has the fields copied from the other
<DjDeaf>
I have ni problem building the hash
Joufflu has quit [Ping timeout: 265 seconds]
<DjDeaf>
no*
<pontiki>
exactly
koderok has joined #ruby
<pontiki>
so why build it twice?
<DjDeaf>
the second one does not created a new hash, it assign values
<shevy>
the knights who said ni
skolman_ has quit [Remote host closed the connection]
<pontiki>
it so very much is building another hash
<DjDeaf>
Or maybe I get something way off?
<pontiki>
@conn.put url, hash_of_options
<DjDeaf>
oh. you have a point. sec :)
theRoUS has joined #ruby
sinkensabe has joined #ruby
vyorkin has joined #ruby
parduse has quit [Killed (kornbluth.freenode.net (Nickname regained by services))]
rdark has joined #ruby
parduse has joined #ruby
<DjDeaf>
Well, brilliant. that worked. Thanks pontiki!!
<shevy>
lol
<shevy>
so you did pass in your hash finally
mistermocha has joined #ruby
vyorkin has quit [Ping timeout: 255 seconds]
<pontiki>
if you want to make it a bit more consise, DjDeaf, take a look at the third form of conn.get on this page: http://www.rubydoc.info/gems/faraday
rippa has joined #ruby
<pontiki>
passing in a block to #get you can set the parameters directly
ClarusCogitatio has quit [Ping timeout: 256 seconds]
<DjDeaf>
checking. and yes, I just passed the hash as you suggested: result = @conn.put "/api/2.0/checks/#{checkid}", options
louism2wash has quit [Quit: This computer has gone to sleep]
kamil has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
ClarusCogitatio has joined #ruby
louism2wash has joined #ruby
louism2wash has quit [Client Quit]
jenrzzz has joined #ruby
<DjDeaf>
Hi, pontiki, what example did you mean in that page?
ptrrr has quit [Quit: ptrrr]
<pontiki>
the third one for conn.get, where you pass a block
<pontiki>
i can whittle that down even futher, but it might get a bit obfuscated
atraylen has quit [Ping timeout: 245 seconds]
andikr has joined #ruby
<shevy>
your code becomes obfuscated?
jusmyth has joined #ruby
jusmyth has left #ruby [#ruby]
<DjDeaf>
That's cool , that way I can save the two separated actions into one
<pontiki>
\o/
<DjDeaf>
Thanks a lot!
tlarevo_ has joined #ruby
<pontiki>
i can't guarantee that will work as i haven't tested it, but at least the form makes more sense
ClarusCogitatio has quit [Ping timeout: 240 seconds]
sinkensabe has quit [Read error: Connection reset by peer]
ClarusCogitatio has joined #ruby
<pontiki>
params might not make sense on a conn.put, forex, but that's easily fixed
tlarevo has quit [Ping timeout: 245 seconds]
aganov has joined #ruby
Wolland has joined #ruby
Wolland has quit [Remote host closed the connection]
mkaesz has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
Wolland has joined #ruby
b1nd has quit [Ping timeout: 258 seconds]
b1nd has joined #ruby
Wolland_ has quit [Ping timeout: 265 seconds]
anarang has joined #ruby
<DTSCode>
so just out of curiosity, i want to know ruby, but if im not going to use it for anything professional, whats the advantage of using it over say python
Wolland has quit [Ping timeout: 256 seconds]
klaut_ has quit [Remote host closed the connection]
axl_ has joined #ruby
<DTSCode>
or just writing a dsl?
<pontiki>
none
<pontiki>
pleasure
<DTSCode>
oh
niKeITA has joined #ruby
<pontiki>
potential for great money, fame, fortune and being shevy's friend
goshdarnyou has joined #ruby
<DTSCode>
how good is it with web dev?
<pontiki>
pretty boss
<pontiki>
but so is python
sinkensabe has joined #ruby
<DTSCode>
hmmm...
<pontiki>
i gotta tell ya, this question is hugely pointless
<DTSCode>
o rly? ok then
<DTSCode>
ill just learn it then just to say i did
<pontiki>
for most things it hardly matters which language you use
<shevy>
hey
<pontiki>
but if you want to be shevy's friend, you have to learn ruby
<shevy>
shevy's friendship is more expensive!
* DTSCode
wants to be shevys friend
<shevy>
omg
<shevy>
DTSCode as to the question - both ruby and python fill very similar niches
<DTSCode>
thats what i figured
<pontiki>
i have learned tons of different languages, but ruby is, for me, a joy to use on a daily basis
<DTSCode>
why so?
<shevy>
DTSCode the main difference is the philosophy
<pontiki>
i can't personally compare it to python, because i've never felt compelled to learn it
<DTSCode>
it looks a lot more elegant than python tbh which is why i want to learn it
<DTSCode>
shevy, makes senes
<tmoore>
DTSCode: my possibly useless opinion is that most people tend to gravitate toward one or the other based on personal style/taste
<pontiki>
why so? that's like asking an artist why painting watercolour is such a joy. the answer is simply because it is
<DTSCode>
will do shevy
<pontiki>
it's an aesthetic
<shevy>
other than that, you also have to keep in mind that there are significantly more python users and devs out there
<DTSCode>
tmoore, good point
axl_ has quit [Ping timeout: 264 seconds]
<DTSCode>
there are? oh.
<shevy>
yeah
<tmoore>
if Ruby looks more elegant to you, then it's probably a good way to go
<tmoore>
some people think Python looks more elegant, for whatever reason
<DTSCode>
i used to, i think it looks nice, but hacky
<pontiki>
python is currently the most popular language taught to people who need to write programs but are not software developers
<DTSCode>
same with c and c++
<shevy>
DTSCode that indirectly affects other people too. many use C++ and then pick only one scripting language, and then often pick python. look at the list of bindings to scripting languages (and other languages) here: http://www.gtk.org/language-bindings.php
<shevy>
perl users are mostly fossil coders :)
<shevy>
waiting for perl 6 ...
<pontiki>
haha, not
niKeITA is now known as niKeITA_away
<DTSCode>
huh. interesting. thanks shevy
<DTSCode>
so any good tuts?
<shevy>
DTSCode one really huge advantage you get with ruby is that "there is more than one way to write and use ruby"
fabrice31 has joined #ruby
<shevy>
in python you get the uniform military coding style
<shevy>
and they still can not decide whether python 2 or python 3 is the better version
<shevy>
but the real difference is the philosophy really
<DTSCode>
i like 2
<shevy>
hehehe
<shevy>
shouldn't you like 3 more?
lampd1 has quit [Remote host closed the connection]
arup_r has quit [Remote host closed the connection]
<DTSCode>
ive never tried 3
<DTSCode>
cause i dont need to
leslie1 has quit [Ping timeout: 240 seconds]
reinaldob has quit [Ping timeout: 258 seconds]
leslie1 has joined #ruby
diegoviola has quit [Quit: WeeChat 1.0.1]
jenrzzz has quit [Ping timeout: 265 seconds]
<shevy>
I dunno
<shevy>
I wanted to pick up on python a few times
<shevy>
the last time I tried, I hated the python 2 vs. python 3. I'm just gonna wait until python 2 is dead
<shevy>
(*transition)
Andriamanitra has quit [Ping timeout: 244 seconds]
mkaesz has quit [Ping timeout: 250 seconds]
<DTSCode>
thanks shevy! found the perfect link
leslie1 has quit [Ping timeout: 240 seconds]
Andriamanitra has joined #ruby
leslie1 has joined #ruby
niKeITA_away has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
workmad3 has joined #ruby
terlar has joined #ruby
BadQuanta has joined #ruby
govg has quit [Quit: leaving]
BadQuanta1 has quit [Ping timeout: 265 seconds]
shredding has joined #ruby
ClarusCogitatio has quit [Ping timeout: 265 seconds]
yfeldblum has quit [Ping timeout: 265 seconds]
mkaesz has joined #ruby
ClarusCogitatio has joined #ruby
RitterJack has joined #ruby
andrewlio has joined #ruby
doev has joined #ruby
wallerdev has joined #ruby
agjacome has joined #ruby
<supermanYellow>
i have a new assignment , open a new terminal with irb
TomyWork has joined #ruby
bluehavana has quit [Quit: Connection closed for inactivity]
<pontiki>
oh that sounds like fun!
<pontiki>
OS-independent?
<shevy>
hehehe
bayed has joined #ruby
magic_ has quit [Quit: Leaving]
magic_ has joined #ruby
magic_ has quit [Remote host closed the connection]
luriv has joined #ruby
last_staff has joined #ruby
wallerdev has quit [Ping timeout: 265 seconds]
<godd2>
WindowsKey+R, i, r, b, Enter
existensil has quit [Ping timeout: 256 seconds]
<pontiki>
maybe i had the wrong idea
<godd2>
That might not work everywhere
<pontiki>
i thought you were in irb, and wanted to open a terminal from inside it
sk87 has joined #ruby
niKeITA has joined #ruby
hanmac1 has joined #ruby
zorak8 has joined #ruby
<godd2>
`irb` ?
jenrzzz has joined #ruby
BadQuanta has quit [Ping timeout: 265 seconds]
<godd2>
no nevermind that didn't work
alex88 has joined #ruby
<shevy>
man guys
<shevy>
supermanYellow does not say anything
einarj has joined #ruby
<shevy>
godd2 what terminal do you use?
<supermanYellow>
oh. i was busy watching the rails gem install fail. its linux OS
<shevy>
lol
<shevy>
this is the exciting thing you have
<shevy>
the fails
<godd2>
I'm on Winblows
<shevy>
wow
<shevy>
do you at least use somehing like MSYS?
<godd2>
I don't know what that is.
<shevy>
:(
<shevy>
it is a kind of primitive terminal
<shevy>
but better than cmd.exe
<supermanYellow>
Its just an idea, that when i come to my office, i have 3 projects to work on, so i just go to the root directory and state the names of the projects, it opens up 3 terminals running bundle exec rails c
<shevy>
which was funny because I wanted to first use mingw because cygwin was annoying
<shevy>
reason I used msys was because I could use a shell on windows too, like on linux. I need a good shell! I do everything via the shell...
<pontiki>
last time i used windows, i had cygwin installed
earfin has joined #ruby
<godd2>
ok what makes MSYS better than cmd?
<pontiki>
that was ages and ages and ages ago
tesuji has joined #ruby
<pontiki>
supermanYellow: you know, emacs has a dandy shell mode
<supermanYellow>
yes. M-x shell ?
<supermanYellow>
but until now (2 months) i have used it run simple commands
Takle has joined #ruby
<zenspider>
I live in it
<zenspider>
got one open right next to this irc buffer
<godd2>
shevy keep in mind Ive only ever used a command line to navigate a file system and run a program or two. nothing more sophisticated than that
<pontiki>
i've never tried running rails console inside emacs shell, but it might be cool
<godd2>
shevy I guess what I'm asking is, what can MSYS do that cmd cant? after all, it looks like they can both navigate file systems and i can run a program from them
jonr22 has quit [Ping timeout: 272 seconds]
<supermanYellow>
Umm, i have a question , how do you run the emacs shell as login shell. other than that rails c doesnot run
existensil has joined #ruby
abuzze has quit [Read error: Connection reset by peer]
TPBallbag has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
abuzze has joined #ruby
lolmaus has joined #ruby
<pontiki>
it's working super fine for me, just tried it out
* supermanYellow
retrying
<godd2>
supermanYellow are you inside your rails app root?
goodenough has quit [Remote host closed the connection]
<pontiki>
rails console doesn't care if it's running in a login shell or not...
<supermanYellow>
oh eff. the bundle install isn't complete yes. yes. i am inside my app root, i can see the app/ bin/ config/ directories
<supermanYellow>
ow
goodenough has joined #ruby
rshetty has joined #ruby
<supermanYellow>
I did see some error .. but I can't remember what.
TPBallbag has quit [Ping timeout: 264 seconds]
<supermanYellow>
This tmux video a 5:58 is awsome
<godd2>
supermanYellow :)
mengu has joined #ruby
<supermanYellow>
(y)
<godd2>
There's lots of awesome rubyconf and railsconf talks on youtube.
dumdedum has joined #ruby
adac has joined #ruby
<godd2>
One of my favorites is Rich Hickey (creator of Clojure) giving a talk at RailsConf about simplicity.
ClarusCogitatio has quit [Ping timeout: 244 seconds]
<gregf__>
haha, confreaks
<gregf__>
pontiki++
ClarusCogitatio has joined #ruby
<hanmac1>
hm does Complex-Domains in Rails have an ı-Part too? ;P
moritzs has joined #ruby
mikecmpb_ has joined #ruby
AkashicLegend has joined #ruby
ephemerian has joined #ruby
Alina-malina has quit [Ping timeout: 244 seconds]
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Alina-malina has joined #ruby
Alina-malina has quit [Changing host]
Alina-malina has joined #ruby
elaptics`away is now known as elaptics
<banister_>
hanmac1 you're awake too early, go back to sleep
<banister_>
;)
mikecmpbll has quit [Ping timeout: 245 seconds]
psy_ has joined #ruby
<hanmac1>
banister_: my local time is 10:30 ... i am awake since 5:30
<banister_>
hanmac1 why awake so early? (5:30)
AlexRussia has quit [Quit: WeeChat 1.1-dev]
<hanmac1>
because i normaly begin to work at 7:00
AlexRussia has joined #ruby
oo_ has quit [Remote host closed the connection]
<banister_>
hanmac1 really? you mean you work in your own time or you have to actually be at office by 7am ?
<banister_>
that's crazy
<DLSteve>
banister_, It's 4:32 am where I am at >.>
oo_ has joined #ruby
oo_ has quit [Read error: Connection reset by peer]
<banister_>
DLSteve haha, and why are you awake so early? :)
<banister_>
let me guess, u haven't slept yet?
<banister_>
stil up smoking weed and watching anime? ;)
emmesswhy has joined #ruby
oo_ has joined #ruby
<DLSteve>
banister_, It's my off day I actually slept in :-P I usualy get up at 3am to be at work by 4.
JohnBat26 has joined #ruby
<banister_>
DLSteve interesting, what kind of work is that?
Boohbah has joined #ruby
St_Marx has joined #ruby
<hanmac1>
banister_: currently i am working form workplace again again, and i am early at work (7:00) because so i can go early home again
<DLSteve>
banister_, I work for a retail chain in logistics.
<lugub>
if I'm wanting to use a website which uses scrubbed data from soundcloud - I could host the site with rails but do the actual hosting with rails right?
Boohbah is now known as Guest34823
axl_ has joined #ruby
St_Marx has quit [Remote host closed the connection]
Guest34823 has quit [Write error: Connection reset by peer]
<banister_>
hanmac1 i dont' start work until 10am, sometimes even later :D (in fact i can more or less work my own hours :)
<DLSteve>
banister_, Honestly though I like getting up early as it is nice and quite, also starbucks opens at 5 am :-P
<banister_>
DLSteve cool, how does ruby figure into that?
zartoosh has quit [Changing host]
zartoosh has joined #ruby
dreamfighter has quit [Changing host]
dreamfighter has joined #ruby
Darryl_ has quit [Changing host]
Darryl_ has joined #ruby
noop has quit [Changing host]
noop has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<banister_>
DLSteve i woke up this morning at 8:30am, that's the earliest i've got up in about 3 years :)
andikr has quit [Changing host]
andikr has joined #ruby
goshdarnyou has quit [Changing host]
goshdarnyou has joined #ruby
<DLSteve>
banister_, It doesn't, ruby is a hobby of mine right now, In the process of learning rails.
bayed has quit [Changing host]
bayed has joined #ruby
<banister_>
DLSteve oh cool, want to make a career change or just keep ruby as a hobby?
anarang has quit [Changing host]
anarang has joined #ruby
Juanchito has quit [Changing host]
Juanchito has joined #ruby
<DLSteve>
banister_, I do freelance web design for extra money and was looking at geting into full time web dev.
snovity has joined #ruby
<banister_>
DLSteve nice, there's a bunch of remote positions for ruby devs these days, those are the sweetest deal if you can land one IMO
sinkensabe has quit [Read error: Connection reset by peer]
tlarevo_ has quit [Read error: Connection reset by peer]
Alina-malina has quit [Ping timeout: 244 seconds]
tlarevo has joined #ruby
Alina-malina has joined #ruby
ghr has joined #ruby
timonv_ has quit [Ping timeout: 250 seconds]
b1nd has quit [Ping timeout: 255 seconds]
ghr has quit [Client Quit]
<DLSteve>
banister_, Yah that would be awesome, as where I live is nice and cheap but is a bit of a drive from all the tech jobs.
b1nd has joined #ruby
<banister_>
DLSteve nice, get a remote job based in NYC/SF, they usually pay around 85K+/year even for an entry level position
sinkensabe has joined #ruby
<DLSteve>
banister_, That would work as they are in the same timezone as me.
<banister_>
NYC and SF are not in the same timezone ;)
soasme has quit [Quit: Leaving...]
<DLSteve>
NYC I meant :-P
DrCode has joined #ruby
<DLSteve>
SF would be a 3 hour delay
reinaldob has quit [Ping timeout: 260 seconds]
<DLSteve>
Of course I am ahead so I would get to sleep in!
klaut has quit [Remote host closed the connection]
<hanmac1>
banister_: hm maybe i will do that later ... first i need to push my rwx project a bit more and get co-workers for it (2 workers already look 100% more better than 1 worker ;P )
Scotteh has quit [Ping timeout: 244 seconds]
<DLSteve>
rwx project?
existensil has joined #ruby
<hanmac1>
DLSteve: wxWidgets binding for ruby ... like wxRuby reloaded ;P
<DLSteve>
ah ok
<hanmac1>
is for desktop gui developing
<DLSteve>
just looked it up :-P, so it is along the lines of QT.
<shevy>
or ruby-gnome!
marr has joined #ruby
<hanmac1>
DLSteve: recently wxWidgets got a QT-port too ...
nfk has joined #ruby
<DLSteve>
haha
<banister_>
hanmac1 nice
<DLSteve>
Looks nice as it uses native API for the interfaces instead of just making one up.
Alina-malina has quit [Ping timeout: 264 seconds]
livathin_ has joined #ruby
niKeITA is now known as niKeITA_away
niKeITA_away is now known as niKeITA
timonv_ has joined #ruby
<DLSteve>
ill bbl, going to starbucks
DLSteve has quit [Quit: Leaving]
livathinos has quit [Ping timeout: 250 seconds]
lugub has quit [Quit: Bye]
<soahccc>
Anyone knows what Ctrl-C in a telnet windows sends to the remote? In Ruby I get two lines of input but the first is ???? and the second is ??
kyb3r_ has quit [Quit: Leaving]
anarang_ has joined #ruby
livathin_ has quit [Remote host closed the connection]
Takle_ has quit [Remote host closed the connection]
anarang has quit [Ping timeout: 250 seconds]
goodenough has quit [Remote host closed the connection]
tvw has joined #ruby
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
dANO_ has joined #ruby
livathinos has joined #ruby
mengu has quit [Remote host closed the connection]
<jhass>
soahccc: print the .bytes of the received input
dANO_ has quit [Client Quit]
<soahccc>
hmm [255, 244, 255, 253, 6] and [255, 251, 6] but I think I'm not going to handle it... Telnet is just a fallback option if you don't have the ruby client
dANO_ has joined #ruby
Hobogrammer has quit [Ping timeout: 250 seconds]
relix has joined #ruby
<jhass>
255 says here comes a telnet command
<jhass>
244 is IP, Interrupt process
<jhass>
253 6 says some expected response or so
<jhass>
251 says he'll do 6, not sure what 6 is yet
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<jhass>
apparently user defined on the protocol level
<soahccc>
zenspider: I'm working on a socket command server. I try to use unix sockets but it fallbacks to TCP and in that case you can connect via telnet as well (not as pretty, but you could invoke stuff) without the need of the ruby client script
wallerdev has quit [Ping timeout: 250 seconds]
Musashi007 has quit [Quit: Musashi007]
<soahccc>
zenspider: It's just a bit annoying that if you press Ctrl-C nothing happens and you have to press enter twice (to send the two messages) until you can send a normal command again
niKeITA is now known as niKeITA_away
vyorkin has joined #ruby
niKeITA_away is now known as niKeITA
<zenspider>
are you trying to ^c your local process?
arup_r_ has joined #ruby
TPBallbag has joined #ruby
<shevy>
zenspider is very inquisitive today :)
<shevy>
soahccc I remember the good old days where folks played MUDs via telnet
<shevy>
man that was awful ...
DaniG2k has joined #ruby
arup_r has quit [Ping timeout: 250 seconds]
rshetty has quit [Remote host closed the connection]
<soahccc>
zenspider: well I actually just don't know how to press the telnet escape character on a german keyboard and I always try to press it to "get out of there" :)
<shevy>
I will wait until LEDs become super-cheap and super-widespread so you can have them all in your flat for very little extra cost
<shevy>
or rather OLEDs
niKeITA_away is now known as niKeITA
DjDeaf has quit [Remote host closed the connection]
klaut has joined #ruby
Spami has joined #ruby
andrewlio has joined #ruby
DjDeaf has joined #ruby
sk87 has joined #ruby
Macaveli_ has joined #ruby
klaut has quit [Remote host closed the connection]
Spami has quit [Client Quit]
godd2 has quit [Ping timeout: 264 seconds]
Macaveli has quit [Ping timeout: 240 seconds]
reinaldob has joined #ruby
Takle has joined #ruby
Macaveli_ has quit [Read error: Connection reset by peer]
Macaveli has joined #ruby
fsapo has joined #ruby
ChoiKyuSang has joined #ruby
anarang_ has quit [Ping timeout: 264 seconds]
larsam has joined #ruby
Fire-Dragon-DoL has joined #ruby
DjDeaf has quit [Remote host closed the connection]
Macaveli has quit [Client Quit]
leslie2 has joined #ruby
timonv_ has joined #ruby
sigurding has quit [Quit: sigurding]
leslie1 has quit [Ping timeout: 255 seconds]
DjDeaf has joined #ruby
supermanYellow is now known as superSadFace
Takle has quit [Remote host closed the connection]
<arup_r_>
In my file I wrote require_relative '../../models/product_1.rb' require_relative '../../models/product_2.rb' require_relative '../../models/product_3.rb' .. How can I write it in one line ? require_relative '../../models/*.rb' didn't work
wallerdev has joined #ruby
anarang_ has joined #ruby
Takle has joined #ruby
Imofftopic has joined #ruby
theotherstupidgu has quit [Ping timeout: 245 seconds]
zly has quit [Changing host]
zly has joined #ruby
klaut has joined #ruby
zly has quit [Quit: Reconnecting]
zly has joined #ruby
zly has quit [Changing host]
zly has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
klaut has quit [Remote host closed the connection]
Macaveli has joined #ruby
niKeITA is now known as niKeITA_away
niKeITA_away is now known as niKeITA
theotherstupidgu has joined #ruby
Dude007 has joined #ruby
wallerdev has quit [Ping timeout: 244 seconds]
Imofftopic has quit [Client Quit]
shredding has quit [Quit: shredding]
RitterJack has quit [Remote host closed the connection]
krz has joined #ruby
ixti has joined #ruby
moritzs has quit [Remote host closed the connection]
<hanmac1>
arup_r_: you cant because you cant trust the order
Soda has joined #ruby
<arup_r_>
Ok,,, So I need to do the way I am doing now.. No one liner?
<hanmac1>
i would say this: Dir['../../models/*.rb'].sort.each {|s| require_relative s }
arup_r_ has quit [Remote host closed the connection]
theotherstupidgu has quit [Ping timeout: 255 seconds]
davidhq has joined #ruby
josephndenton has joined #ruby
mengu has joined #ruby
theotherstupidgu has joined #ruby
niKeITA is now known as niKeITA_away
niKeITA_away is now known as niKeITA
fabrice31 has quit [Remote host closed the connection]
josephndenton has quit [Ping timeout: 245 seconds]
tuelz has quit [Quit: WeeChat 1.0]
jenrzzz_ has quit [Ping timeout: 255 seconds]
_whitelogger has quit [Ping timeout: 256 seconds]
_whitelogger has joined #ruby
drPoggs has joined #ruby
TPBallbag has joined #ruby
arup_r has joined #ruby
charliesome has joined #ruby
francisfish has joined #ruby
anarang has joined #ruby
<wasamasa>
/away works perfectly fine without having to change your nickname
<shevy>
it is useful because basically you just search for the relevant exams, and if you are lucky you can simply download these
<shevy>
obviously that is a php page
<shevy>
I grew fond of the design of pages like that. There are many other pages that are also student pages, and provide something similar, but they suck
atmosx has joined #ruby
<shevy>
since that student is no longer active, others could want to take over
<shevy>
but I'll never maintain php code myself so it would not be me
Takle has joined #ruby
<shevy>
now I could look at the source of that html/css and probably manually extract all parts that are important
lkba has joined #ruby
<shevy>
but I figured I might need to do this again eventually
<shevy>
so anything that could be automatized would be helpful
Takle has quit [Remote host closed the connection]
timgauthier_away is now known as Timgauthier
spastorino has joined #ruby
wallerdev has joined #ruby
<pontiki>
are you just looking to scrape and republish the page somehow?
oo_ has quit [Remote host closed the connection]
banister has quit [Ping timeout: 264 seconds]
Spami has joined #ruby
oo_ has joined #ruby
koderok has quit [Quit: koderok]
niKeITA has quit [Quit: ZZZzzz…]
wallerdev has quit [Ping timeout: 250 seconds]
aaronrl has quit [Ping timeout: 245 seconds]
oo_ has quit [Ping timeout: 264 seconds]
<soahccc>
Does one know about a collection of cinch plugins? Could find much more than the examples
workmad3 has quit [Ping timeout: 255 seconds]
Darryl_ has quit [Quit: Connection closed for inactivity]
jottr has joined #ruby
<arup_r>
hanmac1: Why #sort is needed here? Dir['../../models/*.rb'].sort.each {|s| require_relative s } What is the significance ?
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<hanmac1>
arup_r: you can not trust file system order
Virtualize|away has joined #ruby
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<arup_r>
But not clear.. I am requiring all files at the top of the script then.. using the module or classes whatever.. But then why does it matter - "The order" ?
kp666 has quit [Read error: Connection reset by peer]
<hanmac1>
arup_r: " Note that case sensitivity depends on your system (so File::FNM_CASEFOLD is ignored), as does the order in which the results are returned."
<hanmac1>
arup_r: if your models have dependencies between each other you might get problems
larsam has joined #ruby
<arup_r>
Ahh! makes sense now.. *dependency between requiring files.."
<arup_r>
hanmac1: Thanks for your time...
krz has quit [Quit: WeeChat 1.0.1]
jottr has quit [Ping timeout: 244 seconds]
tlarevo has quit [Remote host closed the connection]
banister has joined #ruby
ptrrr has joined #ruby
Takle has joined #ruby
Takle has quit [Read error: Connection reset by peer]
Takle_ has joined #ruby
kaspergr_ has joined #ruby
kaspergrubbe has quit [Read error: Connection reset by peer]
rshetty has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
anarang has quit [Quit: Leaving]
zorak8 has quit [Ping timeout: 244 seconds]
charliesome has quit [Quit: zzz]
tlarevo has joined #ruby
DaniG2k has quit [Quit: leaving]
sk87 has joined #ruby
aaronrl has joined #ruby
psy_ has quit [Remote host closed the connection]
<shevy>
pontiki hmm in the short term I guess so, but in the long run I think I need to transform the dumped html into my autogenerator
<shevy>
where <div style="color:blue; border: 1px solid green">hey there</div>" would become something like div('blue 1px_solid_green') { 'hey there' } ... or something like that
Hightower666 has joined #ruby
<shevy>
I need to clear my mind first, it's not clear yet what I really need or want
danjordan has quit [Quit: danjordan]
triple_b has joined #ruby
danjordan has joined #ruby
gr33n7007h has quit [Quit: Leaving]
jenrzzz has joined #ruby
klaut has joined #ruby
SouL has quit [Ping timeout: 264 seconds]
michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby
michael_mbp has quit [Excess Flood]
<shevy>
hey Timgauthier what's up
<Timgauthier>
hey hey
<Timgauthier>
back in germany, passed my basic german test, playing vidjeo games and pretending to know what the hell i'm doing
michael_mbp has joined #ruby
<Timgauthier>
you?
triple_b has quit [Ping timeout: 264 seconds]
<Timgauthier>
dropshare stopped working :()
<shevy>
wheee
<shevy>
now I can talk to you in bavarian slang!
<Timgauthier>
ew
<Timgauthier>
:P
ndrei__ has joined #ruby
<Timgauthier>
no, saschen bitte
<shevy>
no please
<Timgauthier>
besides, its only A1
jenrzzz has quit [Ping timeout: 256 seconds]
<shevy>
bavarian german is the only german dialect we from austria can accept to hear
<shevy>
and sächsisch is the most horrible of them all
<Timgauthier>
haha
<Timgauthier>
why is my dropshare broken :(
<shevy>
I only know dropbox
TPBallbag has quit [Remote host closed the connection]
<shevy>
are you still using ruby?
<Timgauthier>
i need to reinstall the actual release of yosemite, my safari dies after sleeping
<Timgauthier>
no, .erb
<shevy>
or have you abandoned towards pph
<Timgauthier>
;)
<shevy>
php
flak has joined #ruby
<shevy>
you need to come to linux!
flak is now known as Guest18765
<Timgauthier>
my current projects are in. middleman (2x) kirby (php), and craftcms (php but you don't write php at all)
<shevy>
then you can randomly break shit and try to figure out how to rescue this crap
<Timgauthier>
naw
<Timgauthier>
i enjoy it enough on mac
<shevy>
hehe
<shevy>
one day I shall learn rails...
<Timgauthier>
yeah?
<Timgauthier>
why would you do that to yourself
<Timgauthier>
i need to restart my shitty computer :(I
reinaldob has quit [Remote host closed the connection]
jxf has joined #ruby
Takle has quit [Remote host closed the connection]
elcheckito has joined #ruby
User458764 has quit [Ping timeout: 245 seconds]
ndrei has joined #ruby
jottr has joined #ruby
sk87 has joined #ruby
oo_ has joined #ruby
<unshadow>
Is there a way to replace multiple items in a string ? like this: a = "cat dog snake fish" now replace cat and snake to "tree" so a is now "tree dog tree fish", I know you can do those one by one with: a.gsub("cat","tree").gsub("snake
arup_r_ has quit [Remote host closed the connection]
<unshadow>
","tree")
DjDeaf has joined #ruby
tier has joined #ruby
<gregf__>
prolly /(cat|dog)/, "tree"
<gregf__>
>> "cat dog snake fish".gsub!(/(cat|dog)/, "tree" )
<hanmac1>
Eduard_Munteanu: can you make a gist of the Gemfile or a link to the prossible repository?
Timgauthier is now known as timgauthier_away
wallerdev has joined #ruby
croOoOoak has joined #ruby
<hanmac1>
Eduard_Munteanu: that source is blocked now because of security issues ... so it should generate https sources now or your script or what ever need to be updated
<hanmac1>
apeiros: croOoOoak spambot
<Eduard_Munteanu>
Right, thanks.
niKeITA has joined #ruby
<Eduard_Munteanu>
Congrats to Rubyists for implementing verified downloads, by the way.
<Eduard_Munteanu>
So much other stuff doesn't. :(
cpruitt has joined #ruby
sigurding has quit [Quit: sigurding]
josephndenton has quit [Ping timeout: 240 seconds]
sigurding has joined #ruby
reinaldob has joined #ruby
rippa has joined #ruby
Kricir has quit [Remote host closed the connection]
jenrzzz has joined #ruby
wallerdev has quit [Ping timeout: 245 seconds]
freezey has joined #ruby
timonv__ has quit [Remote host closed the connection]
Channel6 has joined #ruby
gr33n7007h has quit [Ping timeout: 264 seconds]
davedev24_ has joined #ruby
zartoosh has quit [Remote host closed the connection]
<hanmac1>
hm i need to check if my gems are signed/verified too ... hm as far as i knew i think they are not ... (or are they?)
sailias has joined #ruby
red_horned_rihno has joined #ruby
msmith_ has joined #ruby
phutchins has joined #ruby
<Eduard_Munteanu>
hanmac1, bundle/gem seems to download over https only
haroldwu has quit [Ping timeout: 250 seconds]
Wolland has joined #ruby
klaut has quit [Remote host closed the connection]
beef-wellington has joined #ruby
<Eduard_Munteanu>
I just got spammed by croOoOoak.
ruber has quit [Quit: BitchX: the ONLY three day cure!]
gizmore has joined #ruby
haroldwu has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
freezey has quit [Ping timeout: 245 seconds]
Akuma has quit [Quit: So long sukkas!]
freezey has joined #ruby
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tvw has quit [Remote host closed the connection]
Wolland has quit [Ping timeout: 240 seconds]
adac has quit [Quit: Leaving]
rostam has joined #ruby
Virtualize|away has quit [Read error: Connection reset by peer]
virt|work has joined #ruby
rshetty has joined #ruby
mdarby_ is now known as mdarby
fsapo has quit [Ping timeout: 250 seconds]
<hanmac1>
Eduard_Munteanu: i already ping apeiros he might be able to kick it
<hanmac1>
banister: hm doesnt you have OP rights in this channel there too?
oleo has joined #ruby
banister is now known as banisterfiend
vyorkin has joined #ruby
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
alem0lars|away is now known as alem0lars
ta has quit [Read error: Connection reset by peer]
croOoOoak was banned on #ruby by banisterfiend [*!~roak@84.78.23.203]
croOoOoak was kicked from #ruby by banisterfiend [Your behavior is not conducive to the desired environment.]
mary5030 has joined #ruby
<cpruitt>
I’m drawing a blank on the right search term to use for search. Am I misremembering or is there a feature in ruby where text “data” can be included at the end of a ruby file after the end of the executable code?
<cpruitt>
banisterfiend: That’s the one. Thanks. :-)
rshetty has quit [Ping timeout: 264 seconds]
gr33n7007h has joined #ruby
timonv_ has joined #ruby
<Nilium>
Huh, I did not know you could do that, and I've been using Ruby long enough that I feel like I should've O_o
rismoney1 has quit [Ping timeout: 264 seconds]
moritzs has joined #ruby
mattstratton has joined #ruby
Darryl_ has joined #ruby
drawingthesun has quit [Ping timeout: 272 seconds]
zz_jrhorn424 is now known as jrhorn424
klaut has quit [Remote host closed the connection]
Channel6 has quit [Quit: Leaving]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
Jon30 has quit []
banister has joined #ruby
snath has quit [Ping timeout: 245 seconds]
banister has quit [Max SendQ exceeded]
viet_power has quit [Ping timeout: 250 seconds]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
mikepack has joined #ruby
banister has joined #ruby
last_staff has quit [Quit: last_staff]
banister has quit [Max SendQ exceeded]
mikepack has quit [Remote host closed the connection]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
Akuma has joined #ruby
julian37 has joined #ruby
banister has joined #ruby
banister has quit [Max SendQ exceeded]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
jrhorn424 is now known as zz_jrhorn424
<julian37>
hi, I have this problem where ruby(2.1.3)+rspec+capybara+poltergeist sometimes just exits silently -- exit code 0, nothing in the logs, nothing on STDOUT. google comes up empty. how could I go about diagnosing this?
banister has joined #ruby
<julian37>
is there a flag to make ruby be verbose about which signals it receives?
banister has quit [Max SendQ exceeded]
banister has joined #ruby
jzinedine has joined #ruby
banister has quit [Max SendQ exceeded]
IceDragon has quit [Quit: Space~~~]
IcyDragon has joined #ruby
nucatus has joined #ruby
IcyDragon is now known as IceDragon
<hanmac1>
apeiros: banister is having MaxSendQ problems again ... ;P
banister has joined #ruby
banister has quit [Max SendQ exceeded]
zorak8 has quit [Ping timeout: 245 seconds]
banister has joined #ruby
zz_jrhorn424 is now known as jrhorn424
kaspertidemann has joined #ruby
gr33n7007h has quit [Changing host]
gr33n7007h has joined #ruby
freezey has quit [Remote host closed the connection]
nrsk has joined #ruby
enebo has joined #ruby
rodfersou has joined #ruby
TPBallbag has joined #ruby
az7ar_away is now known as az7ar
nateberkopec has quit [Quit: Leaving...]
_1_Dog has joined #ruby
tlarevo has quit [Remote host closed the connection]
oleo is now known as Guest35719
oleo__ has joined #ruby
sevenseacat has quit [Quit: Leaving.]
mleone has quit [Ping timeout: 245 seconds]
banister has quit [Read error: Connection reset by peer]
banister has joined #ruby
Guest35719 has quit [Ping timeout: 244 seconds]
Kricir has joined #ruby
Takle has quit [Remote host closed the connection]
<hanmac1>
welcome back banister ;P
<banister>
thx
<hanmac1>
i see you did had "MaxSendQ" problems again
Akuma has quit [Quit: So long sukkas!]
jaequery has joined #ruby
mkaesz has joined #ruby
timgauthier_away is now known as Timgauthier
Hijiri has quit [Quit: WeeChat 1.0.1]
Akuma has joined #ruby
bluenemo has joined #ruby
allcentury has joined #ruby
danjordan has quit [Quit: danjordan]
paulfm has quit [Ping timeout: 265 seconds]
_1_Dog has quit [Quit: WhatsChat IRC Android APP]
paulfm has joined #ruby
rshetty has joined #ruby
freezey has joined #ruby
shredding has quit [Quit: shredding]
mengu has quit []
mikepack has joined #ruby
louism2wash has joined #ruby
tagrudev has quit [Remote host closed the connection]
jimmyhoughjr has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
rshetty has joined #ruby
Takle has quit [Remote host closed the connection]
<jonathan_alban>
DjDeaf I found the Pragmatic Programmers guide explained it very well. Also the Poignant Guide to Ruby has some really good ways of explaining things. I've had a number of AHA moments reading it
fabrice31 has quit [Remote host closed the connection]
spyderman4g63 has quit [Remote host closed the connection]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
<txdv>
go tell duschendestroyer and co, they will probably help you
jaequery has joined #ruby
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Virtualize|away has joined #ruby
User458764 has joined #ruby
skolman_ has joined #ruby
moritzs has quit [Ping timeout: 244 seconds]
zz_jrhorn424 is now known as jrhorn424
Ankhers has joined #ruby
skolman_ has quit [Remote host closed the connection]
michael_mbp has quit [Excess Flood]
thegmanehack has joined #ruby
workmad3 has quit [Ping timeout: 258 seconds]
skolman has joined #ruby
skolman has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
skolman_ has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
michael_mbp has joined #ruby
<thegmanehack>
open question, has any taken the "ruby programmer silver" certification? I realize most thing the certification is a joke, but I am required to take it. Was wondering if anyone had any suggested study material.
Virtualize|away has quit [Read error: Connection reset by peer]
red_horned_rihno has quit [Quit: Leaving]
louism2wash has quit [Quit: This computer has gone to sleep]
rfi has quit [Ping timeout: 255 seconds]
Wolland has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
rfi has joined #ruby
louism2wash has joined #ruby
siwica has joined #ruby
hmsimha_ has quit [Ping timeout: 255 seconds]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Client Quit]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
gr33n7007h has joined #ruby
supermanBlack has joined #ruby
supermanBlack is now known as shortCircuit__
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Client Quit]
aganov has quit [Quit: Leaving]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
Phonetiki has joined #ruby
thegmanehack has left #ruby [#ruby]
<Phonetiki>
hey
otherj has quit [Quit: .]
kaspertidemann has quit []
Wolland has quit [Ping timeout: 240 seconds]
thegmanehack has joined #ruby
tier_ has joined #ruby
CustosLimen has joined #ruby
_maes_ has joined #ruby
klaut has joined #ruby
byprdct_ has joined #ruby
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
otherj has joined #ruby
byprdct has quit [Ping timeout: 265 seconds]
preller has quit [Ping timeout: 245 seconds]
otherj has quit [Client Quit]
tier has quit [Ping timeout: 244 seconds]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Takle has joined #ruby
iamjarvo has joined #ruby
balazs has joined #ruby
SouL_ has joined #ruby
tier_ has quit [Remote host closed the connection]
tier has quit [Read error: Connection reset by peer]
tier has joined #ruby
Areessell_ has joined #ruby
renderful has quit [Remote host closed the connection]
<siwica>
I have an object foo1 containing a list of objects foo2 each containing a list of objects type foo3, each object foo3 has a value foo3.x. Whats the best method of finding the lowest value of x in foo1?
ixti has quit [Ping timeout: 265 seconds]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
niKeITA has quit [Quit: ZZZzzz…]
gr33n7007h has quit [Changing host]
gr33n7007h has joined #ruby
chudler has left #ruby ["ISON kauffman@irc.cs.uchicago.edu NickServ"]
gsd has joined #ruby
Timgauthier is now known as timgauthier_away
Ankhers has quit [Remote host closed the connection]
<eam>
siwica: if I'm understanding you correctly, you want to flatten your nested arrays. You can use #flatten for this
<eam>
and to find the lowest value: #min_by
niKeITA has joined #ruby
moritzs has joined #ruby
ta has joined #ruby
ypasmk has joined #ruby
jrhorn424 is now known as zz_jrhorn424
vyorkin has quit [Quit: WeeChat 1.0.1]
Ankhers has joined #ruby
otherj has quit [Quit: .]
Phonetiki has quit [Quit: Disconnected]
livathinos has quit []
TomyWork has quit [Ping timeout: 250 seconds]
terlar has quit [Ping timeout: 272 seconds]
himsin has joined #ruby
rylev_ has joined #ruby
mpajor has quit [Ping timeout: 272 seconds]
julian37 has quit [Ping timeout: 240 seconds]
rylev has quit [Ping timeout: 265 seconds]
rylev has joined #ruby
sk87 has joined #ruby
doev has quit [Quit: Verlassend]
bruno- has joined #ruby
bruno- has quit [Client Quit]
larissa has joined #ruby
SouL_ has quit [Ping timeout: 260 seconds]
Soda has quit [Quit: Soda]
devdazed has quit [Read error: Connection reset by peer]
devdazed_ has joined #ruby
sk87 has quit [Client Quit]
tlarevo has joined #ruby
mpajor has joined #ruby
spyderman4g63 has joined #ruby
klaut has quit [Remote host closed the connection]
rylev_ has quit [Ping timeout: 272 seconds]
ypasmk has quit [Quit: ypasmk]
Pupeno has joined #ruby
Pupeno has joined #ruby
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<gregf__>
siwica: what eam said. something like : foo1.foo2.arroffoo3.min_by{ |obj| obj.x } ?
<siwica>
I am looking for something for an arbitrary nestting depth
dkb20k has joined #ruby
triple_b has joined #ruby
josephndenton has joined #ruby
mikecmpb_ is now known as mikecmpbll
<siwica>
eam: its not a matter of flattening an array, foo1, foo2, ... are objects and have other variables, too
Xeago has joined #ruby
troyready has joined #ruby
kamil has joined #ruby
djbkd has joined #ruby
TPBallbag has quit [Remote host closed the connection]
bricker has joined #ruby
djbkd_ has quit [Ping timeout: 265 seconds]
thagomizer has joined #ruby
josephndenton has quit [Ping timeout: 250 seconds]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mattmcclure has joined #ruby
nichtdiebohne has joined #ruby
timonv_ has quit [Remote host closed the connection]
sk87 has joined #ruby
devdazed_ has quit [Remote host closed the connection]
dkb20k has quit [Ping timeout: 244 seconds]
devdazed has joined #ruby
sk87 has quit [Client Quit]
Eduard_Munteanu has quit [Ping timeout: 272 seconds]
rylev has quit [Remote host closed the connection]
kaspergr_ has quit [Remote host closed the connection]
Hijiri has quit [Quit: WeeChat 1.0.1]
HolyWinner has quit [Quit: Nettalk6 - www.ntalk.de]
ndrei has quit [Ping timeout: 258 seconds]
einarj_ has joined #ruby
kaspertidemann has joined #ruby
qba73 has quit []
rshetty has quit [Remote host closed the connection]
TPBallbag has joined #ruby
rylev has joined #ruby
einarj has quit [Ping timeout: 255 seconds]
<jhass>
siwica: maybe you want the composite pattern?
shortCircuit__ has quit [Ping timeout: 258 seconds]
wallerdev has joined #ruby
TPBallbag has quit [Remote host closed the connection]
Wolland has joined #ruby
jottr_ has joined #ruby
renderful has joined #ruby
speakingcode has quit [Ping timeout: 265 seconds]
<siwica>
jhass: maybe, what is that?
<jhass>
wikipedia it
jottr has quit [Ping timeout: 265 seconds]
TinkerTyper has joined #ruby
jjasonclark has joined #ruby
Takle has quit [Remote host closed the connection]
chthon has quit [Ping timeout: 260 seconds]
kwd has quit [Ping timeout: 272 seconds]
mistermocha has joined #ruby
happyface_ is now known as happyface
<siwica>
jhass: ok, but my datastructure is fix, and cant be changed
<jhass>
why?
shortCircuit__ has joined #ruby
<siwica>
jhass: time issues
<siwica>
:)
<jhass>
so you waste time finding an ugly workaround instead
<siwica>
In that particular case, yes
wallerdev has quit [Ping timeout: 264 seconds]
<jhass>
hf
<siwica>
I have to make a whole project work till tuesday next week
<pontiki>
then it can break?
<eam>
siwica: if you have weird constraints you should share code to illustrate them
timgauthier_away is now known as Timgauthier
<eam>
otherwise we end up playing 20 questions
Timgauthier is now known as timgauthier_away
dANO_ has quit []
<pontiki>
or just not responding after a while
jottr_ has quit [Ping timeout: 265 seconds]
Xeago has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: i've nodded off.]
pietr0 has joined #ruby
ghostmoth has joined #ruby
olivier_bK has quit [Ping timeout: 250 seconds]
mistermocha has quit [Ping timeout: 256 seconds]
Xeago has joined #ruby
Hobogrammer has joined #ruby
jonr22 has joined #ruby
speakingcode has joined #ruby
rylev has quit [Remote host closed the connection]
einarj_ has quit [Remote host closed the connection]
Wolland has quit [Remote host closed the connection]
KC9YDN has joined #ruby
hornairs has joined #ruby
Timgauthier is now known as timgauthier_away
freezey has quit [Remote host closed the connection]
Wolland has joined #ruby
chipotle has quit [Ping timeout: 245 seconds]
iwishiwerearobot has quit [Remote host closed the connection]
drPoggs has quit [Ping timeout: 256 seconds]
KC9YDN-2 has joined #ruby
drPoggs has joined #ruby
jottr_ has quit [Ping timeout: 256 seconds]
rshetty has quit [Ping timeout: 255 seconds]
beneggett has joined #ruby
last_staff has joined #ruby
timonv_ has joined #ruby
KC9YDN has quit [Ping timeout: 245 seconds]
Wolland has quit [Ping timeout: 250 seconds]
shortCircuit__ is now known as ohNoo
lkba has joined #ruby
b1nd has quit [Ping timeout: 264 seconds]
altamic has joined #ruby
altamic has joined #ruby
b1nd has joined #ruby
<siwica>
ok in my specific case I have A Class "Geometry", a Geometry has an attribute mesh_parts (array of elements each being of class "Mesh"), each mesh has an attribute mesh_polygons (array of elements each being of class "Polygon"), each polygon has an attribute points (array of elements each being of class "Point", each Point has the attributes x,y,z.
<siwica>
I want to find the lowest z.coordinate of a geometry
chrisja has joined #ruby
<siwica>
*z-coordinate
shredding has joined #ruby
rodfersou has quit [Read error: Connection reset by peer]
rodfersou has joined #ruby
<siwica>
jhass: with composite pattern I could use a simple recursion?
moritzs has joined #ruby
<jhass>
you would implement a min_z_coordinate in each class
linojon has quit [Quit: linojon]
<jhass>
Point simply returns z
lsmola has quit [Ping timeout: 264 seconds]
axl_ has joined #ruby
Areessell_ has quit [Quit: (null)]
<jhass>
Polygon does points.min_by(&:min_z_coordinate)
<jhass>
or .map.min if you want just the value
pyon has quit [Ping timeout: 265 seconds]
<jhass>
Mesh would do polygons.min_by(&:min_z_coordinate)
<jhass>
and so on
<jhass>
then you simply can call it
<niKeITA>
how to check if a webpage contain a youtube video? (and scrape the url)
<eam>
siwica: do you want the z coordinate or do you want the Geometry which contains the least z coordinate?
<jhass>
and if you add other layers or types later, you at most need to implement an additional method and maybe change one
<siwica>
eam: I want the z-coordinate
<siwica>
jhass: ok, that sounds reasonable
<siwica>
how would you implement that in ruby?
<jhass>
just do it
<siwica>
^^
<siwica>
just additional methods for each class?
jerematic has quit [Remote host closed the connection]
<siwica>
or would you abstract it away somehow?
Spami has quit [Quit: This computer has gone to sleep]
<jhass>
no, just methods
<jhass>
we don't need an inheritance chain for this pattern in ruby
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<siwica>
ok, thats easy
<siwica>
it makes sense
axl_ has quit [Ping timeout: 256 seconds]
<siwica>
sorry for being stubborn at the beginning
linojon has joined #ruby
ohNoo has quit [Ping timeout: 264 seconds]
<siwica>
thank you
<jhass>
you're welcome
ramfjord has quit [Ping timeout: 244 seconds]
RitterJack has quit [Remote host closed the connection]
aewffwea has quit [Ping timeout: 256 seconds]
ohNoo has joined #ruby
mityaz has joined #ruby
ohNoo is now known as shortCircuit__
<siwica>
jhass: I my case I need min and max for each of the three coordinates, would you have 6 methods in this case or abstract it into one?
<jhass>
depends, do you always need both?
<jhass>
for all coords?
<siwica>
jhass: no
Wolland has joined #ruby
<siwica>
jhass: mostly just either one of these
i_s has joined #ruby
<jhass>
mmh, I'd probably extract into a helper to generate them
<jhass>
let me play around a bit
<siwica>
jhass: actually I am asking this for ruby without rails
<jhass>
didn't had any rails impressions :)
<siwica>
:P
rshetty has joined #ruby
tier has quit [Read error: Connection reset by peer]
<diegoviola>
I want to contribute to some project but I don't know which one
cashnguns has quit [Read error: Connection reset by peer]
<diegoviola>
:/
cashnguns has joined #ruby
<rpag>
contribute to one you're interested in?
entrenador has joined #ruby
josephndenton has quit [Ping timeout: 264 seconds]
beef-wellington has quit [Read error: Connection reset by peer]
<diegoviola>
right
<rpag>
happy to help :D
zlude has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<shevy>
diegoviola write your own one man
jaequery has quit [Client Quit]
<shevy>
right now I am (again) rewriting my konsole colours gem, this time I layout how to use it first before writing it
rylev has joined #ruby
<zlude>
Hello! I have a newbie question, if i do @book = Book.find(1) and then @book.delete will it delete record from my database? or i need @book.save ? or @book.save is just to return if true or false?
dkb20k has quit [Ping timeout: 258 seconds]
<rpag>
zlude, try #rubyonrails for those type of questions
<diegoviola>
I want to write an audio player, just for fun
jdj_dk has joined #ruby
Wolland has quit [Ping timeout: 245 seconds]
<zlude>
rpag, thx
<Hijiri>
will the decoding/encoding be in ruby too?
ramfjord has joined #ruby
<diegoviola>
Hijiri: that would be nice
<zlude>
rpag, but i'm really not using rails, hehe. I'm using ruby with activerecord. just.
klaut has joined #ruby
rylev has quit [Remote host closed the connection]
<jhass>
zlude: still the rails people work everyday with AR, which you can't say of all the people here
<rpag>
zlude, it's still a better channel for just AR but to answer your question .save will persist the record *into* the database, delete/destroy removes the record
robbyoconnor has quit [Ping timeout: 256 seconds]
benzrf is now known as benzrf|offline
<rpag>
calling save after delete/destroy would just undo the delete
dumdedum has quit [Quit: foo]
<zlude>
rpag, good! so, don't make any sense .save in a delet action.
<zlude>
rpag, just on a new record action.
cashnguns has quit [Read error: Connection reset by peer]
amargherio has quit [Read error: Connection reset by peer]
keen__________ has joined #ruby
_djbkd has quit [Remote host closed the connection]
zlude has quit [Quit: Page closed]
<twohlix>
so the guy who i can git blame for this line of code isn't around and my googling is coming up with nothing:
<shevy>
hmm with define_method I can add a method to a module dynamically, but how do I add the same method both as a normal instance method and also a class method?
<aep>
nah too lazy to reduce to readable stuff. basically i'm getting some stuff from a database library and i was hoping i can just add methods to their instances
chipotle_ has quit [Ping timeout: 250 seconds]
<siwica>
aep: you could also do if you dont want instance methods module Foo; class Bar; def self.foobar; "yay"; end; end; end;
<aep>
like Foo::Bar.get_all_the_bars().first.my_new_thing
<aep>
nah, i wanted instance
<aep>
the lib kinda works like activerecord
dc_ has quit [Remote host closed the connection]
<aep>
it creates objects from api calls
hmsimha_ has quit [Ping timeout: 245 seconds]
<aep>
and i wanted to add some helpers to prettify stuff. not critical. i'll just do it different
<jhass>
then get_all_bars doesn't return Foo::Bar's
<aep>
thanks!
<aep>
uh yeah it does
[gmi] has quit [Client Quit]
<jhass>
also get rid of that empty parens :(
mdarby has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Areessell_ has joined #ruby
ryao__ is now known as ryao
<aep>
yeah yeah :D
<rpag>
too javascript-y
lolmaus has quit [Quit: Konversation terminated!]
timonv_ has joined #ruby
lolmaus has joined #ruby
timonv_ has quit [Remote host closed the connection]
<siwica>
it does say "* Avoid return where not required."
<siwica>
so discussion over! :)
kireevco has left #ruby [#ruby]
<shevy>
yeah
<shevy>
I think it is the original style guide
<shevy>
created "chneukirchen authored on Dec 28, 2008"
<shevy>
and this bbatsov copy pasted it
thumpba has quit []
ramfjord has quit [Ping timeout: 264 seconds]
<siwica>
but since you cant link to individual points it's kinda useless for discussing things
<shevy>
yeah he copy pasted it
<shevy>
"* Use OptionParser for parsing complex command line options and ruby -s for trivial command line options."
<siwica>
whatever
<shevy>
and extended it in a few areas + added style elements to it
<shevy>
siwica ah you can highlight on github
<siwica>
I dont care who deserves credit for this
<siwica>
its just useful
<shevy>
ok so if I write up another style guide
fsapo has quit [Remote host closed the connection]
<shevy>
will you consider this as just useful as well?
<rpag>
shevy, i don't really adhere to a style guide, but i follow most of the common stuff: snake_case methods/variables, SCREAM_CASE_CONSTANTS, CamelCase classes/modules.
<siwica>
if its good and accepted by many
chrishou_ has quit [Ping timeout: 272 seconds]
Musashi007 has quit [Quit: Musashi007]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
you can try to run rubocop on your ruby code
<shevy>
gem install rubocop
sinkensabe has quit [Remote host closed the connection]
<shevy>
then watch how it screams :D
<siwica>
what does it do?
<siwica>
stylechecks?
<shevy>
oooooh
<jhass>
yeah, most people here hate its default config though ;P
chrishough has joined #ruby
<shevy>
might be that batsov actually wrote or contributed to rubocop
moritzs has quit [Remote host closed the connection]
jzinedine has joined #ruby
otherj_ has quit [Quit: .]
mikeg has joined #ruby
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<siwica>
shevy: I guess that will usually result in some hundred warnings?
Juanchito has quit [Quit: Connection closed for inactivity]
shazaum has quit [Quit: Leaving]
jaequery has joined #ruby
rylev has joined #ruby
jaequery has quit [Max SendQ exceeded]
<shevy>
yeah
<shevy>
but try it!
Musashi007 has joined #ruby
jaequery has joined #ruby
<siwica>
it is very useful for detecting blank lines it seems :)
<siwica>
what is a recommended final blank line for?
sigurding has joined #ruby
<rpag>
at the end of a file?
ldnunes has quit [Quit: Leaving]
jxf has quit [Remote host closed the connection]
jjasonclark has quit [Quit: jjasonclark]
<shevy>
siwica dunno, perhaps you forgot to remove it
pietr0_ has joined #ruby
pietr0 has quit [Ping timeout: 240 seconds]
pietr0_ is now known as pietr0
<siwica>
no, its encouraged
Musashi007 has quit [Client Quit]
rylev has quit [Ping timeout: 258 seconds]
<siwica>
"C: Final newline missing."
ephemerian has joined #ruby
marr has joined #ruby
<siwica>
ok, its semi useful
<shevy>
hehe
coderhs has joined #ruby
linojon has quit [Quit: linojon]
<siwica>
I dont like it complaining about the blank lines I insert for readability
<rpag>
whats readable to you isnt readable to someone else though
<rpag>
i find empty lines to just be noise
m8 has quit [Quit: Sto andando via]
sambao21 has quit [Ping timeout: 265 seconds]
<siwica>
sure
sambao21 has joined #ruby
<siwica>
But if I dont commit to a public project the final instance on these matters is myself
mikeg has quit [Ping timeout: 260 seconds]
elaptics is now known as elaptics`away
<siwica>
but in some cases it's actually useful
emmesswhy has joined #ruby
jenrzzz has joined #ruby
renderful has quit [Remote host closed the connection]
<shevy>
aaah now you understand why there is no community guideline :D
linojon has joined #ruby
wallerdev has quit [Quit: wallerdev]
reinaldob has quit [Remote host closed the connection]
<jhass>
there's none because we have no authoritative place to establish one
Blizzy has quit [Ping timeout: 255 seconds]
cashnguns has quit [Read error: Connection reset by peer]
cashnguns has joined #ruby
speakingcode has quit [Quit: leaving]
speakingcode has joined #ruby
<siwica>
shevy: I dont say you are forced to stick with each aspect, but when in doubt I generally tend to use the recommendation
dc has joined #ruby
timonv_ has joined #ruby
engineered_acade has joined #ruby
ptrrr has joined #ruby
engineered_acade is now known as Cat_1
JohnBat26 has joined #ruby
chrishough has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vyrus001 has joined #ruby
maasha has joined #ruby
jenrzzz has quit [Quit: leaving]
<siwica>
Just curious, what are you doing for a living here in the channel?
mois3x has joined #ruby
<maasha>
regex challenge: substitute all . with .\n unless . is within a pair of matching ()
<siwica>
(*wondering if its mostly professionals or not)
jimmyhoughjr has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
spyderma_ has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spyderman4g63 has quit [Read error: Connection reset by peer]
tier_ has joined #ruby
<siwica>
directly within? "(a.)" too?
benzrf|offline is now known as benzrf
<maasha>
siwica: yes, that too
<siwica>
(.(.() so all these too?
<maasha>
I mean, any . within () should be spared.
<maasha>
siwica: no, there is no nested parens.
<siwica>
ok
Jake232 has joined #ruby
<siwica>
I'll think about it when I have time
northfurr has joined #ruby
<maasha>
siwica: two steps is ok as well.
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
<shevy>
siwica I just idle to power here
<maasha>
I was thinking substituting all . inside parens first to something like #, then substitute remaining . to .\n, and then substituting # back to .
<maasha>
crufty
_djbkd is now known as djbkd_
P-NuT has joined #ruby
iamjarvo has joined #ruby
<P-NuT>
Hi all, How do I take a variable and check what type it is?
tier has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
<jhass>
P-NuT: .class. Yet better get pry and do ls foo
yfeldblum has joined #ruby
<jhass>
maasha: got a test string?
ramfjord has quit [Client Quit]
Blizzy has joined #ruby
jjasonclark has joined #ruby
<maasha>
foo.bar(".").bleh.blah().tyt
<maasha>
off to rubular :o)
dkb20k has joined #ruby
<benzrf>
maasha: why the ()
<maasha>
benzrf: just to have an ugly test string
russt has joined #ruby
<maasha>
benzrf: helps trap weird corner cases
<jhass>
so that's ruby method calls?
<maasha>
jhass: yeah
Areessell_ has joined #ruby
<jhass>
what about foo.bar(baz.bar).blub
<siwica>
Is there a ruby library to zip files?
vifino has joined #ruby
<maasha>
jhass: the baz.bar dot should not be substituted, but the rest should.
<jhass>
kay
<jhass>
I fear you need to tokenize
chrishough has joined #ruby
chrishough has quit [Client Quit]
chrishough has joined #ruby
emmesswhy has quit [Quit: Leaving]
nobitanobi has joined #ruby
godd2 has joined #ruby
dkb20k has quit [Ping timeout: 250 seconds]
kyoshero has joined #ruby
<maasha>
jhass: well, I don't really want to go with look-around-assertions - they are messy. Thus I am willing to accept a number of steps, I was hoping it could be solved with a number of substitutes.
<ruby-help>
hi, im looking to take the output of a command like "curl ifconfig.me" and based on the out put do something with it. I've tried with "system" and "exec" but this seems that any response from stdout is "true"
<jenrzzz>
ruby-help: output = `curl ifconfig.me`
<jenrzzz>
the backticks will return a string with the stdout of running the command
<mg^>
or use a pipe and read the output like you would any file
DjDeaf has quit [Read error: Connection reset by peer]
<wallerdev>
lol
<wallerdev>
yeah why would you need to shell out to curl
x1337807x has joined #ruby
DjDeaf has joined #ruby
JohnBat26 has quit [Ping timeout: 272 seconds]
Lucky__ has joined #ruby
IrishGringo has quit [Ping timeout: 260 seconds]
jaequery has quit [Ping timeout: 264 seconds]
hephaestus_rg has joined #ruby
cpruitt has joined #ruby
silkfox has joined #ruby
jjasonclark has joined #ruby
hhutch has joined #ruby
DjDeaf has quit [Remote host closed the connection]
zB0hs has joined #ruby
<benzrf>
is open-uri in base ruby-help
<benzrf>
er
<benzrf>
*ruby
<jhass>
yes, stdlib
centrx has quit [Quit: The plan is programmed into every one of my one thousand robots]
Xiti` has quit [Quit: Leaving]
<shevy>
benzrf you forgot ruby!
beef-wellington has joined #ruby
Xiti has quit [Quit: Leaving]
<shevy>
all that haskell made you senile
Xiti has joined #ruby
<mg^>
I didn't even read that the command was curl :) I saw output of a command blah blah system exec
<jhass>
I start to assume X/Y problem by default ;)
<ruby-help>
i have an api that uses curl to give an output to a set of vpn tunnels. im looking at displaying an alert if one of these tunnels is down. so i need to run around 400 curl command every say 30 seconds
devdazed has quit [Quit: Bye]
<ruby-help>
output would be "active", "down" or "unknown"
<jhass>
ruby-help: use the typhoeus gems hydra
<jhass>
1000x times faster (no kidding)
<jenrzzz>
+1 for typhoeus
<ruby-help>
ah ok ill take a look at that
silkfox has quit [Quit: WeeChat 0.4.3]
<ruby-help>
thanks
jottr has quit [Ping timeout: 255 seconds]
<ruby-help>
i am however intrigued on how to output the curl command without any gems
havenwood has joined #ruby
<mg^>
you can do it all in stdlib
rbrs has quit [Quit: Leaving]
<jhass>
you've been shown the solution plus a solution for you example in pure ruby without curl
djbkd_ has joined #ruby
maasha has quit [Ping timeout: 246 seconds]
<ruby-help>
curl = 'ifconfig.me' puts curl ?
<mg^>
no
paulfm has quit []
<ruby-help>
curl = `ifconfig.me` puts curl ?
thumpba has joined #ruby
Zackio has joined #ruby
kireevco has joined #ruby
<jenrzzz>
ruby-help: try it.
siwica has quit [Ping timeout: 264 seconds]
<ruby-help>
i did it failed /curl.rb:3:in ``': No such file or directory - ifconfig.me (Errno::ENOENT)
djbkd has quit [Ping timeout: 260 seconds]
<jenrzzz>
why do you think that is?
sambao21 has quit [Quit: Computer has gone to sleep.]
siwica has joined #ruby
jottr has joined #ruby
<shevy>
ruby-help that file was not found
<shevy>
I don't even know what .me is, what is that ruby-help
timonv_ has quit [Remote host closed the connection]
<ruby-help>
the fie is curl.rb
hhutch has quit [Ping timeout: 264 seconds]
<shevy>
you have a file called curl.rb ?
<jenrzzz>
jhass: i didn't know the X-Y problem had a name!
Xeago has quit [Remote host closed the connection]
razieliyo has quit [Remote host closed the connection]
<jhass>
shevy: yeah, just choose something larger than the filesize
<mg^>
ruby-help: I'm trying to comprehend how you don't have a choice about calling curl. You want to call 400 curl commands every 30 seconds, and process the output in ruby. That's going to be rather "interesting" to implement if you can't omit curl, from an efficiency standpoint. Since you have ruby, why not use the tools it provides? Including getting the output from a URL, and managing doing that a
<jhass>
^ if you can guarantee Foo contains nothing but the allowed values
<jenrzzz>
wait, i'm not clear on what you're trying to do there, TeresaP
x1337807x has joined #ruby
<jhass>
and actually it doesn't check the constants values
<jenrzzz>
yeah
spider-mario has quit [Remote host closed the connection]
x1337807x has quit [Max SendQ exceeded]
<shevy>
cool
einarj has joined #ruby
<shevy>
it seems as if sysread is even faster than binread
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
<shevy>
I added a few more iterations... but File.read really becomes awfully slow
<TeresaP>
Basically I'm trying to create a minimized way to check if the user passed in one of :left, :right: :up, :down without the need for a long unless statement, but I think I might go that route
<ruby-help>
i have a set of routers that will respond to a curl or wget command with a username and password ip address and tunnel name.
<TeresaP>
jhass' solution does work though
<jhass>
TeresaP: I'm not sure why you assign those constants in the first place though
<b3itz>
hey guys, so for an assignment, i have to read in a .txt file, then parse it into an array.. i cant figure out how to get the .txt file passed to the program using an ARGV...
<jhass>
usually we just write the symbols where we want them
<TeresaP>
Sometimes it's a simple as a direction
<TeresaP>
Other times it is not
<TeresaP>
I'm just trying to learn something
<jhass>
TeresaP: %i(left right).include? dir
Musashi007 has quit [Quit: Musashi007]
<TeresaP>
thanks jhass
diegoviola has quit [Ping timeout: 264 seconds]
<jenrzzz>
TeresaP: you might be better off putting the symbols in a frozen set or hash and checking for inclusion if you're gonna need to access them in a lot of different places
<jhass>
after all the point of symbols is to have identifiers, no need to a level of indirection to get identifiers ;)
<jhass>
*add a
DjDeaf has joined #ruby
<jenrzzz>
const lookup will be a lot slower
diegovio1 has joined #ruby
Ankhers has quit [Ping timeout: 250 seconds]
russt has quit [Quit: russt]
<benzrf>
b3itz: ARGV
<gkra>
hey, WTF is up with the latest rubocop gem? it's giving me a crapload of "Assignment Branch Condition size for <method_name> is too high" failures that never existed before. ??
Musashi007 has joined #ruby
diegovio1 is now known as diegoviola
russt has joined #ruby
dTSCode is now known as DTSCode
dc has quit [Remote host closed the connection]
<jhass>
b3itz: also check the docs on ARGF
<mg^>
I'm just saying you can do whatever curl is doing with ruby directly and avoid creating subprocesses. Someone else has pointed out that the Thyphoeus gem would also help you manage doing 400 of them.
<jhass>
and actually uses curl!
jheg has quit [Quit: jheg]
DjDeaf has quit [Read error: No route to host]
jhwhite has joined #ruby
vifino has quit [Ping timeout: 240 seconds]
DjDeaf has joined #ruby
<TeresaP>
cool I have not used Sets yet jenrzzz
<TeresaP>
thanks for the info
<jenrzzz>
shevy: is #read that much slower just because of encoding and error handling stuff?
<shevy>
possibly
<shevy>
I am not a C expert
<mg^>
Any time you are thinking about capturing the output of a curl command in any language besides a unix shell, be it Ruby, Perl, C, whatever, it's time to re-evaluate what you're doing.
<b3itz>
i'm receiving this error when running my .rb in ubuntu "ruby: no Ruby script found in input (LoadError)" andy ideas?
<b3itz>
any
<jenrzzz>
^ amen
<jenrzzz>
b3itz: how are you running it?
sambao21 has joined #ruby
<b3itz>
ruby Assignment3.rb
DjDeaf has quit [Read error: Connection reset by peer]
<shevy>
b3itz does the file exist there
<b3itz>
yes
<P-NuT>
How do I take a time string like "Mon Sep 29 08:37:36 2014" and return "2014-10-29" and "08:37:36"
<shevy>
LoadError means that it must load some other file b3itz
DjDeaf has joined #ruby
<shevy>
b3itz normally it tells you the name of the file
<shevy>
have a look at Assignment3.rb what it loads up
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider>
BAMbanda: then don't paste an error to us and expect us to be able to help
<BAMbanda>
zenspider, woah, did i do something wrong?
<zenspider>
we're happy to help, but not with misinformation like that
<apeiros>
I find it amazing how people insist that ruby should figure out the format for them when parsing the time. instead of just providing it with the format…
<jenrzzz>
hakunin: what about what?
<hakunin>
sidekiq runs a bunch of jobs (at concurrency 20), but eventually stops finding the "convert" command on all 3 servers, i hardcoded convert path to /usr/local/bin/convert, so now it just errors out on that command without a message after like 5-10minutes of processing thousands of jobs
<apeiros>
IMO it should be Date.guess
<apeiros>
instead of Date.parse
<zenspider>
BAMbanda: yes, you pasted your terminal output into your input and expected us to be able to help
<zenspider>
try again
<apeiros>
maybe people would be less inclined to blindly use it…
<jenrzzz>
hakunin: what error?
<zenspider>
Date/Time.guess would be awesome
<jenrzzz>
apeiros: +1 for that
spyderma_ has quit [Remote host closed the connection]
<hakunin>
jenrzzz: no message, just that the convert command fialed
spyderman4g63 has joined #ruby
<zenspider>
if Time.parse was FAST and only provided 3-4 formats, I'd LOVE that
spyderman4g63 has quit [Remote host closed the connection]
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
claymore has quit [Quit: Leaving]
<hakunin>
so basically i am forced to sit here and restart sidekiq every 10-20minutes
<hakunin>
to get through this batch
<jenrzzz>
hakunin: convert failed, or the same "convert not found" we had yesterday?
<apeiros>
I'd prefer Time.parse not guessing formats
<hakunin>
jenrzzz: no, this time no longer command not found, STDERR is empty
<zenspider>
hakunin: running out of pids or other resources?
<jenrzzz>
whaaat
<apeiros>
it could provide some symbolized formats for "quick access". and for the rest - format string.
<hakunin>
jenrzzz: but posix-spawn reports this as an error
<hakunin>
zenspider: i was frantically checking ram, and lsof | wc -l
<hakunin>
jenrzzz: i tried rescuing and logging, but that somehow never ran
<hakunin>
(i re-raise it)
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<BAMbanda>
solid 135 mb
<hakunin>
jenrzzz: zenspider: these operations are also S3 upload/download bound, but if i launch a console and try to the rendering manually (while server is failing non stop) it works
P-NuT has quit [Quit: Leaving]
<jenrzzz>
BAMbanda: yeah, you're probably gonna need at least 300 MB to compile it
freerobby has quit [Quit: Leaving.]
<hakunin>
so it's not throttling or anything…
oo__ has quit [Remote host closed the connection]
<jenrzzz>
BAMbanda: but if that's a problem, you can just use the pure-Ruby JSON module in stdlib
<hakunin>
another thing i did - disabled newrelic, and it held on for closer to 20 minutes without failing
<zenspider>
turn swap on
<BAMbanda>
cool thanks guys
BAMbanda has quit []
<hakunin>
i have no idea if that was coincidence
<hakunin>
zenspider: not enough pids - is that the same as lsof? or different resource
<jenrzzz>
how many converts do you have running at once?
<hakunin>
ah different
DjDeaf has quit [Remote host closed the connection]
<hakunin>
jenrzzz: each of the 20 concurrent threads runs one identify/convert/file at a time
<hakunin>
so 20
<hakunin>
i mean, inside thread it's procedural of course
jobewan has quit [Quit: Leaving]
<jenrzzz>
hmmm
Takle has quit [Remote host closed the connection]
<hakunin>
huh i actually have a fairly low limit on pids
<hakunin>
wonder how to find out how many are in use
<hakunin>
only 32k limit
<hakunin>
maybe not that low
<jenrzzz>
ps aux | wc -l ?
<hakunin>
if that shows everything, then only 100 in use currently, but not sure if it's all of them
<hakunin>
when i run strace - i see never-ending "attaching […]"
<jenrzzz>
strace against the sidekiq process or convert?
<hakunin>
sidekiq
<hakunin>
at that point no more convert
<hakunin>
when it fails convert never starts
<hakunin>
and each job just goes to retry
x1337807x has joined #ruby
timonv_ has joined #ruby
<jenrzzz>
does it take a while for sidekiq to get into that state or do jobs start failing right away?
oo_ has joined #ruby
<jenrzzz>
also what ruby are you running?
Deele has quit [Ping timeout: 260 seconds]
<hakunin>
jenrzzz: always takes a while
<hakunin>
jenrzzz: sometimes 5-15mins
<hakunin>
jenrzzz: on these machines 2.1.3p242
lw has joined #ruby
lw has quit [Max SendQ exceeded]
<hakunin>
(bootstrapped them just days ago)
jonr22 has joined #ruby
lw has joined #ruby
jhwhite has quit [Quit: jhwhite]
<hakunin>
so after restart sidekiq definitely doesn't fail
claw has joined #ruby
<hakunin>
for a while
lw has quit [Max SendQ exceeded]
axl_ has quit [Quit: axl_]
einarj_ has joined #ruby
<hakunin>
and in console manually on the same machines they don't fail
claw___ has quit [Ping timeout: 264 seconds]
<jenrzzz>
you said you're using posix-spawn, right? have you tried with Kernel#system or something else in stdlib?
badhatter has quit [Read error: Connection reset by peer]
allcentury has joined #ruby
<hakunin>
jenrzzz: i can hack that in to replace posix-spawn
jack_rabbit has joined #ruby
lw has joined #ruby
lw has quit [Max SendQ exceeded]
<hakunin>
jenrzzz: actually both paperclip and my posix-spawn fial
<hakunin>
fail
badhatter has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<hakunin>
jenrzzz: paperclip auto-selects a strategy with their cocain lib
Kricir has quit [Remote host closed the connection]
lw has joined #ruby
melik has joined #ruby
<hakunin>
jenrzzz: i really think this is so obscure that almost hopeless to debug without some deep tracing…
lw has quit [Max SendQ exceeded]
<hakunin>
jenrzzz: unless you've seen it before specifically :(
livingstn has quit []
<jenrzzz>
hakunin: oh, so it's actually paperclip that's invoking convert?
oo_ has quit [Ping timeout: 265 seconds]
<hakunin>
jenrzzz: there are 2 things that invoke convert, paperclip, and my own lib that uses posix-spawn directly
lw has joined #ruby
<hakunin>
jenrzzz: both are involved
lw has quit [Max SendQ exceeded]
einarj has quit [Ping timeout: 258 seconds]
g0bl1n has joined #ruby
lw has joined #ruby
<hakunin>
jenrzzz: right now i have things in failing state, let me paste some log exactly
<jenrzzz>
hakunin: hmmm. yeah, maybe you could remove posix-spawn and change your lib's invocation and see if shit's still broke
lw has quit [Max SendQ exceeded]
jonr22 has quit [Ping timeout: 260 seconds]
Takle has joined #ruby
lw has joined #ruby
jimbach has joined #ruby
jaequery_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Xuerian has quit [Ping timeout: 258 seconds]
allcentury has quit [Ping timeout: 244 seconds]
KC9YDN has joined #ruby
<hakunin>
jenrzzz: wtf… now (having not changed anything yet) i'm consistently seeing another error, and no longer the command error. This error is paperclip
<hakunin>
jenrzzz: paperclip's validation of mime type claiming it's "spoofed"
<hakunin>
jenrzzz: but from experience i know that this is often because image file is corrupt or similar
<hakunin>
jenrzzz: it uses file command to check it and fails
kirun has quit [Quit: Client exiting]
<hakunin>
not hdd space issue, not lsof issue, not ram issue
<jenrzzz>
hakunin: what distro are you using, and what is it running on?
<hakunin>
digitalocean ubuntu 14.04
<hakunin>
8gb servers
treehug88 has quit []
<jenrzzz>
have you checked your syslog for anything extraordinary?
<jenrzzz>
or dmesg
jimbach has quit [Remote host closed the connection]
DrCode has quit [Remote host closed the connection]
User458764 has quit [Ping timeout: 264 seconds]
<hakunin>
jenrzzz: yes and syslog is devoid of any problems
Pupeno has joined #ruby
larissa has joined #ruby
<hakunin>
dmesg too
failshell has quit [Remote host closed the connection]
<DTSCode>
does ruby have a compiler?
DrCode has joined #ruby
<jenrzzz>
i think removing posix-spawn would probably be the next thing to try
<jenrzzz>
since everything that uses it seems to be failing
pietr0 has quit [Ping timeout: 244 seconds]
<jenrzzz>
DTSCode: not really
Pupeno_ has quit [Ping timeout: 244 seconds]
<hakunin>
jenrzzz: i have also seen many "command not found" errors coming from cocaine before, as i was changing things, and so i hardly suspect posix-spawn, although can try of course
codecop has quit [Remote host closed the connection]
* DTSCode
knows his next project
sinkensabe has joined #ruby
<jenrzzz>
i think cocaine will use posix-spawn if it's available though, right?
<hakunin>
jenrzzz: i really appreaciate how much effort you put into investigating this, it seems pretty hopeless without some hands-on digging… i was hoping to do auto-restart but even that is difficult because sidekiq sometimes gets stuck on trying to stop
<jenrzzz>
you're distracting me from boring work
<jhass>
DTSCode: you might be interested in crystal-lang.org
nettoweb_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jenrzzz>
also i'm still not sure if i want to use resque or sidekiq in this project
<akamel>
hey does anyone know where im selecting these html elements incorrectly. I keep getting watir.rb:17:in `block in <main>': undefined method `inner_html' for nil:NilClass (NoMethodError)
<hakunin>
jenrzzz: heh, sidekiq has been solid aside from this
skolman_ has quit [Remote host closed the connection]
<hakunin>
jenrzzz: my main suspicion has been that somewhere ENV is lost, or PATH
skolman_ has joined #ruby
<hakunin>
jenrzzz: in ruby threads
<hakunin>
but i can't recall any reason why threads would lose ENV or PATH
<hakunin>
it definitely smells like a race condition
<DTSCode>
interesting
<jenrzzz>
akamel: use listing.at_css
<jenrzzz>
akamel: or listing.css.first
<akamel>
ill try it
<akamel>
thank you jenrzzz
thagomizer has joined #ruby
<hakunin>
btw not sure if relevant but i've seen quite a lot of "-1 EAGAIN (Resource temporarily unavailable)" in strace, but google seemed to not care for it
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
momomomomo has quit [Ping timeout: 250 seconds]
hamakn has joined #ruby
tokik has joined #ruby
sinkensabe has quit [Ping timeout: 250 seconds]
<jenrzzz>
hakunin: how does posix-spawn invoke a process?
<jenrzzz>
hakunin: i suppose you could glean something from reading the posix_spawnp(3) man page, but we don't know if that's actually related to the problem
<jenrzzz>
hakunin: really need more data :/
benzrf|offline is now known as benzrf
<hakunin>
jenrzzz: i know i know
Authenticator has joined #ruby
bluehavana has joined #ruby
MattB has joined #ruby
<MattB>
Hi, is there a better way to manipulate an array than Array#map, if not using the enumerated values directly?
<zenspider>
don't use bang methods unless you really mean it
<zenspider>
and you don't
<eam>
it's a no-op
lampd1 has joined #ruby
<MattB>
Well, I don't need the values of the array after the transformation, but regardless, using map without using the enumerated value seems... wrong
<eam>
sorry, not a no-op
<akamel>
jenrzzz: thanks for pointing me to the cheat sheet
<akamel>
i didnt realize by using .first you could no longer run a method on it
freerobby has joined #ruby
<zenspider>
if you don't need the values, then map is exactly the wrong method to use
<zenspider>
what are you ACTUALLY trying to do?
lampd1 has quit [Remote host closed the connection]
<akamel>
jenrzzz: i removed first and just used .inner_text and it worked
<MattB>
[5,4,3,2,1] => [15,10,6,3,1]
lampd1 has joined #ruby
<MattB>
so, each element of the array becomes the sum of itself plus all values that follow it...
<zenspider>
if you don't need the values, then [5,4,3,2,1] => <void>
<jenrzzz>
akamel: sweet! yeah you may want to read up on the API docs cause it sounds like you're a little fuzzy on what objects you're actually working with
<MattB>
I don't need the original values, hence map!
mattstratton has joined #ruby
<Authenticator>
MattB: Would you like something more like by_week.length.times.collect {|i| by_week[i..-1].sum }
<MattB>
But is there a better way?
<Authenticator>
MattB: That might be clearer that you're collecting the result of a function of i, not v and i... Is that what you want?
<MattB>
Authenticator, that could work.
<jenrzzz>
wait what, ranges have a #sum method?
<zenspider>
(n**2 + n)/2 == (1..n).sum
<zenspider>
no need to do a sum at all
<MattB>
Ah, sorry, forgot that the sum method is a Rails value add...
<MattB>
I also then need to convert those numbers to a percentage of the total of all the number in the array.
<MattB>
by_week.map! { |v| (v.to_f/total*100.0) }
snath has quit [Ping timeout: 264 seconds]
<MattB>
(where total is [array].sum or equiv
<jenrzzz>
MattB: why do you need to do this?
<MattB>
I have them both as one map operation: by_week.map!.with_index{|v, i| (by_week[i..by_week.count].sum.to_f/total*100.0)}
<MattB>
User chort analysis
<MattB>
cohort
oo_ has joined #ruby
<MattB>
Percentage of users logging in n weeks after sign-up
Spami has joined #ruby
<zrl>
I have some text with new lines in it. Something along the lines of "Lorem\nipsum". I'd like to create a regex to check whether that text matches the string "Lorem ipsum". It's currently not matching due to the new lines.
jimms has joined #ruby
<zenspider>
>> a = 5.downto(1).map { |n| (n*n + n) / 2 }; sum = a.inject(&:+).to_f; a.map! { |n| n / sum }; a
<zenspider>
but to answer your question: /[\n ]/ or /(\n| )/ would both work. just say exactly what you want and regexps will behave
Axy has quit [Ping timeout: 255 seconds]
TinkerTyper has quit [Ping timeout: 250 seconds]
<zrl>
zenspider: thanks! bookmarked, had no idea that existed and it looks super useful. thanks for putting that together!
<jenrzzz>
zenspider: ditto
oo_ has quit [Ping timeout: 255 seconds]
thumpba has quit [Ping timeout: 256 seconds]
<zenspider>
my pleasure. enjoy
TinkerTyper has joined #ruby
<zrl>
jenrzzz: rubular is awesome! i should have been far clearer in my original question, but i do appreciate you bringing it up again.
Musashi007 has joined #ruby
<jenrzzz>
zrl: it was clear enough, i just didn't read it well :P
vifino has quit [Ping timeout: 244 seconds]
linojon has quit [Quit: linojon]
nateberkopec has quit [Quit: Leaving...]
<MattB>
@zenspider, that's so much better, thank you!
<zenspider>
and O(n)
<MattB>
Let me throw in one last wrinkle. The values start off in a hash, not an array, and I need them as an array with numeric (index) keys. (Don''t ask!)
renderful has quit [Remote host closed the connection]
<jenrzzz>
MattB: do you want them in the same order as they are in the hash, or is there some mapping between hash key and array index?
<MattB>
Same order, so it would end up with {0 => percent, 1 => percent2 etc...}
<MattB>
I'm doing {}.values, then finishing up with Hash[result]
<Authenticator>
What I mean is, is it just a trivial math problem? The sum of a range of integers? (n..N).to_a.sum? Or is the point of it the index manipulation and the example was just poor?
<MattB>
Just wanted to check that I'm not missing a trick
<Authenticator>
vowels = %w(a e i o u) ; vowels.length.times.collect {|i| vowels[i..-1].sum } => ["aeiou", "eiou", "iou", "ou", "u"]