Lord_of_Life has quit [Quit: EliteBNC free bnc service - http://elitebnc.org - be a part of the Elite!]
GriffinHeart has joined #ruby
Caelum has quit [Ping timeout: 250 seconds]
<GriffinHeart>
Hi everyone, for a module that is not supposed to be included anywhere what is the practical difference between `mattr_accessor :var` vs `class << self; attr_accessor :var; end`?
hahuang65 has quit [Ping timeout: 264 seconds]
<GriffinHeart>
Trying to figure out an alternative where rubocop doesn't complain about `@@user_model = nil # rubocop:disable Style/ClassVars`
<_kraken>
are variable declared in a loop in ruby suppsoed to be local to that loop? I'm not finding this to be true
GriffinHeart has quit [Remote host closed the connection]
Caelum has joined #ruby
tristanp has quit [Ping timeout: 260 seconds]
nankyokusei has joined #ruby
karmatr0_ has quit [Read error: Connection reset by peer]
karmatr0n has joined #ruby
jackjackdripper has quit [Client Quit]
tristanp has joined #ruby
rkazak has joined #ruby
houhoulis has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
safe has joined #ruby
arlek has quit [Ping timeout: 252 seconds]
jaguarmagenta has joined #ruby
JJM has joined #ruby
karmatr0_ has joined #ruby
GriffinHeart has joined #ruby
karmatr__ has joined #ruby
karmatr0n has quit [Remote host closed the connection]
jaguarmagenta has quit [Ping timeout: 244 seconds]
Madplatypus has quit [Quit: Connection closed for inactivity]
solocshaw has quit [Ping timeout: 260 seconds]
karmatr0_ has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
tristanp has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
ensyde__ has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
hightower3 has quit [Ping timeout: 264 seconds]
jackjackdripper has joined #ruby
jackjackdripper has quit [Client Quit]
dkam_ has quit [Quit: Be back later ...]
uncertainty has joined #ruby
karmatr__ has quit [Ping timeout: 244 seconds]
karmatr0n has joined #ruby
tristanp has quit [Ping timeout: 260 seconds]
karmatr0n has quit [Remote host closed the connection]
karmatr0n has joined #ruby
braincra- has quit [Quit: bye bye]
uncertainty has quit [Ping timeout: 276 seconds]
pawnbox has joined #ruby
hahuang65 has joined #ruby
tristanp has joined #ruby
jancel has joined #ruby
pontiki has quit [Quit: "Poets have been mysteriously silent on the subject of cheese." -- G.K.Chesterson]
braincrash has joined #ruby
pawnbox has quit [Ping timeout: 276 seconds]
dar123 has joined #ruby
hahuang65 has quit [Ping timeout: 272 seconds]
stardiviner has joined #ruby
stardiviner has quit [Client Quit]
allcentury has joined #ruby
jancel has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 250 seconds]
|meta has quit [Quit: Connection closed for inactivity]
k3rn31 has joined #ruby
moeabdol1 has joined #ruby
Dimik has quit [Ping timeout: 276 seconds]
GriffinHeart has quit [Remote host closed the connection]
tristanp_ has joined #ruby
moeabdol1 has quit [Ping timeout: 244 seconds]
tristanp has quit [Ping timeout: 260 seconds]
nando293921 has joined #ruby
c355e3b has quit [Quit: Connection closed for inactivity]
k3rn31 has quit [Quit: Computer has gone to sleep.]
tristanp has joined #ruby
tristanp_ has quit [Read error: Connection reset by peer]
maletor2 has joined #ruby
Anderson69s has joined #ruby
sixer1 has joined #ruby
hugoxrosa has quit [Ping timeout: 272 seconds]
tvon has joined #ruby
JJM has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jancel has joined #ruby
tvon has quit [Read error: Connection reset by peer]
chip_ has quit [Ping timeout: 260 seconds]
hugoxrosa has joined #ruby
tvon has joined #ruby
Bugboy1028 has quit [Read error: Connection reset by peer]
matp has quit [Remote host closed the connection]
howdoi has joined #ruby
jenrzzz has joined #ruby
LoneHerm_ has joined #ruby
Bugboy1028 has joined #ruby
maletor2 has quit [Ping timeout: 260 seconds]
matp has joined #ruby
tristanp has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
Guest38693 has joined #ruby
mattwashere has quit [Remote host closed the connection]
paradisaeidae_ has quit [Quit: ChatZilla 0.9.92 [Firefox 46.0.1/20160511223818]]
jenrzzz has quit [Ping timeout: 260 seconds]
sixer1 has quit [Quit: Page closed]
jancel has quit [Remote host closed the connection]
kraken has joined #ruby
ramfjord has joined #ruby
kraken is now known as Guest44627
karmatr0n has quit [Ping timeout: 240 seconds]
<Guest44627>
Is there a method for a string that searches through the string for each instance of a parameter, then does something with what is finds via do |x| or something
kgrz has joined #ruby
Yzguy has joined #ruby
blackmesa has joined #ruby
Yzguy has quit [Client Quit]
roamingdog has quit []
lightt has quit [Ping timeout: 258 seconds]
gix has quit [Ping timeout: 260 seconds]
astrobunny has joined #ruby
Anderson69s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Radar>
Guest44627: Do you have an example of how this method might be used?
tristanp_ has joined #ruby
safe has quit [Quit: Leaving]
tristanp has quit [Ping timeout: 260 seconds]
blackmesa has quit [Ping timeout: 244 seconds]
gix has joined #ruby
auzty has joined #ruby
kareeoleez has joined #ruby
Guest44627 is now known as _kraken
uncertainty has joined #ruby
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Arcaire>
This is reading bytes, though. You may have some issues if you're using, say, UTF-16 or UTF-32 encoding.
<Arcaire>
Since they have code units that are two and four bytes long, respectively.
<Arcaire>
If you don't know what that is, then you're probably fine.
gusrub has quit [Quit: Leaving]
last_staff has joined #ruby
mattwashere has quit [Ping timeout: 258 seconds]
<tie_>
I'm actually not trying to read in bytes. Im trying to do letters. I will have a few hundred 1s and 0s printed in the file, but i want to read in 8 at a time as a string.
<Arcaire>
one character is one byte in UTF-8 encoding.
<tie_>
I'm doing it this way so it will be easier to present. Not for functionality.
etehtsea has quit [Quit: Computer has gone to sleep.]
<tie_>
Alright, i'll try it out. Thanks.
<Arcaire>
mmm wait i'm wrong i think
skolman_ has quit [Remote host closed the connection]
<Arcaire>
probably
<Arcaire>
i mean if it's 1 and 0 it's fine
<Arcaire>
if you were using things like ø you'd have an issue
<domgetter>
A character can be more than one byte in UTF-8, to my understanding
<Arcaire>
Between one and four, yes.
jenrzzz has quit [Ping timeout: 272 seconds]
<tie_>
i just mean the ascii value of 1s and 0s
etehtsea has joined #ruby
<Arcaire>
Yeah they're one byte a piece.
<domgetter>
UTF-8 is more like a linked list of characters
<tie_>
standart ASCIi only has 256 different values so that should be one byte
tristanp has quit [Ping timeout: 260 seconds]
Caerus|Away is now known as Caerus
<tie_>
Could you explain the two variables you passed in to .open please?
<ytti>
not to be anal but ascii is 7bits
<domgetter>
The first parameter to open is the filename, and the second is the mode. 'r' means 'read', so that file can only be read from. If you had passed 'w', you could write to it (and overwrite what's ther)
edwinvdgraaf has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 250 seconds]
tristanp has joined #ruby
blackmesa has joined #ruby
kareeoleez has joined #ruby
Yiota has joined #ruby
Yiota has quit [Client Quit]
JesseH has quit [Ping timeout: 260 seconds]
Walter-4` has joined #ruby
jaguarmagenta has joined #ruby
Walter-4 has quit [Ping timeout: 240 seconds]
<tie_>
It was nice to find a text to binary that enters spaces after each letter. I dont need to read in by size now, simply through a delimiter.
blackmesa has quit [Ping timeout: 260 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
RegulationD has quit [Ping timeout: 240 seconds]
uncertainty has joined #ruby
<tie_>
Arcaire: The way you wrote that gist, it looks like a while loop. Will that loop until the eof is found
<Arcaire>
yeah
allcentury has joined #ruby
<tie_>
perfect.
<tie_>
Thats exactly what I need.
<tie_>
This is the fourth language i've learned and this community is by far my favorite.
<tie_>
Err 6th
rkazak has quit [Quit: Sleep.....ing....]
<domgetter>
You should learn Forth next and confuse people when telling them the order of languages
mikar has joined #ruby
uncertainty has quit [Ping timeout: 260 seconds]
<tie_>
Dear lord... Man, i'm already bogged down with all the languages. I've had to work on Python, Prolog, Scheme, Java, and Ruby, all in the span of three months. Prolog is Satans incarnate.
<tie_>
Do I need to include the file extension in the name? Or is it defaulted to .txt
allcentury has quit [Ping timeout: 250 seconds]
mikar is now known as pld
pld has quit [Changing host]
pld has joined #ruby
pld has quit [Changing host]
pld has joined #ruby
n1x-nz has joined #ruby
<domgetter>
tie_ what operating system are you on?
<tie_>
Windows 8
<tie_>
err 8.1
JesseH has joined #ruby
<tie_>
Dont judge >.<
<domgetter>
To open a file, you need to tell Ruby the entire filename, and "filename.txt" would be the whole thing
<domgetter>
s'all good, I'm on Win7 for my desktop. I can help you with ruby windows pain
ur5us has quit [Remote host closed the connection]
<tie_>
I'm my colleges dorm internet technician so I need to stay on 8.1
<Zarthus>
Ruby Windows pain is pretty limited untill you start needing native extensions
karmatr0n has joined #ruby
AlexRussia has quit [Ping timeout: 260 seconds]
tristanp_ has joined #ruby
phredus has quit [Ping timeout: 258 seconds]
phredus has joined #ruby
<tie_>
I'm looking for a delimited input like 'text = gets(" ")' but I cant seem to find it online.
scepticulous has joined #ruby
tristanp has quit [Ping timeout: 260 seconds]
<Zarthus>
text = gets.chomp.split(" ")
<tie_>
That wont effect the eof check?
<Zarthus>
I haven't read up too far to know what the EOF check is
<Zarthus>
probably not.
<tie_>
End of File. Just wherever the pointer is for the current read is.
<Zarthus>
then no, not sure why you'd think it would
<Zarthus>
granted, you want to call gets on the file handler
<Zarthus>
which is more like a loop
<tie_>
Just thought there might be a possibility it reads the whole line and using the delimiter deletes everything past the first instance
raeoks has joined #ruby
tristanp has joined #ruby
lightt has quit [Remote host closed the connection]
tristanp_ has quit [Ping timeout: 252 seconds]
<domgetter>
tie_ when you pass a string to gets, it doesn't "delete" the rest, it just saves it for later
davedev24 has quit []
<domgetter>
in irb try gets(" ") and then type <Space>asdf<Enter> and then run gets()
<domgetter>
it will return " asdf\n"
lightt has joined #ruby
<tie_>
I'm pretty new to this. irb?
<domgetter>
from the command prompt, run irb
<domgetter>
you can get there quickly from WindowsKey+R cmd<Enter>
tristanp_ has joined #ruby
fenre has joined #ruby
<domgetter>
irb is ruby but you can input one line at a time, and it will evaluate the line and spit back the answer
<domgetter>
It's called a "Repl" or "read, evaluate, print, loop", and it's very useful for exploring and testing out things
<tie_>
oh nice. That would have been good to know a few days ago. I created a while new program just to try that stuff out.
yfeldblum has joined #ruby
<tie_>
TestPrograms.rb has gotten more love then my main program :(
tristanp has quit [Ping timeout: 260 seconds]
<domgetter>
You wrote a ruby script that was a repl?
<domgetter>
If so, that's awesome.
<tie_>
Maybe? Sure, lest go with that!
<tie_>
lets*
<ytti>
no rubyist should walk without 'pry'
<ytti>
superior REPL to irb
nando293921 has quit [Ping timeout: 240 seconds]
<domgetter>
ytti: I agree, but tie_ should at least get used to irb to know why pry is superior :)
<ytti>
particularly because you can start in at arbitrary part of code in arbitrary code, with 'binding.pry'
uncertainty has joined #ruby
<ytti>
once execution hits that, it'll open pry REPL shell, exitting will continue program execution
<Caerus>
i mean nvm, shouldnt 'test.read' be 'text.read' ?
<domgetter>
oops, read will read the whole file in at once.
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tie_>
I hope that gist clears some things up
<domgetter>
tie_: does Ruby_Plaintext.txt contain literal 1's and 0's ?
digneety has joined #ruby
karmatr0n has quit [Ping timeout: 240 seconds]
<tie_>
ASCII 1s and 0s.
<domgetter>
okay
last_staff has quit [Quit: last_staff]
jackjackdripper has quit [Quit: Leaving.]
idefine has joined #ruby
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tie_>
Got it to read in an array space delimited. I guess that'll do
maletor2 has joined #ruby
Gasher has joined #ruby
<domgetter>
well you have several options and they depends on the specific constraints of the problem
<domgetter>
if you know for a fact that there will always be 8 characters followed by a space, you can do text.read(8); text.read(1)
hightower3 has joined #ruby
fenre has quit [Remote host closed the connection]
<domgetter>
If you're "allowed" to, I would just do text.gets.chomp.split(" ") for every line in the file. This is fine as long as lines are short, since it reads the whole line into memory at once. If any line in the file is very very long, the will cause you to use a lot of ram at once.
fenre has joined #ruby
<tie_>
It's just for a presentation so it wont be very large. Just a sentence
idefine has quit [Ping timeout: 240 seconds]
<domgetter>
another way to do it would be to text.read(1) one character at a time, check if it's a space, and store it in a string if it's not, and then work on the string you're building up once you hit a space character.
<tie_>
Hey, one second. I think i'm on to something. I'll post what im doing in a sec
maletor2 has quit [Ping timeout: 252 seconds]
<domgetter>
that is the most imperative way to go about it, and not very ruby-ish
<domgetter>
that way you don't have to worry about referring to an index of the list, you can just go over each one
tristanp has quit [Ping timeout: 260 seconds]
<tie_>
Ohh, I remember learning about the .each one time but I completely forgot about that.
ramfjord has quit [Ping timeout: 264 seconds]
<jhass>
also if you're going to read the whole thing into memory anyway, just use File.read("Ruby_Plaintext.txt").split(" ")
<domgetter>
what .each will do is go over the list, and store each element into the variable you put between the |...| and then run the code inside for that element
<Caerus>
kraken_, i know the feeling happens to me too
LoneHermit has quit [Ping timeout: 260 seconds]
czerasz_ has quit [Ping timeout: 240 seconds]
<jhass>
square = ->(n) { n**2 } pls :P
CausaMortis has joined #ruby
<kraken_>
I feel like its a 'with great power comes great responsibility' thing. I feel like there are so many high level ways of doing things now, and I have to think of them
<domgetter>
I finally got my head around blocks when I implemented #each myself
<Caerus>
oh my, functional ruby :o
hightower2 has joined #ruby
<jhass>
domgetter: now do the whole of Enumerable :P
<domgetter>
it's just a loop that does the busywork for you
GriffinH_ has quit [Remote host closed the connection]
troulouliou_div2 has quit [Ping timeout: 276 seconds]
<jhass>
kraken_: yet the real dangerous parts of ruby into that direction are probably still to discover for you :P
Guest14270 has quit [Ping timeout: 264 seconds]
madgen has joined #ruby
<kraken_>
<jhass>: Give me one word on what is to come
<tie>
Well guys. I'm finally done with my project. Thank you so much for all of your help over the past few days. I've really enjoyed Ruby and I hope to work on it more sometime. Here is my final project.
<kraken_>
When you pass a block into a method, you can .call it, so does that mean it becomes an object once you pass it into a method?
<kraken_>
but not before?
<jhass>
kraken_: so, as for "values", only methods but you can get Method objects representing them and blocks, but you can get Proc objects representing them
coffeecupp has joined #ruby
<norc>
kraken_: You can either use yield to call the block, or you have to procify it.
<norc>
domgetter: So by showing an assignment to the lexer (even in dead code), you declare the variable. Ruby automatically then initializes it to nil.
ishe_ua has joined #ruby
tristanp_ has quit [Ping timeout: 260 seconds]
<norc>
depesz_: Knowing where you come from, do you have any postgres related goals in mind if you don't mind my asking?
<depesz_>
for now? not really.
<depesz_>
especially the ruby thing is unrelated
<norc>
Fair enough. :)
tristanp_ has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
tristanp has quit [Ping timeout: 252 seconds]
maletor2 has joined #ruby
madgen has quit [Ping timeout: 260 seconds]
<domgetter>
"No package cowsay available." Seriously CentOS??
<flughafen>
is anybody here familiar with the jenkins_api_client?
allcentury has joined #ruby
tristanp_ has quit [Ping timeout: 252 seconds]
maletor2 has quit [Ping timeout: 240 seconds]
colegatron_origi has quit [Quit: Leaving]
colegatron has quit [Quit: Leaving]
aupadhye has quit [Ping timeout: 244 seconds]
tristanp has joined #ruby
acosonic_ has joined #ruby
acosonic_ has quit [Client Quit]
saneax_AFK is now known as saneax
postmodern has quit [Quit: Leaving]
<pLaToOn>
moin
<flughafen>
moin moin
dkam_ has quit [Remote host closed the connection]
Coldblackice has quit [Ping timeout: 260 seconds]
allcentury has quit [Ping timeout: 276 seconds]
anisha has quit [Quit: This computer has gone to sleep]
giz|work has joined #ruby
ksmutthu has joined #ruby
ruby-lang593 has joined #ruby
antgel has quit [Ping timeout: 272 seconds]
antgel has joined #ruby
tax has joined #ruby
karmatr0n has joined #ruby
RegulationD has joined #ruby
codecop has quit [Remote host closed the connection]
blackgoat has joined #ruby
lightt has quit [Remote host closed the connection]
karmatr0n has quit [Ping timeout: 244 seconds]
tvw has joined #ruby
RegulationD has quit [Ping timeout: 240 seconds]
symm- has quit [Ping timeout: 252 seconds]
antgel has quit [Ping timeout: 272 seconds]
antgel has joined #ruby
johnmilton has quit [Remote host closed the connection]
idefine has joined #ruby
GriffinHeart has joined #ruby
uncertainty has quit [Ping timeout: 276 seconds]
tristanp_ has joined #ruby
the_drow has joined #ruby
tristanp has quit [Ping timeout: 260 seconds]
tristanp has joined #ruby
idefine has quit [Ping timeout: 240 seconds]
tristanp_ has quit [Ping timeout: 260 seconds]
emilkarl is now known as emilkarl[away]
terlar has quit [Ping timeout: 260 seconds]
tristanp_ has joined #ruby
tristanp has quit [Ping timeout: 260 seconds]
emilkarl[away] has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
madgen has joined #ruby
ruby-lang593 has quit [Ping timeout: 250 seconds]
tristanp_ has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
tax has quit [Ping timeout: 260 seconds]
lxsameer has quit [Ping timeout: 244 seconds]
c355e3b has joined #ruby
Alazoral has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has joined #ruby
lxsameer has joined #ruby
Chair has joined #ruby
idefine has quit [Ping timeout: 264 seconds]
Chair is now known as Couch
maletor2 has joined #ruby
millerti has joined #ruby
armyriad has quit [Ping timeout: 244 seconds]
toretore has joined #ruby
tie_ has joined #ruby
nankyokusei has joined #ruby
maletor2 has quit [Ping timeout: 264 seconds]
armyriad has joined #ruby
weckl has joined #ruby
weckl has quit [Max SendQ exceeded]
AlexJakeGreen has quit [Quit: Leaving]
jaguarmagenta has joined #ruby
rodfersou has joined #ruby
skade has joined #ruby
aupadhye has joined #ruby
tristanp_ has joined #ruby
weckl has joined #ruby
Shashikant86 has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
nankyokusei has quit [Ping timeout: 276 seconds]
lxsameer has quit [Ping timeout: 276 seconds]
tristanp has quit [Ping timeout: 260 seconds]
tristanp has joined #ruby
Shashikant86 has quit [Max SendQ exceeded]
weckl has quit [Max SendQ exceeded]
weckl has joined #ruby
weckl has quit [Max SendQ exceeded]
allcentury has joined #ruby
weckl has joined #ruby
jaguarmagenta has quit [Ping timeout: 276 seconds]
weckl has quit [Max SendQ exceeded]
tristanp_ has quit [Ping timeout: 260 seconds]
weckl has joined #ruby
weckl has quit [Max SendQ exceeded]
LoneHermit has joined #ruby
weckl has joined #ruby
weckl has quit [Max SendQ exceeded]
weckl has joined #ruby
weckl has quit [Max SendQ exceeded]
tristanp_ has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tie_>
For shits and giggles I tested out how long it would take to encrypt 1KB of information using my algorithm in C++. How would i go about doing the same? Preferably in this format.
<tie_>
When i mean CPU time, i mean the time that has passed relating to the frequency of the CPU clock
<tie_>
clock time I mean by the actual OS clock
<tobiasvl>
ok, so hw vs sw clock
<tobiasvl>
I assumed correctly
<tie_>
No clue but lets go with that :)
<tobiasvl>
CPU = hardware, OS = software
<tie_>
there we go. That
<tie_>
Does Time.now use hardware or software?
sdothum has joined #ruby
sepp2k has joined #ruby
<ruurd>
No it uses the number of seconds since era as maintained by the OS.
<tobiasvl>
so software
<tie_>
Perfect, thank you.
<ruurd>
Which is initialized first by the time of the RTC clock on your motherboard and then adjusted and maintained by NTP if you installed that (which I advise)
<ruurd>
AFAIK it has millisecond accuraracy.
uncertainty has quit [Ping timeout: 244 seconds]
GriffinHeart has quit []
kgrz has quit [Ping timeout: 276 seconds]
<tie_>
So heres a nice ego boost for you Ruby lovers. After 6 months of C++ programming I wrote my encryption program i wrote it in 454 lines. After taking a 9 hour tutorial on Ruby I wrote it in 300 lines.
<tie_>
C++ took 16.341 seconds to encrypt 10KB of information. Ruby took 2.265 seconds
alfiemax has quit [Ping timeout: 258 seconds]
janebootydoe has joined #ruby
tristanp_ has quit [Ping timeout: 260 seconds]
Fernando-Basso has joined #ruby
<tie_>
Sorry for the butchered english. Its 4am here
QpQ4 has quit [Ping timeout: 244 seconds]
hk238 has joined #ruby
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nowhere_man has joined #ruby
digneety has quit [Quit: Leaving]
skade has quit [Quit: Computer has gone to sleep.]
i5pranay has joined #ruby
tristanp has joined #ruby
<i5pranay>
hi everyone
<i5pranay>
i am facing problem in installing rvm on ubuntu
GodFather has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
tie_ has quit [Ping timeout: 250 seconds]
skade has joined #ruby
tristanp_ has joined #ruby
tristanp has quit [Read error: Connection reset by peer]
Ropeney has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
emilkarl has joined #ruby
GodFather has joined #ruby
<norc>
i5pranay: Take a look at the link behind "Ask good questions" in the topic.
<norc>
And regarding tie_'s message.. Im not sure whether that speaks for Ruby or his C++ skills...
<Caerus>
specially since he probably wasn't using jruby
k3rn31 has joined #ruby
terlar has joined #ruby
<i5pranay>
i am using command :\curl -sSL https://get.rvm.io | bash -s stable --ruby
<i5pranay>
but i keep getting error
GodFather has quit [Ping timeout: 260 seconds]
<i5pranay>
:error:GPG signature verification failed for '/home/pranay/.rvm/archives/rvm-1.27.0.tgz' - 'https://github.com/rvm/rvm/releases/download/1.27.0/1.27.0.tar.gz.asc'! try downloading the signatures: gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
<i5pranay>
i tried running gpg2
<i5pranay>
still wont fix
auzty has quit [Quit: Leaving]
<i5pranay>
also tried :curl -#LO https://rvm.io/mpapis.asc gpg --import mpapis.asc error:gpg: can't open `/home/pranay/.gnupg/pubring.gpg' gpg: keydb_get_keyblock failed: eof gpg: no writable keyring found: eof gpg: error reading `mpapis.asc': general error gpg: import from `mpapis.asc' failed: general error gpg: Total number processed: 0
tie_ has joined #ruby
<tie_>
norc: I do need to say that I wrote my encryption in C++ to be memory efficient so granted it should be a little slower. But not 7 times slower.
sergey_makagon has joined #ruby
<norc>
tie_: Have you profiled your code?
<norc>
tie_: In the end Ruby cannot possibly be more efficient than a clean C or C++ implementation, for the simple reason that Ruby has lots of overhead to implement the VM.
<norc>
That isn't to say Ruby is inherently slow, but it just means your C++ implementation sucks.
mikecmpbll has joined #ruby
i5pranay has left #ruby [#ruby]
<tie_>
Oh, i know. I wrote it a year ago. For encryption, i should have programmed it for speed. But I programmed it for memory (Which is kind of pointless) meaning I put a lot more into some things that I probably shouldnt have.
ur5us has quit [Read error: Connection reset by peer]
<tie_>
But no, I havent profiled it.
kies has joined #ruby
maletor2 has joined #ruby
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
ur5us has joined #ruby
<domgetter>
Hopping back between Ruby and a C/C++ library can cost more than doing the whole thing in Ruby
ldnunes has joined #ruby
<domgetter>
It's best to have a bunch of work for C/C++ to do, and have it do it all at once
aries_liuxueyang has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tie_>
Im not sure I know what you mean.
uncertainty has joined #ruby
<norc>
domgetter: Hopping back between Ruby and C incurs no overhead since you can simply call C functions directly.
GodFather has joined #ruby
maletor2 has quit [Ping timeout: 240 seconds]
johnmilton has joined #ruby
blackmesa has joined #ruby
dn5 has joined #ruby
hanmac has quit [Ping timeout: 260 seconds]
joonty has joined #ruby
<domgetter>
norc: I don't think that's true. You have to use FFI or Fiddle to bolt the C functions to a method
gnufied has joined #ruby
mattwashere has joined #ruby
<norc>
domgetter: Essentially you just need to load the object somehow once and map it to a method which is a fairly low one time cost.
<domgetter>
Calling the method incurs a cost at the call site, does it not?
aupadhye has quit [Ping timeout: 240 seconds]
<norc>
domgetter: Only the same overhead that calling any method does, as you need to invoke Rubys dispatch mechanism.
<norc>
C functions are considerably cheaper to call, which is why all of Rubys core is implemented in C functions.
<domgetter>
Consider a C function that just does 1 + 1. I submit that using FFI or Fiddle to bolt that to an add_1_and_1 method and then calling that method 10000000 times would take longer than just calling 1 + 1 10000000 times in Ruby
mattwashere has quit [Ping timeout: 244 seconds]
blackmesa has quit [Ping timeout: 246 seconds]
<norc>
domgetter: perhaps ffi might suck for this I dont know. But you can just provide a native extension just as easily.
<norc>
That last one I promise you will beat any Ruby implementation that cannot be optimized by the Ruby bytecode compiler.
<domgetter>
I ahven't tried it with native extensions. It may be the case that the overhead is the same as any other method call
tristanp_ has quit [Ping timeout: 260 seconds]
<domgetter>
I do agree that if the C function adds 1 + 1 a million times, that *that* will be faster than adding 1 + 1 a million times in Ruby
panpainter has joined #ruby
davedev24 has joined #ruby
diegoaguilar has joined #ruby
maucar has joined #ruby
maucar has quit [Max SendQ exceeded]
ksmutthu has quit [Ping timeout: 244 seconds]
koooge has quit [Quit: Leaving...]
panpainter has quit [Ping timeout: 240 seconds]
maucar has joined #ruby
maucar has quit [Max SendQ exceeded]
tristanp has joined #ruby
<norc>
domgetter: There is no overhead to calling a native C function other than what Rubys method dispatch incurs *anyway*.
<norc>
As I said - that is the reason why the entire core library is written in C.
tie_ has quit [Ping timeout: 250 seconds]
Ropeney has joined #ruby
hanmac has joined #ruby
tvw has quit [Read error: Connection reset by peer]
rarruda has quit [Quit: leaving]
RegulationD has joined #ruby
ur5us has quit [Remote host closed the connection]
karmatr0n has joined #ruby
sepp2k has quit [Quit: Leaving.]
uncertainty has quit [Ping timeout: 258 seconds]
weckl has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
RegulationD has quit [Ping timeout: 276 seconds]
karmatr0n has quit [Ping timeout: 246 seconds]
GodFather has joined #ruby
pLaToOn has quit [Read error: Connection reset by peer]
GinoManWorks has quit [Read error: Connection reset by peer]
<Caerus>
norc, How do you call native c from ruby? I've read and used inline but that was on a 1.8.7 book. Is that still used?
kgrz has joined #ruby
<norc>
Caerus: No. Either you build a native extension or you use a foreign function interface like Fiddle
<norc>
There are some other solutions as well, but those are the common solutions to the problem.
uncertainty has joined #ruby
<Caerus>
i see
nfk has joined #ruby
weckl has quit [Ping timeout: 260 seconds]
chip_ has joined #ruby
<shevy>
norc I didn't finish to try yesterday, it was already very late and I was tired
<Caerus>
I tried the inline 1 + 1 times 10000000 and ruby did beat c. prolly too much overhead with that gem.
<hanmac>
i prefer building native extensions ... because if done right you might get better Error handling ... also FFI does not work so good when you have C++ stuff
tristanp_ has joined #ruby
kgrz has quit [Ping timeout: 244 seconds]
Alazoral has joined #ruby
GinoManWorks has joined #ruby
lxsameer has joined #ruby
kgrz has joined #ruby
tristanp has quit [Ping timeout: 260 seconds]
Caerus is now known as Caerus|Away
synthroid has joined #ruby
tristanp has joined #ruby
etehtsea has quit [Quit: Computer has gone to sleep.]
<shevy>
hanmac is not a big fan of FFI and swig :D
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
<hanmac>
i need to search for the crite but i have seen somewhere that even the creator of swig dont like it
Azure has quit [Ping timeout: 276 seconds]
rodfersou is now known as rodfersou|coffee
tristanp_ has quit [Ping timeout: 252 seconds]
<norc>
hanmac: ffi is nice if you want to hack something together real quick.
<hanmac>
norc specially if you have seen some of my macros i did use for my wx binding https://github.com/Hanmac/rwx some of them are very funky (like what macro_attr does do)
Corrosive_ has joined #ruby
tristanp has quit [Ping timeout: 252 seconds]
codecop has joined #ruby
<norc>
hanmac: I think you might get less headaches if you provide a C wrapper for Ruby. :o)
maucar has joined #ruby
CorOne has quit [Ping timeout: 258 seconds]
tristanp has joined #ruby
maucar has quit [Client Quit]
maucar has joined #ruby
aufi has quit [Ping timeout: 246 seconds]
tristanp_ has quit [Ping timeout: 252 seconds]
grios has joined #ruby
rodfersou|coffee is now known as rodfersou
janebootydoe has quit [Quit: Leaving]
Kim^J has left #ruby [#ruby]
nadir has quit [Quit: Connection closed for inactivity]
uncertainty has quit [Ping timeout: 240 seconds]
terlar has quit [Quit: WeeChat 1.5]
k3rn31 has quit [Quit: Computer has gone to sleep.]
isxek has joined #ruby
djcp has joined #ruby
CausaMortis has quit [Ping timeout: 264 seconds]
mattwashere has joined #ruby
nhhc has joined #ruby
CausaMortis has joined #ruby
allcentury has quit [Ping timeout: 260 seconds]
fmcgeough has joined #ruby
pawnbox has quit [Remote host closed the connection]
maletor2 has joined #ruby
pawnbox has joined #ruby
jmignault has joined #ruby
platzhirsch has quit [Quit: WeeChat 1.4]
nankyokusei has joined #ruby
maletor2 has quit [Ping timeout: 240 seconds]
jaguarmagenta has joined #ruby
deadnull_ has joined #ruby
AlexRussia has quit [Quit: WeeChat 1.4-dev]
codecop has quit [Remote host closed the connection]
chipotle_ has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
chipotle has quit [Ping timeout: 246 seconds]
giz|work has quit [Ping timeout: 252 seconds]
jaguarmagenta has quit [Ping timeout: 244 seconds]
karmatr0n has joined #ruby
kobain has joined #ruby
karmatr0n has quit [Remote host closed the connection]
madgen has quit [Ping timeout: 252 seconds]
karmatr0n has joined #ruby
hutch34_ has joined #ruby
karmatr0_ has joined #ruby
ramfjord has joined #ruby
bkxd has joined #ruby
nettoweb has joined #ruby
ruby-lang142 has joined #ruby
karmatr0n has quit [Ping timeout: 260 seconds]
giz|work has joined #ruby
ramortegui has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
futilegames has joined #ruby
futilegames has quit [Client Quit]
minimalism has joined #ruby
futilegames has joined #ruby
tristanp_ has joined #ruby
antgel has quit [Ping timeout: 240 seconds]
nettoweb has quit [Ping timeout: 244 seconds]
GodFather has quit [Ping timeout: 260 seconds]
lxsameer has quit [Ping timeout: 240 seconds]
trista___ has joined #ruby
SilverKey has quit [Quit: Halted.]
tristanp has quit [Ping timeout: 252 seconds]
CausaMortis has quit [Ping timeout: 252 seconds]
ChiefAlexander has joined #ruby
tristanp has joined #ruby
nettoweb has joined #ruby
allcentury has joined #ruby
tristanp_ has quit [Ping timeout: 252 seconds]
futilegames has quit [Remote host closed the connection]
GodFather has joined #ruby
<shevy>
hanmac likes c++!
uncertainty has joined #ruby
trista___ has quit [Ping timeout: 252 seconds]
tk__ has joined #ruby
eGGshke has quit [Quit: Leaving...]
stardiviner has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
sepp2k has joined #ruby
tristanp has quit [Ping timeout: 258 seconds]
bkxd has joined #ruby
mattwashere has quit [Remote host closed the connection]
diegoaguilar has quit [Remote host closed the connection]
cdg has joined #ruby
lightt has joined #ruby
lightt has quit [Max SendQ exceeded]
lightt has joined #ruby
<toretore>
shevy likes milhouse
tristanp has joined #ruby
panpainter has joined #ruby
madgen has joined #ruby
pld has quit [Quit: Connection closed for inactivity]
hutch34 has joined #ruby
bkxd has quit [Ping timeout: 264 seconds]
hutch34_ has quit [Ping timeout: 258 seconds]
panpainter has quit [Ping timeout: 244 seconds]
thejamespinto has joined #ruby
giz|work has quit [Ping timeout: 240 seconds]
anisha has joined #ruby
ZeroeSparticus has joined #ruby
giz|work has joined #ruby
surrounder has quit [Quit: WeeChat 1.4]
surrounder has joined #ruby
aegis3121 has joined #ruby
uncertainty has quit [Ping timeout: 244 seconds]
felltir has joined #ruby
CausaMortis has joined #ruby
<shevy>
is that the dude from the simpsons?
aganov has quit [Remote host closed the connection]
lightt has quit [Remote host closed the connection]
ferr has quit [Quit: WeeChat 1.5]
c0mrad3 has quit [Quit: Connection closed for inactivity]
kareeoleez has quit [Remote host closed the connection]
habitullence has quit [Quit: habitullence]
kareeoleez has joined #ruby
lightt has joined #ruby
malconis has joined #ruby
haxrbyte has joined #ruby
duckpuppy has joined #ruby
malconis has quit [Remote host closed the connection]
haxrbyte has quit [Client Quit]
malconis has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
jrafanie has quit [Read error: Connection reset by peer]
<kyrose>
jhass: so it's a gobject binding library?
<jhass>
yes
freerobby has quit [Read error: Connection reset by peer]
freerobby has joined #ruby
<kyrose>
How about ruby-gtk 2/3? Abandoned project?
<jhass>
slow to progress from what I've seen at least, I recommend the gir stuff because it seems actively developed
sergey_makagon has quit [Remote host closed the connection]
<jhass>
and I think the approach makes them easier to follow upstream
<jhass>
opposed to manually binding everything like ruby-gtk tries
<kyrose>
norc: but I believe it's good enough for sysadmin and command line application at least? I wanted to port some Python (cli) apps and libraries into ruby, and I hope it scales well.
<jhass>
CLI apps work very well for ruby
sergey_makagon has joined #ruby
<jhass>
vibrant ecosystem there
chouhoulis has joined #ruby
flughafen_ has quit [Ping timeout: 244 seconds]
scepticulous has quit [Ping timeout: 252 seconds]
<kyrose>
jhass: yay, I'm feel happy now. I'm afraid Ruby is moving itself towards 80% of web development. I'm not really into that, however. What I can confirm, Ruby is fun.
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
<TomyWork>
i like how you can make a functional web service in 4 lines in ruby :)
allcentury has quit [Ping timeout: 264 seconds]
frem_ has joined #ruby
<TomyWork>
but i haven't used rails yet
<kyrose>
TomyWork: wait what? You mean binding into .erb right?
<kyrose>
Oh! Awesome! I hope heroku supports sinatra.
norc has quit [Ping timeout: 250 seconds]
aredridel has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 258 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
<kyrose>
I also tried to get myself into rails (just curious), but it's painful at beginning.
<jhass>
heroku supports anything that starts a HTTP server on $PORT ;)
craigp has quit [Ping timeout: 272 seconds]
<kyrose>
Yeah! Good to know that!
idefine has joined #ruby
aufi has joined #ruby
<kyrose>
talking about heroku, how do you access the log file in the application anyway? Says, writing a file dynamically whenever visitors visit the website? Is there anyway to get/view the log without requiring the paid addon?
gtsai has joined #ruby
fedexo has joined #ruby
eljimmy has joined #ruby
croberts has quit [Remote host closed the connection]
maletor2 has joined #ruby
kareeoleez has quit [Remote host closed the connection]
<jhass>
heroku logs
idefine has quit [Ping timeout: 244 seconds]
<jhass>
there's a #heroku btw
<kyrose>
Oh yeah, thanks for the reference.
qinguan has joined #ruby
nankyokusei has joined #ruby
dionysus69 has joined #ruby
croberts has joined #ruby
poguez_ has joined #ruby
maletor2 has quit [Ping timeout: 258 seconds]
SilverKey has quit [Quit: Halted.]
gtsai has quit [Remote host closed the connection]
Yiota has joined #ruby
deadnull_ has quit [Quit: Bye]
mdw has joined #ruby
TomyWork has quit [Remote host closed the connection]
biox has quit [Quit: brb servers are ded]
nankyokusei has quit [Ping timeout: 240 seconds]
felltir has quit [Remote host closed the connection]
hutch34_ has joined #ruby
hutch34 has quit [Read error: Connection reset by peer]
panpainter has joined #ruby
biox has joined #ruby
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fenre has quit [Remote host closed the connection]
allcentury has joined #ruby
triangles2 has joined #ruby
Seeq has quit [Ping timeout: 272 seconds]
prestorium has joined #ruby
idefine has joined #ruby
morenoh149 has joined #ruby
triangles has quit [Ping timeout: 252 seconds]
JakFrist has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
uncertainty has quit [Ping timeout: 260 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
hutch34_ has quit [Ping timeout: 240 seconds]
aredridel has joined #ruby
mark_66 has left #ruby ["PART #RubyOnRails :PART #elixir-lang :PART #crystal-lang :PING 1464706668"]
chip_ has quit [Remote host closed the connection]
hutch34_ has joined #ruby
uncertainty has joined #ruby
grill has joined #ruby
harrymoreno has joined #ruby
panpainter has quit [Ping timeout: 240 seconds]
Bugboy1028 has quit [Remote host closed the connection]
sergey_makagon has quit []
gtsai has joined #ruby
idefine_ has joined #ruby
isxek has quit [Quit: Leaving]
senayar has quit [Remote host closed the connection]
Bugboy1028 has joined #ruby
Bugboy1028 has quit [Read error: Connection reset by peer]
idefine has quit [Ping timeout: 240 seconds]
gtsai_ has joined #ruby
TomyLobo has joined #ruby
morenoh149 has quit [Ping timeout: 260 seconds]
polishdub has joined #ruby
<shevy>
my thoughts are so much faster than my hands :(
rippa has joined #ruby
<jhbs>
your hands must be slow
gtsai has quit [Ping timeout: 260 seconds]
Es0teric has joined #ruby
aufi has quit [Ping timeout: 264 seconds]
Bugboy1028 has joined #ruby
Bugboy1028 has quit [Remote host closed the connection]
jackjackdripper has joined #ruby
jaruga____ has quit [Quit: jaruga____]
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
anisha has quit [Quit: Leaving]
aegis3121 has joined #ruby
kies has quit [Ping timeout: 244 seconds]
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jhack has quit [Quit: jhack]
SilverKey has joined #ruby
jackjackdripper has quit [Ping timeout: 244 seconds]
freerobby has quit [Quit: Leaving.]
ywvyeu has joined #ruby
<shevy>
they are!
Bugboy1028 has joined #ruby
<shevy>
I already had lots of thoughts today while walking and traveling via the subway... now I am at home again and implementing things will take hours if not days
freerobby has joined #ruby
lightt has quit [Remote host closed the connection]
snebel has joined #ruby
pawnbox_ has joined #ruby
idefine_ has quit [Ping timeout: 244 seconds]
jhack has joined #ruby
<snebel>
A quick question I have a ruby project (not rails) under lib/ directory all my classes and modules, I'd like to add a method to Array class, where should I place that array.rb file to be correct?
pawnbox has quit [Ping timeout: 244 seconds]
<snebel>
in the root of lib?
<snebel>
lib/something/arrary.rb ?
tildes_ has joined #ruby
vilsonacneto has joined #ruby
platzhirsch has joined #ruby
evidex has quit [Ping timeout: 260 seconds]
kgrz has quit [Ping timeout: 240 seconds]
scepticulous has quit [Ping timeout: 272 seconds]
<hanmac>
snebel: hm lib/core/array.rb does looks good, but imo it might not be the best idea to add things to core classes (hm might need to checkout if there is not an better way)
freerobby has quit [Read error: Connection reset by peer]
arlek has joined #ruby
freerobby has joined #ruby
moei has quit [Quit: Leaving...]
Seeq has joined #ruby
<hanmac>
also checkout Redefinement i didn't used them myself before but they might be better than adding stuff to Array directly
<jhass>
snebel: the common convention is lib/gemname/core_ext/array.rb, but ^
ksmutthu has joined #ruby
<snebel>
Mmmm thanks for the answer, the idea I have at this moment is to create a .to_Myobject method
<snebel>
so I can convert arrays of strings to my object structure
<snebel>
may be is not the best way
<snebel>
of doing this..
<jhass>
doesn't sound like it tbh
ksmutthu has quit [Client Quit]
<snebel>
any suggestion on how doing it more compliant, elegant is welcome! :-)
synthroid has quit [Remote host closed the connection]
openstruct has joined #ruby
openstruct has quit [Client Quit]
saneax is now known as saneax_AFK
kies has joined #ruby
harrymoreno is now known as morenoh149
CausaMortis has quit [Ping timeout: 260 seconds]
<shevy>
hmm quick question, just gut feeling - if we have two different very large datasets, may marshalling it be better than storing it into a single yaml file?
hutch34 has joined #ruby
<shevy>
(for reading it lateron)
craigp has joined #ruby
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
kareeoleez has quit [Remote host closed the connection]
mtkd has joined #ruby
murican has joined #ruby
<kyrose>
Is ruby good for data mining, eg. scraping?
<bougyman>
it doesn't suck
<dfockler>
kyrose: python has scrapy if you need a full-featured framework
<havenwood>
kyrose: yes
<wrkrcoop>
when i run OpenSSL::Digest.new('sha1')
<wrkrcoop>
in irb, it says uninitialized constant OpenSSL
<wrkrcoop>
how do i get access to openssl?
<havenwood>
wrkrcoop: require 'openssl'
<adaedra>
require it
mleung has joined #ruby
<wrkrcoop>
havenwood: ty
<wrkrcoop>
i forgot the quotes
pietr0 has joined #ruby
whathappens has joined #ruby
<kyrose>
oh okay thanks, but I don't wanna use scrapy, I wanted to try it in Ruby. Is there anyway to do simple scraping without importing nokogiri and stuff.
<shevy>
hmm wasn't there some stock exchange tool in ruby-gnome that would also sync with external data for that
<dfockler>
kyrose: you'll definitely want some sort of HTML parsing library
<dfockler>
or XML to be more specific
rodfersou|lunch is now known as rodfersou
<jhass>
HTML != XML
<kyrose>
Ruby have that? If not, I have to manually rewirte the http library I guess for this task.
<kyrose>
rewire*
kareeoleez has joined #ruby
<jhass>
kyrose: have a look at the mechanize gem
RobertBirnie has joined #ruby
skolman_ has quit [Read error: Connection reset by peer]
<kyrose>
thanks jhass
Coldblackice has joined #ruby
skolman_ has joined #ruby
<shevy>
mechanize depends on nokogiri :)
<al2o3-cr>
shevy: isn't that the other way round?
kareeoleez has quit [Ping timeout: 244 seconds]
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dfockler>
that's right, mechanize uses nokogiri
SCHAAP137 has joined #ruby
anisha has joined #ruby
<al2o3-cr>
ah, maybe not
<shevy>
al2o3-cr nah, I remember a long time ago that there was a change in mechanize. back then nokogiri was added, and it failed to compile for me (must be like 5 years ago or even longer than that now)
ico has joined #ruby
SilverKey has quit [Quit: Halted.]
hutch34_ has joined #ruby
<al2o3-cr>
shevy: have you used it since?
hutch34 has quit [Ping timeout: 250 seconds]
yfeldblum has quit [Ping timeout: 272 seconds]
<shevy>
al2o3-cr hehehe
<shevy>
nope :(
<al2o3-cr>
:P
<shevy>
I mean, I need something like mechanize
maletor2 has joined #ruby
<shevy>
but failing to get it to run wasn't a lot of fun
<mac10>
havenwood: does require ‘heroku-api’ belong on the config.ru file?
infinito_ has joined #ruby
jhack_ has joined #ruby
ruby-newby has joined #ruby
<ruby-newby>
hey guys - is anyone knowledgable about oauth?
jhack_ has quit [Client Quit]
workmad3 has quit [Ping timeout: 260 seconds]
<aegis3121>
?anyone
<ruby[bot]>
Just ask your question, if anyone has or can, they will respond.
jhack_ has joined #ruby
infinitone has quit [Remote host closed the connection]
infinito_ has quit [Client Quit]
edwinvdgraaf has quit [Read error: Connection reset by peer]
jhack has quit [Ping timeout: 260 seconds]
chouhoul_ has quit [Remote host closed the connection]
jhack__ has joined #ruby
blackmesa has quit [Quit: WeeChat 1.5]
<ruby-newby>
some background: I'm making a twitter app which would require the automatic management of followers, even when the user is not "logged in" to the app via twitter. Once i get an oauth token from twitter for the user, can i use that token to make API requests on their behalf even when they arent logged in?
edwinvdgraaf has joined #ruby
chouhoulis has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
<havenwood>
mac10: I think there's an unofficial heroku channel around here somewhere.
<mac10>
havenwood: yeah i went to #heroku but its quity empty and quiet.
<mac10>
all i want to do it make my weather api work on heroku :(
<ruby-newby>
jhass: so i can just store the token and use it whenever i need?
<mac10>
havenwood: it works on my localhost but not on heroku. im new to api and i cant find an example of it
<jhass>
ruby-newby: it expires, so you need to make sure refresh it from time to time, but yes
futilegames has joined #ruby
<jhass>
ruby-newby: that's why you get two tokens, the access token and the refresh token
<havenwood>
mac10: Try the Rack example they give verbatim. Does that work?
multi_io has quit [Ping timeout: 240 seconds]
flashpoint9 has quit [Remote host closed the connection]
<ruby-newby>
does the user need to be involved in refreshing of the token (give permission)? or can i just like run some cron task to refresh the tokens of my userbase every week or something
flashpoint9 has joined #ruby
<jhass>
the latter
<ruby-newby>
woooooooo
<jhass>
you need the user for initial authentication or when you need new scopes
<ruby-newby>
excellent
<havenwood>
mac10: Does it deploy but not respond to requests? Are you sure you're hitting it correctly? Gist the config.ru?
<mac10>
havenwood: see thats why i’m unsure about. I believe im missing that but i can’t find an example of how to do it
<mac10>
my config.ru page doesnt really have anything API in it
<havenwood>
mac10: What do the logs show?
multi_io has joined #ruby
<mac10>
havenwood: I’m trying to find a sample code of putting an api
<havenwood>
mac10: Watch them: heroku logs -t
Fernando-Basso has quit [Quit: Leaving]
jmignault has joined #ruby
<infinitone>
anyone know a better alternative than pgadmin for Windows?
<mac10>
havenwood: and also “Using the API key” which file do i put these code in
karapetyan has joined #ruby
madgen has quit [Ping timeout: 276 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
madgen has joined #ruby
tildes_ has quit [Ping timeout: 244 seconds]
last_staff has joined #ruby
aswen has joined #ruby
murican has quit [Read error: Connection reset by peer]
A124 has quit [Quit: '']
ruby-newby has quit [Ping timeout: 250 seconds]
Es0teric has quit [Remote host closed the connection]
aegis3121 has quit [Ping timeout: 276 seconds]
A124 has joined #ruby
Seeq has joined #ruby
Yiota has joined #ruby
Yiota has quit [Max SendQ exceeded]
idefine has joined #ruby
nton has joined #ruby
Yiota has joined #ruby
Yiota has quit [Max SendQ exceeded]
Yiota has joined #ruby
nton has quit [Client Quit]
idefine has quit [Ping timeout: 252 seconds]
last_staff has quit [Quit: last_staff]
ramfjord_ has quit [Ping timeout: 252 seconds]
last_staff has joined #ruby
<havenwood>
mac10: It works locally? Where are you putting the files locally? How are you testing it? Why no logs of the request
<havenwood>
?
ico has quit [Read error: Connection reset by peer]
<mac10>
havenwood: the only time i used the api is in public/javascript/js file
BlackHatJack has joined #ruby
<mac10>
havenwood: may i ask where I am suppose to use the API key?
nadir has joined #ruby
bluOxigen has quit [Ping timeout: 240 seconds]
idefine has joined #ruby
ico has joined #ruby
millerti has joined #ruby
bluOxigen has joined #ruby
deadnull_ is now known as _deadnull
<havenwood>
mac10: So it's not working locally in development?
Devalo has quit [Remote host closed the connection]
<havenwood>
mac10: The API docs show how to use the API key.
<mac10>
havenwood: it doesn’t tell me which file to use it in
<mac10>
havenwood: i guess thats where I’m mainly confused about
<havenwood>
It seems you know where the API is being called. That's the place.
idefine has quit [Remote host closed the connection]
sorah__ has quit [Ping timeout: 260 seconds]
sepp2k has quit [Quit: Leaving.]
zeroDi has joined #ruby
aegis3121 has joined #ruby
<havenwood>
(Responded by PM since the key is publicly exposed.)
<norc_>
Regarding the oauth topic earlier.. people who do not understand oauth in the slightest should not be using it.
lacrosse has joined #ruby
futilegames has quit [Quit: futilegames]
<norc_>
I mean eventually such people might figure out how to "get it working" but making subtle (or not-so-subtle) mistakes, removing any security you were hoping to gain..
jenrzzz has quit [Ping timeout: 250 seconds]
idefine has joined #ruby
<daxroc>
How would you add whats in one hash to another where keys match ?
<norc_>
daxroc, can you be more specific?
<norc_>
("Adding" does not make sense when the keys match)
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<daxroc>
merge, x = { :a => { :b => "abc" } } ; n = { :a => { :c => "def" } } ; What I want is { :a => { :b => ..., :c => ... } }
<shevy>
so something like an inner merge
karapetyan has quit [Read error: No route to host]
<norc_>
Look at the implementation (click Show source)
felipecvo has joined #ruby
replay has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
sarbs has quit [Max SendQ exceeded]
sarbs has joined #ruby
<daxroc>
Awesome many thanks
sarbs has quit [Max SendQ exceeded]
Vlat- has joined #ruby
sarbs has joined #ruby
<daxroc>
Curious why it's not on stdlib Hash ?
<norc_>
daxroc, the standard library only contains the functionality that is deemed commonly needed.
idefine has joined #ruby
troulouliou_dev has joined #ruby
vikaton has joined #ruby
yqt has joined #ruby
<norc_>
daxroc, if you feel this could be useful enough to hand it to the millions of ruby developers out there, feel free to make a feature request on the bug tracker.
<shevy>
daxroc you may have been the first one in 5 years who asked for this here quite likely :)
<norc_>
Hardly. I see this being asked in here from time to time.
idefine has quit [Remote host closed the connection]
ocbtec has quit [Quit: leaving]
<shevy>
when was the last time?
<al2o3-cr>
daxroc: x.merge(n) { |k, o, n| o.merge(n) }
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<ta_>
Hola, I'm trying to "run" a script in a string as if it was a file - simple example: `puts Open3.capture3("#!/usr/bin/env ruby\nputs 1\n").inspect`... is that doable at all?
<norc_>
shevy, why don't you use the log yourself.
shinnya has quit [Ping timeout: 244 seconds]
<al2o3-cr>
daxroc: if that's what you mean
SCHAAP137 has quit [Ping timeout: 276 seconds]
<norc_>
al2o3-cr, oh well. That works if the Hash is only one level deep.. ;-)
troulouliou_dev has quit [Quit: Leaving]
<daxroc>
Worked :D
<shevy>
norc_ you made a claim and you could not back it up
<norc_>
shevy, there is a huge difference between not being able to back it up, and not doing the work for you.
joonty has joined #ruby
<norc_>
shevy, if you want to argue for the sake of it, go spend your time digging through logs to prove me wrong. I have better things to do.
<shevy>
norc_ ok so allow me to reply - your statement is incorrect
<al2o3-cr>
whoa, chill peeps :)
<norc_>
Ok.
poguez_ has quit [Quit: Connection closed for inactivity]
_djbkd has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
dfockler has quit [Quit: Leaving]
idefine has joined #ruby
<wrkrcoop>
whats the best way to turn xml into json?
ramfjord has joined #ruby
dmr8 has joined #ruby
<norc_>
wrkrcoop, using code.
<norc_>
wrkrcoop, xml is a markup language, json is javascript object notation. They are not the same or even similar enough to consider a generalized transformation from one into the other.
<xpt>
just rename file noone will see the difference
mleung has quit [Quit: mleung]
<wrkrcoop>
im getting xml and trying to interact with it
idefine has quit [Ping timeout: 244 seconds]
<hxegon>
wrkrcoop: listen to xpt, that is industry standard
fenre has quit [Remote host closed the connection]
edavis has quit [Remote host closed the connection]
edavis has joined #ruby
whathappens has joined #ruby
lightt has quit [Ping timeout: 276 seconds]
xdexter has joined #ruby
<xdexter>
Hello, i have this error "`check_options': unrecognized option: read_timeout (ArgumentError)" someone help me please? (http://pastebin.com/bJaC0Qd0)
<deweydb>
but what i mean is, why is it saying i've got ruby 1.9.3 when rvm list says 2.3.1
electrostat has quit [Ping timeout: 260 seconds]
skade has joined #ruby
sid_fules has quit [Read error: Connection reset by peer]
jhbs has quit [Read error: Connection reset by peer]
<aegis3121>
It's probably defaulting to your system ruby.
infinitone has joined #ruby
sid_fules has joined #ruby
diegoviola has joined #ruby
<aegis3121>
meaning: when you run the script, the system uses its ruby vs what you're telling it to use via rvm
jancel has quit [Remote host closed the connection]
skolman_ has quit [Remote host closed the connection]
electrostat has joined #ruby
<havenwood>
deweydb: try without any `sudo`s
<havenwood>
deweydb: or if you must, replace `sudo` with `rvmsudo` so your env is preserved
diegoaguilar has joined #ruby
madgen has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
skade has quit [Client Quit]
diegoaguilar has joined #ruby
jancel has joined #ruby
<mikecmpbll>
memory question: i'm using ruby 2.1 and what (little) i understood of forking processes is that 'copy-on-write' means they share memory? i'm experiencing memory increasing vastly with each fork
diegoaguilar has quit [Max SendQ exceeded]
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
biberu has quit [Read error: Connection reset by peer]
<mikecmpbll>
"Instead of allocating duplicate memory when a process is forked, COW allows multiple processes to share the same memory until one of the processes needs to modify a piece of information."
diegoaguilar has joined #ruby
<eam>
mikecmpbll: that's correct
<mikecmpbll>
i'm not sure what it means by "modify a piece of information"
ferr has quit [Quit: WeeChat 1.5]
<eam>
memory is separated into pages -- on linux, either 4k, 2m or 1g
diegoaguilar has quit [Max SendQ exceeded]
<eam>
when you fork, the newly forked process has references to the parent's pages. As soon as any modifications to the page occur the page is copied
diegoaguilar has joined #ruby
<eam>
if you fork and do nothing in the parent or child, no significant memory will be allocated. But if either touch a page, it makes a copy for each
infinitone has quit [Ping timeout: 276 seconds]
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
diegoaguilar has quit [Max SendQ exceeded]
<mikecmpbll>
eam : ah .. hm. my process uses about 5GB of memory before forking, the vast majority of which is loaded activerecord objects, do you know of anything in activerecord that causes the memory to be copied? (not yet googled on this angle)
diegoaguilar has joined #ruby
<mikecmpbll>
i'm not modifying the records.
diegoaguilar has quit [Max SendQ exceeded]
diegoaguilar has joined #ruby
<eam>
there's no clear or reliable way to reason about memory pages at the ruby level
nankyokusei has joined #ruby
ChiefAlexander has quit [Quit: Leaving...]
<eam>
the most common place where COW is useful is when you fork, then exec, immediately replacing the child process (so you don't make a copy of the parent to immediately throw it away)
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aegis3121 has quit [Ping timeout: 258 seconds]
<eam>
best answer is probably: poke around with /proc and see what your process is doing
<mikecmpbll>
eam : thanks for your help! :)
<eam>
mikecmpbll: I also wonder how you're measuring memory being used
<mikecmpbll>
eam : free -m, and the process crashing because i run out of memory :d
polishdub has quit [Quit: Leaving]
<eam>
free isn't going to accurately reflect memory use
mattwashere has quit [Remote host closed the connection]
fnodeuser has joined #ruby
<mikecmpbll>
nuh?
<fnodeuser>
hi, how can i make '--js-flags=--expose-gc' work to be able to initiate garbage collection manually from the console? i'm using the latest stable chrome version, entering window.gc() or gc() just makes the console to display 'undefined'
electrostat has quit [Ping timeout: 258 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mikecmpbll>
eam : thanks for the link. what's the reason free won't be accurate?
GBrawl has quit [Ping timeout: 260 seconds]
palms has left #ruby [#ruby]
TomyLobo has quit [Ping timeout: 276 seconds]
lightt has joined #ruby
Oclair_ has quit [Ping timeout: 264 seconds]
arooni has joined #ruby
jancel has quit [Remote host closed the connection]
art-solopov has quit [Quit: Konversation terminated!]
workmad3 has quit [Ping timeout: 272 seconds]
Yiota has joined #ruby
marxarelli has joined #ruby
Parko has joined #ruby
water has joined #ruby
water is now known as Guest63822
kirun has quit [Quit: Client exiting]
DarthGandalf has quit [Ping timeout: 244 seconds]
Yiota has quit [Ping timeout: 252 seconds]
jaiks has quit [Ping timeout: 244 seconds]
xpt has quit [Ping timeout: 246 seconds]
Guest63822 is now known as tinhajj
Seeq has quit [Ping timeout: 264 seconds]
micahf has joined #ruby
ZeroeSparticus_ has joined #ruby
xpt has joined #ruby
lightt has quit [Ping timeout: 276 seconds]
<tinhajj>
If I've required a gem in a gemspec using add_runtime_dependency such as nokogiri I wouldn't need to do require 'nokogiri' in my files right?
<pipework>
tinhajj: of course you would.
<pipework>
you should, too!
<tinhajj>
alright interesting something on rubygems doc is confusing me then 1 sec
ZeroeSparticus has quit [Ping timeout: 258 seconds]
<tinhajj>
it says use gemspec to handle dependencies so I just assumed the dependency took care of requiring the gem, but thats not the case then? gemspec will only take care of versioning and the documentation is just saying that versioning should be in the gemspec
<tinhajj>
does that sound right?
aeterne has quit [Read error: Connection reset by peer]
<hxegon>
I think it's saying don't use a gemfile except to require the .gemspec, as I've seen that pattern a few times. Could be wrong though tinhajj
toretore has quit [Ping timeout: 240 seconds]
jancel has quit [Remote host closed the connection]
JesseH2 has quit [Remote host closed the connection]
mleung has quit [Quit: mleung]
rkazak has joined #ruby
<pipework>
tinhajj: It means literally don't use the `gem` method/thing in your gemspec. You can use Bundler and bundler can use `gemspec` inside the Gemfile just fine.
agent_white has quit [Quit: headinHome]
Seeq has joined #ruby
RobertBirnie has quit [Ping timeout: 260 seconds]
tildes_ has joined #ruby
Synthead has quit [Ping timeout: 276 seconds]
rkazak has quit [Ping timeout: 240 seconds]
diegoaguilar has quit [Remote host closed the connection]
RobertBirnie has joined #ruby
bhaak has quit [Ping timeout: 276 seconds]
firstdayonthejob has quit [Ping timeout: 250 seconds]
justapersona has quit [Quit: Leaving.]
arlek has joined #ruby
electrostat has quit [Remote host closed the connection]
solocshaw has joined #ruby
hutch34__ has quit [Ping timeout: 240 seconds]
fnodeuser is now known as throwaway9999999
ramfjord has joined #ruby
electrostat has joined #ruby
spider-mario has quit [Remote host closed the connection]
edavis has quit [Remote host closed the connection]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
edavis has joined #ruby
madgen has quit [Ping timeout: 244 seconds]
millerti has joined #ruby
<eam>
mikecmpbll: /win 3
<eam>
erp
gnufied has quit [Quit: Leaving]
<eam>
mikecmpbll: there are a couple different ways to account for memory, what you see in free comes with a bunch of caveats
whathappens has joined #ruby
<eam>
if you're trying to show how much memory is shared / not shared between two processes you'll want to look at their mappings in detail
edwinvdgraaf has quit [Remote host closed the connection]
smathy_ has joined #ruby
<mikecmpbll>
okidokes.
Yxhuvud has quit [Ping timeout: 260 seconds]
blackmesa has quit [Ping timeout: 264 seconds]
whathapp_ has quit [Ping timeout: 272 seconds]
smathy has quit [Ping timeout: 260 seconds]
valkyr1e has quit [Ping timeout: 260 seconds]
Seeq has quit [Ping timeout: 260 seconds]
Devalo has joined #ruby
maletor3 has joined #ruby
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
madgen has joined #ruby
maletor2 has quit [Ping timeout: 250 seconds]
Liothen has joined #ruby
idefine has quit [Ping timeout: 240 seconds]
sid_fules has quit [Read error: Connection reset by peer]
valkyr1e has joined #ruby
Devalo has quit [Ping timeout: 276 seconds]
Liothen has quit [Changing host]
Liothen has joined #ruby
freerobby has quit [Quit: Leaving.]
phredus has joined #ruby
tinhajj has quit [Quit: Leaving]
phredus has quit [Remote host closed the connection]
SilverKey has quit [Quit: Halted.]
valkyr1e has quit [Ping timeout: 260 seconds]
bhaak has joined #ruby
cdg has quit [Remote host closed the connection]
jhack has quit [Quit: jhack]
skweek has quit [Ping timeout: 244 seconds]
Seeq has joined #ruby
kus has joined #ruby
kus has quit [Max SendQ exceeded]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
flashpoint9 has joined #ruby
diegoaguilar has joined #ruby
ocbtec has quit [Quit: leaving]
diegoaguilar has quit [Max SendQ exceeded]
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
diegoaguilar has joined #ruby
madgen has quit [Ping timeout: 240 seconds]
diegoaguilar has quit [Max SendQ exceeded]
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
valkyr1e has joined #ruby
diegoaguilar has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
diegoaguilar has quit [Max SendQ exceeded]
domgetter has joined #ruby
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
Vile` has joined #ruby
Ropeney has joined #ruby
hutch34__ has joined #ruby
valkyr1e has quit [Ping timeout: 264 seconds]
ramfjord_ has joined #ruby
Ropeney has quit [Client Quit]
koooge has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
hutch34__ has quit [Ping timeout: 240 seconds]
throwaway9999999 has left #ruby [#ruby]
micahf has quit [Quit: Leaving]
whathappens has quit [Quit: Leaving...]
valkyr1e has joined #ruby
jancel has joined #ruby
sid_fules has joined #ruby
y2mq37 has joined #ruby
y2mq37 has quit [Read error: Connection reset by peer]