jeanlinux has quit [Read error: Connection reset by peer]
<baweaver>
you can
r_baron has quit [Ping timeout: 264 seconds]
leafybasil has quit [Ping timeout: 264 seconds]
<baweaver>
*sighs* again though, you're trying to do this in Ruby when you _should_ be doing it with SQL
mleung has joined #ruby
<baweaver>
explain the problem, you can probably use a group count
<baweaver>
bonhoeffer:
sfr^ has quit [Ping timeout: 244 seconds]
linc01n has quit [Ping timeout: 244 seconds]
Shidash has quit [Ping timeout: 246 seconds]
wldcordeiro has joined #ruby
crdpink2 has joined #ruby
Swappticon has joined #ruby
universa1 has quit [Ping timeout: 244 seconds]
tmk1108 has joined #ruby
mleung has quit [Client Quit]
crdpink has quit [Ping timeout: 246 seconds]
<bonhoeffer>
baweaver: interesting — i agree — i should work it there . . . the key is getting an array: {"name" => ‘discipline’, "data" => [date1, 1], [date2, 2]. . . }
<bonhoeffer>
trying to get that from one sql query as my current solution does
<bonhoeffer>
each row of the db has [date, discipline, health, . . .] as integers
<ruboto>
toretore # => /tmp/execpad-f3d47805c5ae/source-f3d47805c5ae:2: warning: class variable access from toplevel ...check link for more (https://eval.in/432264)
nanoz has joined #ruby
gix has quit [Ping timeout: 265 seconds]
tkuchiki has joined #ruby
blackjid has quit [Max SendQ exceeded]
blackjid has joined #ruby
The_Phoenix has joined #ruby
jenrzzz has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
gix has joined #ruby
jxv has quit [Remote host closed the connection]
jeanlinux has quit [Remote host closed the connection]
podman has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pwnd_nsfw has quit [Ping timeout: 246 seconds]
dotix has joined #ruby
tmtwd has quit [Ping timeout: 240 seconds]
tmtwd has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
badbodh has quit [Remote host closed the connection]
Rurik has quit [Ping timeout: 264 seconds]
badbodh has joined #ruby
CloCkWeRX has joined #ruby
dotix has quit [Ping timeout: 252 seconds]
arescorpio has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
jenrzzz has joined #ruby
destruct1re has quit [Quit: Lost terminal]
yfeldblum has quit [Ping timeout: 246 seconds]
grenierm has joined #ruby
pawnbox has quit [Remote host closed the connection]
Keltia has quit [Read error: Connection reset by peer]
Keltia has joined #ruby
Rickmasta has joined #ruby
jdawgaz has joined #ruby
grenierm has quit [Quit: grenierm]
UtkarshRay has joined #ruby
poli has quit [Ping timeout: 256 seconds]
<tejasmanohar>
say i wanted to write a programming language in ruby just for fun (even if it's terrible)
<tejasmanohar>
the first step is writing the parser as far as i know
<tejasmanohar>
are there any libraries that would be especially useful here?
candelabra has joined #ruby
grenierm has joined #ruby
juanpablo_ has joined #ruby
<jordanm>
tejasmanohar: maybe you are looking to write a DSL (eg puppet)?
Juanchito has quit [Quit: Connection closed for inactivity]
MichaelSmith has quit [Quit: Connection closed for inactivity]
roxtrongo has quit [Remote host closed the connection]
grenierm has quit [Quit: grenierm]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has joined #ruby
dgs has quit [Quit: dgs]
elperdut has joined #ruby
chancy has joined #ruby
oldbay has joined #ruby
catcher has quit [Quit: catcher]
codecop has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roxtrongo has joined #ruby
elperdut has quit [Client Quit]
Asher has joined #ruby
candelabra has quit [Quit: Leaving]
djbkd has joined #ruby
linux_dr has joined #ruby
arescorpio has quit [Quit: Leaving.]
Swappticon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dotix has joined #ruby
Musashi007 has joined #ruby
djbkd has quit [Ping timeout: 265 seconds]
dotix has quit [Ping timeout: 252 seconds]
niko has quit [Ping timeout: 619 seconds]
dionysus69 has joined #ruby
DmitryBochkarev has joined #ruby
devoldmx_ has quit [Remote host closed the connection]
acke has joined #ruby
tmtwd has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
<linux_dr>
I regret I’m flying a bit blind here, and I’m very unfamiliar with Ruby, but I’m trying to dig into Vagrant’s source enough to write some simple plugins… I fear I’m barking up many a wrong tree, but am having trouble untangling one Ruby construct in particular at the moment.: http://pastebin.com/HSNdcM1i
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<linux_dr>
ruboto: ack… (Yes, I know you’re a bot)
<linux_dr>
is there a non-robot in the house?
tejasmanohar has quit [Ping timeout: 265 seconds]
mleung has joined #ruby
tejasmanohar has joined #ruby
GnuYawk has joined #ruby
yeticry has quit [Ping timeout: 250 seconds]
yeticry has joined #ruby
acke_ has joined #ruby
<baweaver>
linux_dr: just a sec
<baweaver>
depends on the initializer of B entirely
<baweaver>
cannot tell from that code.
maletor has joined #ruby
<baweaver>
I would read some basic ruby tutorials to start
rippa has joined #ruby
<baweaver>
most of the time though method will be in the case of class A
<baweaver>
then again fake code will get you precious little as far as answers here
<baweaver>
as we're not keen on flying blind either
tkuchiki has joined #ruby
acke has quit [Ping timeout: 252 seconds]
<baweaver>
Now as far as how it could _not_ be in the context of a, there's something called class_eval and module_eval that take a block and evaluate them in a different context.
jxv has joined #ruby
<baweaver>
That's normally an edge case but I don't know what vagrant is doing there.
<baweaver>
not until you hit run is that block evaluated.
<baweaver>
of course the extent of my vagrant knowledge is that I used it for virtual dev
pyon has quit [Read error: Connection reset by peer]
<linux_dr>
Not sure if you’ve ever seen this code base before, but they have a pretty involved plugin mechanism, to the point that most of the system is implemented, internally, as plugins… What I’d really like to extract from the code is a list of events I can pluginto… The event interception is pretty easy to understand, and there are some examples to follow, but not finding an easy way to grep the code for possible events to
<linux_dr>
intercept.
<baweaver>
yeah, that'd be beyond me without delving the code for a few hours.
<linux_dr>
Yes… I’ve done that, but my Ruby knowledge is sketchy at best.. :(
<baweaver>
that I can help with
<baweaver>
Vagrant specific, only insofar
<linux_dr>
Understood..
mary5030 has joined #ruby
<baweaver>
you could try joining #vagrant and asking
<baweaver>
not sure how active it is though.
<linux_dr>
I think, as far as I’ve been able to untangle things, all event names get registered by being the first parameter to an Environment’s “hook” method.. not sure how to search the code for that.
acke_ has quit [Remote host closed the connection]
<linux_dr>
It’s active enough, but mostly end users… not developers (from my experience)
<linux_dr>
Yes… i saw that two… That’s searching where 3rd party plugins are loaded from… getting a plugin recognized is pretty easy… and registering a handler isn’t much harder (There’s a action_hook() method called in the plugin definition that allows this)… the list of events to tap into is what I’m finding elusive.
<sevenseacat>
thats probably a good sign that i shouldnt click that.
<baweaver>
in the mean time
<baweaver>
yep
<craysiii>
i opened that
<craysiii>
god damnit
<zenspider>
fuck me... damnit.
<sevenseacat>
:/
<shevy>
kiwiirc again
acke has joined #ruby
<zenspider>
damnit... why the fuck does ruboto require a timespan??
milanpaperclip has quit [Ping timeout: 255 seconds]
<zenspider>
I'm getting tired of this bot as a convenience when it's really a crutch and an inconvenient one at that
bkxd has joined #ruby
<linux_dr>
ruboto promotes and demotes itself around every priviledged operation?
<zenspider>
don't care about that... care about the fact that !ban just ignores you if you don't fill out a byzantine syntax ... I don't even WANT a timeout on this ban so it doesn't make sense
<Sigma00>
time to file a PR?
dgs has quit [Ping timeout: 246 seconds]
<baweaver>
already mentioned it.
<linux_dr>
Do you get lots of noise from riffraff in here?
<baweaver>
on occasion.
* linux_dr
nods
Alina-malina has joined #ruby
<baweaver>
if they make themselves annoying I just +q anyone not authenticated.
mleung has quit [Quit: mleung]
Musashi007 has joined #ruby
<craysiii>
that was a lot more than riff raff.
<sevenseacat>
but the newbsssssssss wont somebody think of the newbs
coffeecupp__ has joined #ruby
<zenspider>
how the fuck does imgur not have a report link?
Rurik has quit [Read error: Connection reset by peer]
<zenspider>
you can defend against that by not using an implicit "self."
<linux_dr>
zenspider: Understood… was just trying to understand what I was reading.
fxn has joined #ruby
<zenspider>
overly complex setup code :)
Rurik has joined #ruby
<zenspider>
in fact... that's just a really poor design. why use a block just to create a hash? that's clumsy
<linux_dr>
Oh… any side affects of terminating a Ruby program via exec? How portable is that to non-Unixes?
<baweaver>
zenspider: they're using it for lazy eval
<baweaver>
at least in the vagrant source
<baweaver>
which answers the why, but not the wtf why!?
<linux_dr>
zenspider: I didn’t write the thing.. just trying to wrestle it into submission.
Musashi007 has quit [Quit: Musashi007]
<baweaver>
never a truer statement about programming has been made
<linux_dr>
lol
<shevy>
lol
acke_ has joined #ruby
tejasmanohar has quit [Ping timeout: 244 seconds]
tejasmanohar has joined #ruby
<linux_dr>
You think that’s fun, For my next trick I need to figure out how to resize a virtual hard disk, and the partition and filesystem on it, hopefully without booting the system that’s using it.. (fingers crossed.)
<zenspider>
linux_dr: I know... just .. consider it at least a yellow flag
<zenspider>
so... I can't type for shit (you're not seeing my typos). I'm not proofreading. I'm fucking up pronouns... but hand me an ultra sharp shun and stuff to cut up and I'm good. idgi
acke has quit [Ping timeout: 256 seconds]
<linux_dr>
zenspider: I do think they probably have an overly flexible (and almost certainly and over-engineered) plugin system that needs some amount of backward compatibility.
<zenspider>
linux_dr: side *E*ffects. :P
<zenspider>
what are you asking, specifically? yes, there can be side effects
Lucky__ has quit [Ping timeout: 250 seconds]
<linux_dr>
zenspider: baweaver, was trying to help, but I’m trying to extract a list of hook events I can tap into from a vagrant plugin.
<zenspider>
I don't know vagrant... but I know ruby. ;)
<baweaver>
yeah, vagrant is a bit dense, still looking about but probably won't find anything
<baweaver>
I'd open an issue to ask honestly if you can't get #vagrant to cough up
<linux_dr>
I think I’ve tracked it down to, all events should register themselves by name by calling the ‘hook’ method on environment.
dionysus69 has joined #ruby
<zenspider>
oh god... pastrami is the best thing ever
badbodh has quit [Ping timeout: 246 seconds]
<zenspider>
linux_dr: that's how I'd design it :)
<linux_dr>
So I’m trying to find a way to search for anything that can call ‘hook’
TomyLobo has joined #ruby
arup_r has joined #ruby
<baweaver>
could put a hook in hook to find hooks
<zenspider>
heh. I was gonna suggest that, but wasn't summoning the clever
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<baweaver>
rubygems are editable on the system
<baweaver>
so just sneak a puts in there as a cheap variant
<zenspider>
depends on how they're installed... but you have options either way
<linux_dr>
baweaver: I’m concerned that may be to environment specific...
<baweaver>
fair
<baweaver>
but might give you a better idea.
fxn has quit [Quit: zZzZzZ...]
<zenspider>
linux_dr: a simple grep for \\.hook should suffice
acke_ has quit [Remote host closed the connection]
<zenspider>
is every generic word a user in here?
Musashi007 has joined #ruby
futilegames has joined #ruby
<linux_dr>
well… I found method(:hook) inserted into two hashes that also need to be checked for.
<zenspider>
hah
<zenspider>
check for senders, not definitions
<zenspider>
well... check for both... but you're worried about the senders
toretore has quit [Quit: This computer has gone to sleep]
dionysus69 has quit [Ping timeout: 272 seconds]
<linux_dr>
zenspider: I found 3 explicit hook() calls in vagrant/lib/vagrant/environment.rb… but I’m trying to tease out the rest.
oldbay has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<linux_dr>
zenspider: I’m really worried about the first parameter, or all possible values of the first parameter, only… really
<zenspider>
... why are you tracking all this down?
Musashi007 has quit [Client Quit]
<linux_dr>
zenspider: so I know what events I want to intercept within vagrant.
<linux_dr>
what does an “@“ on the front of a word in Ruby mean again?
<baweaver>
instance variable
jaredrhine has quit [Remote host closed the connection]
<linux_dr>
baweaver: on dereference only? or where else?
<baweaver>
hm?
jaredrhine has joined #ruby
<zenspider>
the actual name of the var has a @ on the front
<linux_dr>
You use @ when you assign to, or evaluate the instance variable… is it needed elsewhere? (in a declaration, for example?)
<zenspider>
it sounds like what you're doing is ... distruptive... don't expect this to work long term
<zenspider>
what are you actually trying to do?
<linux_dr>
umm… what I’m doing is static analysis… or really just trying to understand the damn code a little.
<baweaver>
make sure to use the english versions instead of the perlish ones
<linux_dr>
baweaver: I don’t think I’d go to that extent in Ruby…
<linux_dr>
lol
<baweaver>
I've seen some perl people before
AccordLTN has joined #ruby
<shevy>
lol
<linux_dr>
baweaver: Perl is just one language I’ve done a lot with… I’m actually reaquainting myself with C++ for my current job...
dopie has quit [Quit: This computer has gone to sleep]
<baweaver>
I'm between Ruby, Python, Javascript, Java, and Scala at $WORK depending on the day.
<baweaver>
notably burning Java and replacing with Scala
<baweaver>
used to use Perl
<linux_dr>
I think I remember Larry Wall calling Perl a post-modern language… I’m not going to suggest it’s at all less capible than any other language…. but you certainly have to see all the plumbing, etc.
<shevy>
it came from the 1980 era philosophy!
<baweaver>
let's hope it skipped 1984 ;)
VeryBewitching has quit [Quit: Konversation terminated!]
dionysus69 has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 244 seconds]
jgt has joined #ruby
tkuchiki has joined #ruby
eggoez has joined #ruby
nanoz has joined #ruby
<linux_dr>
1980 era philosophy?
devoldmx has joined #ruby
tkuchiki has quit [Ping timeout: 244 seconds]
<linux_dr>
“pipes should be seen, not heard”? ;-) lol
<shevy>
yeah, back then elegance rarely was a design aim to have
devoldmx has quit [Ping timeout: 246 seconds]
jamesaxl has joined #ruby
athinggoingon has quit [Ping timeout: 250 seconds]
baweaver has quit [Remote host closed the connection]
elperdut has quit [Client Quit]
diegoviola has quit [Remote host closed the connection]
blik71 has joined #ruby
blik71 has quit [Client Quit]
vdamewood has joined #ruby
rehat has quit [Remote host closed the connection]
atzorvas has joined #ruby
yxhuvud has joined #ruby
DoubleMalt has joined #ruby
linux_dr has quit [Quit: linux_dr]
atzorvas has quit [Quit: leaving]
vinleod has joined #ruby
vdamewood has quit [Ping timeout: 264 seconds]
freezeve_ has joined #ruby
<freezeve_>
has anyone implemented dijkstra's algorithm in ruby ?
Meow-J has joined #ruby
Jackneill has joined #ruby
juanpablo_ has joined #ruby
jgt has quit [Ping timeout: 264 seconds]
<morenoh149>
freezeve_: some probably has
moeabdol has joined #ruby
juanpablo_ has quit [Ping timeout: 250 seconds]
Alina-malina has quit [Read error: Connection reset by peer]
moeabdol has quit [Client Quit]
Coldblackice has quit [Ping timeout: 264 seconds]
Coldblackice has joined #ruby
<zenspider>
freezeve_: absolutely. why are you asking?
<freezeve_>
how much hard is it ?
<zenspider>
7
roxtrongo has quit [Read error: No route to host]
<shevy>
lol
jenrzzz has quit [Ping timeout: 264 seconds]
Voker57 has joined #ruby
freezeve_ has quit []
freezevee has joined #ruby
<freezevee>
I am giving detailed explanations about my problem, don't I ?
<freezevee>
lol
yottanami has joined #ruby
<wasamasa>
sure
<yottanami>
I just created a Rails gem and a sample project to use that gem but I got this error Could not find gem 'makan_rails (>= 0) ruby' in source at ../makan_rails.
<yottanami>
Source does not contain any versions of 'makan_rails (>= 0) ruby
<yottanami>
in Gemfile I have gem 'makan_rails', path: '../makan_rails'
faces has quit [Ping timeout: 250 seconds]
face has joined #ruby
<freezevee>
zenspider: it can't be happening
<freezevee>
zenspider: I can't be so fucking stupid
<freezevee>
I am giving it up
ghostlines has joined #ruby
coffeecupp__ has quit [Ping timeout: 250 seconds]
lkba has quit [Read error: Connection reset by peer]
tejasmanohar has quit [Quit: tejasmanohar]
Rurik has quit [Read error: Connection reset by peer]
Rurik has joined #ruby
pawnbox has joined #ruby
tejasmanohar has joined #ruby
<jhass>
yottanami: you do have a .gemspec in that folder?
QORRiE has joined #ruby
atzorvas has joined #ruby
QORRiE has quit [Changing host]
QORRiE has joined #ruby
atzorvas has joined #ruby
atzorvas has quit [Changing host]
firstdayonthejob has quit [Quit: WeeChat 1.4-dev]
DmitryBochkarev has quit [Quit: This computer has gone to sleep]
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
yottanami has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
northfurr has quit [Quit: northfurr]
<shevy>
hmm I may have a string such as "Array#count" but also "Foobar#lala"; I need to find out whether the first part before the '#' is part of default ruby (stdlib, plain vanilla ruby), which would be the case with Array but not with Foobar. Anyone has an idea how to determine this reliably?
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
nhhagen has joined #ruby
Kyokushin has quit [Ping timeout: 240 seconds]
leat2 has quit [Ping timeout: 268 seconds]
apt-get has joined #ruby
ndrei has joined #ruby
apt-get has quit [Ping timeout: 250 seconds]
Vile` has quit [Ping timeout: 240 seconds]
juanpablo_ has joined #ruby
timonv has quit [Ping timeout: 265 seconds]
Ketchy has joined #ruby
[k- has joined #ruby
jglover has joined #ruby
CloCkWeRX has left #ruby [#ruby]
juanpablo_ has quit [Ping timeout: 244 seconds]
fedexo has quit [Ping timeout: 246 seconds]
fxn has joined #ruby
karapetyan has quit [Remote host closed the connection]
dgs has joined #ruby
poli has joined #ruby
ordepdev has joined #ruby
ordepdev has quit [Remote host closed the connection]
platzhirsch has joined #ruby
Blaguvest has joined #ruby
<zenspider>
craysiii: won't matter what version the docs are for. it's stable
kies^ has quit [Quit: baaaaiiiiiiiiiii~]
jglover has quit [Ping timeout: 240 seconds]
kies has joined #ruby
nfk has joined #ruby
apt-get has joined #ruby
lkba has joined #ruby
karapetyan has joined #ruby
QORRiE has quit [Quit: Leaving]
firstdayonthejob has joined #ruby
QORRiE has joined #ruby
howdoicomputer has quit [Ping timeout: 260 seconds]
acke has joined #ruby
bigkevmcd has quit [Read error: Connection reset by peer]
bigkevmcd has joined #ruby
Kyokushin has joined #ruby
<zenspider>
gah. so... I've been cleaning up getting ready for a release of the revamped version of my gem ...
<zenspider>
despite having working on it for a couple weeks now, all of a sudden it's not building from clean
Kyokushin has quit [Client Quit]
platzhirsch has quit [Ping timeout: 252 seconds]
<zenspider>
"Don't know how to build task 'ext/ext/sdl/extconf.rb/extconf.rb'"
Rurik has quit [Quit: Leaving]
<zenspider>
ext/ext ??
<zenspider>
I have NO clue what I changed that could have broke this in this way
Rurik has joined #ruby
<zenspider>
rake-compiler hasn't changed in a long time...
armyriad has quit [Quit: Leaving]
tkuchiki has joined #ruby
niko has joined #ruby
michael_mbp has quit [Excess Flood]
stamina has joined #ruby
tkuchiki has quit [Ping timeout: 246 seconds]
acke has quit [Remote host closed the connection]
michael_mbp has joined #ruby
stamina has quit [Remote host closed the connection]
stamina has joined #ruby
Jameser has joined #ruby
sdothum has joined #ruby
Rurik has quit [Remote host closed the connection]
Rurik has joined #ruby
Jameser` has joined #ruby
Jameser has quit [Remote host closed the connection]
Jameser` has quit [Remote host closed the connection]
Ketchy has quit [Quit: Leaving]
Jameser has joined #ruby
dotix has joined #ruby
ruby-lang858 has joined #ruby
ruby-lang858 has quit [Client Quit]
ordepdev has joined #ruby
dotix has quit [Ping timeout: 240 seconds]
jamesaxl|2 has joined #ruby
bubbys has quit [Ping timeout: 252 seconds]
jamesaxl has quit [Ping timeout: 246 seconds]
FernandoBasso has joined #ruby
Azure has quit [Excess Flood]
zenguy_pc has joined #ruby
Azure has joined #ruby
bubbys has joined #ruby
<zenguy_pc>
boolean_3 = 2**3 == 8 && 3**2 == 9
<zenguy_pc>
boolean_3 = false
<shevy>
hehe
<zenguy_pc>
first statement is true and second statement is false
<zenguy_pc>
right?
<zenguy_pc>
27 uis equal to 9 is false right?
<zenguy_pc>
is*
<zenguy_pc>
so true && false = false
<[k->
both statements are true
<[k->
this is likely a precedence issue
<zenguy_pc>
oh crap.. for some reason i thought 3**2 was 3 x 3 x 3 =27
<zenguy_pc>
i did that twice for some reason
<zenguy_pc>
thanks
<zenspider>
can't assign to false
<zenguy_pc>
true && true = true
<zenspider>
can't assign to true
dionysus69 has joined #ruby
Jameser has quit [Ping timeout: 256 seconds]
nettoweb has joined #ruby
ordepdev has quit [Remote host closed the connection]
<shevy>
:D
Alina-malina has quit [Ping timeout: 246 seconds]
<[k->
in other words, be distinct in what you mean. use = for assignment and == for equality
Jameser has joined #ruby
<zenguy_pc>
i got that from codecademy
<zenguy_pc>
oh .. i see what you mean
moeabdol has quit [Ping timeout: 240 seconds]
<zenguy_pc>
they gave me a state and the following line had a variable = blank. i replace blank with true
leat2 has joined #ruby
<zenguy_pc>
i can now see why you mentioned the assign and assignment thing in this context,, i'll be mindful of that in the future
dgs has quit [Quit: dgs]
Alina-malina has joined #ruby
jgt has joined #ruby
jgt has quit [Ping timeout: 244 seconds]
<atmosx>
I'm creating a quots API and I have death/birth dates for 'Person'. I wonder, is it a good idea to use db type DateTime or Date when... I don't have the month/day of the death of ppl who livedin ancient times
<atmosx>
isn't string better?
platzhirsch has joined #ruby
nanoz has quit [Read error: Connection reset by peer]
bonhoeffer has joined #ruby
bubbys has quit [Ping timeout: 264 seconds]
bubbys has joined #ruby
tno has quit [Remote host closed the connection]
AlexRussia has joined #ruby
sepp2k has joined #ruby
jenrzzz has joined #ruby
morenoh149 has quit [Ping timeout: 272 seconds]
ghostlines has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
[k-_ has joined #ruby
devoldmx has joined #ruby
howdoicomputer has joined #ruby
bubbys has quit [Ping timeout: 250 seconds]
bubbys has joined #ruby
apt-get has quit [Read error: No route to host]
devoldmx has quit [Ping timeout: 260 seconds]
<jhass>
one would think people had invented a datetime data types with unknown values by now
<shevy>
then we could no longer enjoy the end of the world in 2038
<atmosx>
jhass: what about people who are still alive? how would you for 'present' ?
moeabdol has joined #ruby
<jhass>
I'd set death_date to null
<atmosx>
jhass: what about socrates, he died in 399 BC how would use that?
<atmosx>
I mean, you have only year, not month/day
<jhass>
yeah, that's what I meant with my previous comment
<atmosx>
hm
<jhass>
datetimes should allow an "unknown" value for their components
<jhass>
dunno if anybody did that somewhere yet
<jhass>
I guess you could break it out on the schema level, death_year, death_month, death_day but ugh
<atmosx>
jhass: yeah
<atmosx>
that's ugly but could work.
<atmosx>
brb
juanpablo_ has joined #ruby
<[k-_>
and by seconds
<[k-_>
and microseconds
<[k-_>
because, who knows how much the government wants in the future
tkuchiki has joined #ruby
<zenguy_pc>
can unless be assigned an expression instead of just true or false?
Jameser has quit [Ping timeout: 250 seconds]
jdawgaz has joined #ruby
bubbys has quit [Ping timeout: 240 seconds]
<jhass>
probably, what do you mean?
bubbys has joined #ruby
<zenguy_pc>
statement = 2**3 == 8
juanpablo_ has quit [Ping timeout: 265 seconds]
<zenguy_pc>
print "Good to go!" unless statement
allomov has joined #ruby
<zenguy_pc>
or this: statement = (2**3 == 8)
tkuchiki has quit [Ping timeout: 240 seconds]
<[k-_>
you aren't assigning anything to unless
<zenguy_pc>
statement = 2**3 == 9
<zenguy_pc>
print "Good to go!" unless statement
<zenguy_pc>
that worked
<zenguy_pc>
before i got nil ouput
<[k-_>
yes, that isnt a syntax error
<[k-_>
unless means "if not"
<[k-_>
since statement was true in the first case
<[k-_>
you can translate the print statement as: print "Good to go!" if !true
charliesome has joined #ruby
Jameser has joined #ruby
<[k-_>
therefore, it can be further rewritten as: if (!true == true) { print "Good to go!" }
<[k-_>
and ruby would not have to print anything at all
<karapetyan>
hello!
<zenguy_pc>
print "Good to go!" if !#{statement} ... does that make sense?
<karapetyan>
could you help me to understand this example
<[k-_>
zenguy_pc: assigning is different from an expression
<[k-_>
you can't assign an expression to unless
<jhass>
karapetyan: did you read inject's docs yet?
<zenguy_pc>
[k-: expression is the use of ( ) ?
<[k-_>
no, an expression is what you can get a value out of
<karapetyan>
jhass: yes, but i don't understand
<karapetyan>
Combines all elements of enum by applying a binary operation, specified by a block or a symbol that names a method or operator.
<jhass>
karapetyan: yeah okay granted, that's not too well worded
<karapetyan>
what does mean binary operation?
mooe has quit [Quit: Connection closed for inactivity]
<jhass>
karapetyan: inject iterates over the collection you invoke it on. it yields the return value of the block from the last iteration and the current item. On the first iteration it yields the two first elements of the collection
<shevy>
bool true/false
<shevy>
0/1
<karapetyan>
jhass: thanks. :)
<jhass>
karapetyan: so for your example the block gets 5, 6, 5+6 = 11, 11, 7, 11+7 = 18, 18, 8, 18+8 = 26, 26, 9, 26+9 = 35, 35, 10, 35 + 10 = 45
bonhoeffer has quit [Quit: bonhoeffer]
<karapetyan>
thanks! :)
<karapetyan>
jhass: perfect!)
Coldblackice has quit [Ping timeout: 252 seconds]
<karapetyan>
jhass: can i use inject for array of numbers ?
<jhass>
karapetyan: you can also specify the first item by passing an argument, (5..10).inject(0) {|sum, n| sum + n }, then it starts of with 0, 5, 0+5 = 5
<jhass>
karapetyan: yes, any enumerable
<karapetyan>
jhass: reduce is alias for inject?
<jhass>
yes
<jhass>
some languages also call this function foldl
leafybasil has joined #ruby
QORRiE has quit [Quit: Leaving]
<karapetyan>
jhass: thx, (1..value).inject(:*) is it factorial ?
fxn has quit [Quit: zZzZzZ...]
<jhass>
I guess so, yeah
<karapetyan>
actually in some examples i need to add 1, but i don't undertand why (1..value).inject(1, :*)
<[k-_>
(there is also foldr but it has no usecase in ruby)
<[k-_>
the first argument would be the starting value
<jhass>
karapetyan: what if value is 1 or 0? the collection is empty/doesn't have enough elements
<jhass>
so you have to add one to be on the safe side
<karapetyan>
jhass: ok undertand
<karapetyan>
thanks guys
<jhass>
?guys karapetyan
<ruboto>
karapetyan, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
ordepdev has joined #ruby
<karapetyan>
ruboto: ok, sorry folks :)
QORRiE has joined #ruby
<karapetyan>
ruboto: actually i really appreciate for you help
<jhass>
?justabot
<ruboto>
I'm just a bot. You don't need to address me.
<karapetyan>
oh
<karapetyan>
:$
Silox| has joined #ruby
<j416>
?gals
<ruboto>
I don't know anything about gals
ghostlines has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k-_>
is literate programming supported in ruby?
<shevy>
it's english!
<shevy>
you could say that many domain specific languages are literate programming, aren't they?
badbodh has joined #ruby
badbodh has joined #ruby
ndrei has quit [Ping timeout: 265 seconds]
<[k-_>
example?
krz has joined #ruby
danieli has joined #ruby
<shevy>
dunno, they are all ugly
ordepdev has quit [Remote host closed the connection]
northfurr has joined #ruby
<[k-_>
do you literate program?
nhhagen has quit [Remote host closed the connection]
CorpusCallosum has quit [Ping timeout: 272 seconds]
legion_ has joined #ruby
sdfgsdfg has joined #ruby
<legion_>
hlo
<legion_>
guys any1 of u used packetfu?
tkuchiki has joined #ruby
<shevy>
[k-_ I write poetry
k3asd` has joined #ruby
<legion_>
any1...?
sdfgsdfg has quit [Read error: Connection reset by peer]
<ruboto>
slayerjain, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
CustosL1m3n has quit [Ping timeout: 272 seconds]
<slayerjain>
sure duly noted
<legion_>
everyone help me
<[k-_>
havenwood: when? why didnt i know :(
<[k-_>
shevy: 20:31:56 ([k-_) but do you literate programming?
atzorvas has quit [Quit: leaving]
devoldmx has joined #ruby
youngbaks has quit [Ping timeout: 250 seconds]
codecop has joined #ruby
<havenwood>
[k-: I guess it's been a while since I've mentioned it.
<slayerjain>
once again, thanks everyone
platzhirsch has left #ruby [#ruby]
badbodh has quit [Disconnected by services]
badbodh_1 is now known as badbodh
badbodh has quit [Changing host]
badbodh has joined #ruby
youngbaks has joined #ruby
legion_ has left #ruby ["Leaving"]
lkba has quit [Ping timeout: 250 seconds]
acke has joined #ruby
Jameser has joined #ruby
<shevy>
[k-_ I do poetry
devoldmx has quit [Ping timeout: 250 seconds]
<[k-_>
shevy: 20:31:56 ([k-_) but do you literate programming?
<shevy>
[k-_ I do poetry
xcesariox has joined #ruby
karapetyan has joined #ruby
jenrzzz has joined #ruby
<[k-_>
shevy: 20:31:56 ([k-_) but do you literate programming?
<[k-_>
you arent answering the question that i understand!
<j416>
what is the question that you understand
<j416>
:O
<shevy>
but it was answered!
acke has quit [Remote host closed the connection]
<shevy>
we have reached the age of poetry in code
<shevy>
do not remain in the distant past [k-_
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 240 seconds]
_aeris_ has joined #ruby
<shevy>
the next evolutionary step is to let robots program for us
acke has joined #ruby
<[k-_>
what has poetry in someplace got to do with literature in programming?
<shevy>
literature means something to read right
tvw has joined #ruby
<[k-_>
no...
<[k-_>
answer my question!
<[k-_>
yes/no
<shevy>
of course it means to read
<[k-_>
something to read != to read
<shevy>
come to the modern era [k-_
<[k-_>
have you read up on literate programming shevy?
<Papierkorb>
shevy: That, or with File.readlines().
tkuchiki has joined #ruby
badbodh_1 has joined #ruby
badbodh_1 has quit [Remote host closed the connection]
Zai00 has joined #ruby
<imperator>
shevy, IO.foreach if you're worried about memory
badbodh_1 has joined #ruby
<Papierkorb>
shevy: actually, this should be better: File.readlines('..').count{|line| line.include? '[]'}
<Papierkorb>
Doesn't allocate another huge array just for the size
lkba_ has quit [Read error: Connection reset by peer]
lkba has joined #ruby
badbodh has quit [Ping timeout: 250 seconds]
Zai00 has quit [Client Quit]
tkuchiki has quit [Ping timeout: 244 seconds]
tvw has quit []
voltalio has joined #ruby
veduardo has joined #ruby
dasher00 has joined #ruby
jdawgaz has joined #ruby
saddad has joined #ruby
voltalio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
naftilos76 has quit [Ping timeout: 240 seconds]
r_baron_ has joined #ruby
jcoe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
r_baron has quit [Ping timeout: 260 seconds]
kirun has joined #ruby
Azure has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
moeabdol has joined #ruby
vdamewood has quit [Quit: Life beckons.]
jcoe has joined #ruby
djangoJocky has joined #ruby
apt-get has joined #ruby
jcoe has quit [Client Quit]
ordepdev has joined #ruby
djangoJocky has left #ruby [#ruby]
Soda has joined #ruby
nettoweb has quit [Read error: Connection reset by peer]
dgutierrez1287 has joined #ruby
Adran has quit [Remote host closed the connection]
Soda has quit [Remote host closed the connection]
Hrorek has joined #ruby
Rurik has quit [Read error: Connection reset by peer]
k3asd` has joined #ruby
Swappticon has joined #ruby
elperdut has joined #ruby
ordepdev has quit [Remote host closed the connection]
Adran has joined #ruby
ziro` has joined #ruby
juanpablo_ has joined #ruby
Azure has joined #ruby
xcesariox has joined #ruby
<ziro`>
i’ve got a gem that won’t build properly because of a missing build configuration (x86_64-alpine-linux) is there anything I can do it skirt this?
<ziro`>
I’m sure another profile would probably work fine?
<[k->
mkmf?
<hanmac>
ziro`: have you installed ruby build stuff ? like that stuff ruby need to build gems?
dionysus69 has quit [Ping timeout: 246 seconds]
<[k->
hanmac!
juanpablo_ has quit [Ping timeout: 240 seconds]
<[k->
shevy!
<[k->
friends!
<ziro`>
hanmac: yeah, I’ve jsut found a package for my dist that should hopefully satisfy what the gem is trying to build manually
<ziro`>
I’m trying to `gem install compass` which depends on libffi which is falling over when it goes to build it
karapetyan has joined #ruby
<ziro`>
I guess the bundled version doesn’t come with the build config for alpine-linux (for good reason)
fxn has joined #ruby
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<hanmac>
ziro`: ffi gem does need libffi, gems cant install system packages you need to do that yourself
Neverdie has joined #ruby
TheRealSouthner has joined #ruby
<ziro`>
eugh, ok, the gem still insists on building it’s own libffi
<ziro`>
or, at least the extension the gem is using
<hanmac>
yeah the gem might need to build against your system that might take some time
<ziro`>
no, as in, it’s not working because the ffi gem builds an extension on my machine which it does not have a configuration for
<shevy>
perhaps he was using ?a because he can save one character compared to 'a'
morenoh149 has joined #ruby
elfuego has joined #ruby
jgt has joined #ruby
<Ox0dea>
I do it because my editor highlights it differently. Greater information density with fewer characters? Yes, please.
karapetyan has joined #ruby
atmosx_ has joined #ruby
lkba has quit [Ping timeout: 260 seconds]
platzhirsch has joined #ruby
Azure has quit [Ping timeout: 244 seconds]
<freezevee>
I have an array as @uninvited_set, then I set unvisited_set = @unvisited_set and unvisited_set.shift. Why does the first element gets removed also from @unvisited_set ?
hanmac has joined #ruby
<Ox0dea>
freezevee: Because that's what Array#shift does.
<ruby-lang741>
So, my problem is that when I run the exe file created by ocra, it doesn't find my yml config file, ENOENT error is given. How can I get it work?
<freezevee>
but I already said, it's too complicated for someone to spend his time
<freezevee>
I understand
Synthbread has joined #ruby
<ruby-lang741>
This is the line in my code : cnf = YAML.load_file "config.yml". Exe file doesn't get the path of the config file even though it is in the same directory than the exe. I also have Dir.chdir(File.dirname(__FILE__)) at the beginning of the file
DLSteve has joined #ruby
tjohnson has joined #ruby
moeabdol has joined #ruby
Coldblackice has joined #ruby
jcoe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DmitryBochkarev has quit [Quit: This computer has gone to sleep]
<shevy>
then the file does not exist there
DmitryBochkarev has joined #ruby
Rollabunna has quit [Remote host closed the connection]
<Ox0dea>
ruby-lang741: Instead of using Dir.chdir, you might consider adding that directory to $LOAD_PATH.
<shevy>
you can check via a conditional: _ = 'config.yml'; if File.exist? _; YAML.load_file _; else; puts 'the file does not exist.'
solocshaw1 has joined #ruby
<Ox0dea>
ruby-lang741: I haven't used OCRA in some time, but I do recall that it takes some liberties regarding where it places things.
solocshaw has quit [Ping timeout: 244 seconds]
solocshaw1 is now known as solocshaw
ghostlines has joined #ruby
mary5030 has quit [Remote host closed the connection]
Rickmasta has joined #ruby
firstdayonthejob has quit [Ping timeout: 260 seconds]
mary5030 has joined #ruby
mary5030 has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
cornerma1 has joined #ruby
MichaelSmith has quit [Quit: Connection closed for inactivity]
tmtwd has quit [Ping timeout: 272 seconds]
Pupeno has quit [Remote host closed the connection]
cornerman has quit [Ping timeout: 252 seconds]
Pupeno has joined #ruby
Pupeno has joined #ruby
juanpablo_ has joined #ruby
cornerma1 is now known as cornerman
rehat has joined #ruby
leat has joined #ruby
Swappticon has joined #ruby
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
armyriad has joined #ruby
elperdut has joined #ruby
<karapetyan>
how to compare if item[0] > 1 && item[0] > item[1]
juanpablo_ has quit [Ping timeout: 250 seconds]
<karapetyan>
what if item[1] don't exist?
<karapetyan>
it will raise error?
stamina has quit [Ping timeout: 250 seconds]
<Ox0dea>
karapetyan: You could probably get away with `item.take(2).sort.last > 1`.
Soda has joined #ruby
centrx has joined #ruby
<Ox0dea>
>> nil.to_i # karapetyan: Something to bear in mind.
<Ox0dea>
You'll probably want to endeavor to really understand what you're doing, then. :P
<Ox0dea>
I bet you get asked why A* should generally be preferred over Dijkstra's.
zotherstupidguy has quit [Ping timeout: 246 seconds]
<freezevee>
Ox0dea: it's not that advanced level
<freezevee>
Ox0dea: I need to know how to implement an algorithm
Pupeno has quit [Remote host closed the connection]
<freezevee>
Ox0dea: so If I know what to do with one, I can do this will all
<freezevee>
algorithms is theory, you read and then implement
<Ox0dea>
You're missing the crucial "understand what the fuck I just did" step.
Pupeno has joined #ruby
karapetyan has quit [Ping timeout: 272 seconds]
Swappticon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
I suppose that's part of the recipe that can be ignored if you're just trying to get your foot in the door.
karapetyan has joined #ruby
VeryBewitching has joined #ruby
<karapetyan>
thanks! folks!
Narzew has joined #ruby
<Ox0dea>
What's the cleanest approach to obtaining a heredoc's label?
blue_deref has joined #ruby
<Ox0dea>
The parser has it, of course, but it's not emitted anywhere; do I have to re-parse the heredoc?
Limix has joined #ruby
houhoulis has quit [Remote host closed the connection]
bonhoeffer has joined #ruby
dopamean_ has joined #ruby
Goose23 has joined #ruby
bonhoeffer has quit [Client Quit]
_tpavel has joined #ruby
JDiPierro has joined #ruby
_tpavel has quit [Read error: Connection reset by peer]
fedexo has quit [Ping timeout: 244 seconds]
<centrx>
Ox0dea, Like ParseTree ?
drptbl has joined #ruby
Swappticon has joined #ruby
karapetyan has quit [Remote host closed the connection]
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Hrorek has joined #ruby
Rurik has quit [Read error: Connection reset by peer]
leat has quit [Remote host closed the connection]
leat has joined #ruby
Goose23 has quit [Ping timeout: 264 seconds]
karapetyan has joined #ruby
DmitryBochkarev has quit [Quit: This computer has gone to sleep]
araujo has quit [Quit: Leaving]
phillip has joined #ruby
karapetyan has quit [Remote host closed the connection]
segfalt has quit [Ping timeout: 260 seconds]
segfalt has joined #ruby
elperdut has joined #ruby
pyon has quit [Read error: Connection reset by peer]
timonv has joined #ruby
dotix has joined #ruby
devoldmx_ has quit [Remote host closed the connection]
karapetyan has joined #ruby
devoldmx has joined #ruby
nofxx has joined #ruby
yqt has joined #ruby
farn has quit [Ping timeout: 246 seconds]
Narzew has quit [Read error: Connection reset by peer]
dopie has joined #ruby
dotix has quit [Ping timeout: 244 seconds]
devoldmx has quit [Ping timeout: 250 seconds]
<Ox0dea>
centrx: Well, whitequark/parser is the best Ruby parser I know of, and I'll have to fall back on something like it if there's no other way, but I thought there might be some magical String method I didn't know of.
stamina has joined #ruby
mistermocha has joined #ruby
<centrx>
oh that's an interesting idea
<Ox0dea>
Then again, heredocs are "just Strings", and I suppose it'd be unnecessarily wasteful to stick a #label method on every instance.
skade has joined #ruby
<centrx>
Ox0dea, by label you mean the delimiter?
karapetyan has quit [Remote host closed the connection]
<Ox0dea>
Oui.
badbodh has quit [Remote host closed the connection]
ruby-lang741 has quit [Ping timeout: 246 seconds]
<centrx>
Ox0dea, I suspect that doesn't exist past the parser. Treated as a token without meaning
karapetyan has joined #ruby
<Ox0dea>
Makes sense, really. :/
farn has joined #ruby
Narzew has joined #ruby
crdpink has joined #ruby
crdpink2 has quit [Ping timeout: 244 seconds]
matp has quit [Remote host closed the connection]
phillip has left #ruby ["bye"]
monoprotic has quit [Read error: Connection reset by peer]
taylorrf_ has joined #ruby
taylorrf has quit [Ping timeout: 244 seconds]
dopie has quit [Quit: This computer has gone to sleep]
gambl0re has quit [Ping timeout: 240 seconds]
r_baron has joined #ruby
fxn has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mary5030 has quit [Remote host closed the connection]
tmtwd has joined #ruby
zenguy_pc has joined #ruby
matp has joined #ruby
mary5030 has joined #ruby
yfeldblum has joined #ruby
mary5030 has quit [Read error: Connection reset by peer]
mary5030_ has joined #ruby
monoprotic has joined #ruby
monoprotic has quit [Changing host]
monoprotic has joined #ruby
QORRiE has quit [Ping timeout: 260 seconds]
zotherstupidguy has joined #ruby
karapetyan has quit [Remote host closed the connection]
JDiPierro has quit [Remote host closed the connection]
<atmosx>
Is there any quick way to turn this object to a hash? #<Person @values={:id=>1, :name=>"Socrates", :url=>"https://en.wikipedia.org/wiki/Socrates", :occupation=>"Philosopher", :birth_day=>nil, :birth_month=>nil, :birth_year=>470, :birth_ad=>false, :death_day=>nil, :death_month=>nil, :death_year=>399, :death_ad=>false, :created_at=>2015-09-13 21:54:28 +0300}> ?
home has joined #ruby
<atmosx>
ah stupid of
<atmosx>
.methods.sort showed to_hash ...hm and to_json
<nofxx>
atmosx, jhass to_h is new now? So ppl don't have the habit to implemnt it ?
mary5030 has joined #ruby
<nofxx>
is new no?*
<Ox0dea>
nofxx: It was introduced in 2.0.
<jhass>
atmosx: it's not like we have any clue about what that thing is from its inspect
<nofxx>
Ox0dea, ty
<Ox0dea>
nofxx: Sorry, might be 2.1.
morenoh149 has quit [Ping timeout: 272 seconds]
<Ox0dea>
Yeah, 2.1.
Nanuq has joined #ruby
Swappticon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zenguy_pc has quit [Read error: Connection reset by peer]
MichaelSmith has joined #ruby
mary5030 has quit [Ping timeout: 246 seconds]
duncannz has quit [Ping timeout: 256 seconds]
karapetyan has joined #ruby
segfalt has quit [Quit: segfalt]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
hotpancakes has joined #ruby
nettoweb has joined #ruby
FalseDeal has joined #ruby
nettoweb has quit [Client Quit]
morenoh149 has joined #ruby
pwnd_nsfw has quit [Ping timeout: 246 seconds]
allomov has quit [Remote host closed the connection]
<havenwood>
So it's in all stable releases, but not in the maintenance release due to be end-of-lifed this Winter.
djbkd has joined #ruby
saddad has quit [Read error: No route to host]
<Ox0dea>
nofxx: If you're worried about compatibility, `Hash[*foo]` is usually equivalent to `foo.to_h`.
Burgestrand has joined #ruby
segfalt has joined #ruby
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
Modulo the splat, I suppose; it's situational, really.
TheRealSouthner has joined #ruby
home has left #ruby [#ruby]
elfuego has quit [Quit: elfuego]
* havenwood
looks forward to Ruby 2.3 with --enable-frozen-string-literal this Christmas
Pupeno has quit [Remote host closed the connection]
<Ox0dea>
havenwood: Aware it's already a compile-time option, I assume?
karapetyan has quit [Remote host closed the connection]
djbkd has quit [Ping timeout: 244 seconds]
sonofflynn has joined #ruby
<havenwood>
Ox0dea: Yup!
<Ox0dea>
Aware also that objects can be unfrozen? ;)
blue_deref has quit [Quit: Taking myself out of hear.]
DarthGandalf has joined #ruby
<Ox0dea>
require 'mutable_everything'
<havenwood>
Ruby 3.0, muahahaha.
<sonofflynn>
I apologize, but I have a dumb question I think dealing with string escapes. I'm trying to work with shellcode. When I do "\x32\x14\a1".length it equals 3. When use the same string base64 encoded I get: base64.decode64(base64encodedshellcode).length it equals 9
Pupeno_ has joined #ruby
drPoggs has left #ruby ["Leaving"]
<sonofflynn>
SO basically, I think I need to figure out how to string escape that shellcode after base64 decoding it, but I can't figure it out for the life of me
<sonofflynn>
Could anyone offer some insight? I'd really appreciate it
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<sonofflynn>
I'm base64 decoding shellcode
<sonofflynn>
(I just added that gsub at the end, but that doesn't work)
Pupeno_ has quit [Read error: Connection reset by peer]
<sonofflynn>
however
dgutierrez1287 has quit [Remote host closed the connection]
<sonofflynn>
when it's decoded, it's decoded as "\\x32\\x14\\x23...."
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
<sonofflynn>
and I need to convert that so ruby interprets that as "\x32\x14\x23"
<sonofflynn>
and it's interpreted as shellcode, not 12 literal string characters
Swappticon has joined #ruby
dotix has joined #ruby
dotix has joined #ruby
jcoe has joined #ruby
dotix has quit [Client Quit]
<lianj>
huh, #ruby-lang and #ruby got merged? whats the story?
<Ox0dea>
jhass: You really should've emphasised that you missed "minimal".
<jhass>
yeah
codecop has joined #ruby
<jhass>
lianj: #ruby got a new op team and was the larger channel, so the reason for #ruby-lang to exist ceased to be and we merged the smaller into the larger channel
<sonofflynn>
so what's the best way to convert the string "\\x32\\x43\\x14..." into "\x32\x43\x14..." and be interpreted as shellcode vs. literal string characters
<sonofflynn>
?
leat has quit [Ping timeout: 256 seconds]
segfalt has quit [Quit: segfalt]
allomov has quit [Remote host closed the connection]
devoldmx has joined #ruby
zenguy_pc has quit [Read error: Connection reset by peer]
<jhass>
mmh, is [Base64.decode64(base64).delete("\\")].pack("H*") correct?
rodfersou has quit [Ping timeout: 260 seconds]
<jhass>
where does that base64 come from in the first place? do you control its generation?
Hrorek has quit [Read error: Connection reset by peer]
Rurik has joined #ruby
<Ox0dea>
For what it's worth, avoiding AV probably constitutes exploitation.
TheRealSouthner has left #ruby [#ruby]
<sonofflynn>
So, I'm not really. The framework is developed in python. What it does is creates windows executables based in a variety of languages
krz has quit [Quit: WeeChat 1.2]
<sonofflynn>
right now it supports, python, .net, c, ruby, and powershell
<sonofflynn>
(powershell is obviously not an executable)
<Ox0dea>
But you're porting existing code, yes?
<sonofflynn>
Kind of. I'm using windows api calls in each respective language
<sonofflynn>
any language that I can interact with the windows api, I can use
<sonofflynn>
(as long as I can also convert to a windows executable)
<Ox0dea>
Then why not just use the Python code you're cribbing?
<Ox0dea>
What do you stand to gain in converting it all to Ruby?
<sonofflynn>
Because, simply changing the base language of the executable from python to ruby bypasses detection by AV
<sonofflynn>
so, any payload in C is easily caught
<sonofflynn>
but literally porting the same calls to python, completely bypassed detection
<Ox0dea>
Why not just figure out which sequence of bytes is tripping the AV and ensure it doesn't end up in your executable?
Pupeno has joined #ruby
<sonofflynn>
we're doing that, in addition to adding support for new languages
<Ox0dea>
I don't see how the language has much to do with it.
<jhass>
sacarlson: you'll have some weirdness like that Module2::Class2::Class2::Class2 will be valid, but beyond that nothing to argue against based on fake code
<sonofflynn>
it's funny, it's because AV sucks
<sonofflynn>
I can literally port the same code in C to Python
<sonofflynn>
and C will get caught, but python won't
<sonofflynn>
veil-evasion is the specific av evading tool
<sonofflynn>
no, not spam, just showing what I am talking about
<Ox0dea>
sonofflynn: That wolf shouldn't be howling if it's trying to pass itself off as a sheep.
Pupeno has quit [Remote host closed the connection]
<sonofflynn>
but yeah, it's sad, bypassing AV is as simple as changing the language
<sonofflynn>
lol
allomov has joined #ruby
<Ox0dea>
sonofflynn: I reckon you might be out of your depth, mate.
<sonofflynn>
and once we run out of languages, we can expand upon the modules we have
<sonofflynn>
by finding where it's detected, modify it, etc.
<Ox0dea>
That "changing the language" "works" is accidental.
lxsameer has joined #ruby
<sonofflynn>
not really, it works because static signature based detection is the wrong approach
<Ox0dea>
Aye, so why not just ensure you don't get caught by it?
<sonofflynn>
proper AV detection would be heuristics based, looking at winapi calls, etc.
<sonofflynn>
what do you mean? that's what we're doign
modern has quit []
<Ox0dea>
You're using a damned chainsaw where a scalpel would do.
<Ox0dea>
"Shit, we've been detected; better rewrite all this in another language."
<sonofflynn>
well, it's like I said before. We want to add support for as many languages as possible. The reason is because we'd love to have community involvement.
<sonofflynn>
Oh, we don't do it like that
<sonofflynn>
We release new languages even before we're caught
<sacarlson>
sonofflynn: if AV detects in that manner maybe just encrypt the code you plan to run in python, decode the code you plan to run in python then run it. you can reencode it with a different seed so it keeps changing
nofxx has quit [Ping timeout: 264 seconds]
<sonofflynn>
the reason we do that is to release a "baseline" of how to do it in a specific language
<sonofflynn>
It's to show how to inject shellcode in each respective language
rehat has quit [Remote host closed the connection]
gambl0re has joined #ruby
<Ox0dea>
sonofflynn: Sounds like you and your team need more msf in your lives.
<sonofflynn>
then anyone can use that as a base and expand upon it, such as grabbing encrypted shellcode, and decrypting it at runtime to bypass static signature analysis
<Ox0dea>
sonofflynn: With Base64, yes?
<sonofflynn>
MSF is ok, but it's payload generation gets caught usually, which is why we started making Veil
<sonofflynn>
base64 != encryption
<Ox0dea>
But that's what you're doing, isn't it?
<sonofflynn>
That's the only ruby one. Python we have aes encrypted shellcode that's decrypted at runtime
<sonofflynn>
DES, ARC, etc.
<sonofflynn>
basic letter substitution
<Ox0dea>
Ruby supports all of those; why did you go with Base64?
<sonofflynn>
I will add in DES, AES, etc.
<sonofflynn>
I just wanted to start with base64
<sonofflynn>
that's the only reason
<Ox0dea>
> base64 != encryption
<sonofflynn>
I know
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
<sonofflynn>
doesn't need to be encrypted to bypass
<sonofflynn>
letter substitution works too'
<Ox0dea>
memfrob(3) to the rescue.
<sonofflynn>
.replace('\\x', 'zz')
<sonofflynn>
then switching back at runtime bypasses too
mary5030 has joined #ruby
segfalt has joined #ruby
Burgestrand has joined #ruby
mistermocha has quit [Remote host closed the connection]
crankharder has quit [Ping timeout: 268 seconds]
Coldblackice has quit [Ping timeout: 250 seconds]
<sonofflynn>
but anyways, that's the project, thanks for all the help everyone
allomov has quit [Remote host closed the connection]
segfalt has quit [Client Quit]
mary5030 has quit [Ping timeout: 252 seconds]
osmansekerlen has joined #ruby
rakm has joined #ruby
ruby-lang049 has joined #ruby
<ruby-lang049>
Hello World
diegoviola has joined #ruby
rakm has quit [Client Quit]
minimalism has joined #ruby
MyMind has joined #ruby
devbug_ has joined #ruby
<jhass>
World Hello
elperdut has joined #ruby
workmad3 has joined #ruby
Sembei has quit [Ping timeout: 264 seconds]
dgs has joined #ruby
Pupeno has joined #ruby
ruby-lang049 has quit [Ping timeout: 246 seconds]
athinggoingon has quit [Ping timeout: 252 seconds]
danieli has quit [Quit: *does an epic backflip into nowhere*]
diego3 has joined #ruby
diego3 has quit [Changing host]
diego3 has joined #ruby
diegoviola has quit [Ping timeout: 240 seconds]
<Ox0dea>
In truth, I only asked after "declassing" because of the "mullins" => "declass" thing.
<Ox0dea>
Sad fact: there are no eight-letter words which come out the other end of a base transformation as another word. :/
danieli has joined #ruby
<jhass>
in a language you recognize at least
<sacarlson>
Ox0dea: that's wierd so in that case you generate the test code it it creates something that resembles the code. Interesting but I'm not going with that
<Ox0dea>
sacarlson: Aye, it was mostly a fun experiment, I think.
<Ox0dea>
jhass: Fair point.
<Ox0dea>
>> 'hosts'.to_i(30).to_s(34) # This is my favorite.
diegoviola has quit [Remote host closed the connection]
oo_ has quit [Ping timeout: 240 seconds]
iszak has quit [Ping timeout: 272 seconds]
fostertheweb has joined #ruby
iszak has joined #ruby
fostertheweb has quit [Client Quit]
fwaokda has joined #ruby
havenwood has quit [Ping timeout: 244 seconds]
<fwaokda>
If i want to use mysql2 in my ruby script, do I just need to run `gem install mysql2` and then use require 'mysql2' at the top of my script file?
<ironcamel>
where it says " register Sinatra::ConfigFile", is register a ruby thing or a sinatra thing?
wldcordeiro has joined #ruby
<Ox0dea>
&ri register @ironcamel
<`derpy>
No results
jxf has joined #ruby
sacarlson has joined #ruby
TheHodge has joined #ruby
jxf has quit [Changing host]
jxf has joined #ruby
jxf has quit [Max SendQ exceeded]
j416 has joined #ruby
jxf has joined #ruby
platzhirsch has left #ruby [#ruby]
rodfersou has joined #ruby
bruno- has quit [Ping timeout: 255 seconds]
jhkff has quit [Quit: WeeChat 1.3]
fwaokda has quit [Ping timeout: 268 seconds]
djbkd has joined #ruby
jdawgaz has joined #ruby
Limix has quit [Quit: Limix]
osmansekerlen has quit [Quit: osmansekerlen]
Yzguy has joined #ruby
djbkd has quit [Ping timeout: 264 seconds]
arescorpio has joined #ruby
FernandoBasso has quit [Quit: WeeChat 1.3]
platzhirsch has joined #ruby
platzhirsch has left #ruby [#ruby]
Voker57 has quit [Read error: Connection reset by peer]
Pupeno has quit [Remote host closed the connection]
devoldmx has joined #ruby
pyon has joined #ruby
Balzrael has quit [Quit: Leaving]
tmtwd has quit [Ping timeout: 240 seconds]
athinggoingon has joined #ruby
tmtwd has joined #ruby
segfalt has joined #ruby
devoldmx_ has joined #ruby
saddad has quit [Ping timeout: 240 seconds]
devoldmx has quit [Ping timeout: 264 seconds]
G186 has joined #ruby
lokulin has quit [Changing host]
lokulin has joined #ruby
<G186>
Hello, i'm new to ruby, quick question, is there a way to accept an input of ints separated by a space like in c? say I wanted to input 3 numbers form the user, I want to input 12 342432 92 all in one line, without writing a parsing method?
TheRealSouthner has joined #ruby
<mistym>
G186: Would intstring.split(" ").map(&:to_i) work for you?