Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Dios has quit [Max SendQ exceeded]
Dios has joined #ruby
skweek has quit [Ping timeout: 250 seconds]
diegoviola has quit [Quit: WeeChat 1.5]
allcentury has joined #ruby
matp has joined #ruby
ur5us has quit [Remote host closed the connection]
aupadhye has joined #ruby
smathy is now known as smathy_afk
allcentury has quit [Ping timeout: 250 seconds]
wrkrcoop has quit [Quit: wrkrcoop]
hightower2 has quit [Ping timeout: 276 seconds]
Fuzai has joined #ruby
yfeldblum has quit [Remote host closed the connection]
<Fuzai>
Hi there, is there anyone around that's familiar with UUIDTools and specifically namespaces that could shed some light on this for me? I'm familiar with UUID's but I feel like I'm failing to grasp the concepts/logic/reasoning/use of uuid namespaces. Thanks!
johnDoe111 has joined #ruby
certainty has joined #ruby
freerobby has quit [Quit: Leaving.]
whathappens has quit [Quit: Leaving...]
jabreity__ has quit [Changing host]
jabreity__ has joined #ruby
jabreity__ has quit [Changing host]
jabreity__ has joined #ruby
jabreity__ is now known as jabreity
moeabdol has joined #ruby
nankyokusei has joined #ruby
APhilp has quit [Ping timeout: 246 seconds]
rcvalle has quit [Quit: rcvalle]
johnDoe111 has quit [Ping timeout: 276 seconds]
LaT0rtue has joined #ruby
LaT0rtue has quit [Client Quit]
certainty has quit [Ping timeout: 276 seconds]
jrafanie has quit [Ping timeout: 276 seconds]
nankyokusei has quit [Ping timeout: 244 seconds]
moeabdol has quit [Ping timeout: 264 seconds]
ixti has joined #ruby
APhilp has joined #ruby
Wolland has joined #ruby
griffindy has joined #ruby
gnufied has joined #ruby
APhilp has quit [Ping timeout: 258 seconds]
dorje has quit [Ping timeout: 272 seconds]
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Wolland has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
kies has quit [Ping timeout: 250 seconds]
ur5us has quit [Read error: Connection reset by peer]
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blockchan has joined #ruby
Dimik has joined #ruby
pepee has joined #ruby
nadir has joined #ruby
MrBusiness has quit [Quit: Leaving]
nobitanobi has joined #ruby
Ch4rAss has quit [Ping timeout: 240 seconds]
Noxilex has joined #ruby
ur5us has joined #ruby
polll has joined #ruby
Ch4rAss has joined #ruby
nhhc has joined #ruby
sauvin has joined #ruby
norc has joined #ruby
tvw has joined #ruby
ur5us has quit [Ping timeout: 276 seconds]
Wolland_ has quit []
giz|work has quit [Ping timeout: 250 seconds]
Spami has joined #ruby
agit0 has joined #ruby
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
rbr has joined #ruby
vondruch has joined #ruby
c0mrad3 has joined #ruby
aries_liuxueyang has joined #ruby
flashpoint9 has joined #ruby
pawnbox has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 246 seconds]
Axy has joined #ruby
pawnbox has joined #ruby
andikr has joined #ruby
TomyWork has joined #ruby
blockchan has quit [Ping timeout: 250 seconds]
Niham has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blockchan has joined #ruby
Mia has quit [Ping timeout: 252 seconds]
flashpoint9 has quit [Ping timeout: 244 seconds]
mistermocha has joined #ruby
duckpuppy has joined #ruby
ensyde__ has quit [Ping timeout: 246 seconds]
blackmesa has joined #ruby
nobitanobi has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 258 seconds]
duckpuppy has quit [Ping timeout: 244 seconds]
Coldblackice has quit [Ping timeout: 276 seconds]
A124 has quit [Quit: '']
blackmesa has quit [Ping timeout: 244 seconds]
flughafen_ has joined #ruby
sarbs has quit [Read error: Connection reset by peer]
sarbs has joined #ruby
scorphus has quit [Ping timeout: 260 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
nando293921 has quit [Ping timeout: 264 seconds]
A124 has joined #ruby
sepp2k has quit [Quit: Leaving.]
Noxilex has quit [Ping timeout: 250 seconds]
roamingdog has joined #ruby
noobsu_ has joined #ruby
tmtwd has quit [Ping timeout: 276 seconds]
giz|work has joined #ruby
k3rn31 has joined #ruby
polll has quit [Quit: leaving]
polll has joined #ruby
polll has quit [Client Quit]
polll has joined #ruby
Rodya_ has joined #ruby
jud^ has joined #ruby
nertzy3 has joined #ruby
MrBusiness has joined #ruby
pawnbox has quit [Remote host closed the connection]
roamingdog has quit [Ping timeout: 246 seconds]
darkxploit has quit [Read error: Connection reset by peer]
nertzy2 has quit [Ping timeout: 258 seconds]
pawnbox has joined #ruby
jud has quit [Ping timeout: 276 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
eGGshke has joined #ruby
lessless has joined #ruby
allcentury has joined #ruby
al2o3-cr has quit [Quit: WeeChat 1.5]
pepee has quit [Read error: Connection reset by peer]
pepee has joined #ruby
tjohnson has quit [Quit: Connection closed for inactivity]
<flughafen_>
morning
giz|work has quit [Ping timeout: 260 seconds]
edwinvdgraaf has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
edwinvdg_ has joined #ruby
johnDoe111 has joined #ruby
allcentury has quit [Ping timeout: 250 seconds]
danieli has quit [Changing host]
danieli has joined #ruby
edwinvdgraaf has quit [Ping timeout: 258 seconds]
johnDoe111 has quit [Ping timeout: 244 seconds]
certainty has quit [Ping timeout: 244 seconds]
emptyflask has quit [Remote host closed the connection]
sameerynho has joined #ruby
ash_workz has joined #ruby
djbkd has quit [Quit: My people need me...]
achamian has quit []
darkxploit has joined #ruby
pawnbox has quit [Remote host closed the connection]
<adaedra>
Hej hej
Staticillmatic has joined #ruby
moeabdol has joined #ruby
<flughafen_>
hej adaedra
coffeecupp has joined #ruby
giz|work has joined #ruby
MrBusiness2 has joined #ruby
znz_jp has quit [Remote host closed the connection]
Niham has joined #ruby
polll has quit [Quit: leaving]
jud^ is now known as jud
moeabdol has quit [Ping timeout: 252 seconds]
jud has quit [Changing host]
jud has joined #ruby
znz_jp has joined #ruby
MrBusiness has quit [Ping timeout: 258 seconds]
Staticillmatic has quit [Ping timeout: 244 seconds]
al2o3-cr has joined #ruby
ocbtec has joined #ruby
ecksit has joined #ruby
ksinkar has joined #ruby
aberen has joined #ruby
phredus has quit [Remote host closed the connection]
pepee has quit [Quit: bye $IRC]
mikecmpbll has joined #ruby
elementaru has joined #ruby
<ksinkar>
has anyone here used the Ruby Shell library recently? I am using it, but other than echo, I cannot access any other shell commands which are available in my shell through my PATH.
<norc>
ksinkar: What library is that?
zacstewart has quit [Ping timeout: 264 seconds]
nobitanobi has joined #ruby
Silthias has joined #ruby
phredus has joined #ruby
mark_66 has joined #ruby
pawnbox has joined #ruby
alfiemax has quit [Ping timeout: 250 seconds]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
thamster has joined #ruby
thamster has quit [Client Quit]
johnbat26 has joined #ruby
thamster has joined #ruby
thamster has left #ruby [#ruby]
jazz1 has joined #ruby
blackgoat has quit [Ping timeout: 272 seconds]
joonty has joined #ruby
jaruga___ has joined #ruby
pawnbox_ has joined #ruby
senayar has joined #ruby
crdpink has quit [Ping timeout: 250 seconds]
ICantCook has quit [Ping timeout: 244 seconds]
pawnbox has quit [Ping timeout: 264 seconds]
dionysus69 has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
certainty has joined #ruby
giz|work has quit [Ping timeout: 240 seconds]
crdpink has joined #ruby
TheHodge has joined #ruby
diegoaguilar has joined #ruby
rikkipitt has joined #ruby
axsuul has quit [Ping timeout: 240 seconds]
sandelius has joined #ruby
yatish27 has quit [Remote host closed the connection]
Rodya_ has joined #ruby
Dimik has quit [Ping timeout: 250 seconds]
der-landgraf has quit [Quit: WeeChat 1.5]
der-landgraf has joined #ruby
nobitanobi has quit [Remote host closed the connection]
zacstewart has joined #ruby
der-landgraf has quit [Client Quit]
der-landgraf has joined #ruby
tmtwd has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
madgen has joined #ruby
allcentury has joined #ruby
diegoaguilar has quit [Ping timeout: 276 seconds]
jackjackdripper has quit [Quit: Leaving.]
axxyhtrx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
neanderslob has quit [Remote host closed the connection]
<lala2004>
i'm getting: undefined method `try_spin' for main:Object (NoMethodError)
<lala2004>
but i clearly define it
<lala2004>
oh -- order!!! got it
madgen has quit [Ping timeout: 276 seconds]
Couch has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
<norc>
lala2004: By the way, in Ruby functions are called "methods" :)
<lala2004>
thanks! i'm new to computers
tatsuo has joined #ruby
jaruga___ has joined #ruby
<norc>
lala2004: But yeah, Ruby executes code from top to bottom. There is no static analysis like in C, where you can call a function before you declare it (in the same file).
<lala2004>
that must be because it doesn't compile
<norc>
lala2004: Well actually it does.
<lala2004>
or it has too . . . but it does it at runtime (whatever that means)?
<norc>
Yes!
<norc>
In that respect Ruby is similar to Java.
moeabdol1 has joined #ruby
<workmad3>
norc: err, java needs compilation to bytecode before it can run on the JVM
<norc>
workmad3: And Ruby does exactly that.
<workmad3>
norc: not explicitly
<lala2004>
so -- there is a virtual machine that directly abstracts into, say, x86?
johnmilton has quit [Remote host closed the connection]
<norc>
lala2004: Yes.
<workmad3>
lala2004: since 1.9, yes
<norc>
workmad3: 2.0
<norc>
Or was it 1.9?
<workmad3>
norc: I thought YARV became MRI with 1.9 :)
* norc
shrugs
<lala2004>
yarv?
<lala2004>
mri?
vondruch has quit [Remote host closed the connection]
<lala2004>
sorry . . .
<norc>
lala2004: MRI is Ruby slang for "Matz Ruby Interpreter"
<jhass>
lala2004: ignore them, all this is completely irrelevant for you currently
<lala2004>
like a wrapper around the procesor
<workmad3>
jhass: it's friday, let us shave yaks :P
<lala2004>
jhass: sorry, I'm terrible at ignoring things -- i know it is a weakness
devbug has quit [Ping timeout: 252 seconds]
moeabdol has quit [Ping timeout: 272 seconds]
<norc>
workmad3: Im curious though, what did you mean by "not explicitly" ?
<workmad3>
norc: for java, you need to run `javac` in order to get the bytecode, the JVM doesn't actually include the source->bytecode compiler as part of the VM
<workmad3>
norc: while with ruby, the source->bytecode compilation is part of the interpreter
<workmad3>
and there's no separate compilation step
<norc>
workmad3: Fair enough.
<norc>
You could enforce it to be separate though.
<norc>
Ship people ISeqs :D
<workmad3>
you could, if you had a bytecode standard for the VM that you were commited to keeping stable
<norc>
workmad3: The biggest problem though is that it needs require/autoloading support.
<norc>
(in order to seamlessly ship a library as an iseq binary)
<workmad3>
norc: that's not a huge problem... the bigger problem is `eval` ;)
<norc>
evaling works..
<workmad3>
not if you remove the source->bytecode compiler from the runtime and enforce the use of ISeqs
<norc>
What do you mean?
<workmad3>
eval needs to compile the string as ruby code... if you're going to remove the bytecode compiler and rely on ISeqs, then eval doesn't have a mechanism to compile with...
nobitanobi has joined #ruby
nobitanobi has quit [Remote host closed the connection]
<norc>
Oh you actually meant Kernel#eval there.
<workmad3>
yeah
<norc>
Fuck that.
<workmad3>
agreed... but it's part of the language, and makes switching to a more java-esque VM style more difficult :)
<norc>
workmad3: Though I think if there was enough support to make require/autoloading work with binary ISeqs, it could help a lot with the startup time of things like rails apps.
colegatron_origi has quit [Quit: Leaving]
<norc>
But I guess I should actually profile this first before making such claims.
camilasan has quit [Remote host closed the connection]
sandelius has joined #ruby
truenito has joined #ruby
<workmad3>
similarly, afaik there's not a commitment to having a stable VM bytecode in ruby currently either, which is the real stumbling block... without that, there's always the potential issue of an ISeq not working with your ruby version (solvable, but only if you're fine with just caching compiled ISeqs and throwing them away if there's any issues for a recompile from source)
<workmad3>
I think python does that though, so it's probably not a big deal, and could help startup times :)
<norc>
Considering we have had grammar changes even in minor versions, cross-version compability has never been much of a big feature of Ruby.
<norc>
Yeah they do.
<norc>
workmad3: Im wondering whether this could actually be the more sane approach to an app preloader like Spring.
allcentury has joined #ruby
<norc>
Since you would essentially only be preloading something that has non side-effect.
camilasan has joined #ruby
<workmad3>
norc: yeah... but imagine the error messages when you get told that your program won't load because `unexpected byte 0xff was encountered in ISeq` rather than a sensible parser Syntax error in a source file ;)
<lala2004>
so LLVM is bytecode, could the yarv run that?
kknight has quit [Quit: Leaving]
<workmad3>
lala2004: no
<norc>
lala2004: No
<norc>
lala2004: Ruby uses a custom VM, not a very complex one either.
vondruch has joined #ruby
<lala2004>
llvm is specific to cland?
<lala2004>
clang?
<norc>
lala2004: no
<norc>
llvm is specific to llvm.
<lala2004>
ok . . .
<workmad3>
lala2004: no... but the LLVM VM is a different VM to the ruby VM, which means it runs a different bytecode
<norc>
clang is just a compiler frontend for llvm
<lala2004>
what is the relationship between clang . . . oh got it
<lala2004>
norc: are there other frontends for llvm?
<norc>
lala2004: Plenty!
<lala2004>
so what could run llvm?
<workmad3>
lala2004: bytecode is just a term for "We compiled our source into a machine code representation that corresponds to a virtual machine in our runtime"
<norc>
lala2004: Rubinius is probably the best example, consideirng we are in #ruby.
<lala2004>
oh -- thanks -- so bytecode is for a vm, where a binary is for specific hardware?
sdothum has joined #ruby
giz|work has quit [Ping timeout: 250 seconds]
<norc>
lala2004: Sure, I think that view is fine.
<lala2004>
ha -- probably wrong but gets me to the next step at least
<norc>
It seems quite correct actually.
<workmad3>
lala2004: pretty much... there's nothing really stopping you from creating custom hardware that implements the instruction set of a VM, but I'm not aware that anyone has ever bothered :)
mdw has quit [Quit: Sleeping Zzzzz]
<norc>
lala2004: In the end its just fancy terms. In reality you have so many levels of abstractions. If you compile C code, you have the following layers
truenito has quit [Ping timeout: 250 seconds]
<lala2004>
as a beginner, it seems everything i think is wrong in some way
allcentury has quit [Ping timeout: 272 seconds]
<lala2004>
at least code runs -- that is a certain definition of reality
<norc>
lala2004: C source code > Abstract Syntax Tree > (1-3 levels of) Intermediate Representation > (Possibly a VM) > Assembly > Instructions > Microcode
<lala2004>
nice! that helps
<workmad3>
lala2004: sometimes you need to learn something that isn't completely accurate in order to get a base of knowledge to understand the more accurate version
<elomatreb>
Isn't the microcode independent from the program, basically CPU firmware?
<norc>
lala2004: And then within that, Ruby emulates a virtual machine.
<norc>
elomatreb: Correct.
<norc>
elomatreb: firmware is a bit generic though, effectively its what allows modern processors to offer CISC but still get pipeline benefits from RISC.
<norc>
(since it breaks CISC into RISC operations)
<elomatreb>
norc: I think I just misunderstood your example above. (Close-to-metal programming isn't anything I want to have anything to do with)
nankyokusei has joined #ruby
<workmad3>
elomatreb: modern CPUs don't actually run something like the x86 instruction set... instead they have what amounts to a compilation unit as part of the processer that accepts x86 machine code and compiles it into instructions for an internal microcode that's simpler and easier for the CPU to optimise
joonty has quit [Quit: This computer has gone to sleep]
babblebre has joined #ruby
<workmad3>
elomatreb: that's the Instructions > Microcode step norc meant (or at least, my understanding of it... I'm not much of a low-level coder either)
<norc>
workmad3: Correct.
<elomatreb>
I read the Wikipedia article on RISC once, that's basically anything I ever learned about that :shrug:
<norc>
workmad3: The biggest benefit is that it allows for out-of-order execution. :)
<norc>
(Technically its not necessary, but it makes it far more effective)
<norc>
Or parallelism rather.
<workmad3>
elomatreb: as you can probably see, the distinction is somewhat more fuzzy nowadays :) and it wasn't ever particularly sharp anyway
nankyokusei has quit [Ping timeout: 240 seconds]
<norc>
lala2004: Anyway. The point was to show that in programming you have many layers of abstractions. And Rubys VM is on the left side.
<workmad3>
^ there's a classic saying - "Every problem in programming can be solved by an extra layer of indirection"
<norc>
lala2004: So you would have "Ruby VM" > "C Code" > etc.
KINGSABRI has quit [Remote host closed the connection]
<elomatreb>
I'm continuously impressed that computers do anything, ever
kent\n has quit [Read error: Connection reset by peer]
hakunin_ has joined #ruby
<workmad3>
norc: technically, "C Code" sits off to the side of that, as the Ruby VM doesn't emit C Code, it emits instructions... but it's compiled from C Code :)
hakunin has quit [Read error: Connection reset by peer]
fenre has quit [Ping timeout: 260 seconds]
<norc>
workmad3: Yeah I suppose.
raeoks has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nobitanobi has joined #ruby
techietrash has quit [Ping timeout: 264 seconds]
<workmad3>
elomatreb: yeah... the scariest thing about being a programmer is to realise just how fragile the entire edifice of the modern world is
<elomatreb>
workmad3: Or how impressive it is that we can talk to people using a few grams of carefully etched sand
polll has joined #ruby
nobitanobi has quit [Remote host closed the connection]
seitensei has quit [Ping timeout: 250 seconds]
<workmad3>
elomatreb: a few grams of carefully etched sand that only achieves anything by pretending that everything is a number!
biox has quit [Ping timeout: 260 seconds]
<workmad3>
really shows how powerful Gödelisation is...
ash_workz has quit [Remote host closed the connection]
<lala2004>
norc: how can there be anything lower than instructions?
<norc>
lala2004: the CPU is effectively running an interpreter of its own.
joonty has joined #ruby
biox has joined #ruby
techietrash has joined #ruby
<elomatreb>
lala2004: The lowest level of "instructions" on your CPU are just logic gates of two transistors
<lala2004>
ok -- so 0x37 might instruct the processor to xor two registers, you are saying that below that there is hardware incorporated instructions?
seitensei has joined #ruby
<norc>
lala2004: an instruction gets decoded into microinstructions, and these microinstructions again consist of single operations.
<elomatreb>
lala2004: Even a XOR gate is built using four NAND gates
hk238 has joined #ruby
<lala2004>
got it -- so the corpus of x86 instructions takes some number of transistors to execute
<norc>
lala2004: an xor needs to connect registers to the alu, set the ALU to do things, and then force the cpu to jump to the next instruction.
<lala2004>
say that is "n" transistors -- why do we now have billions >> n?
<elomatreb>
because you can't reconfigure transistors on the fly
<workmad3>
lala2004: something as simple as xor on two registers probably would pass through directly into a single microcode instruction... but the x86 instruction set has much more complicated instructions
<norc>
lala2004: modern CPUs are really complex designs.
polll has quit [Quit: leaving]
<lala2004>
but still x86 worked on 1/100th (or even less) of the transistors of more recent chips
<norc>
lala2004: For example during a single cycle a modern x86 CPU can execute up to 4 instructions.
yqt has joined #ruby
<workmad3>
lala2004: I don't know if they're supported on modern CPUs, but some processors had instructions for things like squareroots, sine and cosine, etc.
<lala2004>
is there something like a pie chart of what transistors on a modern chip are used for?
<norc>
lala2004: dont think in terms of transistors.
<norc>
lala2004: You cannot sensibly understand it from that perspective.
<workmad3>
^ it's like trying to understand an airplane in terms of atoms
<elomatreb>
But it's quite enlightening to understand how a computer is even able to operate. Maybe not for programming, but in general
<lala2004>
fair enough -- but why would i want 4B transistors versus 4000 if 4000 is all it takes to run all x86 opcodes
<norc>
lala2004: that diagram is as low as you can understand it without losing yourself.
davedev24 has joined #ruby
<norc>
lala2004: Look at that, and then begin to understand that modern processors are unbelievably complex.
<lala2004>
thanks
<workmad3>
elomatreb: if you want something fun - you can also construct all basic logic gates from NOR gates... and you can construct a NOR gate from a single transistor
<norc>
and then start building arithmetic operations
<norc>
try to build a half-adder without looking at the wiki
<lala2004>
well, i'm impressed -- my teacher said that ruby coders don't understand how things work
<norc>
then a full adder
<lala2004>
that i should learn c because i would learn what the computer does
<elomatreb>
workmad3: In Germany you actually do that in school if you pick CS in the higher grades
<norc>
lala2004: C is a fine language but has different goals.
<workmad3>
lala2004: if you learn C, you learn what a PDP11 does...
<norc>
lala2004: C is useful when you need to write language close to the hardware.
<norc>
For Kernel development there are only 2 sensible languages (a few others have been used successfully though)
<norc>
C and possibly C++.
<workmad3>
it has about as much actual resemblance to modern hardware as ruby... but it has 30+ years of intensive compiler optimisation behind it
<norc>
lala2004: But if the task is to quickly provide a website, then C is not the right task because you are too close to the hardware.
<norc>
In essence: Ruby developers don't _care_ about the hardware (as opposed to dont know)
<elomatreb>
lala2004: If you really want to use a compiled language you could check out Rust (https://www.rust-lang.org/). Almost all the benefits with few of the risks of C
flashpoint9 has joined #ruby
k3rn31 has joined #ruby
nobitanobi has joined #ruby
<lala2004>
does rust give you the h/w knowledge
<ytti>
rust has no run time
<ytti>
it can be used for anything
<lala2004>
ytti: what does that mean?
<ytti>
it means it's as low level a it gets
<lala2004>
ah -- nice
<norc>
Just dont try Kernel development with it. :-P
joonty has quit [Remote host closed the connection]
<ytti>
(i disagree greatly if C is fine language, i don't think it is, i think large amount of poor quality software is attributed to C being too hard to program right)
<elomatreb>
Unless you're developing actual drivers you probably shouldn't be interested in HW knowledge for programming
<workmad3>
lala2004: tbh, no language will really give you h/w knowledge (not even C)... the main thing C will give you is working knowledge of an ancient processor, and manual memory management
joonty1 has joined #ruby
<lala2004>
workmad3: i see
<norc>
ytti: Well its fine for specific tasks, which is kernels and drivers.
rodfersou has joined #ruby
<workmad3>
lala2004: what gives you hardware knowledge is having to interface with hardware (like elomatreb said)
<lala2004>
got it
Emmanuel_Chanel has joined #ruby
<elomatreb>
If you're really interesting in Hardware get a Arduino or some similar microcontroller chip. Quite fun to play with
<elomatreb>
*interested
certainty has joined #ruby
<workmad3>
lala2004: C doesn't really expose you to things like having to move data from memory to registers, the instruction counter, etc. and it definitely won't expose you to the microcode optimisations of modern hardware... it's surprisingly far away from actual hardware for something that's claimed as 'low level' by so many :)
ramfjord has quit [Ping timeout: 272 seconds]
<lala2004>
so -- breaking code, ida and the like might give one that knowledge
tlaxkit has joined #ruby
chouhoulis has joined #ruby
<norc>
workmad3: And yet C requires you to be *aware* of all these things. If you have misaligned data, your program might crash. If you dont write cache line aware core, you suffer from extreme performance penalties.
<norc>
*code
<workmad3>
norc: yeah, but it needs you to be aware of them in a way that's closer to PDP11s hardware than modern hardware
<workmad3>
norc: that doesn't make it 'close to the metal', it makes it annoying ;)
<norc>
Heh.
<norc>
workmad3: The headache I got yesterday when I learned why exactly I had to enable the A20 gate during boot sequence.
<norc>
Unbelievable.
<workmad3>
norc: compilers make up for a lot of the inconsistency though, so C compiles down to something pretty close to optimal for the underlying hardware in most cases
<norc>
Not to mention why one of the common ways to do it was through the keyboard controller (that provoked a real wtf)
<lala2004>
ok -- sorry, very basic again -- if I have a hash: freq = Hash['large' => 0, 'small' => 0, 'tiny' => 0, 'lose' => 0] and I want to increase 'large' by one?
<norc>
workmad3: Indeed. Though cache line awareness is something the programmer has to do, the compiler can not help.
<norc>
Bish: Did you have a reason not to use an XML/HTML parser?
nobitanobi has quit [Remote host closed the connection]
joonty1 is now known as joonty
<Bish>
well that regex was sufficent until now
<Bish>
i really only wanted links, that's all i needed
<norc>
lala2004: By the way! https://eval.in/ allows you to share code *and* have it executed. (gists are great for everything else though)
johnDoe111 has joined #ruby
duckpuppy has joined #ruby
<norc>
Bish: see, with nokogiri it would be: document.css(‘a’)
<workmad3>
Bish: `<a\n` isn't broken HTML, afaik
swills has joined #ruby
<lala2004>
norc: cool -- appreciate any tips on my code -- that was much easier than i thought
<lala2004>
simulating a game i'm making for school -- a roulette wheel
<norc>
lala2004: Considering you just started, just focus on figuring things out.
<norc>
lala2004: aside from the usual "use 2-space indention, not tabs" that you hear in this channel I wouldn't really care to comment on else.
<lala2004>
ok -- well that works -- i love the switch syntax
<norc>
Otherwise you would be busy for a day rewriting this.
gnufied has joined #ruby
mistermocha has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
<lala2004>
ok -- well, i'm excited that i got something to work
<lala2004>
thanks for all the understanding too
<norc>
lala2004: It looks generally fine otherwise.
<norc>
So you are on a good path.
<lala2004>
i'll take it
<lala2004>
good day all
lala2004 has left #ruby [#ruby]
johnDoe111 has quit [Ping timeout: 260 seconds]
duckpuppy has quit [Ping timeout: 260 seconds]
Guest35287 has quit [Quit: leaving]
allcentury has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
axsuul has joined #ruby
swills has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
vondruch has quit [Quit: Ex-Chat]
blockchan1 has quit [Ping timeout: 250 seconds]
deadnull_ has joined #ruby
chouhoulis has joined #ruby
preller has joined #ruby
preller has quit [Changing host]
preller has joined #ruby
rodfersou has quit [Quit: leaving]
syath has joined #ruby
axsuul has quit [Ping timeout: 276 seconds]
jaguarmagenta has joined #ruby
AcidCrash has quit []
CloCkWeRX has joined #ruby
Fredrich010 has joined #ruby
Fredrich010 is now known as AcidCrash
davedev24 has quit [Remote host closed the connection]
<Bish>
workdmad3 i never said <a\n would be the reason why the html is broken
kareeoleez has quit [Ping timeout: 250 seconds]
<Bish>
workmad3: *
<Bish>
it can get much worse than that :D
kareeoleez has joined #ruby
preller has quit [Quit: leaving]
<jhass>
?tabnick
<ruby[bot]>
pro-tip - use tab completion for nicks. avoids typos in nicks.
<Bish>
i scrolled up in irssi somehow couldn't tab during that
preller has joined #ruby
preller has joined #ruby
preller has quit [Changing host]
<jhass>
get weechat :P
<Bish>
i like irssi
jaguarmagenta has quit [Ping timeout: 240 seconds]
nobitanobi has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
rodfersou has joined #ruby
hanmac has quit [Ping timeout: 258 seconds]
preller has quit [Quit: leaving]
flashpoint9 has quit [Remote host closed the connection]
Silthias has quit [Ping timeout: 258 seconds]
blockchan has joined #ruby
nobitanobi has quit []
chouhoulis has quit [Remote host closed the connection]
blockchan1 has joined #ruby
matp has quit [Remote host closed the connection]
matp has joined #ruby
blockchan has quit [Ping timeout: 252 seconds]
Yiota has joined #ruby
Silthias has joined #ruby
Wildfyr has joined #ruby
<shevy>
real men need real GUIs
<Bish>
i feel like text interfaces are way more manly
hutch34 has joined #ruby
johnDoe111 has joined #ruby
Niham has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Yiota has quit [Ping timeout: 272 seconds]
joonty has quit [Quit: This computer has gone to sleep]
hanmac has joined #ruby
<jhass>
what does usability have to do with my gender?
alfiemax has quit [Ping timeout: 272 seconds]
<workmad3>
jhass: it has very little to do with your gender, but it has a lot to do with cultural gender-specific stereotypes
<jhass>
doesn't sound like a good situation then
lightt has joined #ruby
rikkipitt has joined #ruby
<apeiros>
Bish: in what way? that most interfaces are dicks to users?
<shevy>
lol
blackgoat has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
<shevy>
text interfaces are a lot easier to do right
<apeiros>
in a way. in a way they're a lot more difficult.
swills has joined #ruby
moeabdol2 has joined #ruby
<Bish>
i think different
swills has quit [Remote host closed the connection]
romistrub has joined #ruby
<jhass>
different from/than?
lightt has quit [Remote host closed the connection]
<romistrub>
hi all
<Bish>
apeiros: in a way that interfaces are a lot closer to the "engine" like a motorengine of a car => manly
<jhass>
what a sad statement
<jhass>
anyway
<Bish>
if you have a sort of syntax you can often reuse something
<jhass>
?offtopic
<ruby[bot]>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<Bish>
more flexieble etcpp, but as jhass said
<Bish>
jhass: i wasn't 100% serious about that one :D
moeabdol1 has quit [Ping timeout: 250 seconds]
<jhass>
sarcasm doesn't prevent reproduction
<romistrub>
how do I create a subclass of String and then set its value as something from within a function? Is there something like my_string.value = "xyz"? I don't think it makes sense to do self = "xyz" from within a function
<apeiros>
romistrub: a) don't do it, b) #replace
<jhass>
romistrub: don't subclass string, wrap it
k3rn31 has joined #ruby
<romistrub>
jhass: apeiros I'll look into wrapping, thanks!
<Bish>
jhass: what is this supposed to mean?
<Bish>
does*
<Bish>
is?
<apeiros>
Bish: that your sarcasm is complicit in keeping stereotypes alive
<Bish>
jesus christ, it's really easy to fall into the PC-trap in irc
ElFerna has joined #ruby
<apeiros>
that's a rather sad excuse
Niham has joined #ruby
duckpuppy has joined #ruby
<apeiros>
"oh no, don't hit on me you bad bad evil PC people you - *I* didn't do anything wrong!!!"
<apeiros>
that's unmanly, btw. :-p
<Bish>
excuse for what, there was nothing done wrong, the statement "real men need guis" is already sexist in a way, and it was not serious
<romistrub>
google searched "wrap ruby class" and I'm getting "wrap ruby class method"
<jhass>
romistrub: look into SimpleDelegator
<Bish>
i gonna stop here, but you're overdoing it
<apeiros>
Bish: sure. keep yourself telling that.
<jhass>
apeiros: Bish #ruby-offtopic. now.
symm- has quit [Ping timeout: 258 seconds]
zacstewart has joined #ruby
<workmad3>
jhass: do I need to go to #ruby-offtopic if I want to make a comment that your previous statement is like a teacher telling off bad children? :)
<jhass>
romistrub: yup, three bars at the top left, options
<sandelius>
composition that is
<toretore>
(or tell you that it is in fact a valid use of inheritance :P )
<shevy>
can penguins fly?
<sandelius>
no that's the problem :)
<sandelius>
read
dionysus69 has joined #ruby
<apeiros>
romistrub: it's relatively simple: don't subclass classes you don't own
<romistrub>
jhass: thx
<shevy>
this code is well documented
<shevy>
class Penguin < Bird
<shevy>
# LOL I'm a penguin
<romistrub>
apeiros: gotcha, simple in principal
<sandelius>
shevy haha right
<apeiros>
"the idea is borrowed from Go" - I almost made a mess with my drink at that point :D
<romistrub>
So I'm creating a WebSocket server, which is basically a TCPSocket with some special encoding, decoding, and control functionality
<romistrub>
I know there are existing WebSocket servers, but I'm just getting back into programming and needed to get my hands dirty
<toretore>
i don't think you can classify a websocket as-a tcpsocket
<Bish>
the pengiun article doesn't provide a solution but one that doesn't exist :o
<sandelius>
Bish no but it points out the problem with inheritance :)
<sandelius>
not all inheritance is bad tho
<romistrub>
toretore: disagree, programatticaly speaking they seem the same; an ideal case for inheritance, as their functions are almost identical, but with some pre-and-post-processing going on frame-by-frame
<toretore>
romistrub: well, if that's the case then inheritance is ok
<toretore>
romistrub: but you have to be really sure that there aren't any exceptions
<toretore>
i've thought the same many times and inherited something, only to discover that some assumptions made in the superclass aren't true for my case
nerium has joined #ruby
c355e3b has joined #ruby
<Bish>
that ruby doesn't have ++ hurts me for the first time :( ouchy
<romistrub>
Hah! I forgot how much I suck at reading someone else's code
<sandelius>
off topic: I havent done any real PHP work but in most languages we use connection pools for creating new e.g database connections. But in PHP it seems like a new connection is created upon each request? Can this really be?
<Bish>
sandelius: yes, php scripts lifecycles is during the request
rikkipitt has quit [Remote host closed the connection]
<Bish>
starts and ends with it
<toretore>
it probably could. iirc, a php script is.. what bish said
jaruga___ has quit [Ping timeout: 264 seconds]
Gasher has joined #ruby
<sandelius>
Bish but but but wont the dataabse slap you in the face if you get many requests?
jaruga___ has joined #ruby
Xentil has joined #ruby
<Bish>
it probably does, but i guess they mysql module of php does some hacky things to recycles connections between multiple requests
<Bish>
(just a guess, don't know)
flashpoint9 has joined #ruby
<sandelius>
you would end up with an insane amount of open connections
<Bish>
depends if you stall them / limit the amount of multiple requests
<sandelius>
(porting a php project to ruby)
diegoaguilar has quit [Ping timeout: 250 seconds]
last_staff has quit [Ping timeout: 250 seconds]
ElFerna has quit [Ping timeout: 252 seconds]
<Bish>
but your understanding is right, atleast some sort of connection has to be created every request
<norc>
sandelius: if you know from the beginning well enough that its offtopic that you designate it as "offtopic:", start the conversation in #ruby-offtopic
<norc>
Not here.
<norc>
?offtopic
<ruby[bot]>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<sandelius>
norc sry
<Bish>
but you can have "too many connections" error in ruby, too, so there is basicially no difference
davedev24 has joined #ruby
triangles has joined #ruby
<romistrub>
jhass: am I crazy, is there a class *within* a class in your link?
blackmesa has joined #ruby
<jhass>
sure!
<jhass>
both classes and modules can be used as namespaces, true for Crystal and Ruby
<romistrub>
oh shazam, I thought that was the name of the websocket implementation :|
fmcgeough has joined #ruby
infra-red has quit []
davedev24 has quit [Remote host closed the connection]
<romistrub>
reading Crystal was like listening to Dutch while being a native english speaker
davedev24 has joined #ruby
<Bish>
crystal not even once
<romistrub>
it sounds so close that you think you're having a stroke
<Bish>
have u thought about that one BEFORE deciding for the name?
<romistrub>
Bish: hilarious :P
der-landgraf has joined #ruby
<romistrub>
dibs on crystaladdict.com
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
der-landgraf has quit [Client Quit]
der-landgraf has joined #ruby
deadnull_ is now known as _deadnull
lxsameer has quit [Ping timeout: 252 seconds]
xlegoman has joined #ruby
noobsu has joined #ruby
terminalrecluse has joined #ruby
phredus has quit [Remote host closed the connection]
phredus has joined #ruby
<romistrub>
I still have no idea what everybody was talking about when they were talking about wrapping... :| hahah
xlegoman has left #ruby [#ruby]
<jhass>
class WebSocket < TcpSocket -> class WebSocket; def initialize(socket); @socket = socket; end;
ramortegui has joined #ruby
dstarh has joined #ruby
jancel has quit [Read error: Connection reset by peer]
roamingdog has joined #ruby
cdg has joined #ruby
blockchan1 has quit [Ping timeout: 244 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
ta_ has quit [Remote host closed the connection]
<romistrub>
jhass: gotcha, thanks
blockchan has joined #ruby
<romistrub>
jhass: and why do I prefer that exactly? :P
eljimbo has quit [Quit: This computer has gone to sleep]
<jhass>
you have 100% control, now _and_ in the future, what interface your class provides
<romistrub>
jhass: okay, thank u
<jhass>
you don't have to worry about how any behavior _or changes of behavior_ of your parent class will affect the interface of your class
jasondotstar has joined #ruby
swills has joined #ruby
lxsameer has joined #ruby
roamingdog has quit [Ping timeout: 276 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
<jhass>
and finally it usually also makes your class more flexible by duck typing on the class it wraps, so you can just substitute TCPSocket for FakeSocket in your tests for example
craigp has joined #ruby
axxyhtrx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Madplatypus has quit [Quit: Connection closed for inactivity]
jancel has joined #ruby
<romistrub>
jhass: thanks; is all this info in that book u linked me to?
<jhass>
uh, I don't remember, probably not exactly like it
<jhass>
but it sets the right mindset for sure
<romistrub>
I'm definitely more of an Epimethius than Promethius type, so style books could serve me well
roamingdog has joined #ruby
Niham has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
eGGshke has quit [Quit: Leaving...]
hutch has joined #ruby
<hutch>
good morning :)
certainty has joined #ruby
<romistrub>
morning hutch
blackmesa has joined #ruby
edwardly has quit [Max SendQ exceeded]
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
certainty has quit [Ping timeout: 258 seconds]
tatsuo has quit [Remote host closed the connection]
_deadnull is now known as deadnull_
chouhoulis has joined #ruby
aegis3121 has joined #ruby
tlaxkit has quit [Quit: ¡Adiós!]
gregf has quit [Quit: WeeChat 1.5]
Snowy has joined #ruby
gregf has joined #ruby
aegis3121 has quit [Ping timeout: 246 seconds]
kies has quit [Ping timeout: 276 seconds]
<Bish>
how do i neatly get the time of yesterday? -24h
<Bish>
i always end up substracting seconds, but that sucks
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
blaxter has joined #ruby
<toretore>
what do you mean the time of yesterday, a Time object representing now - 24h?
<Bish>
yep
<toretore>
yes, then by subtracting 86400
<chris2>
wrong for a leap second :P
<shevy>
hmm
<hutch>
would Time.now - 1.day work ?
<toretore>
>> 1.day
<ruby[bot]>
toretore: # => undefined method `day' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/586765)
jancel has quit [Remote host closed the connection]
codecop has quit [Remote host closed the connection]
jaruga___ has quit [Quit: jaruga___]
swills has joined #ruby
kinnie has quit [Quit: Bye]
mrmortondk has joined #ruby
frem_ has joined #ruby
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
leitz has joined #ruby
sandelius has joined #ruby
sankarshanmudkav has joined #ruby
sankarshanmudkav has left #ruby [#ruby]
<romistrub>
So I'm trying to pass event handlers as lambdas into a function so that they can be called and passed certain variables (I thought this was their major use-case); but I keep getting a "undefined local variable: connection" (Name Error)
<apeiros>
terrabl: you'd get it when some other code earlier defines it as a class
<apeiros>
>> class X; end; module X; end
<ruby[bot]>
apeiros: # => X is not a module (TypeError) ...check link for more (https://eval.in/586821)
<apeiros>
also you can't invoke an instance method directly on the class (create, defined on line 6, upper file, invoked in line 9, lower file)
SilverKey has joined #ruby
<terrabl>
I figured out what I did wrong, i accidently made a class TestController inside of the file I was requiring inside of loadtestcontroller.rb
<terrabl>
I thought as a module I can just call the function as long as I required it in the file?
<terrabl>
Like calling create from scheduler would run the TestControllers.create method?
ChiefAlexander has quit [Remote host closed the connection]
<apeiros>
no, that's not how it works
snath has joined #ruby
tildes_ has joined #ruby
<terrabl>
Sorry I'm new to ruby could you explain or point me in a direction that will help me understand.
<terrabl>
I like the concept of modules, and need to implement them, but I think I am correlating them too closely to user defined regular old classes
tjbiddle has quit [Quit: tjbiddle]
<apeiros>
terrabl: I'm a bit busy at the moment, so excuse me for just telling you to read a tutorial or book. class- vs. instance-methods is relatively basic.
saneax_AFK is now known as saneax
<apeiros>
i.e. should be covered by any introductionary material
Niham has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jas02 has quit [Quit: jas02]
tildes_ has quit [Ping timeout: 264 seconds]
william_ has joined #ruby
<terrabl>
apeiros: yeah i guess its probably something I could have looked up myself, sorry for bothering you.
diegoviola has joined #ruby
<apeiros>
not a bother. asking is fine. just ain't got time now.
dhollinger has joined #ruby
ChiefAlexander has joined #ruby
aegis3121 has quit [Ping timeout: 250 seconds]
matejkonrad has joined #ruby
aganov has quit [Remote host closed the connection]
kareeole_ has quit [Remote host closed the connection]
swills has joined #ruby
sergey_makagon has quit []
mtkd has quit [Ping timeout: 276 seconds]
marr123 has joined #ruby
marr has quit [Killed (barjavel.freenode.net (Nickname regained by services))]
marr123 is now known as marr
aegis3121 has joined #ruby
despai has joined #ruby
mtkd has joined #ruby
Asher has joined #ruby
kies has quit [Ping timeout: 244 seconds]
taylorrf has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
TomyLobo has joined #ruby
certainty has joined #ruby
ramfjord has joined #ruby
tjbiddle has joined #ruby
learath has left #ruby [#ruby]
certainty has quit [Ping timeout: 244 seconds]
aberen has quit [Ping timeout: 250 seconds]
lxsameer has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rodfersou is now known as rodfersou|lunch
haraigo has quit [Ping timeout: 250 seconds]
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 240 seconds]
rkazak has joined #ruby
hobodave has joined #ruby
chopin has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 276 seconds]
chopin has joined #ruby
kgrz has joined #ruby
rikkipitt has quit [Remote host closed the connection]
hutch34 has joined #ruby
jancel has joined #ruby
shinnya has joined #ruby
agit0 has quit [Read error: Connection reset by peer]
emptyflask has quit [Remote host closed the connection]
jaguarmagenta has joined #ruby
RobertBirnie has joined #ruby
johnDoe111 has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
sandstrom has quit [Quit: My computer has gone to sleep.]
aep-shoutlet has joined #ruby
jancel has quit [Ping timeout: 252 seconds]
Rodya_ has joined #ruby
lxsameer has joined #ruby
cschneid has joined #ruby
<cschneid>
How fast is array#reverse? I assume O(n)?
darkxploit has quit [Quit: Leaving]
<aep-shoutlet>
is x || false logically equivalent to x, or would values like nil be passed through in the second but transformed to false in the first?
pawnbox has joined #ruby
<Bish>
aep-shoutlet: wyh dont u just test it
<aep-shoutlet>
irb experiment confirms the behavior is different, thanks!
jaguarmagenta has quit [Ping timeout: 244 seconds]
johnDoe111 has quit [Ping timeout: 260 seconds]
<apeiros>
cschneid: O(n) is its algorithmic complexity. not to be confused with performance ("fast")
Rodya_ has quit [Ping timeout: 250 seconds]
tatsuo has joined #ruby
<cschneid>
yeah yeah. I know. I just want to verify that what I'm doing won't blow up in time if I give it a longer array
kareeoleez has joined #ruby
moeabdol2 has quit [Ping timeout: 264 seconds]
Gasher has quit [Quit: Leaving]
kareeoleez has quit [Remote host closed the connection]
senayar has quit []
GinoManWorks_ has joined #ruby
<apeiros>
"I know, I'll still use the wrong terminology". never ceases to draw a smile on my face…
nando293921 has quit [Ping timeout: 252 seconds]
tatsuo has quit [Ping timeout: 260 seconds]
GinoManWorks has quit [Ping timeout: 260 seconds]
william_ has quit [Quit: Saindo]
<cschneid>
yeah, I get the difference between "fast" and "algorithmic complexity" but one is much longer to type :)
<cschneid>
mostly I had code like: ` @lines = @lines.reverse.drop_while{|l| ! l.controller? }.reverse ` -- where I want to remove "everything after the last element that returns true to `.controller?`
cajone has left #ruby [#ruby]
AlexJakeGreen has joined #ruby
znz_jp has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
rueben_ has joined #ruby
<apeiros>
you could use .reverse_each.find_index. will be a little bit more code, though.
kareeoleez has joined #ruby
<cschneid>
yeah. I'll probably leave this until it's too slow
aberen has joined #ruby
emptyflask has joined #ruby
cajone has joined #ruby
kareeoleez has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
ncthom91 has joined #ruby
amclain has joined #ruby
sandstrom has joined #ruby
babblebre has quit [Quit: Connection closed for inactivity]
raeoks has joined #ruby
<apeiros>
oh, just learned that &. does not short-circuit :(
terminalrecluse has joined #ruby
Wildfyr has left #ruby [""Sayonara""]
kies has joined #ruby
vasilakisfil has quit [Ping timeout: 272 seconds]
kareeoleez has joined #ruby
lxsameer has quit [Ping timeout: 272 seconds]
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
evidex has quit [Ping timeout: 250 seconds]
whathappens has joined #ruby
emptyflask has quit [Remote host closed the connection]
hutch34_ has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
smathy has joined #ruby
emptyflask has joined #ruby
inukshuk_ has joined #ruby
swills has quit [Ping timeout: 240 seconds]
inukshuk_ has quit [Client Quit]
kareeoleez has quit [Ping timeout: 246 seconds]
joonty has quit [Quit: This computer has gone to sleep]
taylorrf has quit [Remote host closed the connection]
[Butch] has joined #ruby
SCHAAP137 has joined #ruby
davedev24 has joined #ruby
troulouliou_div2 has joined #ruby
hutch34_ has quit [Ping timeout: 272 seconds]
davedev24 has quit [Read error: Connection reset by peer]
Mon_Ouie has quit [Ping timeout: 240 seconds]
certainty has joined #ruby
davedev2_ has quit [Ping timeout: 240 seconds]
davedev24 has joined #ruby
hutch34_ has joined #ruby
David_H_Smith has quit [Remote host closed the connection]
axl_ has joined #ruby
David_H_Smith has joined #ruby
jancel has joined #ruby
johnbat26 has quit [Ping timeout: 260 seconds]
<terrabl>
Can you pass variables to a module method?
taylorrf has joined #ruby
hutch34 has joined #ruby
certainty has quit [Ping timeout: 240 seconds]
VeryBewitching has joined #ruby
swills has joined #ruby
mistermocha has joined #ruby
danostrowski has joined #ruby
alfiemax has quit [Ping timeout: 276 seconds]
mdw has quit [Quit: Sleeping Zzzzz]
hutch34_ has quit [Ping timeout: 240 seconds]
madgen has joined #ruby
nando293921 has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
p0p0pr37_ has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
<terrabl>
Nevermind that was a stupid question, something else was wrong.
hutch34_ has joined #ruby
aberen has quit [Ping timeout: 276 seconds]
p0p0pr37 has quit [Ping timeout: 250 seconds]
p0p0pr37_ is now known as p0p0pr37
tildes_ has joined #ruby
mistermocha has joined #ruby
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kareeoleez has joined #ruby
ramfjord has joined #ruby
DTZUBDUB has quit [Read error: Connection reset by peer]
rkazak has quit [Ping timeout: 276 seconds]
tubuliferous_ has quit [Ping timeout: 250 seconds]
noobsu has quit [Remote host closed the connection]
kareeoleez has quit [Ping timeout: 250 seconds]
moeabdol2 has joined #ruby
qasaur has joined #ruby
lubekpl has joined #ruby
lubekpl has quit [Client Quit]
alfiemax has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
kareeoleez has joined #ruby
DroidBurgundy has joined #ruby
platzhirsch has quit [Ping timeout: 258 seconds]
<romistrub>
newbie question: what's the best way to grab the first two letters of a string, and also chop those letters off the string at the same time?
johnDoe111 has joined #ruby
beatdown is now known as mosh
ChiefAlexander has quit [Remote host closed the connection]
mosh has quit [Changing host]
mosh has joined #ruby
kareeoleez has quit [Remote host closed the connection]
Rodya_ has joined #ruby
mleung has joined #ruby
mhib has joined #ruby
biberu has joined #ruby
aberen has joined #ruby
<romistrub>
found it... it's slice! :)
mdw has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
matejkonrad has quit [Read error: Connection reset by peer]
tk__ has quit [Quit: ばいばい]
wrkrcoop has joined #ruby
rcvalle has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
<wrkrcoop>
if i put a rescue and end statement at the end of my method, will that just catch any exception?
whathappens has quit [Remote host closed the connection]
<shevy>
wrkrcoop if you just do rescue, without any specific exception, it is equivalent to: "rescue Exception", so yeah, this means you should rescue everything
<norc>
apeiros, who is responsible for `derpy? It is still linking 2.3.0 docs
johnDoe111 has quit [Ping timeout: 244 seconds]
<al2o3-cr>
norc: adaedra
dorje_ has joined #ruby
SilverKey has quit [Quit: Halted.]
despai has quit [Quit: Connection closed for inactivity]
kareeoleez has joined #ruby
* norc
pokes adaedra in the eye
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dorje has quit [Ping timeout: 250 seconds]
dorje_ is now known as dorje
<pilne>
i think my first two "significant" projects are going to be porting my ghost blog to jekyll, and doing something simple with rails, anything else similar worth taking a look at (not my first language, first true dive into ruby though).
<norc>
pilne, yes - I have a fairly useful recommendation:
<pilne>
i like both of those! i enjoy doing my blog, but not juggling several node versions, and I enjoy the idea of creating interesting websites :)
<pilne>
ty, going there now :)
symm- has joined #ruby
mostlybadfly has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
SilverKey has joined #ruby
kareeoleez has quit [Ping timeout: 272 seconds]
ChiefAlexander has joined #ruby
aberen has quit [Ping timeout: 252 seconds]
Snowy has joined #ruby
sergey_makagon has joined #ruby
noobsu_ has joined #ruby
blaxter has quit [Quit: foo]
guacamole has quit [Quit: leaving]
guacamole has joined #ruby
mwlang has joined #ruby
kgrz has quit [Ping timeout: 264 seconds]
freerobby has quit [Quit: Leaving.]
rafa2000 has joined #ruby
leitz has joined #ruby
rafa2000 has quit []
noobsu_ has quit [Ping timeout: 260 seconds]
freerobby has joined #ruby
kareeoleez has joined #ruby
tildes_ has joined #ruby
Rodya_ has joined #ruby
Snowy has quit [Remote host closed the connection]
freerobby has quit [Client Quit]
blaxter has joined #ruby
Snowy has joined #ruby
rikkipitt has quit [Remote host closed the connection]
kareeole_ has joined #ruby
sergey_makagon has quit [Remote host closed the connection]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kareeoleez has quit [Ping timeout: 246 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
malconis has joined #ruby
kent\n has joined #ruby
kent\n has quit [Changing host]
kent\n has joined #ruby
aep-shoutlet has quit [Quit: Connection closed for inactivity]
troulouliou_div2 has quit [Remote host closed the connection]
kareeole_ has quit [Ping timeout: 276 seconds]
romistrub has quit [Quit: Page closed]
rafa2000 has joined #ruby
sergey_makagon has joined #ruby
kareeoleez has joined #ruby
jancel has joined #ruby
Coldblackice has joined #ruby
<raz>
hmm anyone here happen to know how to wrap PTY.spawn, so a spawned 'stty size' will return terminal dimensions other than '0 0'? (because the latter screws with many tty-expected programs, which kinda defeats the purpose of using PTY to begin with :/ )
howdoi has quit [Quit: Connection closed for inactivity]
<raz>
i've tracked it down to an ioctl TIOCGWINSZ that PTY.spawn apparently doesn't patch up (on purpose? by oversight? am i doing this wrong?)
jaruga___ has quit [Quit: jaruga___]
diegoviola has quit [Quit: WeeChat 1.5]
aegis3121 has joined #ruby
kareeoleez has quit [Ping timeout: 272 seconds]
jancel has quit [Ping timeout: 250 seconds]
<leitz>
In an initialize, are the assignments done in order? That is, can the second one use the output from the first?
aberen has joined #ruby
<shevy>
initialize is a method like any other method
<shevy>
normal ruby rules apply to it as well
nando293921 has quit [Ping timeout: 276 seconds]
Snowy has quit [Remote host closed the connection]
chouhou__ has quit [Remote host closed the connection]
<raz>
when you run 'stty size' directly, it will display your current terminal size
<raz>
i need the command running inside PTY.spawn to think it's running in a terminal that has a size that is not 0 0 (because many programs can't deal with that zero-size and crash) :)
<leitz>
I'm pausing my reading of "programming ruby" to actually code. Trying to clean up a lot of my earlier misunderstandings with new misunderstandings.
cdg has quit [Remote host closed the connection]
<leitz>
Taking a break now and then to read "The Ruby Way" when I'm too brain dead to code. Working through a cold/flu/something.
nando293921 has joined #ruby
<ghr>
heh, yeah gotta be _doing_ rather than just reading. I'd say instance variables are pretty fundamental though, so put it high on your list
danostrowski has joined #ruby
pepee has joined #ruby
<shevy>
yes, programming is an active art
<leitz>
Yeah, I've often made the mistake or reading more than coding. Trying to get back to Ruby, and be happy with the basics. Since Part 1 of "Programming Ruby" can handle 90% of what I want to do, I'm better off setting it down.
<leitz>
"The Ruby Way" is mostly because Hal is a nice guy and I need something to read now and again.
djbkd has joined #ruby
mdw has joined #ruby
nando293921 has quit [Ping timeout: 252 seconds]
cwenner has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
cwenner has joined #ruby
al2o3-cr has quit [Quit: WeeChat 1.5]
helpa-bot has joined #ruby
mistermocha has quit [Remote host closed the connection]
sergey_m_ has joined #ruby
helpa has quit [Remote host closed the connection]
pld has quit [Quit: Connection closed for inactivity]
Azure has quit [Remote host closed the connection]
ramfjord has joined #ruby
<norc>
wrkrcoop, generally you should should either pass an exception class, or exception class and an error message.
taylorrf has joined #ruby
<wrkrcoop>
hmm ok
blackmesa has quit [Ping timeout: 260 seconds]
<norc>
wrkrcoop, and it is useful to use your own exception class, so it can be caught specifically
<ule>
do you guy sknow if there is a command to list all listeners?
<norc>
ule, listeners?
<ule>
I don't know if this is default from rails
<ule>
or if it's something people implemented here at work
<ule>
I'm gonna do some research here
<ule>
they call pubsub
DroidBurgundy has quit [Ping timeout: 244 seconds]
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DroidBur_ has quit [Ping timeout: 240 seconds]
<norc>
ule, you need to give us more than that. pubsub sounds like publish subscribe pattern...
<toretore>
ule: it is definitely not something that ruby has built-in; it's a library, be it rails or something else
<norc>
ule, are you talking about something in Ruby? Something in some library? Some application?
mleung has quit [Quit: mleung]
helpa-bot has joined #ruby
DroidBurgundy has joined #ruby
p337rB_ has joined #ruby
<ule>
cool
yfeldblum has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
smathy is now known as smathy_afk
helpa has quit [Remote host closed the connection]
<ule>
yeah.. it's publish subscribe pattern
<ule>
I thought it's a default in Rails
<terrabl>
If there is a gem availible for rails does that mean i can use it in regular scripting ruby too?
<terrabl>
Like I want to use the gruff graphing gem
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
<toretore>
terrabl: it depends; for this particular gem probably yes
symm- has quit [Ping timeout: 250 seconds]
symm- has joined #ruby
<terrabl>
Awesome. Is there a way to tell?
p337rB has quit [Ping timeout: 264 seconds]
<norc>
ule, even Rails is a huge pile of libraries
<toretore>
no
<norc>
ule, you have to be more specific still.
<norc>
ule, gist some code you have.
jackjackdripper has quit [Quit: Leaving.]
<toretore>
terrabl: most gems are not rails-specific
<norc>
terrabl, like I just said, all rails is is a huge collection of different gems, most of which you can use separately.
<norc>
(Only very few have interdependencies)
smathy_afk is now known as smathy
dorje has quit [Ping timeout: 276 seconds]
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
Dimik has joined #ruby
<al2o3-cr>
raz: pty, doesn't play nicely here
sneakerhax has quit [Ping timeout: 240 seconds]
<raz>
al2o3-cr: yup. i found winsize= in io/console now. but i can't figure out how to use it.
Rodya_ has joined #ruby
<al2o3-cr>
raz how'd you mean use it?
DroidBurgundy has quit []
<raz>
al2o3-cr: well, i tried all kinds of variants of creating an IO and feeding that to spawn, but nothing works. this stuff is not very well documented ;)
mistermocha has quit [Remote host closed the connection]
emptyflask has quit [Remote host closed the connection]
sphex has quit [Ping timeout: 260 seconds]
aberen has joined #ruby
sphex has joined #ruby
multi_io has quit [Ping timeout: 250 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
<shevy>
ruby is so good, it does not need any documentation!!!
tildes_ has quit [Ping timeout: 240 seconds]
<al2o3-cr>
lol
multi_io has joined #ruby
aberen has quit [Ping timeout: 260 seconds]
kies has joined #ruby
yfeldblum has quit [Ping timeout: 250 seconds]
wrkrcoop has quit [Quit: wrkrcoop]
wrkrcoop has joined #ruby
johnDoe111 has joined #ruby
B1n4r10 has joined #ruby
ben010 has joined #ruby
johnDoe111 has quit [Ping timeout: 260 seconds]
aberen has joined #ruby
mistermocha has joined #ruby
jas02 has joined #ruby
<ben010>
can anyone help a new ruby (on rails) convert set up his local vagrant dev env from a server? i've got 85% of it, but struggling to know how best to do the last 15%.
mistermocha has quit [Remote host closed the connection]
whathappens has quit [Quit: Leaving...]
wrkrcoop has quit [Quit: wrkrcoop]
craigp has joined #ruby
dasher00 has joined #ruby
johnbat26 has joined #ruby
<jhass>
?anyone ben010
<ruby[bot]>
ben010: Just ask your question, if anyone has or can, they will respond.
rikkipitt has joined #ruby
aberen has quit [Ping timeout: 244 seconds]
<ben010>
so i have the local vagrant vm going, have the db setup with the server data, but i'm not sure how to best migrate the code, which is on an amazon server and code in bitbucket. should i bitbucket clone the files to the default nginx www directory? then manually replace the necessary code files with any server settings... should i manually copy the files first then set up the bitbucket connection and see which files are different. sh
kies has quit [Ping timeout: 272 seconds]
<ben010>
elsewhere with symlinks?
johnmilton has quit [Remote host closed the connection]
<ben010>
i think i've manually installed the server identical versions of ruby/rails/etc.
sergey_makagon has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
madgen has quit [Ping timeout: 260 seconds]
djbkd has joined #ruby
danostrowski has joined #ruby
UserInNeed has joined #ruby
danostrowski has quit [Client Quit]
spider-mario has joined #ruby
cdg has joined #ruby
<palms>
ben010: have you considered using any config mgmt software? that might be a bit excessive for your use case. Perhaps a cloud-init script is what you are looking for. As for best practices, I would create my own nginx vhost tailored for RoR and use that in lieu of the default, then clone my code to somewhere like /var/www/current
kareeoleez has quit [Remote host closed the connection]
djbkd has quit [Ping timeout: 244 seconds]
blaxter has quit [Read error: Connection reset by peer]
<palms>
as for cfg mgmt, using chef, salt, and puppet would be useful because you would use the same code for vagrant as you would for AWS, potentially.
ur5us has joined #ruby
certainty has joined #ruby
<ben010>
when you say config management is that like capistrano or something? i don't want to tamper with the server in fear that my present level of ruby/ror stupidity is dangerous.
danostrowski has joined #ruby
<palms>
Yes, a capistrano-like deploy would handle the things like deploying rails while chef, puppet or salt would manage system users, nginx, mysql, etc.
<ben010>
can i use those cfg management tools without changes to live server?
blaxter has joined #ruby
mistermocha has joined #ruby
<palms>
it's more involved. i would stand it up side by side and keep instances immutable.
k3rn31 has quit [Quit: Computer has gone to sleep.]
ItSANgo__ has quit [Quit: Leaving...]
<ben010>
as in on the server create a parallel application which i then set up to use config management? and then i migrate that parallel setup?
<palms>
ansible is another option as well. i don't intend to promote any cfg mgmt over another
moeabdol2 has quit [Ping timeout: 240 seconds]
SilverKey has quit [Quit: Halted.]
<palms>
i think that's a good general practice overall, cfg mgmt or not. If you bork prod, you have no bail plan.
swills has quit [Ping timeout: 272 seconds]
certainty has quit [Ping timeout: 260 seconds]
whathappens has joined #ruby
kareeoleez has joined #ruby
<ben010>
i agree, but i'm just sort of stepping in to do a small job on their code, so i'm limited in what i can do. i was just trying to set up a local dev environment so i could work.
<palms>
ben010: if you need to get your code onto your local vm using vagrant, you should just need to do something like `config.vm.synced_folder ".", "/vagrant", type: "nfs"` if you have the code checked out locally
swills has joined #ruby
<palms>
then you can bash something on it like `config.vm.provision "shell", path: "config-vm.sh"` with all of your nginx, etc stuff
cajone has quit [Read error: Connection reset by peer]
rikkipitt has quit [Remote host closed the connection]
<ljarvis>
or, just think "I should never use and/or"
<norc>
ljarvis, never say never.
stan has joined #ruby
<norc>
ljarvis, the general rule of thumb is:
<ljarvis>
neverrr
kraken has joined #ruby
moeabdol2 has joined #ruby
kraken is now known as kraken_
<norc>
ljarvis, when you have to use parens because && or "and" have the wrong predecence, use the other operator.
<norc>
(same goes for ||/"or")
<kraken_>
Hey, what is the difference between :: and . ? I don't get whats happening when for instance Net::HTTP is called, what is the :: doing?
<ljarvis>
correct, but since &&/|| are higher precedence anyway, you pretty much can't go wrong to just straight avoid and/or. When you start worrying about parens your code is probably too complex
<shevy>
kraken_ . is shorter :)
<shevy>
kraken_ for Net::HTTP that is different than .
<havenwood>
kalleth: The `::` is a namespace separator, in your case between the `Net` module and `HTTP` class.
<kraken_>
So it's bassically saying that Net is the module, HTTP is the class within it?
<ljarvis>
you can also use it to call class methods but you shouldn't
<norc>
kraken_, or class.
<havenwood>
kraken_: The `.` is for calling methods.
<norc>
kraken_, classes and modules are practically the same - in this particular example Net could also be a class.
<havenwood>
kraken_: Nested classes within modules with modules within classes, however.
mistermocha has quit [Ping timeout: 244 seconds]
<kraken_>
So for instances, Net::HTTP::Get.new is this: Net module, calling the HTTP class within this module calling the Get class within this class, calling the .new method within the Get class?
mistermo_ has joined #ruby
haraigo has joined #ruby
<ljarvis>
there's no "calling", you're just referring to it by resolution
kareeoleez has quit [Ping timeout: 258 seconds]
<ljarvis>
but yes, Net is a module, HTTP is a class, Get is a nested class
<havenwood>
kraken_: The one "calling" is the `.new` class method.
certainty has quit [Ping timeout: 264 seconds]
<ljarvis>
^
<ljarvis>
every call i be resolving classes and calling methods
<norc>
kraken_, maybe it becomes more obvious if you use the top space name resolution
<ljarvis>
day
moeabdol2 has quit [Ping timeout: 246 seconds]
<kraken_>
hmm
<norc>
kraken_, for example ::Array will refer to the top level array
<norc>
regardless of whether you have a local Array class.
<kraken_>
So, correct me if I'm wrong, but :: is just used to access a class within a class
<norc>
kraken_, the namespace resolution operator also gives you access to a classes singleton methods, that may be where your confusion is coming from.
blaxter has quit [Quit: KTHXBYE]
<wrkrcoop>
if i put a rescue statemnet at the end of a method, and i dont use a begin statement, do i need to include the end?
<wrkrcoop>
in other words if there is not begin do i need an end?
<norc>
wrkrcoop, well you can use it inside a def;end block
<norc>
Possibly inside a class/module block too, but Im not sure about that.
<wrkrcoop>
norc: yeah in my def end block i have a rescue statement … i got an error saying ‘theres an extra end’ and then i removed it and it went away ...
jenrzzz has joined #ruby
<norc>
ljarvis, okay instance methods too.
whathappens has quit [Remote host closed the connection]
<wrkrcoop>
so there’s no ned for an end to a resuce?
<norc>
wrkrcoop, there always is!
<norc>
wrkrcoop, except you already have one from your def.
Madplatypus has joined #ruby
<wrkrcoop>
oh ...
<norc>
def;rescue;end
<norc>
begin;rescue;end
<LiquidInsect>
You need to end the block that contains the rescue
<wrkrcoop>
i see
<norc>
wrkrcoop, you can of course nest them as required. :)
Akuma has joined #ruby
Akuma has quit [Client Quit]
<wrkrcoop>
norc: what do u mean nest them?
<wrkrcoop>
u mean begin rescue end inside a def end?
<norc>
def; begin; rescue; end; end
<norc>
wrkrcoop, yes.
<wrkrcoop>
i see
<wrkrcoop>
thanks :d
<wrkrcoop>
:D
sheperson has joined #ruby
<norc>
wrkrcoop, of course its a pointless excercise if there is no code surrounding the begin block.
whathappens has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
<sheperson>
ljarvis: it would return the object itslef
<ljarvis>
I would suggest stop caring about returning explicit true/false, and return truthly/falsely
<ljarvis>
sheperson: perfect, then I'd use valid? && persist!
<ljarvis>
or: persist! if valid? which basically do the same thing
<ljarvis>
nil if it fails, the object if it succeeds
<ljarvis>
done.
<sheperson>
def save; valid? && persist!; end
<ljarvis>
si
<ljarvis>
persist! if valid? might be preferred, up to you style wise
<norc>
Either way ljarvis. Since the question seems to have been directed as whether return early or not, the answer is still to always return early if you can.
<ljarvis>
the question what "which of these two is preferred"
<havenwood>
sheperson: `valid? and persist` and `persist! if valid?` are the control flow ways
<ljarvis>
pfft
johnmilton has quit [Ping timeout: 260 seconds]
kraken_ has quit [Quit: Leaving]
<norc>
ljarvis, if you cannot extrapolate the question from that gist then Im sorry.
<ljarvis>
apology accepted
Noxilex has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
freerobby has joined #ruby
kareeoleez has quit [Ping timeout: 246 seconds]
<sheperson>
norc: I was looking for return early or not
noobsu_ has joined #ruby
<norc>
sheperson, that does not invalidate ljarvis's opinion though. But generally if the choice is to return early or not - return early.
<sheperson>
yes, I see
xlegoman has quit [Read error: Connection reset by peer]
mikecmpbll has quit [Ping timeout: 250 seconds]
iooner has quit [Ping timeout: 260 seconds]
<ljarvis>
I concur, I was just trying to point out a better way altogether, if it was more complex I would have done what norc suggested (version 2)
sleazoid has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jas02 has quit [Quit: jas02]
kareeoleez has joined #ruby
noobsu_ has quit [Ping timeout: 252 seconds]
shinnya has joined #ruby
mrmortondk has quit [Read error: Connection reset by peer]
sleazoid has quit [Ping timeout: 250 seconds]
ips|malc has joined #ruby
kies has joined #ruby
iooner has joined #ruby
kareeoleez has quit [Ping timeout: 244 seconds]
spejamchr has joined #ruby
sheperson has quit [Quit: sheperson]
iooner has quit [Excess Flood]
johnDoe111 has joined #ruby
johnmilton has joined #ruby
iooner has joined #ruby
jancel has quit [Remote host closed the connection]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
moeabdol2 has joined #ruby
kareeoleez has joined #ruby
bruce_lee has quit [Ping timeout: 260 seconds]
gigetoo has quit [Ping timeout: 240 seconds]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
mistermo_ is now known as mistermocha
al2o3-cr has quit [Quit: WeeChat 1.5]
smathy is now known as smathy_afk
johnDoe111 has quit [Ping timeout: 244 seconds]
<postmodern>
when writing a data structure where certain fields default to other values or fields, what is the ruby idiom for determining if the field was omitted? present? myfield? has_field?
kareeoleez has quit [Ping timeout: 246 seconds]
gigetoo has joined #ruby
emptyflask has quit [Ping timeout: 240 seconds]
<norc>
postmodern, I cannot recall seeing this idiom anywhere. My first instinct tells me "omitted?" is the most accurate.
dhollinger has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
jaguarmagenta has joined #ruby
nando293921 has quit [Ping timeout: 252 seconds]
<ytti>
&win 12
Ishido has quit [Remote host closed the connection]
solars has joined #ruby
kareeoleez has joined #ruby
yfeldblum has joined #ruby
axsuul has quit [Ping timeout: 260 seconds]
agent_white has quit [Quit: leaving]
al2o3-cr has joined #ruby
hobodave has joined #ruby
maloik has quit [Remote host closed the connection]
jaguarmagenta has quit [Ping timeout: 272 seconds]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maloik has joined #ruby
minimalism has joined #ruby
<norc>
asm>> a.b ^ a.b ^ a.b
<ruby[bot]>
norc: I have disassembled your code, the result is at https://eval.in/587015
<norc>
cschneid, that is an awful lot of ruby method calls.
blackmesa has quit [Ping timeout: 276 seconds]
kareeoleez has quit [Ping timeout: 260 seconds]
polll has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
ips|malc has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ecksit has quit [Ping timeout: 244 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
blackmesa has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
al2o3-cr has quit [Ping timeout: 276 seconds]
rikkipitt has quit [Remote host closed the connection]
B1n4r10 has joined #ruby
moeabdol2 has quit [Ping timeout: 250 seconds]
c0mrad3 has quit [Quit: Connection closed for inactivity]
ta_ has joined #ruby
dhollinger has joined #ruby
palms has quit [Ping timeout: 252 seconds]
<cschneid>
norc: sure. But everything is a method call in ruby :) It's still a hell of a lot faster than any other data structure I could be using.
<cschneid>
s/any other/any other one that I reach for normally, I'm sure there's something silly out there that's better/
jancel has joined #ruby
daivyk has quit [Quit: Quit]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<norc>
cschneid, if the hash method is implemented in C directly, you get to do shortcuts. :)
kirun has quit [Quit: Client exiting]
B1n4r10 has quit [Ping timeout: 264 seconds]
<cschneid>
yeah, sure. But then I'd have to go write a C extension for something that isn't a performance hit. I already took the big performance hit by choosing ruby in the first place :)
jancel has quit [Ping timeout: 250 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
kareeoleez has joined #ruby
ur5us has quit [Remote host closed the connection]
* norc
opens a feature request for interpolating strings into strings
okdas has joined #ruby
okdas has quit [Changing host]
okdas has joined #ruby
<adaedra>
If this was the only problem `derpy had, I would be happy :)
fikse has joined #ruby
<norc>
:)
tubuliferous_ has quit [Ping timeout: 240 seconds]
* adaedra
pats `derpy anyways
certainty has quit [Ping timeout: 250 seconds]
neanderslob has joined #ruby
allcentury has joined #ruby
<choke>
i hate when i'm a bonehead... having all sorts of rspec issues with an AMS and after an hour realize i forgot to add "_serializer" onto the file
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
aries_liuxueyang has joined #ruby
polishdub has quit [Quit: Leaving]
wrkrcoop has quit [Quit: wrkrcoop]
prestorium has quit [Quit: Leaving]
biberu has quit [Read error: Connection reset by peer]
asahi has joined #ruby
emptyflask has joined #ruby
rikkipitt has quit [Remote host closed the connection]
<asahi>
hello, if I do require 'foo.rb', does a new scope get created for whatever is in foo.rb? that is, any variable definitions in foo.rb are not available from the calling scope?
kavanagh has joined #ruby
<lupine>
well, that depends entirely on what's in foo.rb
<asahi>
suppose it's a bunch of local variable definitions
<lupine>
constants will end up in your scope
<shevy>
asahi local vars won't be available, constants are
<lupine>
local variables will not
<asahi>
okay, thank you
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tref has joined #ruby
freerobby has joined #ruby
gigetoo has quit [Ping timeout: 246 seconds]
danostrowski has joined #ruby
gigetoo has joined #ruby
mtkd has quit [Ping timeout: 276 seconds]
<lupine>
of course, the required file might do weird things with TOPLEVEL_BINDING
mtkd has joined #ruby
Coldblackice has quit [Ping timeout: 258 seconds]
cschneid has quit [Remote host closed the connection]
globalall0c has joined #ruby
globalall0c has left #ruby [#ruby]
ben010 has quit [Ping timeout: 250 seconds]
Rodya_ has quit [Remote host closed the connection]
fikse has quit [Quit: leaving]
SilverKey has quit [Quit: Halted.]
sumobob has quit [Quit: WeeChat 1.5]
johnDoe111 has joined #ruby
art-solopov has quit [Quit: Konversation terminated!]
duncannz has joined #ruby
allcentury has quit [Ping timeout: 246 seconds]
toretore has quit [Ping timeout: 264 seconds]
duckpupp1 has joined #ruby
jackjackdripper has quit [Ping timeout: 260 seconds]
jancel has joined #ruby
lightt has joined #ruby
agent_white has quit [Quit: bai]
johnDoe111 has quit [Ping timeout: 260 seconds]
kavanagh has quit [Remote host closed the connection]
kavanagh has joined #ruby
karmatr0n has quit [Ping timeout: 250 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
duckpupp1 has quit [Ping timeout: 244 seconds]
jancel has quit [Ping timeout: 240 seconds]
jackjackdripper has joined #ruby
xlegoman has joined #ruby
JesseH2 has quit [Remote host closed the connection]