Cohedrin has quit [Read error: Connection reset by peer]
dtcristo has left #ruby ["Kicked by @appservice-irc:matrix.org"]
Cohedrin has joined #ruby
Demo318 has quit [Ping timeout: 240 seconds]
hotpanca_ has quit [Remote host closed the connection]
arescorpio has joined #ruby
ecuanaso has joined #ruby
mim1k has joined #ruby
electrostat has quit [Quit: uwotm8]
mim1k has quit [Ping timeout: 240 seconds]
hotpanca_ has joined #ruby
Danny has joined #ruby
Danny is now known as Guest38892
Mia has quit [Ping timeout: 240 seconds]
electrostat has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
hotpanca_ has quit [Ping timeout: 255 seconds]
Cohedrin has joined #ruby
username has joined #ruby
Guest38892 has quit [Remote host closed the connection]
marxarelli is now known as marxarelli|afk
roshanavand has quit [Quit: roshanavand]
jhack has quit [Quit: Leaving]
AnoHito has joined #ruby
gusrub_ has quit [Remote host closed the connection]
d^sh has quit [Ping timeout: 246 seconds]
hotpancakes has joined #ruby
d^sh has joined #ruby
Danny has joined #ruby
Danny is now known as Guest25813
PorcoRex has quit [Quit: Leaving]
cdg has joined #ruby
hotpancakes has quit [Read error: Connection reset by peer]
hotpanc__ has joined #ruby
enterprisey has quit [Remote host closed the connection]
Guest25813 has quit [Ping timeout: 240 seconds]
Cohedrin has quit [Read error: Connection reset by peer]
genpaku has quit [Remote host closed the connection]
hutch34 has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
genpaku has joined #ruby
Cohedrin has joined #ruby
latemus has quit [Quit: life is bullshit]
jameser has joined #ruby
gothicsouth has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bauruine has quit [Ping timeout: 240 seconds]
Danny has joined #ruby
Danny is now known as Guest55161
hotpanc__ has quit [Remote host closed the connection]
charliesome has joined #ruby
KeyJoo has quit [Ping timeout: 255 seconds]
mitt3ns has joined #ruby
Guest55161 has quit [Ping timeout: 255 seconds]
Demo318 has joined #ruby
bauruine has joined #ruby
Danny has joined #ruby
Danny is now known as Guest55370
agent_white has quit [Ping timeout: 246 seconds]
Guest55370 has quit [Remote host closed the connection]
hotpanca_ has joined #ruby
__Yiota has joined #ruby
hotpanca_ has quit [Remote host closed the connection]
jrafanie has joined #ruby
hotpanca_ has joined #ruby
hotpanca_ has quit [Remote host closed the connection]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hotpancakes has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
ecuanaso has joined #ruby
uZiel has quit [Remote host closed the connection]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bbdk has joined #ruby
muelleme_ has joined #ruby
hotpancakes has quit [Remote host closed the connection]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hotpancakes has joined #ruby
<bbdk>
hey guys :) i've comming from JS.. and i have a question i would like to know the real diference between ruby and python..
alveric1 has quit [Quit: WeeChat 1.8]
Demo318 has quit [Ping timeout: 260 seconds]
muelleme_ has quit [Ping timeout: 258 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elomatreb>
bbdk: One is Ruby, the other is Python? More concrete pls
weathermaker has quit [Quit: weathermaker]
jrafanie has joined #ruby
uZiel has joined #ruby
jane_booty_doe has joined #ruby
whiteline_ has joined #ruby
uZiel_ has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
hotpancakes has quit [Remote host closed the connection]
whiteline has quit [Ping timeout: 264 seconds]
<bbdk>
Sorry, I meant that, I would like to know the pros / cons of ruby since, I am a javascript developer and many people tell me, to go to python and other ruby. So, I came here to hear from you that you are experienced.
csaunders_ has quit [Quit: later tater]
<elomatreb>
They're not that different in the grand scale of things. Learn both if you're unsure and use what you like better
<Nilium>
What do you want to do?
<Nilium>
And when you've got that in mind, probably ask communities of both about that
<Nilium>
And just leave out the whole "compared to this other language" bit
marxarelli|afk has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
jane_booty_doe has quit [Quit: Leaving]
<bbdk>
Web dev
username has quit [Ping timeout: 255 seconds]
lel has joined #ruby
nankyokusei has joined #ruby
hotpancakes has joined #ruby
igniting has quit [Ping timeout: 240 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<SeepingN>
I can see wanting to limit the version of ruby, esp if you don't have time to test it on several major releases. I have found the move from 1.6.7 to 2.0 to be full of surprises, many of which I didn't hit until certain timeout events triggered in production
Ropeney_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<elomatreb>
1.6 is ancient though, and included some of the most major changes in Ruby history
<elomatreb>
E.g. upgrading from 2.2 to 2.3 was hardly any work for the most part
polysics has quit [Ping timeout: 258 seconds]
hotpancakes has joined #ruby
<Nilium>
I'd be kind of surprised to see anyone who still used 1.6
postmodern has quit [Quit: Leaving]
<mistnim>
this is really bad, if you use binding.pry __dir__ becomes ".", that's the opposite of useful for debugging
<dminuoso>
mistnim: It's perfectly fine if you know what __dir__ does.
mtkd has quit [Read error: Connection reset by peer]
<dminuoso>
mistnim: Use __FILE__ if you can't use it in a dynamic context.
mtkd has joined #ruby
<mistnim>
dminuoso, if I have a function that uses __dir__ than it will fail if launched from pry
<mistnim>
then*
ferr1 has joined #ruby
cschneid_ has joined #ruby
ascarter has joined #ruby
muelleme_ has joined #ruby
hotpancakes has quit [Ping timeout: 260 seconds]
<mistnim>
then I have to investigate the problem and it was just pry being tricky
cschnei__ has joined #ruby
<dminuoso>
mistnim: Well the issue is that __dir__ is a method that asks Kernel at runtime.
<dminuoso>
Though.. mmm.
<dminuoso>
Wait..
dc4 has quit [Ping timeout: 240 seconds]
silverdust is now known as Guest74864
<elomatreb>
__FILE__ is set by pry, so that probably breaks things
cschneid_ has quit [Ping timeout: 240 seconds]
Abhijit has quit [Quit: Bye.]
mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
<mistnim>
in any case, I'm going with DIR = __dir__ on top, and then use DIR instead of __dir__
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hightower2 has joined #ruby
rohitpaulk has quit [Ping timeout: 260 seconds]
ecuanaso has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
muelleme_ has quit [Ping timeout: 240 seconds]
<mistnim>
lol, I really have a troubled relationship with pry. Calling a function play is a bad idea
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
anisha has joined #ruby
hotpanca_ has joined #ruby
raul782 has joined #ruby
rohitpaulk has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ecuanaso has joined #ruby
Demo318 has joined #ruby
mistnim has quit [Remote host closed the connection]
raul782 has quit []
Guest74864 is now known as silverdust
cschnei__ has quit [Ping timeout: 240 seconds]
<dminuoso>
mmmm
<dminuoso>
elomatreb: Yeah you are right.
hotpanca_ has quit [Remote host closed the connection]
latemus has quit [Ping timeout: 240 seconds]
muelleme_ has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has joined #ruby
rgr has joined #ruby
latemus has joined #ruby
ignarps has quit [Ping timeout: 255 seconds]
biberu has joined #ruby
TomyWork has joined #ruby
ecuanaso has joined #ruby
watersoul_ has joined #ruby
Demo318 has quit [Ping timeout: 260 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
watersoul has quit [Ping timeout: 240 seconds]
nankyokusei has joined #ruby
haraoka has quit [Ping timeout: 255 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nankyokusei has quit [Ping timeout: 268 seconds]
muelleme_ has quit [Ping timeout: 260 seconds]
jaruga_________ has joined #ruby
ecuanaso has joined #ruby
rohitpaulk has quit [Ping timeout: 255 seconds]
ltem has joined #ruby
ignarps has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
x86 has joined #ruby
mark_66 has joined #ruby
bvcosta has joined #ruby
joonty has joined #ruby
<x86>
hello
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has joined #ruby
sleetdrop has quit [Quit: Computer has gone to sleep.]
solocshaw has joined #ruby
sleetdrop has joined #ruby
patarr has quit [Ping timeout: 255 seconds]
<al2o3-cr>
o/
sleetdrop has quit [Client Quit]
<x86>
no one alive?
<havenwood>
x86: hey
<x86>
hello
ryzokuken has joined #ruby
<hightower2>
Do you have a quality question for us, x86 sir.
<x86>
well.. it's not quality question. but: When do you find fun in ruby?
blackwind_123 has quit [Ping timeout: 260 seconds]
<ropeney>
about 10am most days
<hightower2>
always :) it's a language with cleanest/simplest syntax
<x86>
I think I am recently too unmotivated.
<x86>
It may be not a programming question.
sleetdrop has joined #ruby
bvcosta has quit [Remote host closed the connection]
pandaant has joined #ruby
blackwind_123 has joined #ruby
x86 has quit [Quit: Page closed]
<darix>
Dir.pwd
ryzokuken has quit [Remote host closed the connection]
Silthias1 has joined #ruby
ryzokuken has joined #ruby
ecuanaso has joined #ruby
bvcosta has joined #ruby
charliesome has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
Silthias has quit [Ping timeout: 260 seconds]
jameser has quit [Ping timeout: 240 seconds]
psychicist__ has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
jenrzzz has quit [Ping timeout: 246 seconds]
bvcosta has quit [Remote host closed the connection]
jameser has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bauruine has quit [Max SendQ exceeded]
ddffg has joined #ruby
hanmac has quit [Ping timeout: 246 seconds]
bauruine has joined #ruby
mim1k has joined #ruby
bvcosta has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yeticry_ has quit [Ping timeout: 240 seconds]
ecuanaso has joined #ruby
ddffg has quit [Ping timeout: 255 seconds]
yeticry has joined #ruby
hanmac has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pandaant has quit [Remote host closed the connection]
nofxxx has joined #ruby
rohitpaulk has joined #ruby
pandaant has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
cfec0b8d has quit [Remote host closed the connection]
lxsameer has joined #ruby
ropeney has quit [Quit: Leaving]
cfec0b8d has joined #ruby
nankyokusei has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hutch34 has joined #ruby
elomatreb has left #ruby ["Leaving"]
elomatreb has joined #ruby
hotpancakes has joined #ruby
faces has quit [Ping timeout: 260 seconds]
facest has joined #ruby
nankyokusei has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 246 seconds]
hotpancakes has quit [Ping timeout: 268 seconds]
rohitpaulk has quit [Ping timeout: 240 seconds]
ecuanaso has joined #ruby
bvcosta has quit [Remote host closed the connection]
joonty has quit [Quit: This computer has gone to sleep]
rohitpaulk has joined #ruby
bvcosta has joined #ruby
Beams has joined #ruby
ben__ has joined #ruby
KeyJoo has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
ben__ has quit [Remote host closed the connection]
mim1k has quit [Read error: Connection reset by peer]
mim1k has joined #ruby
astrobunny has quit [Remote host closed the connection]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
solocshaw has quit [Ping timeout: 246 seconds]
Demo318 has joined #ruby
ecuanaso has joined #ruby
marr has joined #ruby
chat_ has quit [Read error: Connection reset by peer]
chat_ has joined #ruby
Demo318 has quit [Ping timeout: 260 seconds]
joonty has joined #ruby
blackwind_123 has quit [Ping timeout: 260 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bvcosta has quit [Remote host closed the connection]
uZiel has quit [Remote host closed the connection]
patarr has joined #ruby
Bounga has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider>
define "wouldn't work"
<jokke>
well apparently the measurements are way off
<zenspider>
I'm waiting...
<jokke>
i have a program that's been running for months single threaded. I implemented a threadpool to it today and i can verify that the total runtime has gone down significantly. If i add up the runtimes of the calls to the method i'm measuring i get a far greater number. Even greater than before the multithreading.
<zenspider>
yes
<zenspider>
theading takes work. that's expected
marr has quit [Ping timeout: 260 seconds]
<zenspider>
threading, even...
<jokke>
yeah
patarr has quit [Ping timeout: 255 seconds]
<ineb>
runtime is faster but measured execution time is slower?
rohitpaulk has quit [Ping timeout: 255 seconds]
<zenspider>
the sum of the thread times > old time > threaded time
ecuanaso has joined #ruby
<jokke>
ineb: well the thing is i use the same mechanics to measure the total runtime which is basically just a method that creates and joins the threadpool
<dminuoso>
jokke: Threads introduce context switches, waiting for shared resources, etc. So the overall CPU time can actually go up.
<dminuoso>
(Even if total runtime goes down)
<jokke>
dminuoso: i'm not measuring cpu time
<jokke>
i'm just using started = Time.now; do_stuff; puts Time.now - started
<jokke>
basically
<jokke>
in one case do_stuff is the method which spawns and joins the threads
<jokke>
and in one case it's the actual work done per thread
bvcosta has joined #ruby
<jokke>
i also wrote log syringe and right now i'm regretting it a bit
<jokke>
too much magic
<ineb>
you couldve went with the proxy pattern
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jokke>
mhm
solocshaw has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ecuanaso has joined #ruby
xall has quit [Ping timeout: 246 seconds]
sekmo has joined #ruby
<jokke>
i wanted to be able to separate logging and metrics completely from the application code so that you could remove the files and everything would continue working as before
<ineb>
good point
<jokke>
but it has its downsides as you can see :)
<ineb>
how about a hook then which triggers everytime a method is called to do the measuring?
<ineb>
this would separate the logic
<ineb>
such hooks can be done with Kernel#set_trace_func
patarr has joined #ruby
<jokke>
yeah but i've heard it's pretty bad performance wise
sekmo has quit [Client Quit]
<ineb>
yeah but maybe its okay if youre app is in testing
<ineb>
for production you could simply disable it
alamar has quit [Ping timeout: 246 seconds]
Guest66963 has joined #ruby
<Guest66963>
hi. anyone knows here howto configure the ssh credentials when using serverspec?
patarr has quit [Ping timeout: 240 seconds]
pale3 has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pale3>
how to extract last and last parent substring from path. E.g case "/papa-foo/child-foo/grandchild-foo/grandgrandchild-foo/foo", get only "/grandgrandchild-foor/foo"?
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Demo318 has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #ruby
<Papierkorb>
zenspider: practical example, we have lots of code using Pathname. Then that stuff had to talk through SSH to access remote files. Now there's RemotePathname, which mirrors the Pathname API (Or it inherited from Pathname, dunno), and suddenly, all that code cone work with remote stuff. A migration path is allowing the user to pass in a String or Pathname, and then just use the Pathname converter function to turn whatever into a Pathname for
<Papierkorb>
internal use.
ecuanaso has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Seenox>
Hi everyone. How can I use this sed in ruby? --> sed -n 's/.*\\s\\([0-9.]\\+\\)/\\1/p'
sepp2k has joined #ruby
Abhijit has joined #ruby
<Abhijit>
hi
<Abhijit>
i can require 'json' from rails app and irb in my system. but it fails saying cannot load such file -- json if i require 'json' in simple test.rb script
Puffball has quit [Remote host closed the connection]
ryzokuken_ has quit [Ping timeout: 246 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nertzy has quit [Read error: Connection reset by peer]
ldnunes has joined #ruby
nertzy has joined #ruby
horst has quit [Quit: horst]
<syndikate>
For testing my ruby modules, should I be using test/unit or minitest?
Abhijit has quit [Quit: Bye.]
ecuanaso has joined #ruby
<daed>
no idea seenox, use rubular to test stuff out
<Seenox>
daed: trying...
bvcosta has quit [Remote host closed the connection]
bvcosta has joined #ruby
<kspencer>
when you use begin->rescue, is it a bug that my begin code still totally runs even with an exception, or is there a way for it to abort right when it tries to run, as I'm running a db operation and I'm checking for whether there is already a record in the database, but all the code is getting ran instead of just the insert->which should then cause the 'duplicate entry' exception, and run my rescue code (Using
<kspencer>
Sequel which exception is Sequel::UniqueConstraintViolation)
aglorei has quit [Read error: Connection reset by peer]
uZiel has quit [Read error: Connection reset by peer]
aglorei has joined #ruby
bast has quit [Ping timeout: 260 seconds]
GinoMan has joined #ruby
jenrzzz has joined #ruby
synthroid has joined #ruby
Abhijit has joined #ruby
<Abhijit>
why this bug https://github.com/flori/json/issues/318 gets fixed with changing my shebang line from /usr/bin/ruby to /usr/bin/env ruby as pointed by one commentor?
bast has joined #ruby
bast has quit [Changing host]
bast has joined #ruby
<warrshrike>
ineb: okay but i mean
GinoMan2440 has joined #ruby
<warrshrike>
how does backticks work?
<warrshrike>
does it take over the ruby process?
<warrshrike>
in that case how i monitor it?
<warrshrike>
or does it spawn a child process
nertzy has quit [Read error: Connection reset by peer]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 240 seconds]
nertzy has joined #ruby
<ineb>
warrshrike: backticks, they just block and return the output as string as soon as the command finished
Abhijit has quit [Quit: Bye.]
<warrshrike>
ineb: so can i use a timout condition with that?
GinoMan has quit [Ping timeout: 246 seconds]
<warrshrike>
maybe if i use a second ruby thread?
<ineb>
warrshrike: if you want more controle over the process, like stdin stdout and so on, you can use Open3
<warrshrike>
ineb: i basically just want the timeout condition
uZiel has joined #ruby
<ineb>
then you can use a timer
<warrshrike>
ineb: cool lemme try it
KeyJoo has joined #ruby
rgr has quit [Quit: rgr]
__Yiota has joined #ruby
bvcosta has joined #ruby
muelleme_ has quit [Ping timeout: 240 seconds]
pupsicle has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
<warrshrike>
hey what do i need to 'require'
<warrshrike>
to include Timer
<pupsicle>
'facets/timer'
marr has quit [Ping timeout: 255 seconds]
ben_____ has joined #ruby
marr has joined #ruby
<warrshrike>
pupsicle: unresolved...did you mean Time>
<pupsicle>
Do you have the facets gem installed?
gizmore has joined #ruby
<warrshrike>
no sir i do not
acalycine has quit [Quit: bye]
<warrshrike>
that worked
<warrshrike>
but the larger thing isn't working
<warrshrike>
so
oleo has joined #ruby
<warrshrike>
timer doesnt time out
<warrshrike>
when doing `bash` commands with backticks
<warrshrike>
ideas?
<warrshrike>
comments?
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<warrshrike>
any other way to put execution limits on backticks?
<pupsicle>
You want a shell command to timeout?
<warrshrike>
pupsicle: yup...so im doing this...output = "cd #{GL}; java -Xmx2400m -cp cfl2.jar Graph #{Base}/#{name} #{rhsid}"; out = `#{output}`
<warrshrike>
but sometimes it takes hours
<warrshrike>
and i want to set timeout to 10 minutes
hutch34 has joined #ruby
nankyokusei has joined #ruby
warrshrike_ has joined #ruby
<pupsicle>
warrshrike: Did you see the Timeout class?
<meshsmith>
Does anyone know if Sass can be ran on GIT?
shynoob has joined #ruby
hlmjr has quit [Remote host closed the connection]
<warrshrike_>
pupsicle: example? in java you need to either throws in method signature or throw-catch but in ruby i cant tel when sth will throw exp
<warrshrike_>
pupsicle: nvm found exp
Demo318 has joined #ruby
doublemalt_ has joined #ruby
<konsolebox>
Papierkorb: wasn't MRI a JIT already?
<chrisseaton>
konsolebox: no MRI's never had a JIT merged into it - there have been some experiments though
<pupsicle>
meshsmith: Restate your question.
<konsolebox>
well that's good news. because you know MRI can still be made faster.
<meshsmith>
K. Does anyone know if SASS, the CSS preprocessor that runs on Ruby, can be ran on Github pages?
<shynoob>
Hey there, I am newbie here.. I just want to know if is it important to spend time with Ruby .. understand its constructs.. and then move on to Rails or I'll be just fine and catch up if I am a beginner in web development?
<hightower2>
shynoob, knowing Ruby will help you a lot
shynoob has quit [Remote host closed the connection]
ferr1 has quit [Quit: WeeChat 1.8]
bvcosta has quit [Remote host closed the connection]
haylon has joined #ruby
bvcosta has joined #ruby
GinoMan2440 has quit [Remote host closed the connection]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sleetdrop has quit [Quit: Computer has gone to sleep.]
drptbl has joined #ruby
Hunter1 has quit [Remote host closed the connection]
Hunter1 has joined #ruby
sleetdrop has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
sleetdrop has quit [Client Quit]
charliesome has joined #ruby
arup___ has joined #ruby
cadillac_ has joined #ruby
<cjohnson>
What do people recommend for interactive debugging in vim? I know you can use binding.pry but I was hoping to use vim to set breakpoints and step code and such
<cjohnson>
I would need rspec integration for command line and passenger integration for web requests
<pupsicle>
Just create a macro to insert binding.pry
<cjohnson>
I don't see how that gives me vim integration?
<cjohnson>
that just gives me a pry prompt on command line when I run rspec
<cjohnson>
I'm specifically wanting to use vim's interactive debugger
brian_penguin has joined #ruby
Silthias1 has left #ruby [#ruby]
Silthias has joined #ruby
esfandyar has joined #ruby
esfandyar has quit [Client Quit]
igniting has quit [Ping timeout: 258 seconds]
patarr has joined #ruby
esfandyar has joined #ruby
oleo has quit [Read error: Connection reset by peer]
esfandyar is now known as esfandyar_
esfandyar_ has quit [Client Quit]
bmurt has joined #ruby
polysics has joined #ruby
__Yiota has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
mark_66 has left #ruby ["PART #elixir-lang :PART #crystal-lang :PONG :adams.freenode.net"]
<kspencer>
when you use begin->rescue, is it a bug that my begin code still totally runs even with an exception, or is there a way for it to abort right when it tries to run, as I'm running a db operation and I'm checking for whether there is already a record in the database, but all the code is getting ran instead of just the insert->which should then cause the 'duplicate entry' exception, and run my rescue code (Using
<kspencer>
Sequel which exception is Sequel::UniqueConstraintViolation)
shinnya has joined #ruby
skweek has quit [Ping timeout: 260 seconds]
mim1k has joined #ruby
<adam12>
kspencer: show some code please.
oleo has joined #ruby
<kspencer>
i'll have to pastebin it later, as i need to get back to work.
anisha has quit [Quit: This computer has gone to sleep]
patarr has quit [Ping timeout: 240 seconds]
Renich_ has joined #ruby
Renich_ has quit [Remote host closed the connection]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Renich has quit [Ping timeout: 260 seconds]
arup___ has quit [Remote host closed the connection]
__Yiota has joined #ruby
TomyWork has quit [Ping timeout: 240 seconds]
patarr has joined #ruby
theunraveler has joined #ruby
hogetaro has quit [Quit: Leaving...]
enterprisey has joined #ruby
xenops has joined #ruby
hotpanca_ has joined #ruby
conta has quit [Ping timeout: 246 seconds]
hutch34 has joined #ruby
nankyokusei has joined #ruby
pankaj has joined #ruby
bvcosta has quit [Remote host closed the connection]
cfec0b8d has quit [Remote host closed the connection]
nankyokusei has quit [Ping timeout: 246 seconds]
hutch34 has quit [Ping timeout: 255 seconds]
zerowaitstate has joined #ruby
pandaant has quit [Remote host closed the connection]
hutch34 has joined #ruby
TomyLobo has joined #ruby
heliumk has joined #ruby
<brian_penguin>
when you rescue exceptions in ruby the code will continue to execute
dionysus69 has quit [Ping timeout: 240 seconds]
<brian_penguin>
if you were to do something like "rescue MyErrorClass => err"
<brian_penguin>
you could do something to save state or log the error and then call "raise err" to stop execution again
heliumk has left #ruby ["Leaving"]
elifoster has joined #ruby
arup_r has joined #ruby
cbyrda has quit [Quit: leaving]
hotpanca_ has quit [Remote host closed the connection]
_joes____ has joined #ruby
lacuna has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<cjohnson>
Just because you get 300 doesn't mean it's guaranteed to always be 300
<arup_r>
can you explaim why not guranteed?
<elomatreb>
arup_r: Imagine: Thread 1 reads the current value, say, 50, but the then the scheduler switches to Thread 2, which also reads 50, adds 1 and writes it back, and it schedules back to Thread 1, which adds 1 to 50 and writes back 51
<elomatreb>
So you skipped one add
<pupsicle>
That increment operation is not atomic
<elomatreb>
It consists of three parts: Reading the value, adding one, and writing it back. It may be interrupted between those
<ljarvis>
arup_r: write @n += 1 like this: @n = @n + 1 -- does that make a difference?
<ljarvis>
(in your understanding)
<ljarvis>
there's 2 things happening here, Ruby just has some syntax sugar for doing it: "+="
alamar_ has quit [Ping timeout: 255 seconds]
<elomatreb>
I bet if you run that example a couple of times you'll end up with different values sometimes
belmoussaoui has quit [Remote host closed the connection]
<cjohnson>
could experiment doing it while the CPU is pegged, that might influence
<arup_r>
ljarvis: I know `+=` .. I was just not getting why the final value of @n is not determined.. But elomatreb broke it down and now it is clicking to me.. :)
millerti has joined #ruby
<elomatreb>
It's a little tricky/dangerous in Ruby since it doesn't actually execute code in more than one thread at a time, which may make unsafe operations seem safer than they are
belmoussaoui has joined #ruby
cschneid_ has joined #ruby
<arup_r>
so that is why class variables are not good to use people says ?
bvcosta has joined #ruby
<ljarvis>
no
<elomatreb>
@@class_vars are rarely used because they are confusing and rarely what you actually want, they're not more or less threadsafe than @instance_vars or e.g. module state without locks
<cjohnson>
are ruby threads green or does it use real threads?
brent__ has joined #ruby
<bougyman>
depends on the ruby implementation
<cjohnson>
standard ruby I guess
polysics has quit [Ping timeout: 240 seconds]
alamar has joined #ruby
cschnei__ has joined #ruby
<elomatreb>
MRI uses native threads IIRC but due to locking you only get something from them when waiting for IO
alamar is now known as Guest80925
<havenwood>
cjohnson: System threads in 1.9+. They were green threads in 1.8.
<bougyman>
and jruby uses the jvm threading, rubinius is native threads, I believe.
<cjohnson>
makes sense, thanks
<havenwood>
elomatreb: It can release for things other than IO, but IO is probably the most important. C-ext gems don't have to GIL, etc. Here's a gist to be devilish and bypass it yourself: https://gist.github.com/tenderlove/5733632
cschneid_ has quit [Ping timeout: 260 seconds]
<elomatreb>
A friend told me numpy in Python does something like that
belmoussaoui has quit [Remote host closed the connection]
cschnei__ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
cschneid_ has quit [Read error: Connection reset by peer]
doublemalt_ has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #ruby
cschneid_ has joined #ruby
username has joined #ruby
belmoussaoui has quit [Ping timeout: 240 seconds]
belmoussaoui has joined #ruby
Silox| has quit [Quit: Connection closed for inactivity]
cschneid_ has quit [Ping timeout: 246 seconds]
ketan has joined #ruby
ResidentBiscuit has quit [Ping timeout: 260 seconds]
hotpancakes has quit [Remote host closed the connection]
hotpancakes has joined #ruby
rohitpaulk has quit [Ping timeout: 246 seconds]
ecuanaso has joined #ruby
sekmo has joined #ruby
duderonomy has quit [Ping timeout: 240 seconds]
ledestin has joined #ruby
jrafanie has joined #ruby
sekmo has quit [Client Quit]
ledestin has quit [Ping timeout: 240 seconds]
pankaj has quit [Ping timeout: 255 seconds]
nitric has joined #ruby
kies has quit [Ping timeout: 260 seconds]
mim1k has quit [Quit: Lost terminal]
gusrub has joined #ruby
rohitpaulk has joined #ruby
<arup_r>
yeah so I feel like I needed an @@x var, I go with constants as they feel more reliable.. because it throws error while someone by mistake try to mutate it
<arup_r>
when I feel like*
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
[Butch] has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chalkmonster has joined #ruby
Bounga has quit [Ping timeout: 240 seconds]
hotpancakes has quit [Remote host closed the connection]
hotpancakes has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
jrafanie has joined #ruby
theunraveler has quit []
ascarter has joined #ruby
hotpancakes has quit [Remote host closed the connection]
chalkmonster has quit [Quit: Daddy's flown, 'cross the ocean.]
brent__ has quit [Ping timeout: 255 seconds]
joonty has quit [Quit: This computer has gone to sleep]
ascarter has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 240 seconds]
simmaniac has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ascarter has joined #ruby
ascarter has quit [Client Quit]
sysvalve has quit [Ping timeout: 240 seconds]
pb122 has joined #ruby
muelleme_ has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
KeyJoo has quit [Read error: Connection reset by peer]
uZiel has quit [Ping timeout: 248 seconds]
uZiel has joined #ruby
MarkBilk has quit [Ping timeout: 258 seconds]
hotpancakes has joined #ruby
ascarter has joined #ruby
MarkBilk has joined #ruby
Beams has quit [Quit: .]
uZiel has quit [Remote host closed the connection]
uZiel_ has joined #ruby
uZiel_ has quit [Client Quit]
hotpancakes has quit [Remote host closed the connection]
uZiel has joined #ruby
MarkBilk_ has joined #ruby
muelleme_ has quit [Ping timeout: 240 seconds]
hotpancakes has joined #ruby
synthroid has quit []
SegFaultAX has joined #ruby
MarkBilk has quit [Ping timeout: 258 seconds]
pupsicle has quit [Quit: Leaving]
eightlimbed has joined #ruby
nankyokusei has joined #ruby
hotpancakes has quit [Ping timeout: 240 seconds]
AndBobsYourUncle has joined #ruby
arup_r has quit [Remote host closed the connection]
rohitpaulk has joined #ruby
gusrub has quit [Read error: Connection reset by peer]
nankyokusei has quit [Ping timeout: 258 seconds]
kies has joined #ruby
aredride- has quit [Ping timeout: 246 seconds]
gusrub has joined #ruby
AndBobsYourUncle has quit [Ping timeout: 240 seconds]
gusrub has quit [Remote host closed the connection]
<eightlimbed>
im learning about the step method... ruby-doc says it iterates over a range passing each nth element to a block
bvcosta has quit [Remote host closed the connection]
bvcosta has joined #ruby
hotpancakes has quit [Ping timeout: 246 seconds]
psychicist__ has joined #ruby
hotpancakes has joined #ruby
<eightlimbed>
ahh
<eightlimbed>
thanks baweaver and derpy
brian_penguin has quit [Remote host closed the connection]
<baweaver>
derpy is a bot
bvcosta has quit [Ping timeout: 260 seconds]
<eightlimbed>
lol
hotpanca_ has quit [Ping timeout: 246 seconds]
GinoMan1423 has joined #ruby
blackwind_123 has joined #ruby
<eightlimbed>
baweaver do i need to install something beyond the basic ruby installer (i'm running windows) to be able to type &ri Integer#step in the command line?
<baweaver>
just take the & off
Cohedrin has joined #ruby
GinoMan1423 has quit [Remote host closed the connection]
enterprisey has quit [Remote host closed the connection]
blackwind_123 has quit [Ping timeout: 255 seconds]
ruby-lang580 has joined #ruby
<hanmac>
ornerymoose: do you have some test data?
blackwind_123 has joined #ruby
<elomatreb>
Yeah, maybe reduce that example a little more. There's a lot going on there
<hanmac>
hm or is maybe the case sensitive wrong?
Bounga has joined #ruby
<ornerymoose>
hanmac: actually i accidentially lied. in the SQL query itself on SSMS HBO should return 7856 rows. when i open up the csv there is 7356 items in the HBO column with 1’s (so at least its populating them, but missing roughly 500 1’s)
<ornerymoose>
hanmac: thats what i was thinking or maybe some whitespace
<ornerymoose>
but doesnt appear to be so in SSMS
ResidentBiscuit has joined #ruby
bigkevmcd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bounga has quit [Remote host closed the connection]
Bounga has joined #ruby
ketan has quit [Remote host closed the connection]
<ornerymoose>
Note ‘offering’ is one of the columns returned in the SQL query
ketan has quit [Ping timeout: 246 seconds]
zerowaitstate has quit [Quit: Lost terminal]
statelesscode has joined #ruby
hotpancakes has quit [Remote host closed the connection]
bvcosta has joined #ruby
bvcosta has quit [Remote host closed the connection]
<eightlimbed>
baweaver: i got the docs installed, this will be very helpful. thank you!
<elomatreb>
ornerymoose: You could maybe try printing the values your validate method is getting passed (`p something` is debug print)
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bounga has quit [Ping timeout: 246 seconds]
ecuanaso has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bounga has joined #ruby
benlieb has joined #ruby
Hunter1 has quit [Remote host closed the connection]
<ornerymoose>
elomatreb: got it, definitely something to do with the data. I’ve updated the gist: https://gist.github.com/ornerymoose/36fbf193b43c81d3a53c982f45ddfa71 and it’s not returning the correct number of rows. Now, question is, is that tacky use of gsub? Should I be fixing the HBO entries in the database instead? (whether it be LTRIM RTRIM etc)
<ornerymoose>
and it’s now***
Hunter1 has joined #ruby
<elomatreb>
If you can I don't see why you should work around broken data when you can fix it
pragmatism has joined #ruby
<ornerymoose>
yeah, fair point
<ornerymoose>
appreciate the help
gusrub has joined #ruby
<havenwood>
Always nice to coax the data towards sanity rather than follow it with your code into insanity.
ruby-lang580 has left #ruby [#ruby]
<havenwood>
If it's your data to munge.
Bounga has quit [Ping timeout: 246 seconds]
simmaniac has quit [Quit: Leaving]
aredridel has quit [Ping timeout: 276 seconds]
duderonomy has joined #ruby
meshsmith has quit [Remote host closed the connection]
enterprisey has joined #ruby
jaruga_________ has quit [Quit: jaruga_________]
brent__ has joined #ruby
<ornerymoose>
havenwood: very good point
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
aredridel has joined #ruby
SCHAPiE has quit [Read error: Connection reset by peer]
<ivanskie>
thats the screenie from app im working on. in essense i have to download 5 files from 22 devices, so i wrote this to do it for me. also combines the csv files into a single per device.
<ivanskie>
the problem came in when realize i have to skip some rows
Silthias has joined #ruby
<ivanskie>
while checking each row to see if it has a match from either values inside an array. its not working how i want it to. so i think im fucking up the loop there
<elomatreb>
Is it skipping too many, too few, the wrong lines?
<ivanskie>
the test code i made, that i mentioned in gist. seem to work partially. it says it skips 27 times, but actually prints out some wrong ones.
[Butch] has quit [Quit: I'm out . . .]
<ivanskie>
code in the app on repo skips too few.
aglorei has joined #ruby
<ivanskie>
as you see in screenshot, i need to keep it under 1000, and the code seems to only skip one row
<ivanskie>
i think I have an idea of how to fix it, but i want to understand what im doing wrong here.
<elomatreb>
Minor thing that pains me: You can do `var += 1` instead of `var = var + 1`
<kspencer>
https://paste.ofcode.org/5cLibcJftaXXV9qT9cJfWG <-- here's my problem if anyones got any ideas on why all code in the begin (the insert is anticipated to raise Sequel::UniqueConstraintViolation when there is already the same ip in the database) and all the code in the rescue is ran, which means my log returns empty fields, and runs the Log#import Log#dupe and Log#db functions (which write templated log lines)
<ivanskie>
skiplist, right now, includes both numbers and strings. so the numbers are just the individual addresses that should be skipped, but i realized that only the string gets repeated, the numbers in csv files vary. so i patched on the strings ('Max Vac'). so i think i can fix it by using smarter_csv since im already using it elsewhere in the app. and only match against strings, and only in single column, could probably speed the whole thing up a bit.
d10n-work has joined #ruby
Bounga has joined #ruby
<ivanskie>
elomatreb: yah i've taken a bit of a break from ruby stuff, and have been burying my head with learning javascript. so this was just a quick fix when i realized you can't do var++ in ruby lol. i plogize for the pain, but its shared. thanks
xall has joined #ruby
<ivanskie>
i was about to re-do the gist and just make a repo with extracted functionality with sample files it downloads and the test code thats it.
<ivanskie>
don't have time to write a full test with faker on this
hutch34 has quit [Ping timeout: 246 seconds]
ecuanaso has joined #ruby
<elomatreb>
You want to skip a row of that CSV if it contains one of the entries of the skiplist in any of the fields, did I get that right?
Bounga has quit [Ping timeout: 255 seconds]
<ivanskie>
yes
<elomatreb>
You said your gist does something incorrect, could share some output?
<elomatreb>
Maybe print whole row (with `p` instead of puts for debug print) in line 18, so we can actually see what's happening
cdg has joined #ruby
cschneid_ has joined #ruby
<ivanskie>
one sec
<adam12>
kspencer: Remind me of the issue again? The rescue clause is always run? or it's never run?
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hotpancakes has quit []
Demo318 has joined #ruby
hutch34 has joined #ruby
<kspencer>
even if there is no duplicates (DELETE FROM table WHERE `column` LIKE '127.%'; before checking) and then import the ips, the whole begin and the whole rescue clause run, instead of tripping up on just the insert and raising the exception
<kspencer>
@ adam12
cschneid_ has quit [Ping timeout: 240 seconds]
<kspencer>
so when there are no duplicates, it runs the insert and Log.import() yet also runs the rescue clause for each address
<ivanskie>
i have a list of crap to ignore (skiplist).. im processing up-to 5 csv files at a time and saving into single csv file, while making sure to skip the crap that i dont need
jrafanie has joined #ruby
<santoxxcc>
havenwood so you are just checking if "r" exist inside the array? that's all the logic?
<apeiros>
if you repeatedly check whether something exists in an array, you should consider using a set for the test
<santoxxcc>
then i suppose you want to ignore some elements in another array so you could just use reject to create a new array with usefull elements
<santoxxcc>
like when developing a sumaryzer
<ivanskie>
before i was passing the whole row, and doing. row.each do r -- skiplist.each do s. if r==s -- skip. and it wasnt working... now i just do. skiplistinclude?(row[1])
poloych has quit [Remote host closed the connection]
<ivanskie>
hm. could do. but would have to convert each row from csv into set and do that check, then push it into the new csv file
<ivanskie>
this way its organically array in array out
<ivanskie>
block above sits inside CSV.process array of arrays
<apeiros>
um,no?
<apeiros>
as I understood it you have one array which remains the same, and you test each row of the csv whether one cell of it is in said constant array. no?
<santoxxcc>
i understand that too
<apeiros>
haven't looked at your code yet, though. so maybe I misunderstood what I read.
roshanavand has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros>
you should also learn about scopes it seems
<apeiros>
scopes = boundaries of where variables are accessible
<ivanskie>
scopes between class and modules.
<ivanskie>
yea
<apeiros>
scopes *of things
<ivanskie>
wait no
<ivanskie>
i see what i did wrong here
<j0bk>
var = "hello"; things.each{ |var| puts var}; puts var
<j0bk>
like this
<ivanskie>
eh?
<j0bk>
scopes
<j0bk>
var lives inside and outside of the each
<apeiros>
also "where can I access which @instance_variable"
Bounga has quit [Ping timeout: 240 seconds]
<apeiros>
Device's @skiplist seems unused f.ex.
<ivanskie>
yeah im good with scopes between blocks or methods and inside modules etc..
<ivanskie>
you are right i just removed it a bit earlier
<ivanskie>
okay so.. in my program. each site object has multiple device objects.. thought i realize not in the same way as activemodel does it.
patarr has quit [Ping timeout: 255 seconds]
<ivanskie>
damn i need to get out of rails in my head lol
<ivanskie>
i learned rails before ruby
enterprisey has joined #ruby
<ivanskie>
messing me up a bit
<ivanskie>
i want to do Site.skiplist
<apeiros>
that'd be a class method
<j0bk>
def Site.skiplist; end
<j0bk>
or self.skiplist
* apeiros
prefers the latter
<j0bk>
yep for refactors
<j0bk>
;)
<ivanskie>
and would work if this was activemodel. but i dont have that relationship between device and site. @devices is just an array of objects inside Site object. so i can't do Parent.skiplist
ketan has joined #ruby
<apeiros>
j0bk: also for grep and less typing
<apeiros>
o0
<apeiros>
Parent?
<ivanskie>
i have class Device < Site. but honestly i dont know what im doing there and if it even makes any sense at all
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ivanskie>
multiple sites, each site has multiple devices
<apeiros>
you say that Device is a subclass of Site
<apeiros>
then no, that doesn't make sense
<j0bk>
ivanskie what do you want to do?
<ivanskie>
j0bk was talking about doing OOP. thats what im trying to do here
<apeiros>
inheritance means "it's similar in its shape"
d10n-work has joined #ruby
Tagami[m] has joined #ruby
<ivanskie>
yes and device has nothing in common with site in that regard.
ecuanaso has joined #ruby
<apeiros>
then don't inherit
<j0bk>
yes, but you need to think what do you want to model before thinking in OOP
<ivanskie>
in my mind if i pass @skiplist to every device, or everytime i run fetchMaps method on each device.. its inefficient. im thinking @skiplist is common thing between all devices per each site. so one site -- one skiplist.
bmurt has joined #ruby
hobodave_ has quit [Quit: Computer has gone to sleep.]
<apeiros>
so class Site has an instance variable @skiplist
<ivanskie>
yes
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<apeiros>
and Site has an instance variable @devices
<apeiros>
one site, many devices, right?
<ivanskie>
yes
<apeiros>
now you just need the proper datatype of @devices
<ivanskie>
so i should make class Devices
<apeiros>
Array and Hash are the common collection classes
<apeiros>
maybe
ketan has quit [Ping timeout: 258 seconds]
<apeiros>
most people are too lazy to write their own collection classes, but it'd often make sense.
<ivanskie>
this is a simple problem case here so dont need to over complicate it. but im trying to learn ruby not just write a dirty scrip that does the job
<apeiros>
I do tend to call them DeviceList or something else more explicit, since people tend to miss the difference between Device and Devices
<apeiros>
those are useful to implement your own collection classes
bauruine has quit [Ping timeout: 255 seconds]
__Yiota has joined #ruby
<apeiros>
but yeah, I'd probably not focus on collection classes yet
<apeiros>
write the scalar classes first
<ivanskie>
k going to do device.fetchMaps(@uids, @savepath, @skiplist) for now. just to get the project going (i actually need to do something with the end csv for work lol). then practice this
<ivanskie>
ok looks like that fixed it.
<apeiros>
uh, no
<apeiros>
oh
<apeiros>
ok, maybe yes :)
<j0bk>
:P
<ivanskie>
if this was rails i'd just do device.fetchMaps and that'd inherit the instance variables of the site that it belongs to
enterprisey has quit [Remote host closed the connection]
<apeiros>
no, rails doesn't inherit ivars either
<ivanskie>
well
<apeiros>
no idea where you have that from :)
ski4x7 has joined #ruby
bauruine has joined #ruby
<apeiros>
it does have inheritable ivars. but that's a different thing.
ski4x7 has quit [Read error: Connection reset by peer]
<j0bk>
ActiveRecord != Rails; classes != models
<ivanskie>
i mean to say that.. i'd have access to device.site.skiplist
<apeiros>
through the relation, yes
<ivanskie>
yes
<apeiros>
and that one doesn't happen magically either
<ivanskie>
no.
<apeiros>
what do you think rails does behind the scenes? :)
<ivanskie>
maaaagicccc
<ivanskie>
mushrooms
<apeiros>
no. argument passing.
ski7777 has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
ski4x7 has joined #ruby
<apeiros>
and it's got nothing to do with inheritance. at all.
<ivanskie>
so essentially. device gets site and its ivars
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros>
not really.
<ivanskie>
i should take a look at activerecord
<apeiros>
device's class knows it's got a relation to site and provides a method to access the related site.
haylon has quit []
<apeiros>
you still have to go through site to get the skiplist. you don't have it in device itself.
patarr has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ivanskie>
what you said above about classes!=models. it took me a few to figure out what difference between class and methods is. and still in my head class is a model (trying to break that).
Guest85918 has joined #ruby
johnson[m] has joined #ruby
kp666[m] has joined #ruby
torarne has joined #ruby
M107262[m] has joined #ruby
heftig has joined #ruby
intermo[m] has joined #ruby
jonjits[m] has joined #ruby
aviraldg has joined #ruby
voltai[m] has joined #ruby
turt2live1 has joined #ruby
dman[m] has joined #ruby
KevinMGranger has joined #ruby
Giphy[m] has joined #ruby
<apeiros>
actually j0bk said that ;-)
ski4x7 has quit [Client Quit]
testnick[m] has joined #ruby
velu_aon[m] has joined #ruby
el_ocho[m] has joined #ruby
<ivanskie>
okwhen j0bk said that
<ivanskie>
ya
<apeiros>
(they're right, of course, though models < classes)
<j0bk>
models < Object == "classes"
<apeiros>
o0
<apeiros>
no, models are classes
<apeiros>
that's what I meant
<j0bk>
yes
<apeiros>
ok :)
ski7777 has joined #ruby
quobo has joined #ruby
<ivanskie>
thats how i got that
<ivanskie>
class ModelName
<ivanskie>
which then inherits from application::activerecord if i remember correctly
hutch34 has quit [Ping timeout: 255 seconds]
<apeiros>
ActiveRecord::Base
<ivanskie>
right
<apeiros>
or any subclass thereof
<ivanskie>
this is a great excercise
patarr has quit [Ping timeout: 240 seconds]
<ivanskie>
the ruby code was writing.
<ivanskie>
spend 4 days, to save 2 hours
<ivanskie>
now it does it what i need it to do in 2mins
def_jam has quit [Read error: Connection reset by peer]
eblip has quit [Read error: Connection reset by peer]
<ivanskie>
24 devices, each 3-5 csv files.. and these 3-5 files would have to be renamed or put in its own folder, etc etc. now just run code --> 24 ready csv files.
<ivanskie>
then need to add code to zip it and a couple other files, and then can just email the zip file to schneider
<apeiros>
shouldn't it be 72-120 csv files?
ResidentBiscuit has quit [Read error: Connection reset by peer]
<apeiros>
24x(3-5)
<ivanskie>
if done manually yes
eblip has joined #ruby
def_jam has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ivanskie>
here's what this is. have 24 PDUs, these have APC PowerXpertGateway nic cards in them, each PDU has two breaker panels, each panel has up to 40 breakers. each is measured. now we need to access this info in a DCIM tool. but DCIM tool needs a device definition file, which says how to talk to said device, and which sensors (or data points) to import.
SeepingN has joined #ruby
<ivanskie>
so easier way would be SNMP, but these devices don't output all the data in SNMP, but do output complete data to MODBUS
<ivanskie>
modbus is old, u have to send packet [command, unit id, register]
<ivanskie>
so you have register map tables.
<ivanskie>
all that just to explain that each of those. 5 files is a register map for specific unit id. and unit id is mentioned in file name. but otherwise each csv file has the same structure
__Yiota has joined #ruby
doublemalt_ has quit [Ping timeout: 240 seconds]
<ivanskie>
so what im doing here is, downloading each file, injecting unit id, and combining all into a single csv file.
<ivanskie>
so instead of 72-120 csv files, we get 24
<ivanskie>
skiplist was an afterthought because, schneider came back and said. uhm we can't do more than 1000 sensors per device for performance reasons.
__Yiota has quit [Client Quit]
* ivanskie
facepalm
gusrub has joined #ruby
<ivanskie>
now that i have these 24 files, and filtered to less than 800 data points each now. i can send to schneider and wait for them to make a device definition file for us..
__Yiota has joined #ruby
Fernando-Basso has quit [Quit: WeeChat 1.8]
<ivanskie>
need this script/program because if someone changes/moves/adds/removes a breaker, have to repeat the above process
<ivanskie>
hense the need for my app
roshanavand has quit [Ping timeout: 255 seconds]
<apeiros>
sounds like something fun to write :)
<ivanskie>
only if it didn't take 4 days.
<ivanskie>
i was starting to get burnout
<ivanskie>
get burntout
<apeiros>
burned out?
<ivanskie>
ty
hutch34 has joined #ruby
dionysus69 has quit [Quit: dionysus69]
Guest85918 has quit [Changing host]
Guest85918 has joined #ruby
<ivanskie>
this whole thing started with trying to write a powershell script because i can't install ruby on corp machines.
<ivanskie>
shit didn't work, not as experienced in powershell.
<ivanskie>
so then manager said fine do what u need to do.
dionysus69 has joined #ruby
<ivanskie>
then took a day to figure out that i need digestauth and not simpleauth
__Yiota has quit [Client Quit]
<ivanskie>
one thing after another basically
ledestin has joined #ruby
<ivanskie>
once you spend more time on trying to solve the problem in code, than it would take you to do manually.. you get stress.
ecuanaso has joined #ruby
patarr has joined #ruby
<ivanskie>
whew. now i can start refactoring and cleaning the shit code up.
<ivanskie>
i'm a wannabe ruby/rails/js web developer...
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
<ivanskie>
i wonder if this counts as junior dev.
patarr has quit [Ping timeout: 260 seconds]
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
AnoHito has quit [Quit: Leaving]
FastJack has quit [Read error: Connection reset by peer]
hutch34 has quit [Ping timeout: 255 seconds]
FastJack has joined #ruby
<apeiros>
probably?
konsolebox has quit [Ping timeout: 268 seconds]
__Yiota has joined #ruby
<ivanskie>
just pushed working code
<apeiros>
gn8
<ivanskie>
?
<ivanskie>
oh
<ivanskie>
gn8
<ivanskie>
thank you
<ivanskie>
oh yeah also have multiple sites
patarr has joined #ruby
__Yiota has quit [Ping timeout: 246 seconds]
konsolebox has joined #ruby
Bounga has joined #ruby
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<baweaver>
so in my case, Brandon A Weaver, it'd be first name Brandon last name A
<baweaver>
which is incorrect.
jaruga_________ has quit [Quit: jaruga_________]
<santoxxcc>
i see...
elifoster has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
<santoxxcc>
so would be like 4 placeholders?
<baweaver>
names are fun.
<Papierkorb>
(^ noooot)
<santoxxcc>
D:
<Papierkorb>
santoxxcc: to make matters even more fun, rarely, but some ppl don't even have nor first or no last name at all. Ask the user for both separately
<Papierkorb>
santoxxcc: not to mention that some people have multiple last names, so you can't even get away with assuming that all but the last word are first names
<baweaver>
See: India
skweek has quit [Ping timeout: 240 seconds]
brent___ has quit [Ping timeout: 260 seconds]
<baweaver>
they inherit a ton of family names in some cases.
<santoxxcc>
so
<santoxxcc>
i should make code for all those cases?
<baweaver>
Make a text field for last and first names
<baweaver>
let them figure it out, that's the easy path
<santoxxcc>
like a if..elsif construct?
nankyokusei has joined #ruby
<santoxxcc>
Then i'll ask the user to only put first and last names
zepy_aq has joined #ruby
meshsmith has quit [Remote host closed the connection]
gothicsouth has joined #ruby
<santoxxcc>
what's better? use initialize() to define object variables or use attr_accessor?
eightlimbed has quit [Ping timeout: 255 seconds]
santoxxcc has quit [Read error: Connection reset by peer]
<baweaver>
Read on what both of them do.
<Papierkorb>
santoxxcc: Both do different things. In #initialize you can initialize @instance vars to some value (hence the name), with attr_accessor and friends you define accessor methods to those instance variables
santoxxcc has joined #ruby
hutch34 has joined #ruby
nankyokusei has quit [Ping timeout: 246 seconds]
herbmillerjr has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
bauruine has quit [Ping timeout: 240 seconds]
belmoussaoui has joined #ruby
sneakerhax has joined #ruby
bauruine has joined #ruby
eightlimbed has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
postmodern has joined #ruby
t-recx has joined #ruby
Cohedrin has joined #ruby
cschneid_ has quit [Remote host closed the connection]
helpa-bot has joined #ruby
Truenigma has joined #ruby
helpa-bot has quit [Remote host closed the connection]
helpa-bot has joined #ruby
utkarsh_ has joined #ruby
t-recx_ has joined #ruby
Kug3lis_ has joined #ruby
m4rCsi has joined #ruby
P1ro_ has joined #ruby
tw1sted_ has joined #ruby
t-recx has quit [Disconnected by services]
ahuman has joined #ruby
t-recx_ is now known as t-recx
helpa-bot has quit [Remote host closed the connection]
musl_ has joined #ruby
helpa-bot has joined #ruby
psychicist__ has quit [Ping timeout: 268 seconds]
abort has joined #ruby
devyn_ has joined #ruby
Sp4rKy_ has joined #ruby
lucas has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
_mak has joined #ruby
montyboy_ has joined #ruby
santoxxc1 has joined #ruby
chaos95_ has joined #ruby
swills_ has joined #ruby
PaulCapestany has quit [Quit: .]
ejnahc_ has joined #ruby
matled- has joined #ruby
helpa-bot has quit [Remote host closed the connection]
helpa-bot has joined #ruby
Bounga has joined #ruby
ishigoya- has joined #ruby
helpa-bot has quit [Remote host closed the connection]
sindork_ has joined #ruby
dyyylan- has joined #ruby
tekmaster has joined #ruby
synstack_ has joined #ruby
synstack_ has joined #ruby
synstack_ has quit [Changing host]
tomaw| has joined #ruby
swistak35_ has joined #ruby
_Tristan-Speccy_ has joined #ruby
Disavowed_ has joined #ruby
helpa-bot has joined #ruby
shortdudey123_ has joined #ruby
Radar_ has joined #ruby
elem has joined #ruby
<santoxxc1>
what's good for the brain pain?
belmoussaoui has quit [*.net *.split]
santoxxcc has quit [*.net *.split]
kies has quit [*.net *.split]
Kug3lis has quit [*.net *.split]
Guest66963 has quit [*.net *.split]
d^sh has quit [*.net *.split]
borei1 has quit [*.net *.split]
BTRE has quit [*.net *.split]
cout has quit [*.net *.split]
al2o3-cr has quit [*.net *.split]
helpa has quit [*.net *.split]
devyn has quit [*.net *.split]
tekacs has quit [*.net *.split]
seggy has quit [*.net *.split]
swills has quit [*.net *.split]
Guest61596 has quit [*.net *.split]
Sammichmaker has quit [*.net *.split]
SuperLag has quit [*.net *.split]
shortdudey123 has quit [*.net *.split]
_mak_ has quit [*.net *.split]
ejnahc has quit [*.net *.split]
scorphus` has quit [*.net *.split]
nchambers has quit [*.net *.split]
synstack has quit [*.net *.split]
abort_ has quit [*.net *.split]
Radar has quit [*.net *.split]
Guest4061 has quit [*.net *.split]
Truenigma_Work has quit [*.net *.split]
cajone has quit [*.net *.split]
P1ro has quit [*.net *.split]
xMopxShell has quit [*.net *.split]
matled has quit [*.net *.split]
nicoulaj46 has quit [*.net *.split]
utkarsh has quit [*.net *.split]
vqrs has quit [*.net *.split]
musl has quit [*.net *.split]
nathani has quit [*.net *.split]
montyboy has quit [*.net *.split]
theRoUS has quit [*.net *.split]
Tristan-Speccy has quit [*.net *.split]
ahuman_ has quit [*.net *.split]
reinh1 has quit [*.net *.split]
lucas__ has quit [*.net *.split]
swistak35 has quit [*.net *.split]
Raboo has quit [*.net *.split]
Disavowed has quit [*.net *.split]
Sp4rKy has quit [*.net *.split]
tw1sted has quit [*.net *.split]
dyyylan has quit [*.net *.split]
phreakocious has quit [*.net *.split]
FifthWall has quit [*.net *.split]
maxmanders has quit [*.net *.split]
ishigoya has quit [*.net *.split]
chaos95 has quit [*.net *.split]
ekem has quit [*.net *.split]
sindork has quit [*.net *.split]
michael_mbp has quit [*.net *.split]
m4rCsi_ has quit [*.net *.split]
tomaw has quit [*.net *.split]
tekmaster is now known as tekacs
perryh is now known as perry
matled- is now known as matled
Sp4rKy_ is now known as Sp4rKy
FifthWall_ has joined #ruby
IceDragon has joined #ruby
FifthWall_ is now known as FifthWall
dionysus69 has quit [Ping timeout: 240 seconds]
theRoUS has joined #ruby
d^sh has joined #ruby
phreakocious has joined #ruby
nchambers has joined #ruby
Sp4rKy is now known as Guest6064
IceDragon is now known as Guest83229
shortdudey123_ is now known as shortdudey123
helpa-bot has quit [Remote host closed the connection]
kies has joined #ruby
helpa has joined #ruby
Guest66963 has joined #ruby
xMopxShell has joined #ruby
veloutin has quit [Ping timeout: 260 seconds]
cajone has joined #ruby
vqrs has joined #ruby
nathani has joined #ruby
al2o3-cr has joined #ruby
borei1 has joined #ruby
nuck has quit [Ping timeout: 260 seconds]
BTRE has joined #ruby
Bounga has quit [Ping timeout: 255 seconds]
cschneid_ has joined #ruby
Raboo has joined #ruby
<santoxxc1>
hi
ionte has quit [Ping timeout: 240 seconds]
veloutin has joined #ruby
santoxxc1 has quit [Quit: leaving]
maxmanders has joined #ruby
reinh1 has joined #ruby
belmoussaoui has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ionte has joined #ruby
ketan has joined #ruby
cout has joined #ruby
cschneid_ has quit [Ping timeout: 268 seconds]
michael_mbp has joined #ruby
ketan has quit [Ping timeout: 246 seconds]
BTRE has quit [Ping timeout: 246 seconds]
brent__ has joined #ruby
nuck has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
brent__ has quit [Ping timeout: 246 seconds]
Qommand0r has joined #ruby
pupsicle has quit [Ping timeout: 240 seconds]
pupsicle has joined #ruby
nitric has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]