<mcatch>
i have lots of questions i'm sure, but i'll collect my thoughts and save them for another time
<jacktrick>
this is a good place for them
zzing has joined #ruby
<mcatch>
i use windows 99% of the time, but i'm getting tired of seeing all these cool new languages pop up and do awesome stuff on other operating systems, so i'm forcing myself to use linux and learn some ruby
greenysan has quit [Ping timeout: 276 seconds]
<mcatch>
well, "relatively" new languages, that is
hbpoison has quit [Ping timeout: 246 seconds]
<jacktrick>
heh, I was the same
<havenwood>
mcatch: FreeBSD is pretty nice as a Linux alternative as well. :)
<jacktrick>
eventually I found linux a lot easier to use than windows
<mcatch>
i spend a lot of time gaming, so the transition to linux hasn't been as easy as i would like
karancho has joined #ruby
<zzing>
As an exercise to learn Ruby, I am doing some parsing of weblogs with the ultimate goal of making queries on them. I could store everything in a single relational table, but I was wondering if there are other data stores that I might want to look at to generate webstats from.
<mcatch>
driver compatibility + no OS support from most developers makes it a lot of switching back and forth
apok has joined #ruby
<jacktrick>
the day I wrote an awk one-liner to handle some csv data instead of opening up a spreadsheet program was the day I uninstalled windows
<mcatch>
haha :)
<jacktrick>
then I wanted to play counter strike and had to wait to reinstall XD
<mcatch>
zzing, are you looking to store on file system or in memor?
<mcatch>
memory*
<zzing>
mcatch, definitely on the file system.
<mcatch>
sqlite is a very quick and easy thing to spin up and store data in
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby
<mcatch>
havenwood, currently using ubuntu, haven't tried anything else yet (ubuntu gives me that nice familiar usability that i'm used to with Windows)
<zzing>
mcatch, I do have mysql installed so I can use that fairly easily.
angusiguess has quit [Ping timeout: 248 seconds]
<havenwood>
mcatch: ya, i like Ubuntu too - have you taken a look at Mint? i was impressed and meant to give it another look
greenysan has joined #ruby
<jacktrick>
ever since unity I've been using xubuntu
<jacktrick>
the keyboard shortcuts out the box are fantastic
<mcatch>
havenwood, when i was evaluating linux branches a few months back i was running a Windows 8 release candidate, and dual booting was very difficult. Mint was one of the boots that was not working for me, and ubuntu eventually did with a lot of extra work
Kuifje has quit [Ping timeout: 248 seconds]
<mcatch>
i haven't gone back to look at Mint yet. ubuntu is starting to feel sort of clunky and heavy for me now
<mcatch>
but i don't know enough about linux to provide for myself what ubuntu is probably doing behind the scenes
JamesF has quit [Ping timeout: 246 seconds]
<mcatch>
ie: ubuntu is a small step down from windows, as it's probably holding my hand a lot
Chryson has joined #ruby
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby
greenysan has quit [Ping timeout: 255 seconds]
<mcatch>
disappointingly, my online buddies use ventrillo to chat, and there seems to be no official linux release of ventrillo. (says "under development" on their website)
rburton- has joined #ruby
<jacktrick>
there may be a 3rd party effort somewhere
<mcatch>
zzing, aside from a database backend, i'm not sure what other storage you'd need/be looking for as an alternative
<yfeldblum>
Es0teric, ruby, as a standard programming language, has got no underlying integration with Web or with Web pages ... this is a major difference from PHP
reppard has joined #ruby
coin3d has quit [Quit: coin3d]
<havenwood>
Es0teric: Most Ruby web servers are Rack web servers. Likewise, there are a number of Rack web frameworks in Ruby.
ckrailo has quit [Quit: Computer has gone to sleep.]
<yfeldblum>
Es0teric, there are a number of libraries and frameworks that you can use as an alternative to Rails, but you're going to want to go with one or another of them
<havenwood>
Es0teric: Rails and Sinatra are both Rack web frameworks.
icole has quit [Remote host closed the connection]
<Es0teric>
ok so what you're saying is that you cant build a web site without rails?
<havenwood>
Es0teric: Then you'll hear of stuff like Unicorn, Passenger, Thin, Puma, Webrick, etc - those are Rack web servers.
pdamer has joined #ruby
<yfeldblum>
Es0teric, because Ruby all by itself isn't built for rendering Web pages; it's just a normal programming language that you can build a Web framework on top of
<reppard>
Es0teric: that is not what anyone is saying
<havenwood>
Es0teric: are you trolling? :P
<Es0teric>
havenwood nah man.. i am serious about these questions because i am learning ruby right now... i do OOP in PHP
<havenwood>
Es0teric: You can build a web app with any of the Rack web frameworks (Rails included) or even non-Rack frameworks.
<Es0teric>
so the difference is not that great... its easier for me to learn this stuff
cccman has joined #ruby
sn0wb1rd has joined #ruby
<Es0teric>
havenwood, yfeldblum ok rack web frameworks
<Es0teric>
got it
<havenwood>
Es0teric: I'd suggest taking a look at alternative web servers to Rails just to familiarize with the concept of Rack web servers. Sinatra and Camping (maybe Cuba or Renee) would be good ones.
<Es0teric>
but what can you do with just ruby alone?
mattbl has joined #ruby
<cccman>
i suggest shutting the fuck up
<yfeldblum>
Es0teric, there are many ways to get started with Ruby-without-Rails; Sinatra is good at that, for example
<yfeldblum>
Es0teric, Ruby all by itself has very little facility or writing Web apps or showing Web pages; you can write command-line scripts with Ruby alone ...
kofno has quit [Remote host closed the connection]
<Es0teric>
well i already have...
<reppard>
you could write a mud in ruby
<Es0teric>
teamtreehouse and lynda.com
<Es0teric>
as well as codeacademy
<Es0teric>
when it comes down to it
kofno has joined #ruby
<havenwood>
Es0teric: Thousands of lines of Ruby are used to model F-35 flight instrumentation hardware and software, to run Twitter's front-end, and yesterday I wrapped someone's animated ascii art roflcopter into a gem for OS X with whoosh noises.
<davidcelis>
reppard: node.js would be better for that
<yfeldblum>
Es0teric, part of the nice thing about PHP is that it has a lot of Web-related stuff baked into it; but in order to get Web-related stuff in Ruby, you need to add the Web-related stuff on top ... and there's a wealth of options to choose from (sinatra and rails, to take the two most popular)
<yfeldblum>
Es0teric, so doing a Web-based project with Just Ruby Alone is rather difficult, and it's not something that can be explained in IRC
<Es0teric>
yfeldblum well i was trying to gauge the difference
<Es0teric>
thats all
<davidcelis>
Es0teric: If you want to get into the nitty-gritty of Ruby, but still write for the web, just use Rack
Aiur has quit [Quit: Computer has gone to sleep.]
<yfeldblum>
Es0teric, so typically you'll use Ruby for the language, and something else like Sinatra or Rails for the Web stuff
Xeago has quit [Remote host closed the connection]
<Es0teric>
i see, yfeldblum and davidcelis
<Es0teric>
but i have another question
<yfeldblum>
Es0teric, they're not smushed together like they are in PHP
<Es0teric>
is it possible to build pub/sub apps in ruby?
<yfeldblum>
Es0teric, yes
<Es0teric>
what attracted me to ruby was the syntax
<davidcelis>
Es0teric: Ruby itself is just like any other scripting language when you get down to it. You can write desktop applications, shell scripts, web applications, mobile applications
<Es0teric>
its so freakin clean
<davidcelis>
you can write whatever you want dude
goldenwest has left #ruby [#ruby]
<davidcelis>
of course you can write a pub/sub app
<yfeldblum>
Es0teric, certain methods in that example are recognized as hook methods that EventMachine calls when data is available, sort of like Nodejs event callbacks
idkazuma has joined #ruby
<Es0teric>
and how would i activate it after its installed, havenwood ?
daig0ro has quit [Client Quit]
<reppard>
im looking at the source of this amazing gem right now
<Es0teric>
man thats cool as hell... you can chain commands like in javascript
daniel_- has quit [Quit: WeeChat 0.3.9.2]
angusiguess has quit [Ping timeout: 252 seconds]
nfk has joined #ruby
<havenwood>
Es0teric: method chaining ftw
thone_ has joined #ruby
<Es0teric>
indeed havenwood
emergion has joined #ruby
thone has quit [Ping timeout: 248 seconds]
ErsatzRyan has quit [Remote host closed the connection]
chrishunt has joined #ruby
nga4 has quit [Ping timeout: 264 seconds]
thone_ has quit [Ping timeout: 252 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
jblack has joined #ruby
dallasm has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
nfk has quit [Quit: yawn]
NiteRain has joined #ruby
meoblast001 has joined #ruby
thone has joined #ruby
alexturner has joined #ruby
reppard has quit [Ping timeout: 276 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
<alexturner>
Lads and Ladies, trying to get some old code written for 1.8 on my machine with 1.9.3 installed. Trying to optimise the app to run though I seem to be getting some Gem errors. Does this make sense to anyone? /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- initializer (LoadError)
mattbl has quit [Quit: This computer has gone to sleep]
adeponte has quit [Remote host closed the connection]
robscott has joined #ruby
<alexturner>
.
ninegrid has quit [Ping timeout: 255 seconds]
johnpcamara has quit [Quit: johnpcamara]
onemanjujitsu has quit [Quit: onemanjujitsu]
rakl has quit [Quit: sleeping]
Hanmac1 has joined #ruby
[rupee] has quit [Quit: Leaving]
dallasm has quit [Remote host closed the connection]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
davidokner has quit [Quit: Lost terminal]
BrindleFly_ has joined #ruby
BrindleFly has quit [Read error: Operation timed out]
BrindleFly_ is now known as BrindleFly
Hanmac has quit [Ping timeout: 264 seconds]
DrShoggoth has joined #ruby
hadees has quit [Read error: Connection reset by peer]
<davidokner>
I'm going through the Sinatra book. People should know not to try to install the web servers mentioned in the book, because the gems don't work.
ninegrid has quit [Read error: Operation timed out]
johnpcamara has quit [Quit: johnpcamara]
<davidokner>
Specifically, the web servers "Mongrel" and "Thin".
<yfeldblum>
davidokner, thin works fine
<jblack>
Hi. I'm trying ot set dynamic method calls into a subclass without much success. The idea is that I can dynamically inject code into my class by using included and method.call. I have sample code of what I'm trying to do at: http://codepad.org/iEtOvmNY
baphled has joined #ruby
<davidokner>
yfeldblum: It installed for you, but the gem has a fault so it won't install for everybody.
<jblack>
I have 2 classes, Parent and Child. Parent has an add_runner method. I have a module with 2 methods, included, and replaceampersand (that's the real work)
<jblack>
however, line 7, base.add_runner(:start, method(:replaceampersand))
<jblack>
gripes that undefined method `add_runner' for Child:Class (NoMethodError)
ffranz has quit [Quit: Leaving]
tylersmith has quit [Quit: tylersmith]
ninegrid has joined #ruby
<yfeldblum>
jblack, in 6, `base` is a class; in 16, add_runner is an instance method, not a class method
<jblack>
I have definitely been confused on instance methods vs. class methods.
<jblack>
Ok, so I should be using extend instead of include?
bricker_ has joined #ruby
caleb_io has quit [Quit: caleb_io]
ctult_ has joined #ruby
bricker_ is now known as bricker`LA
johnpcamara has joined #ruby
havenwood has joined #ruby
pdamer has quit [Quit: pdamer]
<jblack>
How do I get the intsance that I'm including into? self seems to be the module itself, and if base is just the class method..
stormetrooper has quit [Quit: Leaving]
chrishunt has quit [Quit: zZzZzZ...]
etcetera has joined #ruby
quest88 has joined #ruby
etcetera has quit [Client Quit]
johnpcamara has quit [Quit: johnpcamara]
rcosta has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
arya has quit [Ping timeout: 248 seconds]
erlingur has quit [Quit: Computer has gone to sleep.]
yakko has quit [Quit: No Ping reply in 180 seconds.]
angusiguess has joined #ruby
yakko has joined #ruby
arya has joined #ruby
evenix has joined #ruby
banister`sleep has quit [Remote host closed the connection]
onemanjujitsu has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
hadees_ has quit [Ping timeout: 248 seconds]
hadees has joined #ruby
reppard has quit [Ping timeout: 256 seconds]
Dwarf has quit [Ping timeout: 246 seconds]
qpf has joined #ruby
arya has quit [Ping timeout: 260 seconds]
arya has joined #ruby
d2dchat has quit [Remote host closed the connection]
baba has joined #ruby
toekutr has quit [Remote host closed the connection]
arya_ has joined #ruby
adeponte has joined #ruby
havenwood has quit [Remote host closed the connection]
cobragoat has quit [Remote host closed the connection]
Spooner has quit [Quit: Leaving]
robscott has quit [Quit: robscott]
alexturner has quit [Quit: alexturner]
dallasm has joined #ruby
arya has quit [Ping timeout: 248 seconds]
havenwood has joined #ruby
kmurph has quit [Quit: kmurph]
dallasm has quit [Remote host closed the connection]
bradleyprice has quit [Ping timeout: 256 seconds]
dallasm has joined #ruby
<zzing>
If I have a language construct like rule(:weblog) { ... } what type of construct is :weblog? (sample from Parslet code)
evenix has quit [Ping timeout: 248 seconds]
arya_ has quit [Ping timeout: 252 seconds]
bradleyprice has joined #ruby
arya has joined #ruby
fedza has joined #ruby
havenwood has quit [Ping timeout: 252 seconds]
onemanjujitsu has quit [Quit: onemanjujitsu]
zzing has quit [Quit: Computer has gone to sleep.]
onemanjujitsu has joined #ruby
thone has quit [Ping timeout: 252 seconds]
thone has joined #ruby
chrishough has quit [Quit: chrishough]
arya_ has joined #ruby
arya has quit [Ping timeout: 256 seconds]
hmarr has joined #ruby
Proshot has joined #ruby
Targen has joined #ruby
kennyvb has quit [Read error: Operation timed out]
kennyvb has joined #ruby
wallerdev_ has joined #ruby
arya has joined #ruby
Dwarf has joined #ruby
juco has quit [Read error: Operation timed out]
juco has joined #ruby
wallerdev has quit [Read error: Operation timed out]
wallerdev_ is now known as wallerdev
etcetera has joined #ruby
mnaser has quit [Read error: Operation timed out]
pu22l3r has joined #ruby
erry has quit [Read error: Operation timed out]
erry has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
RailWolf has quit [Read error: Operation timed out]
adkron_ has quit [Ping timeout: 255 seconds]
RailWolf has joined #ruby
adeponte has quit [Remote host closed the connection]
statarb3 has quit [Ping timeout: 256 seconds]
arya_ has quit [Ping timeout: 248 seconds]
mnaser has joined #ruby
arya_ has joined #ruby
arya has quit [Ping timeout: 244 seconds]
hadees_ has joined #ruby
<unstable>
(1..(num - 1)).select { |i| i.prime? }; How long would it take to find all the primes for 600851475143?
hadees has quit [Ping timeout: 248 seconds]
hadees_ is now known as hadees
main has joined #ruby
billiam has joined #ruby
banister`sleep has joined #ruby
SirRamonGabriel has joined #ruby
PanPan has quit [Read error: Connection reset by peer]
PanPan has joined #ruby
rking has joined #ruby
reset has quit [Ping timeout: 276 seconds]
adkron_ has joined #ruby
<unstable>
ahh, I found a good sieve implementation
<unstable>
damn, if you don't optimize it really well for big numbers.. is just rapes my processor and gives me no results.
CamonZ has quit [Remote host closed the connection]
arya has joined #ruby
dcwu has joined #ruby
nga4 has joined #ruby
<perdent>
I just started learning Ruby yesterday and I was wondering if it's possible to put an if/else statement inside of another if/else statement For instance: http://pastebin.com/UL6ERpUL
<adkron>
perdent: yes, but it is generally accepted as a bad practice if it can be avoided. It leads to complex code with many paths.
graft_ has joined #ruby
graft_ has quit [Changing host]
graft_ has joined #ruby
tylersmith has joined #ruby
cobragoat has joined #ruby
SirRamonGabriel has quit [Remote host closed the connection]
<perdent>
adkron: What is the best approach then?
<zzing>
unstable, of course it does. That sieve is only good up to that point.
jamescarr has joined #ruby
arya has quit [Ping timeout: 248 seconds]
JumpMast3r has quit [Quit: JumpMast3r]
hmarr has joined #ruby
karancho has quit [Quit: Saliendo]
arya has joined #ruby
<unstable>
zzing: What is the best sieve for up to 700 billion?
dmiller has quit [Ping timeout: 252 seconds]
<adkron>
perdent: I think it would be at least a little better to wrap these things in methods.
_nitti has quit [Remote host closed the connection]
pu22l3r has quit [Remote host closed the connection]
justinleitgeb has quit [Remote host closed the connection]
arya has joined #ruby
SolidResolve has quit [Ping timeout: 276 seconds]
graft_ has quit [Ping timeout: 244 seconds]
<adkron>
perdent: consider if you need that many paths through your code. Do you need to tell the user it was the password that was wrong. Would it work just as well to say the combination is bad.
<apeiros_>
it'd not make sense to treat `thing = 5` as a method call.
<lectrick>
apeiros_: method_missing makes that work? really?
<apeiros_>
no
<apeiros_>
you want `thing = 5` to be a method call.
<apeiros_>
that makes no sense.
<apeiros_>
it'd break locals.
<apeiros_>
one reason being method_missing.
<lectrick>
so thing by itself on a iine uses the "thing" reader, but thing = 5 by itself on a line doesn't use the "thing" writer, but creates a local var instead? and to set it via the writer I have to use self.thing = 5?
<apeiros_>
yes
<lectrick>
apeiros_: OH.
<lectrick>
I see now. Well jeez
idkazuma has joined #ruby
<lectrick>
So why not make all accessors need to be called on self? why does "thing" by itself on a line still work by calling the reader?
<apeiros_>
yes, `thing` calls the method. except if you shadow it with a local
<apeiros_>
in that case, you must use explicit syntax. that is, either `thing()`, or `self.thing`
<apeiros_>
the latter won't work with private methods
<apeiros_>
but if you shadow methods with locals, then you only have yourself to blame :)
* apeiros_
off
<lectrick>
apeiros_: no kidding. i found code that used a local named the same as an accessor and I was like wtf
<lectrick>
I avoid that automatically to avoid the ambiguity
icole has joined #ruby
mockra has joined #ruby
tylersmith has quit [Quit: tylersmith]
rakl has quit [Quit: sleeping]
chendo_ is now known as chendo
arya has quit [Ping timeout: 255 seconds]
otters has joined #ruby
<jblack>
I just can't seem to find an easy way to tell an instance the names of the methods just loaded by include
mattbl has quit [Quit: This computer has gone to sleep]
mattbl has joined #ruby
l3o has joined #ruby
qpf has quit [Ping timeout: 264 seconds]
mattbl has quit [Client Quit]
thone has quit [Ping timeout: 276 seconds]
arya has joined #ruby
thone has joined #ruby
jfl0wers has quit [Ping timeout: 248 seconds]
thone has quit [Read error: Operation timed out]
l3o has quit [Quit: Saliendo]
senayar has joined #ruby
arya has quit [Ping timeout: 260 seconds]
dmiller has quit [Ping timeout: 276 seconds]
Aiur has joined #ruby
dnordstrom has joined #ruby
icole has quit [Remote host closed the connection]
Aiur has quit [Client Quit]
yshh has joined #ruby
lifestream has joined #ruby
lifestream has left #ruby [#ruby]
arya has joined #ruby
yshh has quit [Read error: Connection reset by peer]
thone has joined #ruby
yshh has joined #ruby
freakazoid0223 has quit [Quit: Leaving]
reset has joined #ruby
main has quit [Ping timeout: 240 seconds]
dallasm has quit [Remote host closed the connection]
kofno has quit [Remote host closed the connection]
Vektur has joined #ruby
cparen has joined #ruby
yshh_ has quit [Remote host closed the connection]
<Nom->
Is it adviseable to use ObjectSpace? I saw some warnings about it being horrible performance under JRuby, so wasn't sure if it's a good idea to use in MRI?
thone has quit [Ping timeout: 252 seconds]
SolidResolve has joined #ruby
cableray has quit [Ping timeout: 276 seconds]
chendo has quit [Ping timeout: 244 seconds]
jblack has quit [Ping timeout: 255 seconds]
chendo_ has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
<micaeked>
unstable: Use a sieve to find the primes between n and sqrt(n). That will give you all the potential prime factors. After filtering, if you want all the factors (not just prime), check multiples.
<micaeked>
unstable: err... between 1 and sqrt(n)
kmurph has joined #ruby
arya has joined #ruby
tcstar has quit [Ping timeout: 246 seconds]
haxrbyte has quit [Ping timeout: 255 seconds]
haxrbyte_ has quit [Remote host closed the connection]
<zzing>
There are also primaility testers that may be better if you are trying to determine if a number that size is in fact a prime number
haxrbyte has joined #ruby
oscardelben has joined #ruby
dmiller has quit [Ping timeout: 255 seconds]
kojul has quit [Quit: kojul]
robscott has joined #ruby
robscott has left #ruby [#ruby]
ryanf has quit [Quit: leaving]
JumpMast3r has joined #ruby
arya has quit [Ping timeout: 260 seconds]
tcstar has joined #ruby
etcetera has joined #ruby
spaceships has quit [Quit: leaving]
thone has quit [Read error: Operation timed out]
etcetera has quit [Client Quit]
<Es0teric>
wow...
<Es0teric>
you can chain sooo many things
<Es0teric>
this shit is crazy
arya has joined #ruby
techlife has quit [Ping timeout: 272 seconds]
<unstable>
Why does mathn dump crap to my pry terminal?
<unstable>
/75B
<unstable>
Stuff like that.
thone has joined #ruby
mcqueenorama has joined #ruby
arya has quit [Ping timeout: 255 seconds]
tk_ has joined #ruby
techlife has joined #ruby
arya has joined #ruby
graft_ has quit [Read error: Connection reset by peer]
idiocrash has joined #ruby
<idiocrash>
GUISE
<idiocrash>
So I'm learning ruby
<idiocrash>
When creating classes, do you find yourself frequently using the initialize method to call other methods on the class to govern the existing of your objects spawned from your class?
<idiocrash>
like, you kinda end up writing a sort of pseudo language
jamescarr has quit [Quit: jamescarr]
graft_ has joined #ruby
graft_ has quit [Changing host]
graft_ has joined #ruby
<idiocrash>
I was just curious if that was something others did as well
<unstable>
idiocrash: I do that.
lusory has quit [Quit: leaving]
<idiocrash>
cool! I just sort of naturally started doing that
<idiocrash>
but, apparently not just me
zzing has quit [Quit: Computer has gone to sleep.]
dnordstrom has quit [Ping timeout: 246 seconds]
senayar has quit [Quit: Quitte]
dnordstrom has joined #ruby
fwaokda has joined #ruby
cantbecool has joined #ruby
icole has quit [Read error: Connection reset by peer]
icole has joined #ruby
Umren has joined #ruby
arya has quit [Ping timeout: 255 seconds]
angusiguess has quit [Ping timeout: 244 seconds]
cantbecool has quit [Client Quit]
mattbl has quit [Quit: This computer has gone to sleep]
arya has joined #ruby
plotter has quit [Ping timeout: 246 seconds]
mattbl has joined #ruby
megha has joined #ruby
joeycarmello has joined #ruby
Evixion` has joined #ruby
Evixion` has quit [Client Quit]
baba has quit [Ping timeout: 252 seconds]
jfl0wers_ has joined #ruby
flip_digits has joined #ruby
icole has quit [Ping timeout: 264 seconds]
chendo_ has quit [Ping timeout: 248 seconds]
icole has joined #ruby
megha has quit [Quit: WeeChat 0.4.0]
browndawg has quit [Ping timeout: 264 seconds]
caleb_io has joined #ruby
joeycarmello has quit [Ping timeout: 256 seconds]
chendo_ has joined #ruby
whitedawg has quit [Quit: Leaving.]
baba has joined #ruby
kmurph has quit [Quit: kmurph]
browndawg has joined #ruby
bradleyprice has quit [Remote host closed the connection]
Fretta has quit [Quit: Fretta]
dmerrick has joined #ruby
Dcr has joined #ruby
meoblast001 has quit [Remote host closed the connection]
whowantstolivefo has quit [Quit: who wants to live forever ?]
<shevy>
idiocrash usually I dont need to create many other objects, except for the main script in a large project
<shevy>
I do tend to re-use common methods on my objects however, especially "reset" (restore the object to the default state again) and "run" (start the main action of that object)
<idiocrash>
reset is a convention you use?
<shevy>
yeah
<idiocrash>
huh, I like that idea
<shevy>
do you have an example how you use initialize() btw?
dmerrick has quit [Quit: dmerrick]
mattbl has quit [Quit: This computer has gone to sleep]
<idiocrash>
uh, take like... a class called GuessingGame
<idiocrash>
methods might be:
<idiocrash>
greet_player
<idiocrash>
get_player_guess
<idiocrash>
check_player_guess
<idiocrash>
if player_won? exit
<idiocrash>
...etc
<shevy>
sounds like what I do inside of run() :)
<shevy>
I used to have initialize methods like this:
<shevy>
def initialize(name, age)
<shevy>
@name = name; @age = age
<shevy>
for very small classes I still do that, but in general I hate to modify @ivars via simple assignment alone
<idiocrash>
for very small classes, do you also use attr_accessible ?
<shevy>
yeah
<shevy>
if I need to modify that @ivar
<shevy>
if I dont need to modify it, then of course I wont use it
<shevy>
but in my experience, often enough I need to do sanity checking before I assign to an @ivar
frogstarr78 has quit [Remote host closed the connection]
<shevy>
and attr_* does no sanity checking (logically)
kmurph has joined #ruby
<shevy>
so you would then have methods, like:
<shevy>
def foo=(i)
<idiocrash>
Sorry, I meant to say attr_accessor
<shevy>
raise 'We need a Room Object.' unless i.is_a? RoomObject
<shevy>
@foo = i
<shevy>
end
Dcr has left #ruby ["Leaving"]
<shevy>
yeah idiocrash, same reason for all attr* helpers really
<idiocrash>
ooh, I like
<shevy>
no sanity checking makes for limited use
therod has quit [Quit: Leaving...]
fgro has joined #ruby
<shevy>
take ARGV for instance
<shevy>
it is the same in every ruby object
<shevy>
in the past, I used to have things like this:
mattbl has quit [Quit: This computer has gone to sleep]
hadees has joined #ruby
joeycarmello has quit [Ping timeout: 240 seconds]
fgro_ has quit [Ping timeout: 255 seconds]
ananthakumaran has joined #ruby
baba has quit [Quit: WeeChat 0.4.0]
shock_one has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby
cparen has quit [Quit: cparen]
irchub has joined #ruby
icole has quit [Remote host closed the connection]
greenysan has joined #ruby
zigomir has joined #ruby
zeen has joined #ruby
havenwood has quit [Ping timeout: 260 seconds]
rezzack has quit [Quit: Leaving.]
kmurph has quit [Quit: kmurph]
kmurph has joined #ruby
generalissimo has quit [Remote host closed the connection]
swex has joined #ruby
ericmathison has joined #ruby
hackerdude has quit [Remote host closed the connection]
swex_ has quit [Ping timeout: 248 seconds]
mcqueenorama has quit [Remote host closed the connection]
micaeked has quit [Quit: WeeChat 0.4.0]
idkazuma has quit [Remote host closed the connection]
techlife has quit [Ping timeout: 276 seconds]
Chryson has quit [Ping timeout: 248 seconds]
joeycarmello has joined #ruby
rohit-sharma has joined #ruby
toekutr has joined #ruby
nomenkun has joined #ruby
Pufferfood has joined #ruby
idkazuma has joined #ruby
joeycarmello has quit [Ping timeout: 246 seconds]
techlife has joined #ruby
<sterk>
Hi, I need to write a hash to a human-readable, ruby-executable file. I have this http://ideone.com/5Vn7Qg (2 lines), and it works, but it does not look very good (codewise). Are there any prettier ways of doing this?
arya has quit [Ping timeout: 256 seconds]
nari has quit [Ping timeout: 255 seconds]
horrror has joined #ruby
<sterk>
(the puts is only there for demonstartion, it's the string building code i want looked at)
<rohit-sharma>
can anyone please guide me on how to integrate eventmachine in rails
lkba has quit [Ping timeout: 244 seconds]
<shevy>
sterk: require 'pp'; pp hash
<shevy>
I think there is also awesome_print, which may allow that kind of styling
<shevy>
and I also think the PP module allows for specific formatting, but I am unsure how (never needed that level of control, normal pp was usually enough)
Pufferfood has quit [Read error: Operation timed out]
anderse has joined #ruby
joeycarmello has joined #ruby
yakko has quit [Remote host closed the connection]
Pufferfood has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
billiam has quit [Ping timeout: 256 seconds]
anderse has quit [Client Quit]
Cork has joined #ruby
joeycarmello has quit [Ping timeout: 256 seconds]
elkclone has quit [Ping timeout: 245 seconds]
dcwu has quit [Quit: Leaving.]
elkclone has joined #ruby
elkclone has quit [Read error: Connection reset by peer]
prtksxna has joined #ruby
browndawg has joined #ruby
icole has joined #ruby
alexturner has joined #ruby
icole has quit [Read error: Connection reset by peer]
icole has joined #ruby
d34th4ck3r has joined #ruby
<d34th4ck3r>
what does underscore do in ruby? I mean if _c=2 then what is c ? and what does it represent?
alexturner has quit [Client Quit]
rohit-sharma has left #ruby ["Leaving"]
<shock_one>
d34th4ck3r, it's just yet another character. _c and c are different variables
<shock_one>
d34th4ck3r, it usually means that a variable is part of implementation and shouln'd be accessible from the outside
havenwood has joined #ruby
b6 has joined #ruby
<d34th4ck3r>
shock_one: thanks
<b6>
is there an idiom for getting values from nested hashes when you're not sure all the keys exist? like h[a][b][c] when you're not sure h.has_key?(a), etc.
<shock_one>
d34th4ck3r, no problem
ahokaomaeha has quit [Ping timeout: 252 seconds]
statarb3 has joined #ruby
<shock_one>
b6, just test for nil afterwards.
<b6>
shock_one: yeah, i can do it, i just mean it's ugly.
<b6>
surely there's an elegant way.
relixx has joined #ruby
<shock_one>
b6 what do you want it to do?
zigomir_ has joined #ruby
<b6>
shock_one: it's just, you end up with code like if r0 = h[a] and r1 = r0[b] and r2 = r1[c]
<b6>
or you repeat the lookups over and over.
<b6>
there's probably something like tap that only continues the execution if the previous result was nonnil.
kidoz has quit [Remote host closed the connection]
<prtksxna>
b6: Will it make the querying easier if you use rassoc?
<shock_one>
b6, there is a try method if you use rails
<b6>
prtksxna: dunno, lemme read about that. never heard of it.
<shock_one>
b6, some languages allow you to call methods on nil, like Objective C or SmallTalk, but not Ruby. You can also rescue NoMethodError but I don't think you're going to like it.
<prtksxna>
shock_one: rescuing on NoMethodError, reminds me of that presentation on Ruby and JS called "wat"
<shock_one>
banisterfiend, you're right. At least filter returns a hash.
lewellyn has joined #ruby
<lewellyn>
good morning. :)
<lewellyn>
i'm trying to compile ruby for a posix system which doesn't have setmode() (which isn't part of posix). io.c uses setmode() without an ifdef. i was wondering if anyone knew of this having been encountered previously.
<lewellyn>
i'm not finding such :(
zzing has joined #ruby
relixx has quit [Quit: relixx]
kristofers has joined #ruby
zomgbie has joined #ruby
zzing has quit [Ping timeout: 256 seconds]
lkba has joined #ruby
marr has joined #ruby
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
erry has quit [Ping timeout: 624 seconds]
elkclone has joined #ruby
elkclone has quit [Remote host closed the connection]
kmurph has quit [Quit: kmurph]
elkclone has joined #ruby
m8 has joined #ruby
ferdev is now known as ferdev|away
mahmoudimus has quit [Quit: Computer has gone to sleep.]
hbpoison has quit [Read error: No route to host]
Kuifje has joined #ruby
Kuifje has quit [Changing host]
Kuifje has joined #ruby
relixx has joined #ruby
qpf has joined #ruby
francisfish has joined #ruby
anderse has quit [Quit: anderse]
LouisRoR has quit [Ping timeout: 246 seconds]
joeycarmello has joined #ruby
nfk has joined #ruby
sepp2k has joined #ruby
alexturner has joined #ruby
banisterfiend has quit [Remote host closed the connection]
erry_ has joined #ruby
nfk has quit [Remote host closed the connection]
nfk has joined #ruby
BrindleFly has joined #ruby
joeycarmello has quit [Ping timeout: 244 seconds]
erry_ is now known as erry
rheoli has joined #ruby
reset has quit [Quit: Leaving...]
nfk has quit [Remote host closed the connection]
ferdev|away is now known as ferdev
Nisstyre-laptop has quit [Quit: Leaving]
<shevy>
lewellyn hehe
<shevy>
brave man
<shevy>
come to linux!
<poseid>
hmm
<shevy>
leave your dark side
<poseid>
now [{:a=>{:d=>1}}, {:a=>{:e=>2}}]
<lewellyn>
shevy: the target is non-linux ;)
<lewellyn>
embedded++
<poseid>
how to make [:d =>1, :e => 2]
<poseid>
how to make {:d =>1, :e => 2}
zzing has joined #ruby
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
tobstarr has joined #ruby
ahokaomaeha has joined #ruby
<tobstarr>
hey
arturaz has quit [Remote host closed the connection]
<lewellyn>
that actually looks very vaguely familiar
<Nom->
ii openssl 1.0.1c-3ubuntu2 amd64 Secure Socket Layer (SSL) binary and related cryptographic tools
<lewellyn>
hm.
elkclone has quit [Quit: It's never too late to unplug and run.]
<lewellyn>
it looks like something i saw with one of the 1.0.0 versions a while back
<lewellyn>
upgrading to the latest patchlevel fixed it.
<Nom->
Well the fun part is that this particular vendor supplied library is linked against openssl 0.9.8
<Nom->
So i've got both installed
<lewellyn>
oh.
<Nom->
I wish they'd just be nice and supply source code :(
<lewellyn>
so are you mixing 0.9.8 and 1.0.1 at the same time? that's a feasible reason for a segfault.
pyrac has joined #ruby
<Nom->
Not by choice
joeycarmello has joined #ruby
<lewellyn>
it doesn't help that useful info is "<optimised out>"
anderse has joined #ruby
<shevy>
hehehe
<shevy>
VERSION MISMATCH FUN!!!
<Nom->
Yeah, it's most certainly openssl though... I've got a short script now where I can comment out securerandom and a single call to it and the segfault stops
<lewellyn>
i'm tempted to blame ubuntu's patches to openssl just because openssl is so fragile :)
<Nom->
I'm debating blatting Ubuntu's openssl with the vendors'
<shevy>
folks on ubuntu should never compile anything
<lewellyn>
good thing i'm not on ubuntu! :D
vlad_starkov has quit [Ping timeout: 240 seconds]
<Nom->
But that could create just as many problems as it solves
main has joined #ruby
<lewellyn>
Nom-: you're compiling your own ruby?
<Nom->
via RVM
<shevy>
hehehehe
<shevy>
there was once a king trying to build a castle
<shevy>
he used sand
<lewellyn>
Nom-: well, i was going to suggest ensuring it finds your preferred ssl first
<lewellyn>
but i don't know how to tell rvm to do so
<Nom->
Well it's a linker thing rather than openssl afaik
<Nom->
And given it's dymanically linked I can just drop others in
<lewellyn>
er.
<lewellyn>
0.9.8 and 1.0.1 are incompatible. you can't just swap them.
joeycarmello has quit [Ping timeout: 276 seconds]
<Nom->
No I mean differing versions of 0.9.8
<lewellyn>
oh
erry has joined #ruby
<Nom->
The vendor has supplied a .so of 0.9.8x it seems and Ubuntu has 0.9.8o
<lewellyn>
that "should" work.
<lewellyn>
in any case, it's a matter of convincing rvm to find the preferred openssl
<Nom->
I shall uninstall the ubuntu package and try :P
erry has quit [Read error: Connection reset by peer]
<shevy>
ack
<shevy>
you try to flee from the ubuntu prison
<shevy>
you are a bad boy
erry_ has joined #ruby
<shevy>
one day you may end up wanting to compile everything from source :(
<lewellyn>
or you could be as bad as me... don't do that...
<shevy>
yeah lectrick is a bad ass C hacker
<shevy>
but one day I'll come to you guys, it's just that ruby is so much nicer than C
* lewellyn
can type uname into 8 different ssh sessions and get 8 wildly different uname results.
<lewellyn>
and almost every one is cross-compiling to the same target
Agis__ has quit [Quit: Agis__]
<shevy>
hehe
kofno has quit [Read error: Connection reset by peer]
<shevy>
how do you cross compile? do you use .sh scripts?
<lewellyn>
well, autoconf is generally good at it these days.
<lewellyn>
ruby is giving me some issues atm though
<lewellyn>
see my earlier question about setmode :)
<Nom->
I haven't seriously tackled with C in a long time... my day to day is Perl (and i hate it)
<Nom->
Trying to effect change towards Ruby and need to get this library going to make that happen
<lewellyn>
perl is a pain and a half to cross-compile :(
<shevy>
Nom- whoa cool
<shevy>
a perl guy trying to push for migration towards ruby
kofno has joined #ruby
<Nom->
Well you'd have to be a mad man to go the other way :P
<shevy>
lewellyn, I am also having fun ... trying to compile qt 4 right now, it whines about gold-linker
<shevy>
I really hope llvm annihilates gcc one day
<lewellyn>
shevy: haha. my target has qt4 already as part of the core os!
fedza has joined #ruby
* lewellyn
sticks out his tongue
<lewellyn>
and llvm won't annihilate gcc till it supports arm better
<shevy>
pffft arm
poseid has quit [Ping timeout: 245 seconds]
<lewellyn>
arm isn't exactly a minor target, you realize ;)
<shevy>
we desktop users are being attacked
erry_ is now known as erry
<Nom->
Ack. Still segfaults with vendor lib
<shevy>
isn't arm for those cheap folks who cant afford a proper CPU?
<lewellyn>
arm doesn't preclude desktop
<lewellyn>
arm does 64 bit now!
TheFuzzball has joined #ruby
<shevy>
I tell you, this mobile sector is a huge disease
<shevy>
ubuntu unity wtf
<shevy>
the only real way to reduce the amount of bugs is to find those developers and shoot them
<lewellyn>
shevy: llvm still sucks on POWER, too, iirc
SeySayux has joined #ruby
Takehiro has joined #ruby
chussenot has quit [Quit: chussenot]
Agis__ has joined #ruby
Villadelfia has joined #ruby
<lewellyn>
supporting a platform doesn't necessarily mean it does as well as even gcc ;)
<shevy>
yeah but it has momentum
<shevy>
and gcc was in decline even before llvm
<Nom->
Yep, so openssl.so (from ruby) is linked against 1.0.0 as suspected
<Nom->
How the heck am I going to get this sorted :/
<lewellyn>
gcc was in decline in the 90s
<shevy>
hehehe
<shevy>
at least I could get gcc 4.0.4 to compile
<shevy>
now you need mpfr mpc and gmp work properly before to even try
<lewellyn>
i'm talking 2.8ish
<Nom->
I guess my best bet is going back to the vendor and trying to get a client built against openssl 1.0.0
chussenot has joined #ruby
<Nom->
Otherwise downgrade Ubuntu
<lewellyn>
Nom-: or ensuring that the ruby you're building links against the desired openssl...
<lewellyn>
and why is it linked against 1.0.0? you said you have 1.0.1
aaronmcadam has joined #ruby
<Nom->
ii libssl1.0.0:amd64 1.0.1c-3ubuntu2 amd64 SSL shared libraries
<Nom->
Ubuntu has this nasty habit lately of not updating the package and filename versions
berserkr has joined #ruby
<lewellyn>
yet you use it anyhow.
<Nom->
Like for the kernel... the package is version 3.5.0 but it's actually based on 3.5.somethign
emocakes has joined #ruby
<Nom->
Well, our company is standardized on Ubuntu
<lewellyn>
i'm glad i don't have that problem! :D
<emocakes>
ouch, poor company Nom-
workmad3 has joined #ruby
<Nom->
We are looking at how we're going to do stuff going forward though... I'm toying around with the idea of doing Private PaaS
crackfu has joined #ruby
<Nom->
So if anyone has any ideas... only requiremenets are needs to run Ruby & Java (Perl is a massive bonus) and allow us to use custom C libraries like this one from TIBCO and IBM DB2 as well :P
<lewellyn>
db2++
<Nom->
I hate their driver
<lewellyn>
that's the first thing you've mentioned that i agree with :D
<lewellyn>
yeah. but db2 itself is pretty sane.
<Nom->
Yah
<lewellyn>
no database is perfect, alas.
<Nom->
But a 250MB client driver? Really?
<lewellyn>
it does $everything though
<Nom->
And if you want the Perl DBI client to work, you need the 900MB complete client
<lewellyn>
blame perl for that ;)
<Nom->
I blame IBM for taht... they wrote the Perl driver :P
<lewellyn>
hey. i'm trying to help convince you to switch from perl!
<lewellyn>
fwiw i can confirm that aside from one minor quirk (which you probably ran into on ubuntu), rhel handles db2 nicely.
<lewellyn>
(the quirk is that it expects inittab to work)
Agis__ is now known as yozieor
<emocakes>
Nom-, why on earth would you use ubuntu for PaaS?
<emocakes>
and dont say heroku use it. you aren't heroku :p
<Nom->
We don't ... we're using Ubuntu today ... I'm trying to push some discussions about going down a Private PaaS route ... possibly with something like ActiveState Stackato
<emocakes>
SmartOS
<emocakes>
is awesome
<emocakes>
btw
<emocakes>
you should check it out
<emocakes>
like, seriously have a good hard look at it
<emocakes>
i love it
<lewellyn>
emocakes: how well does it run db2? ;)
<lewellyn>
(i know the answer)
petersaints_ has joined #ruby
<yozieor>
why do people say you can't do parallelism in mri?
<Nom->
yozieor: Because you can't really unless the tasks are I/O bound? :P
petersaints has quit [Ping timeout: 257 seconds]
<Nom->
Running DB2 itself isn't the issue... we just need to be able to compile and install the client driver for the apps to use
<Nom->
I don't see us changing away from VMWare any time soon for the Hypervisor though :P
<emocakes>
lewellyn, nfi ;)
<yozieor>
Nom-: why must the tasks be IO bound?
<emocakes>
lewellyn, but you can put rhel in a KVM on it
zigomir has quit [Quit: zigomir]
<emocakes>
so no issue
<lewellyn>
Nom-: db2 is FAR better supported on sparc than x86-64 for solaris. be forewarned.
<Nom->
yozieor: The GIL (different name in 1.9) still prevents multiple blocks of code running concurrently... and you can't extend past a single CPU within a single process
<yozieor>
Nom-: but you can spawn processes, right? and they can be running in parallel
hamed_r has joined #ruby
joeycarmello has joined #ruby
<Nom->
Yeah... server side we've got a full AIX Stack from IBM for that :P
<Nom->
yozieor: Yes, fork to parallelize... that's the model under MRI at the moment... threads are *not* parallel though unless you're in JRuby or Rubinius
<emocakes>
or ironruby?
<Nom->
Don't have experience with IronRuby
<Nom->
Why would I want to run .NET ? :P
<yozieor>
Nom-: so in the end, you *can* do parallelism in mri, by using processes (and not threads).. right?
anderse has quit [Quit: anderse]
<Nom->
yozieor: Yes, but then you can't easily do things like (for example of something I do in Java all the time) a thread worker pool
niklasb has quit [Ping timeout: 252 seconds]
shock_one has quit [Ping timeout: 252 seconds]
<Nom->
yozieor: Which is probably where the argument comes from.. because it's a separate process, you then need to change the way you communicate between processes
<Nom->
ZeroMQ for the win there.
<yozieor>
Nom-: so it all comes down to the fact that some things you can do easier/better with just threads, not processes
greenarrow has joined #ruby
<yozieor>
or are there things that you *only* can do with threads
<yozieor>
?
<Nom->
You can solve nearly any problem with forks and the right methods of communication, but that adds complexity
joeycarmello has quit [Ping timeout: 276 seconds]
<Nom->
There's also a memory penalty to forking instead of threading
<yozieor>
i see..
<yozieor>
thanks, that was clarifying:)
erlingur has joined #ruby
<Nom->
No problem... there's probably other things too, but I've lived without threads in Perl for a long time... there's not much you can't do given the proper motivation and time :P
<lewellyn>
Nom-: you can build a threaded perl! </troll>
<Nom->
Yeah, but then you can't use signals, throw exceptions (ie. use 'die') and probably a stack of other things they don't advertise :P
<Nom->
Goodbye alarm/$SIG{ALRM} handlers for timeouts, as an example :P
nfk has joined #ruby
robustus has quit [Ping timeout: 248 seconds]
<lewellyn>
i guess your parser stripped the unbalanced tag ;)
Agis__ has joined #ruby
<Nom->
:)
Agis__ has quit [Client Quit]
<Nom->
I've had that argument with Perl guys a few times
crackfu has quit [Remote host closed the connection]
<Nom->
"But perl does threads!"... yeah, like hell it does :P
<shevy>
perl guys use an inferior language
Beoran_ has quit [Ping timeout: 245 seconds]
chussenot has quit [Quit: chussenot]
anderse has joined #ruby
crackfu has joined #ruby
robustus has joined #ruby
<shevy>
php kicked perl in the arse
<shevy>
:(
<Zelest>
totally related to ruby :D
<lewellyn>
Nom-: people who have been around perl a while say it in jest or they attach lots of caveats quickly.
yozieor has quit [Ping timeout: 256 seconds]
<Nom->
lewellyn: about perl doing threads, or attacking it because it doesn't really? :P
kmurph has joined #ruby
chussenot has joined #ruby
<Nom->
Probably getting a bit off topic by this point :P
<lewellyn>
at some point, ruby will have some wart as bad as perl's threads. that is just par for the course after a long time and having to support a bajillion configurations
pac1 has joined #ruby
<lewellyn>
Nom-: note that i was trying to stay somehow on topic ;)
anderse has quit [Client Quit]
<Nom->
Ruby already has it's quirks, but the fact there's multiple implementations might be the saving grace
cisco has joined #ruby
<lewellyn>
well, revisit that after ruby's a quarter-century old :)
<shevy>
Zelest well we are all a big scripting family after all, we must look at competition and see if they do something better
<Nom->
One day when JRuby isn't so slow, or Rubinius is compatable enough to use just about everything you can use in MRI...
<shevy>
rubinius lost its momentum
<Nom->
Anyway, circling back to my earlier segfault problem, it seems RHEL 6.3 has openssl 1.0.1, so there's a better than even chance TIBCO will have released their software built against it
* Nom-
can hope
crackfu has quit [Ping timeout: 248 seconds]
<lewellyn>
Nom-: good luck ;)
workmad3 has quit [Ping timeout: 252 seconds]
sambio has joined #ruby
<Nom->
Just need to wait until Monday to get access to the download site again... our database guys don't give the credentials out :(
<lewellyn>
sadly i can't provide more help than that since you're lacking things which may provide clues :(
<mcatch>
Can someone help me understand this? I'm trying to prove Ruby's passing of arguments to functions, and whether it's by value or by reference, but my proof is showing it can be both? https://gist.github.com/anonymous/4745373
<mcatch>
essentially, if i set an argument to a value, and check that value after the function, it's not changed... but if I use a Bang method on the argument, it is changed
samphippen has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby
workmad3 has joined #ruby
<mcatch>
does this essentially mean that a bang method is a special case, returning a reference to the "banged" object, and the assignment operator simply returns a copy of the "changed" argument?
kristofers has joined #ruby
_nitti has quit [Remote host closed the connection]
kristofers has quit [Client Quit]
arya has quit [Ping timeout: 248 seconds]
kristofers has joined #ruby
jamescarr has quit [Quit: jamescarr]
CodeGnome has joined #ruby
baphled_ has joined #ruby
<banisterfiend>
mcatch: no, ruby is pass by value, but what is passed is the reference
tk_ has quit [Quit: ばいばい]
arya has joined #ruby
<mcatch>
hmm
<mcatch>
not sure it's clicking in my head. so passing a local variable to a method, and setting that variable inside the method does not change the value of that method
<mcatch>
but banging the argument does change the value of it
baphled has quit [Ping timeout: 256 seconds]
<mcatch>
why is bang so special? isn't it just assigning something to the argument under the hood?
hmarr has joined #ruby
poga has joined #ruby
<arturaz>
mcatch, because bang is mutating the thing under the ref
<mcatch>
and assigning it isn't?
<mcatch>
what special operator is banging using under the hood that isn't an assign?
whitedawg has joined #ruby
<banisterfiend>
mcatch: no assigning isn't
kofno has quit [Remote host closed the connection]
alx- has joined #ruby
<banisterfiend>
mcatch: assigning doesn't affect the object at all, it just associates another variable to that object
<banisterfiend>
mcatch: x = y = z = obj
<banisterfiend>
mcatch: x, y and z all point to object
<banisterfiend>
x = other_obj
reppard has quit [Ping timeout: 244 seconds]
<banisterfiend>
now the x variable points at other_obj
<banisterfiend>
mcatch: it has *no effect* on obj (which x used to point to)
joeycarmello has joined #ruby
<mcatch>
correct, that i understand
<banisterfiend>
"because bang is mutating the thing under the ref" yet you said "and assigning it isn't?" in response to arturaz's comment :)
vlad_starkov has quit [Remote host closed the connection]
<jokke>
hi, how can i match something in a regexp that can be anything except an " or ' unless it's preceeded with a \ ?
<mcatch>
hmm, still not making myself clear i guess. let me try another way
<mcatch>
i'm not doubting you guys btw, i'm sure you're right and i'm wrong, i just need to understand why
<mcatch>
let me think of another way to explain myself
arietis has quit [Quit: Computer has gone to sleep.]
<arturaz>
jokke, ([^\\][^"']) ?
apeiros_ has quit [Remote host closed the connection]
mityaz has joined #ruby
ninegrid has quit [Ping timeout: 255 seconds]
poga has quit [Remote host closed the connection]
<shevy>
hmmm /([p3nis])/
joeycarmello has quit [Ping timeout: 260 seconds]
<shevy>
wheee, bluefish 2.2.4 is out
ninegrid has joined #ruby
<shevy>
I am using a "HTML editor" for ruby
<mcatch>
banisterfiend: ok, here's probably a simpler example
<mcatch>
banisterfiend: (assume str is an argument to a method in the following two examples) str = str.downcase # does not change the value of input argument 'str'
havenwood has joined #ruby
<mcatch>
str.downcase! # DOES change the value of input argument 'str'
<banisterfiend>
mcatch: because downcase makes a copy
<mcatch>
what exactly is ruby doing under the hood on a downcase! that is different than an assignment?
colonolGron has joined #ruby
<banisterfiend>
mcatch: downcase! does not make a copy, it mutates the object itself, that's why it has the !
<banisterfiend>
mcatch: it's more the other way round
<mcatch>
do they reveal it to us? the exact syntax?
liquid-silence has quit [Quit: Computer has gone to sleep.]
Pandaen has quit [Remote host closed the connection]
<mcatch>
is there a practical usecase for the 'unless' keyword? a situation in which a simple negation in an if condition wouldn't be easier on the eyes?
pskosinski has joined #ruby
EvanR has joined #ruby
arya has quit [Ping timeout: 248 seconds]
EvanR is now known as Guest16700
Umren has joined #ruby
Jon30 has joined #ruby
erry__ has joined #ruby
<shevy>
mcatch unless is very much like ! if
<shevy>
I mean
<shevy>
if !
<mcatch>
yep, ok
<mcatch>
thanks
<shevy>
sometimes one has to use parens for if ! though
<poseid>
which could then be merged into [{:b=>10, :c=>20}, {:f=>10, :d=>20}] ?
freakazoid0223 has joined #ruby
BrindleFly_ has joined #ruby
<clj_newb>
Hi, if in bash I see output from, let's say, echo $MY_VAR, then to read that var from the same bash session ENV['MY_VAR'] would suffice, isn't it? or am I missing something
<kraljev>
what ruby version will clear this date/time/datetime mess?
<poseid>
the dates are the "shared" stuff like the :a above
eldariof has joined #ruby
jonahR has joined #ruby
hmarr has quit [Quit: Computer has gone to sleep.]
joeycarmello has joined #ruby
erry__ is now known as erry
jerikl has joined #ruby
<Hanmac>
kraljev what excactly is your problem? heftig shows you want you need to do, you are only to lazy to type that??
jamescarr has quit [Quit: jamescarr]
<kraljev>
Nooo....
<kraljev>
I'm ranting about illogical date objects
<kraljev>
On completely unrelated topic
<heftig>
you could use Time.parse, but you'd lose the sub-second information
<Hanmac>
that postgre use feaky & shitty state formats is not rubys fault ... and an good database binding should take care about that and automatic convert it
<heftig>
ah, never mind, you don't
Takehiro has joined #ruby
<heftig>
and it's not called postgre
aapzak has quit [Read error: Connection reset by peer]
<kraljev>
but let's face it, ruby has separate date and time object, completelly unnecessary
joeycarmello has quit [Ping timeout: 245 seconds]
workmad3 has joined #ruby
<heftig>
well, Time is part of core (though Time.parse isn't). Date/DateTime are stl
<heftig>
er, stdlib
BrindleFly has quit [Quit: BrindleFly]
volte has quit [Ping timeout: 252 seconds]
jamescarr has joined #ruby
joneshf-laptop has quit [Ping timeout: 264 seconds]
<jerikl>
kraljev: separate Date and Time objects are causing you issues?
<kraljev>
Not exactly issues, but inconvenience
niklasb has quit [Ping timeout: 255 seconds]
palyboy has quit []
<jerikl>
how so?
dmiller has joined #ruby
<kraljev>
Time object can also store date as it is time_t internally
<poseid>
Hanmac... ok, using inject asks for some practice...
<kraljev>
They could make only one boject
oscardelben has joined #ruby
colonolGron has joined #ruby
<kraljev>
But postgres has terible bindings :)
<kraljev>
How to parse array string
<kraljev>
'{1,2,3}'
<jerikl>
okay, but what are you trying to do? oh, so it's more of the postgres bindings that's the issue?
<kraljev>
don't say regex
<kraljev>
:)
mityaz has joined #ruby
aapzak has joined #ruby
<kraljev>
SELECT ARRAY[1,2,3]
megha has joined #ruby
<kraljev>
returns {1,2,3} as string
jrajav has joined #ruby
<heftig>
then the bindings suck
<heftig>
are you using 'pg' bindings?
<kraljev>
yes
<kraljev>
but i guess it is a database limitation
nomenkun has joined #ruby
<kraljev>
unless you make another query
<kraljev>
you cannot know the type of the result columns
mityaz has quit [Client Quit]
<heftig>
kraljev: SELECT unnest(ARRAY[1,2,3])
<kraljev>
yes, in this example
aaronmcadam has quit [Ping timeout: 248 seconds]
<kraljev>
but sometimes you have array stored in a field
<poseid>
what do you think the ||= Array.new is it OK ?
mityaz has joined #ruby
<kraljev>
||= [] is cleaner
arietis has joined #ruby
<poseid>
I see
<poseid>
ok.
<CmdrTallen>
Any ruby + mongodb suggestions, tips, comments?
<poseid>
ok... need to take a break...
<poseid>
see you later...
<poseid>
thanks!
<jblack>
How do I get the instance variable of what's including my module in included?
mattbl has quit [Quit: This computer has gone to sleep]
jamescarr has quit [Quit: jamescarr]
cawaker has joined #ruby
hmarr has quit [Quit: Computer has gone to sleep.]
<kraljev>
what is the difference between escape_bytea() and escape_string(), pg postgres binding
* lewellyn
grumbles
<lewellyn>
./ext/extmk.rb:228:in `extmake': undefined method `prepend' for #<String:0x2b4e9f80e8a0> (NoMethodError)
pu22l3r has joined #ruby
poseid has quit [Ping timeout: 245 seconds]
<lewellyn>
i suppose that's progress!
therod has quit [Quit: Leaving...]
HardFu has quit [Read error: Connection reset by peer]
abcdefg_ has joined #ruby
hmarr has joined #ruby
Jon30 has quit []
mattbl has joined #ruby
crackfu has joined #ruby
<Hanmac>
lewellyn it shows that your ruby version is to old
freakazoid0223 has quit [Read error: Connection reset by peer]
mattbl has quit [Client Quit]
abcdefg_ has quit [Client Quit]
<lewellyn>
Hanmac: well, this is while compiling ;)
<lewellyn>
i wasn't even aware the build host had ruby till i got the error
<davidokner>
So are software engineers/companies going to be able to compete with other countries like India and emerging markets?
BrindleFly has joined #ruby
kmurph has quit [Quit: kmurph]
hmarr has quit [Client Quit]
<jblack>
I can't figure out the proper way to do this. It shouldn't be this hard!
<lewellyn>
of course it should. it puts hair on your chest. ;)
* jblack
cries like a girl
<jblack>
=)
<davidokner>
Why did countries like India choose to get into software development so much and not other things they could have done?
mattbl has joined #ruby
stormetrooper has joined #ruby
<jblack>
I'm trying to come up with a clean way to include code into classes and run the included methods without knowing the names of the methods beforehand
<Dwarf>
Heya, I'm fiddling with rails and I have made a link, and as text I wish to display «
<Dwarf>
But instead of using the HTML entity it literally prints «
<Dwarf>
How do I change that?
<jblack>
for example, I might have 2 or 3 modules that might want to include to tune a search phrase. another module or two to tune search results.
<Hanmac>
Dwarf #rubyonrails
therod has joined #ruby
crackfu has quit [Remote host closed the connection]
jacktrick has joined #ruby
crackfu has joined #ruby
<heftig>
Dwarf: if your website uses utf8 you could just use
<heftig>
«
<jblack>
My original thought I'd just use modules and included to have the module add itself to a hash that lists callbacks at key points in a class, so that it can modify the class instance.
crackfu has quit [Read error: Connection reset by peer]
mattbl has quit [Client Quit]
angusigu1ss has joined #ruby
skattyadz has joined #ruby
crackfu has joined #ruby
angusiguess has quit [Ping timeout: 245 seconds]
<Dwarf>
Aye, but I prefer to use html entities for maximum compatibility
uxp has quit [Quit: Lost terminal]
<jblack>
e.g. in module FixSearchString, it would do something like @injections[:start] << method(FixSearchString.dowork)
uxp has joined #ruby
jonahR has quit [Quit: jonahR]
<jblack>
that's within included. But I can't figure out how to get to the actual instance that's doing the actual include, so that I can add to the callbacks
blaxter has joined #ruby
LouisRoR has joined #ruby
Philpax has quit [Read error: Connection reset by peer]
<Hanmac>
jblack: FixSearchString.method(:dowork) and define the dowork method as class method
<lewellyn>
hm. is there a good repo for rhel-6-alikes to have a modern ruby? i thought i had one somewhere but i can't think of which server it'd be on.
DerekPow has quit [Ping timeout: 244 seconds]
therod has quit [Quit: Leaving...]
uxp has quit [Client Quit]
nimred has quit [Ping timeout: 260 seconds]
nimred has joined #ruby
wallerdev has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<jblack>
I got it!!
eka has joined #ruby
banisterfiend has joined #ruby
<jblack>
I'm using extend instead, and I perform the extend inside of the instande itself, in initialize.
<sterk>
Are there anything like instance_variable_get for class constants? Or any other way of getting a constant by its name as string?
wallerdev has quit [Client Quit]
<banisterfiend>
sterk: const_get
mcqueenorama has quit [Remote host closed the connection]
Pandaen has joined #ruby
wallerdev has joined #ruby
eka has quit [Client Quit]
<sterk>
banisterfiend: Thanks
J-_-L has joined #ruby
mattbl has joined #ruby
nimred has quit [Ping timeout: 246 seconds]
<lewellyn>
grumble.
<lewellyn>
executable host ruby is required. use --with-baseruby option.
<lewellyn>
:(
hadees has quit [Ping timeout: 276 seconds]
quest88 has quit [Quit: quest88]
<Hanmac>
lewell yeah you need ruby to build ruby :P
onemanjujitsu has joined #ruby
icantbecool has joined #ruby
robotmay has quit [Remote host closed the connection]
<moofy>
if i'm using textile or markdown to write a thing, what might be a good way to add a custom tag?
<moofy>
i want to come up with a way of adding sidebar text but i'm not sure how to approach it
otters has joined #ruby
otters has quit [Client Quit]
ahokaomaeha has quit [Ping timeout: 276 seconds]
otters has joined #ruby
<abcdefg>
yes
joeycarmello has quit [Ping timeout: 252 seconds]
poga has quit [Remote host closed the connection]
Opettaja has quit [Client Quit]
Vert has joined #ruby
otters has quit [Client Quit]
rdark has quit [Ping timeout: 255 seconds]
ahokaomaeha has joined #ruby
albakry has joined #ruby
albakry has quit [Changing host]
albakry has joined #ruby
<Amnesia>
question, I'm "tailing" stdout, and I somehow need to detect whether there's no output anymore
<Amnesia>
how could I achieve this?
<Amnesia>
=~ /^$/ isn't an option
eldariof has joined #ruby
<bean>
"whether there's no output anymore" man, that is a hard sentence to parse.
otters has joined #ruby
nobuoka has quit [Quit: Leaving...]
<bean>
Amnesia, what sort of data are you tailing?
otters has quit [Client Quit]
<Amnesia>
bean: stdout using PTY
otters has joined #ruby
arya has quit []
decoponio has quit [Quit: Leaving...]
hackeron has joined #ruby
arya has joined #ruby
colonolGron has joined #ruby
kraljev has quit [Ping timeout: 255 seconds]
cableray has joined #ruby
mercwithamouth has joined #ruby
Opettaja has joined #ruby
banisterfiend has joined #ruby
<Jeaye>
I'm currently using CGI (and looking into FastCGI) for some basic Ruby scripts on my website. One thing I'd like to do is a progress bar for uploading files. I'd wager this can't be done with CGI, since it's a serial call that happens before the HTML is shown. What's the easiest way to do dynamic graphics with Ruby in a web browser that's relatively performant and portable?
shevy has quit [Read error: Operation timed out]
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
PanPan has quit [Read error: Connection reset by peer]
<canton7>
tuixy, #rubyonrails
<tuixy>
it's a ruby question
<canton7>
(unless it is a syntax question and not a rails one)
<canton7>
cool
PanPan has joined #ruby
Fretta has quit [Ping timeout: 248 seconds]
<tuixy>
can anyone explain me why it uses self.current_user (which I believe is a class var), @current_user (which is a instance var) and current_user (which is a local var)?
yankeefan04 has joined #ruby
<tuixy>
it seems it works, but I don't know why
<canton7>
current_user refers to the method, if there isn't a local variable of that name
yankeefan04 has left #ruby [#ruby]
p2w has joined #ruby
<tuixy>
ah, ok.. sure
<tuixy>
same for self.current_user
<canton7>
likewise self.current_user from inside a method is reffering to the current_user= method
<tuixy>
I guess that if you put current_user = foo in the first method, it defines a local variable instead
<tuixy>
is it correct?
<canton7>
yeah
maz-dev has joined #ruby
<tuixy>
ok, thanks ;)
workmad3 has quit [Ping timeout: 260 seconds]
maxmanders has joined #ruby
<canton7>
one thing about ruby that I don't likle tbh :P
<canton7>
*like
<tuixy>
yeah, it's a bit confusing first time you see it all together
<sterk>
What's the best way to get all items from an array that matches a certain condition? Something like arr.collect {|x| x if x > 10}, but that doesn't give a nil for x <= 10.
<sterk>
canton7: Thank you, #select seems to be just what i need
tommyvyo has joined #ruby
<canton7>
:)
<canton7>
#select and #map are, between them, incredibly powerful
<canton7>
(and much easier on my eyes than list comprehensions)
kmurph has quit [Quit: kmurph]
caleb_io has joined #ruby
shevy has joined #ruby
snearch has joined #ruby
Opettaja has quit [Read error: Connection reset by peer]
albakry has quit [Read error: Operation timed out]
mercwithamouth has quit [Ping timeout: 240 seconds]
snearch has quit [Max SendQ exceeded]
<Jeaye>
I don't see how FastCGI works. I have the fcgi gem, but I'd imagine FastCGI as a daemon and not a gem. o.O Seems to be no online documentation for it either.
joeycarmello has joined #ruby
brady has joined #ruby
iamjarvo has joined #ruby
brady has quit [Client Quit]
Opettaja has joined #ruby
hmarr has joined #ruby
epitron has quit [Ping timeout: 240 seconds]
anderse has quit [Quit: anderse]
peteyg has quit [Ping timeout: 248 seconds]
albakry has joined #ruby
gosshedd has quit [Ping timeout: 260 seconds]
stormetrooper has quit [Quit: Leaving]
joeycarmello has quit [Ping timeout: 256 seconds]
epitron has joined #ruby
peteyg has joined #ruby
gosshedd has joined #ruby
subbyyy has joined #ruby
nomenkun has joined #ruby
crackfu has quit [Remote host closed the connection]
crackfu has joined #ruby
LouisRoR has quit [Ping timeout: 248 seconds]
Fretta has joined #ruby
banister_ has joined #ruby
banisterfiend has quit [Ping timeout: 245 seconds]
Guest34984 is now known as juzprawiedaz
joeycarmello has joined #ruby
stormetrooper has joined #ruby
abcdefg has quit [Quit: ChatZilla 0.9.90 [Firefox 17.0.1/20121128204232]]
crackfu has quit [Ping timeout: 252 seconds]
nomenkun has quit [Ping timeout: 252 seconds]
generalissimo has quit [Remote host closed the connection]
arya_ has joined #ruby
jerikl_ has joined #ruby
arya has quit [Ping timeout: 248 seconds]
txdv has quit [Ping timeout: 246 seconds]
ferdev|away is now known as ferdev
stormetrooper has quit [Client Quit]
stormetrooper has joined #ruby
pdamer has joined #ruby
txdv has joined #ruby
stormetrooper has quit [Client Quit]
goraxe has quit [Ping timeout: 252 seconds]
stormetrooper has joined #ruby
BrindleFly has joined #ruby
hmarr has quit [Quit: Computer has gone to sleep.]
browndawg1 has left #ruby [#ruby]
snearch has joined #ruby
snearch has quit [Max SendQ exceeded]
BrindleFly has quit [Client Quit]
snearch has joined #ruby
hmarr has joined #ruby
snearch has quit [Max SendQ exceeded]
snearch has joined #ruby
jerikl_ has quit [Quit: jerikl_]
stormetrooper has quit [Quit: Leaving]
joofsh has joined #ruby
Cymurai has quit [Quit: Leaving]
berserkr has quit [Quit: Leaving.]
snearch has quit [Max SendQ exceeded]
pdamer has quit [Quit: pdamer]
snearch has joined #ruby
subbyyy has quit [Ping timeout: 245 seconds]
nazty has quit [Read error: No route to host]
nazty has joined #ruby
adambeynon has joined #ruby
snearch has quit [Max SendQ exceeded]
eka has joined #ruby
subbyyy has joined #ruby
otters has quit [Quit: WeeChat 0.3.9.2]
weasels has joined #ruby
weasels has quit [Client Quit]
otters has joined #ruby
otters has quit [Client Quit]
snearch has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
colonolGron has quit [Quit: leaving]
colonolGron has joined #ruby
snearch has quit [Max SendQ exceeded]
otters has joined #ruby
Virunga has joined #ruby
weasels has joined #ruby
Virunga has quit [Read error: No route to host]
weasels has quit [Client Quit]
Virunga has joined #ruby
otters has quit [Client Quit]
otters has joined #ruby
subbyyy has quit [Ping timeout: 260 seconds]
otters has quit [Client Quit]
albakry_ has joined #ruby
albakry_ has quit [Client Quit]
otters has joined #ruby
Chryson has joined #ruby
albakry_ has joined #ruby
otters has quit [Client Quit]
otters has joined #ruby
Morkel has quit [Read error: Connection reset by peer]
albakry has quit [Ping timeout: 255 seconds]
chrishough has joined #ruby
wyhaines has quit [Ping timeout: 245 seconds]
Morkel has joined #ruby
albakry has joined #ruby
albakry has quit [Read error: Connection reset by peer]
mityaz has joined #ruby
jamescarr has joined #ruby
albakry_ has quit [Ping timeout: 248 seconds]
txdv_ has joined #ruby
weasels has joined #ruby
txdv has quit [Read error: Connection reset by peer]
weasels has quit [Client Quit]
albakry has joined #ruby
albakry has quit [Changing host]
albakry has joined #ruby
BrindleFly has joined #ruby
otters has quit [Quit: WeeChat 0.4.0]
jimeh has joined #ruby
jamescarr has quit [Ping timeout: 240 seconds]
elaptics is now known as elaptics`away
canton7 has quit [Read error: Connection reset by peer]
octoberry has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby
otters has joined #ruby
banister_ is now known as banisterfiend
snearch has joined #ruby
Virunga has quit [Remote host closed the connection]
<yfeldblum>
Es0teric, there are also Padrino, WebMachine, and Goliath
Al____ has joined #ruby
<havenwood>
or plain ole Rack apps
<Es0teric>
ok which is the best choice
<Es0teric>
out of all of them
<arturaz>
Es0teric, out of curiosity - why don't you like rails?
pyrac has quit [Quit: pyrac]
<Es0teric>
arturaz its just... wierd
<yfeldblum>
Es0teric, there is no best choice; there is only the choice that is the best match, at the time, for your needs, at the time
<arturaz>
like?
<invisime>
^
<Es0teric>
yfeldblum ok so sinatra vs rails... what are the pros and cons?
mengu_ has joined #ruby
<yfeldblum>
Es0teric, depends; what are you looking to do?
brianpWins has quit [Ping timeout: 264 seconds]
<Es0teric>
yfeldblum well for starters... i am going to create something to view books/comic books/literature on
<Es0teric>
or create a booking system of some sort
sorbo_ has joined #ruby
<yfeldblum>
Es0teric, i'm much more familiar with Rails; Rails will allow you to write normal Ruby classes and do normal object-oriented programming for the majority of the system
<Es0teric>
yfeldblum so that means the OOP i learned in PHP will be transferrable with rails?
<yfeldblum>
Es0teric, Ruby is much more OOP than PHP
<yfeldblum>
Es0teric, so, yes it is transferable, but more so :D
<Es0teric>
intresting
d34th4ck3r has quit [Ping timeout: 276 seconds]
<swarley>
iirc a lot of php's stdlib is in a procedural style
<yfeldblum>
Es0teric, Rails has plenty of helper functions that make writing apps easier, for example, `book_url(@book)` will return "http://myapp.com/books/345", where @book is an instance of class Book, which represents a record in your database in the "books" table
<Es0teric>
yfeldblum well i would be using a API for the most part
<swarley>
explode("string", "i") etc
icole_ has quit [Remote host closed the connection]
<yfeldblum>
Es0teric, what kind of API?
<swarley>
I don't know any real php though
statarb3 has quit [Read error: Connection reset by peer]
onemanjujitsu has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
yakko has joined #ruby
<Es0teric>
swarley is really barney right?
<swarley>
MY COVER IS BLOWN
<Es0teric>
and str.split is same as explode()
<swarley>
FALL BACK
<Es0teric>
swarley i watch HIMYM too lol
<Es0teric>
Swarles Barkley
qohelet_ has quit [Quit: qohelet_]
<arturaz>
Es0teric, ditch ruby, go Scala :))
<Es0teric>
arturaz man i just got into ruby
ebobby has joined #ruby
<yfeldblum>
arturaz, um ... why?
Vektur has quit [Ping timeout: 252 seconds]
<Es0teric>
yfeldblum just an api... from a third party site
<Es0teric>
i am using it to make a sample app
<Es0teric>
so i can get the feel for ruby
Morkel has quit [Quit: Morkel]
<arturaz>
yfeldblum, do you want an objective reason or the illogical one? ;)
<Es0teric>
i was thinking of using net/http
<Es0teric>
and json
Al____ has quit [Quit: Al____]
<Es0teric>
to parse the data
Vektur has joined #ruby
<yfeldblum>
arturaz, i want one that applies specifically to Es0teric's case, based on his particular needs ...
<arturaz>
Es0teric, yfeldblum, scala & play are way more scalable with futures & async io than traditional request/response cycle on which all rack-based servers are built.
<Es0teric>
arturaz for the booking system
<bbttxu>
0
<Es0teric>
i am looking for something more event based
<Es0teric>
because everything should happen in real time
<arturaz>
the illogical one - guy dislikes rails because it feels weird. So why not scala? :D
gosshedd has quit [Ping timeout: 248 seconds]
<Es0teric>
arturaz i mean, i am open to using rails
<Es0teric>
maybe it will grow on me
<swarley>
sinatra \o/
<yfeldblum>
arturaz, oh he should certainly try Scala too
<swarley>
Not for a large web app maybe..
<Es0teric>
swarley that booking system would be a huge web app
<arturaz>
Es0teric, if you're just getting data, transforming it and spewing it out, play is really built for that
danielpcox has quit [Ping timeout: 244 seconds]
<Es0teric>
i mean its 5% done in php but its difficult to get real-time results with php
Proshot has joined #ruby
<Es0teric>
arturaz no its more like... there will be invoicing, multiple users, multiple user levels
<Es0teric>
social network
<Es0teric>
shit like that
<swarley>
look at reddit's code or something
<Es0teric>
so the data would be created by the site
bkparsons has quit [Quit: bkparsons]
<yfeldblum>
Es0teric, you can certainly use threads with Ruby and Rails; you can have a multithreaded app server that handles a request in its own thread, plus each request handler can itself do IO work in worker threads too
<Es0teric>
yfeldblum so it would be more pub/sub
<Es0teric>
right?
<Es0teric>
i mean i want everything in that app to be in realtime
<swarley>
you keep saying that
<yfeldblum>
Es0teric, you can use Celluloid for an actor-based concurrency model for doing that concurrent work if you need it
<arturaz>
Es0teric, real advise - just skim over frameworks, read the docs, find one that feels right :)
<swarley>
but there are many ways to interpret it
<yfeldblum>
Es0teric, you can use Celluloid with Rails, or probably with many of the Ruby web frameworks
<swarley>
truly real time would be *very* data expensive, websockets or http-streams
<Es0teric>
swarley, let me use this example... when someone creates an event.. i want all people that are involved to instantly recieve it
<Es0teric>
*recieve
<arturaz>
yfeldblum, +1 for celluloid. We've been using it since early days successfully on our game server. Even laid my hands on some dev. Although to be honest its far from something like Akka in java-land.
<yfeldblum>
arturaz, yeah but then you need to be in java-land :D
<arturaz>
Es0teric, you want websockets?
<arturaz>
yfeldblum, or jruby
<Es0teric>
arturaz i dont mind websockets
<Es0teric>
i do plan on using HTML5
<swarley>
that sounds like something that could be done with javascript and an EventSource
<yfeldblum>
arturaz, Akka in JRuby?
<arturaz>
yfeldblum, yeah? why the question?
angusiguess has joined #ruby
<Es0teric>
swarley see i was looking at nodejs
<Es0teric>
for that
<yfeldblum>
arturaz, just asking if that's what you meant
<swarley>
no i mean
<Es0teric>
but the problem with node is that.. it only ouputs in json or text
<Es0teric>
not html
<arturaz>
yfeldblum, yes, you can use akka from jruby :)
pothibo has joined #ruby
<Es0teric>
well from the last time i used node
<swarley>
no what I'm saying is that you would create an EventSource object client side
<arturaz>
Es0teric, php gains you sort of simplicity and tons of uneducated programmers. ruby gains you nice OOP model, lots of gems and an ability to run on quite nice performance using jruby. Scala gains you static typing that helps to avoid bugs, massive performance boost, but lacks in libraries and is in general more "mathy".
<arturaz>
Determine what client-server communication you need, pick your language/framework based on that.
mityaz has quit [Remote host closed the connection]
<Es0teric>
arturaz i see
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
<Es0teric>
i mean with php i find myself using composer alot
<Es0teric>
but i mean... even that is alittle frustrating
<invisime>
it's also worth noting that the *VAST* majority of applications don't have to worry about scalability.
<sterk>
Is *[*x] a stupid thing to do if I need an array and x can be either an array or a single value? (Meaning, are there any other way I should do it?)
<Dwarf>
Without quotes of course
<M13>
ok, thanks
<Dwarf>
sterk, in what context?
<sterk>
Dwarf: (*[*x]).map { ... }
<Dwarf>
I should learn more ruby
icole has joined #ruby
mengu_ has quit [Quit: This computer has gone to sleep]
<M13>
I think my graphics card just blew up... :/
<Dwarf>
oops
grzywacz has quit [Ping timeout: 248 seconds]
qpf has joined #ruby
cyong has joined #ruby
kofno has joined #ruby
cyong has quit [Client Quit]
mengu_ has joined #ruby
arya has quit [Ping timeout: 248 seconds]
kofno has quit [Remote host closed the connection]
fjfish has joined #ruby
cyong has joined #ruby
jdstraughan has joined #ruby
<kalleth>
say i have an object, and i want to create a block using that object with every operatin inside the block operatnig on that object
<kalleth>
with @object do; save_item, do_stuff; end replacing @object.save_item, @object.do_stuff
<kalleth>
i know I can do that, not sure how
arya has joined #ruby
francisfish has quit [Ping timeout: 248 seconds]
dmiller has quit [Read error: Operation timed out]
alanp_ has joined #ruby
<arturaz>
kalleth, @object.with do; ...; end
alanp has quit [Ping timeout: 246 seconds]
<arturaz>
and with is def with(&block); instance_eval(&block); end
clj_newb has quit [Quit: Lost terminal]
<arturaz>
something along these lines
<arturaz>
you want self in the block to point to @object
<kalleth>
hmmm
seba4 has quit [Ping timeout: 248 seconds]
spider-mario has quit [Remote host closed the connection]
rakun has joined #ruby
gcoderre has joined #ruby
hackerdude has joined #ruby
chrishough has quit [Quit: chrishough]
etcetera has quit []
razibog has quit [Ping timeout: 255 seconds]
adeponte has quit [Remote host closed the connection]
workmad3 has joined #ruby
nfk has quit [Read error: Operation timed out]
banister_ has joined #ruby
kmurph has joined #ruby
palyboy has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
banister_ has quit [Read error: Connection reset by peer]
fedza_ has joined #ruby
M13 has quit [Quit: Leaving]
banisterfiend has joined #ruby
adeponte has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
idkazuma has joined #ruby
jonathanwallace1 has joined #ruby
seba4 has joined #ruby
jonathanwallace has quit [Ping timeout: 255 seconds]
kmurph has quit [Ping timeout: 252 seconds]
gcoderre has quit [Quit: gcoderre]
fedza has quit [Ping timeout: 255 seconds]
nfk has joined #ruby
chrishough has joined #ruby
caleb_io has quit [Quit: caleb_io]
apok has joined #ruby
arya has quit [Ping timeout: 248 seconds]
angusiguess has joined #ruby
caleb_io has joined #ruby
techlife has quit [Read error: Connection reset by peer]
adeponte has quit [Remote host closed the connection]
arya has joined #ruby
techlife has joined #ruby
icole has quit [Remote host closed the connection]
mengu_ has quit [Quit: This computer has gone to sleep]
tjbiddle has joined #ruby
baphled_ has quit [Ping timeout: 255 seconds]
hmarr has quit [Quit: Computer has gone to sleep.]
cawaker has quit [Remote host closed the connection]
cawaker has joined #ruby
apok has quit [Quit: apok]
<jokke>
is there a clever way to group an array of objects by a certain attribute of those objects?
alanjc has joined #ruby
<banisterfiend>
jokke: group_by
apok has joined #ruby
danneu has joined #ruby
Proshot has quit [Quit: Leaving]
caleb_io has quit [Quit: caleb_io]
<jokke>
banisterfiend: yes but i can only say something like group_by {|obj| obj.attr == "foo"}
<jokke>
but i want objects with the _same_ attributes to be grouped together
punk_ has joined #ruby
punk_ has quit [Client Quit]
<banisterfiend>
jokke: can u post a gist showing what u mean
<jokke>
well no, because i have no clue
<jokke>
i try to explain
samphippen has quit [Quit: Computer has gone to sleep.]
sorbo_ has quit [Quit: sorbo_]
<jokke>
i have a class Dependency which has three attributes: name, version and op
ahokaomaeha has joined #ruby
apok has quit [Client Quit]
<jokke>
now i defined a class method which gets an array of Dependency objects and has to play around with them. For one it has to group those dependencies, that have the same name
onemanjujitsu has quit [Quit: onemanjujitsu]
generalissimo has quit [Remote host closed the connection]
chrishough has quit [Quit: chrishough]
<jokke>
so if i have dep_a = Dependency.new "foo", "1.0", "=" and dep_b = Dependency.new "foo", "2.0", "<="
<jokke>
and my class method gets [dep_a, dep_b] it should return [[dep_a, dep_b]]
arya has quit []
wyhaines has quit [Remote host closed the connection]
<jokke>
banisterfiend: oh that does it?
<jokke>
:D
reset has joined #ruby
sailias has joined #ruby
havenwood has quit [Remote host closed the connection]
Billiam_ has joined #ruby
monkegjinni has quit [Remote host closed the connection]
billiam has quit [Ping timeout: 246 seconds]
angusiguess has quit [Ping timeout: 255 seconds]
<banisterfiend>
jokke: you can even group by all attributes by doing this: deps.group_by { |dep| [dep.x, dep.y, dep.z] }
<banisterfiend>
it'll group according to which objects have those attributes in common
<jokke>
okay, good to know
<jokke>
thanks
ctult has quit [Ping timeout: 276 seconds]
jamescarr has joined #ruby
idkazuma has quit [Remote host closed the connection]
<maetthew>
This might be kinda weird question but I'm not really sure what to search for. I want to make a quite simple script that I can invoke from command-line.
<maetthew>
someone point me in the right direction :)
JumpMast3r has joined #ruby
ShellFu has joined #ruby
<banisterfiend>
maetthew: google for Thor
jowee has joined #ruby
<maetthew>
banisterfiend: cool looks sweet
<maetthew>
thanks
arturaz has quit [Remote host closed the connection]
<ShellFu>
Hey All I have two hashes. >h1 = {"item" => {"key1" => "value1"}}< and >h2 = {"item" => {"key2" => "value2"}}< How can I merge h1 and h2 on item and append the key1 and key2 value pairs?
jamescarr has quit [Ping timeout: 244 seconds]
dnordstrom has quit [Ping timeout: 252 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
<ShellFu>
to end up with {"item" => {"key2" => "value2", "key1" => "value1"}} something like that
<maetthew>
banisterfiend: lol it even has source code for basically exactly what i want to do
<maetthew>
fetch stuff from git
<ShellFu>
ive tried variations on merge and inject, but i cannot seem to keep the key value pairs they overwrite
<banisterfiend>
maetthew: where are you looking? link?