iamlacroix has quit [Remote host closed the connection]
<lurraca>
but what i need is that if is not a domain name, add http:// to the string and check one more time if its a domain_name and return true or false
<lurraca>
i mean I can do one more if on it
ph^ has joined #ruby
<lurraca>
but doesn't seems like an elegant solution to me
<waxjar>
does someone know a trick for making sure a method exists on an object you're including a Module in?
Takehiro has quit [Ping timeout: 240 seconds]
sent-hil has quit [Remote host closed the connection]
<waxjar>
this illustrates my problem: https://gist.github.com/3802815. I'd like to be able to put the include statement on top for readability
jgwong has joined #ruby
roadt has joined #ruby
lggr has joined #ruby
rvmeier has joined #ruby
wargasm has joined #ruby
linoj has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
<Spooner>
waxjar : No, because the method hasn't been defined by the time the include is called. Why do you need it? Likely there is a better way to deal with it in another way.
vitor-br has joined #ruby
ffranz1 has quit [Quit: Leaving]
<waxjar>
i have a helper module that needs to send messages over a socket. the module will be included on a few classes (obviously).
<waxjar>
i thought i'd do that using a method each class that includes the helper module implements (as the method to send messages with each of those classes will be different)
tgraham_ has joined #ruby
havenn has quit [Remote host closed the connection]
seoaqua has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
lggr has quit [Ping timeout: 244 seconds]
<waxjar>
i don't have to check if the method exists per sé, but the helper is written in such a way that other projects could just copy and paste it. i thought it'd be nice to built a little check like that in, but it's only going to cause trouble now
tgraham has quit [Ping timeout: 244 seconds]
pskosinski has quit [Ping timeout: 276 seconds]
<Spooner>
Well, a run-time check if the method exists is probably the most sensible, but it will raise an exception when it calls #test anyway, so I wouldn't worry too much.
<waxjar>
by run-time check you mean just check in the methods on the helper?
emergion has joined #ruby
yoklov has joined #ruby
<Spooner>
Yeah, but if you do that, then all you'd do is raise an exception. Might as well let the user just get the NoMethodError.
friskd has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
<waxjar>
yeah, good point
headius has joined #ruby
<Spooner>
Perhaps you don't want a module, though, if it is important. Perhaps you want another class that you create with MyClass.new(OriginalClass) or somesuch.
jeffreybaird has joined #ruby
rabidpraxis has joined #ruby
hbpoison has quit [Ping timeout: 240 seconds]
Sunhay is now known as sunhay
cakehero has joined #ruby
Targen has joined #ruby
butblack has joined #ruby
colinbm has quit [Quit: colinbm]
lggr has quit [Ping timeout: 244 seconds]
rabidpraxis has quit [Remote host closed the connection]
<havenn>
Guest69952: Or you can get an older (1.9.2) Ruby with: sudo apt-get install ruby1.9.1
yigal has quit [Read error: Operation timed out]
Takehiro has joined #ruby
seich- has joined #ruby
rking has quit [Remote host closed the connection]
yigal has joined #ruby
rking has joined #ruby
bradhe has joined #ruby
<Guest69952>
ta
mucker has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 246 seconds]
chendo_ has quit [Ping timeout: 255 seconds]
joofsh has joined #ruby
pygmael has quit [Read error: Connection reset by peer]
pygmael has joined #ruby
chendo__ has joined #ruby
slicslak has quit [Ping timeout: 255 seconds]
fredjean has joined #ruby
icooba has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
ph^ has quit [Ping timeout: 255 seconds]
peregrine81 has quit [Quit: Computer sleeping.]
icooba has joined #ruby
Erfankam has joined #ruby
stephenjudkins has joined #ruby
indian has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
qos has quit [Read error: Connection reset by peer]
lggr has joined #ruby
NoNMaDDeN has joined #ruby
qos has joined #ruby
adeponte has joined #ruby
stkowski has quit [Quit: stkowski]
rakl has quit [Quit: sleeping]
ryanf has joined #ruby
JC_SoCal has quit [Excess Flood]
xuser has left #ruby [#ruby]
JC_SoCal has joined #ruby
xpen has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ruby
ori-l is now known as it
xpen has quit [Remote host closed the connection]
it is now known as Guest45906
daniel_hinojosa1 has quit [Ping timeout: 246 seconds]
Guest45906 is now known as ori-l
stepnem has joined #ruby
adeponte has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
ori-l is now known as three
three is now known as atdt
atdt is now known as ori-l
ph^ has joined #ruby
beachandbytes has quit [Ping timeout: 272 seconds]
lggr has joined #ruby
rakl has joined #ruby
diegoviola has quit [Ping timeout: 246 seconds]
talsamon has joined #ruby
talsamon has left #ruby ["Verlassend"]
lggr has quit [Ping timeout: 240 seconds]
ph^ has quit [Ping timeout: 245 seconds]
mikepack has quit [Remote host closed the connection]
Erfankam has quit [Ping timeout: 245 seconds]
NoNMaDDeN has left #ruby ["Leaving..."]
lggr has joined #ruby
yoklov has quit [Quit: computer sleeping]
luckyruby has joined #ruby
icole has joined #ruby
robustus has joined #ruby
Vinz_ has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
h4mz1d has joined #ruby
margle has joined #ruby
Takehiro has quit [Remote host closed the connection]
justinmcp has joined #ruby
justinmcp has quit [Remote host closed the connection]
chimay has joined #ruby
chendo__ has quit [Changing host]
chendo__ has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
ph^ has joined #ruby
lggr has joined #ruby
nimred has joined #ruby
nimred has quit [Client Quit]
recycle has joined #ruby
und3f has joined #ruby
havenn has quit [Remote host closed the connection]
margle has quit [Quit: Computer has gone to sleep.]
neurotech has joined #ruby
rdsm has joined #ruby
hbpoison has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 255 seconds]
Takehiro has joined #ruby
lggr has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
nimred has joined #ruby
nimred has quit [Changing host]
nimred has joined #ruby
Averna has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 256 seconds]
recycle has quit [Remote host closed the connection]
_bart has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
casheew has joined #ruby
Rydefalk_ has joined #ruby
lggr has joined #ruby
casheew has quit [Quit: leaving]
sysadm_ has joined #ruby
rdsm has quit [Ping timeout: 246 seconds]
mengu has joined #ruby
NotproN has joined #ruby
yshh_ has quit [Remote host closed the connection]
mikekelly has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 260 seconds]
jasonkuhrt has joined #ruby
yshh has joined #ruby
yshh_ has joined #ruby
yshh has quit [Read error: Connection reset by peer]
lggr has joined #ruby
williamherry has joined #ruby
jasonkuhrt has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Ping timeout: 240 seconds]
yshh_ has quit [Remote host closed the connection]
triptec has quit [Read error: Connection reset by peer]
Guest69952 has quit [Quit: Gone to sleep.]
triptec has joined #ruby
Hamed-R has joined #ruby
Jacob_ has joined #ruby
Jacob_ is now known as Guest32860
ph^ has joined #ruby
hbpoison has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<williamherry>
hi, I am new to ruby and I write a little ruby script and upload it on rubygems, now I can download and install it by gem install tinyssh, it depends on net-ssh, how can i tell the depends so when i install my app, needed package can be install auto
NotproN has left #ruby ["Leaving..."]
SegFaultAX has joined #ruby
<Guest32860>
williamherry: you can add it as a dependency
<Vinz_>
In gemspec
seoaqua has joined #ruby
<williamherry>
Guest32860: Vinz_ thanks, any examples?
<seoaqua>
i found all my gems r installed into /root/.gem/ruby/1.9.1/ and when i require a gem with a non-root account , i will catch an exception that it can't require the gem file. any ideas? pls
<wedtm>
That will show you the address of the server
<nyuszika7h>
oh
<wedtm>
port, ip = Socket.unpack_sockaddr_in(socket.getpeername)
vlad_starkov has joined #ruby
<wedtm>
Use that for the peer address
<nyuszika7h>
thanks
<wedtm>
That's for 1.9 btw
hekin_ has joined #ruby
jasonkuhrt has joined #ruby
ryanf has quit [Ping timeout: 260 seconds]
Erfankam has quit [Ping timeout: 252 seconds]
lggr has joined #ruby
Guest64548 has joined #ruby
<lurraca>
I have a question not particular to Ruby, but when I'm crawling websites some of them takes long time to load. Any idea what might be the problem?
hekin has quit [Ping timeout: 252 seconds]
<bnagy>
'the internet' ?
<jblack>
the gerbils in your dsl modem are hungry and need to be fed.
jasonkuhrt has quit [Ping timeout: 245 seconds]
<nyuszika7h>
yep, I have 1.9.3-p194 :)
triptec has joined #ruby
seoaqua has quit [Ping timeout: 248 seconds]
Erfankam has joined #ruby
JarJar has joined #ruby
mohits has quit [Quit: Leaving]
maletor has quit [Quit: Computer has gone to sleep.]
Takehiro has quit [Remote host closed the connection]
tk__ has joined #ruby
<nyuszika7h>
./socket_test.rb:23:in `getpeername': Transport endpoint is not connected - getpeername(2) (Errno::ENOTCONN)
Villadelfia has joined #ruby
Raimiss has quit [K-Lined]
lggr has quit [Ping timeout: 252 seconds]
msch has joined #ruby
arietis has joined #ruby
jenrzzz has joined #ruby
<lurraca>
was that for me bnagy and jblack? well I'm running my script on ec2 instace which should have pretty decent bandwidth, might be something its like some specific sites, gets stuck for like 20 secs or so
SeySayux has quit [Read error: Operation timed out]
G has joined #ruby
iCEAGE has joined #ruby
vukini has joined #ruby
Villadelfia has quit [Ping timeout: 246 seconds]
cantonic_ has joined #ruby
lggr has joined #ruby
samphippen has joined #ruby
cantonic has quit [Ping timeout: 245 seconds]
cantonic_ is now known as cantonic
<nyuszika7h>
wedtm, client.peeraddr worked
<wedtm>
sweet!
<wedtm>
Good to know :)
<nyuszika7h>
(and client = server.accept)
F1skr has joined #ruby
<wedtm>
lurraca, the internet is a vast network, sometimes, websites aren't hosted on the best of hardware/internet connection
<wedtm>
They may be overloaded, or have network issues.
<wedtm>
It's just the way of the internet, nothing that can really be done about it.
Hamed-R has joined #ruby
Hamed-R has joined #ruby
Hamed-R has quit [Changing host]
Hamed-R has quit [Remote host closed the connection]
chrishunt has quit [Ping timeout: 244 seconds]
Hamed-R has joined #ruby
Villadelfia has joined #ruby
<lurraca>
I'm thinking about using sidekiq gem
lggr has quit [Ping timeout: 255 seconds]
iCEAGE has quit [Ping timeout: 245 seconds]
pskosinski has joined #ruby
<lurraca>
see if my total running time gets lower, I'm crawling like 20000 website in a single batch
lggr has joined #ruby
Axsuul has joined #ruby
slainer68 has quit [Remote host closed the connection]
Takehiro has joined #ruby
SeySayux has joined #ruby
rdsm has quit [Quit: Leaving]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
yaroslav has joined #ruby
yshh has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
vukini has quit [Ping timeout: 252 seconds]
x0F_ is now known as x0F
lggr has quit [Ping timeout: 246 seconds]
<Guest64548>
can you help me? i cant install a gem in win7, it síys make is not recognized as a command
Iszak has joined #ruby
AcidWeb has joined #ruby
Guest64548 is now known as Jackneill
Jackneill has quit [Changing host]
Jackneill has joined #ruby
lkba has joined #ruby
hbpoison has joined #ruby
lggr has joined #ruby
jgrevich has quit [Quit: jgrevich]
Eplemosen has joined #ruby
saschagehlich has quit [Ping timeout: 256 seconds]
ph^ has quit [Remote host closed the connection]
hbpoison has quit [Ping timeout: 255 seconds]
saschagehlich has joined #ruby
icole has joined #ruby
adambeynon has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
wedtm is now known as wedtm|away
yshh has quit [Remote host closed the connection]
samuel02 has joined #ruby
chrxn has quit [Ping timeout: 246 seconds]
icole has quit [Ping timeout: 256 seconds]
beachandbytes has joined #ruby
PapaSierra has joined #ruby
bradhe has joined #ruby
lggr has joined #ruby
<AcidWeb>
Hello. I got small problem which someone maybe can help me explain. I have rake script that use 5 threads. Entire script is a scraper and even with 5 threads execution time is over 10minutes. In most cases it run flawlessly but sometimes random thread after a random amount of time crash:" Expected X/TP/app/models/item.rb to define Item." Item is used hundreds of times during each thread execution.
<A124>
Guest64548: make is compiling helper.. thus you need a Development and compiling tools
<A124>
*Jackneill
A124 has quit [Quit: Leaving.]
<AcidWeb>
Im using RoR third day and i dont have idea what is this type of error.
<Jackneill>
A124: ok thx
A124 has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
bradhe has quit [Ping timeout: 246 seconds]
Iszak has quit [Quit: Computer has gone to sleep.]
VegetableSpoon has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
chimay has joined #ruby
lggr has joined #ruby
rabidpraxis has joined #ruby
etehtsea has joined #ruby
Forevernade has joined #ruby
jasonkuhrt has joined #ruby
AcidWeb has left #ruby [#ruby]
virtualentity has quit [Ping timeout: 248 seconds]
F1skr has quit [Ping timeout: 260 seconds]
slainer68 has joined #ruby
emmanuelux has joined #ruby
jasonkuhrt has quit [Ping timeout: 245 seconds]
hekin_ has quit [Read error: Connection reset by peer]
hekin has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
hiroyuki has quit [Remote host closed the connection]
hsbt_away is now known as hsbt
sent-hil has quit [Remote host closed the connection]
ryanf has joined #ruby
lggr has joined #ruby
yshh has joined #ruby
banseljaj is now known as imami|afk
adambeynon has quit [Quit: Computer has gone to sleep.]
hsbt has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
ryanf has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
LouisGB has joined #ruby
F1skr has joined #ruby
hsbt_away has joined #ruby
hsbt_away is now known as hsbt
futilegames has joined #ruby
thinkclay has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ruby
Russell^^ has joined #ruby
daniel_- has joined #ruby
bobbbo has quit [Quit: bobbbo]
hsbt has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 260 seconds]
nari_ has joined #ruby
workmad3 has joined #ruby
Jork1 has joined #ruby
eldariof has joined #ruby
yshh has quit [Read error: Connection reset by peer]
hsbt has joined #ruby
etehtsea has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
LouisGB has quit [Ping timeout: 246 seconds]
hbpoison has joined #ruby
hsbt has quit [Ping timeout: 246 seconds]
hsbt_away has joined #ruby
hsbt_away is now known as hsbt
lggr has quit [Ping timeout: 248 seconds]
Morkel has joined #ruby
hbpoison has quit [Ping timeout: 245 seconds]
Virunga has quit [Remote host closed the connection]
adambeynon has joined #ruby
jtdowney has joined #ruby
lggr has joined #ruby
hackeron has quit [Remote host closed the connection]
ltsstar has joined #ruby
quest88 has joined #ruby
daniel_- has quit [Ping timeout: 255 seconds]
<A124>
AcidWeb: Did you got it working?
Eplemosen has quit [Quit: NOPE]
<A124>
lurraca: What are your speeds now?
futilegames has quit [Quit: futilegames]
cnf has joined #ruby
resure has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
areil has quit [Remote host closed the connection]
lggr has joined #ruby
etehtsea has joined #ruby
JarJar has quit [Quit: Leaving]
slainer68 has quit [Remote host closed the connection]
Virunga has joined #ruby
gani has joined #ruby
axl_ has joined #ruby
resure has quit [Quit: Leaving]
Markvilla has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
workmad3 has quit [Read error: Operation timed out]
<milestone>
hi all
<milestone>
is this the official ruby help channel?
lggr has joined #ruby
hiroyuki has joined #ruby
Drakx has quit [Ping timeout: 260 seconds]
Jackneill has quit [Read error: Connection reset by peer]
jimeh4 has quit [Ping timeout: 245 seconds]
Jackneill has joined #ruby
<heftig>
milestone: no, that'd be #ruby-lang
adambeynon has quit [Quit: Computer has gone to sleep.]
Jackneill is now known as Guest51674
<heftig>
that said, this is a ruby channel as well
<milestone>
heftig: thx
milestone has left #ruby [#ruby]
etehtsea has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ruby
baphled has joined #ruby
butblack has joined #ruby
Markvilla has quit [Quit: Computer has gone to sleep.]
dangerousdave has joined #ruby
hvq has joined #ruby
roadt has quit [Ping timeout: 255 seconds]
ananthakumaran has quit [Ping timeout: 255 seconds]
kjellski has joined #ruby
butblack has quit [Client Quit]
ananthakumaran has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<nyuszika7h>
how can I make it so that output is temporarily blocked until pressing enter if a key is pressed while gets.chomp is running in a separate thread (to avoid blocking output),
huy has quit [Quit: huy]
ianblenke2 has joined #ruby
bradhe has joined #ruby
jtdowney has quit [Remote host closed the connection]
<A124>
If you want first to focus on the client and then on the input this will do the job momentarily
<nyuszika7h>
I'll try
<A124>
It will not block until you press Enter
bencaron has quit [Quit: bencaron]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
slainer68 has quit [Remote host closed the connection]
JohnBat26 has quit [Ping timeout: 248 seconds]
Markvilla has joined #ruby
lkba has joined #ruby
williamherry has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
thehodge has joined #ruby
nari_ has joined #ruby
average_drifter has quit [Ping timeout: 244 seconds]
lggr has joined #ruby
jeffreybaird has joined #ruby
<thehodge>
quick question, if I have a remote CSV file thats 1m+ lines is there an easy of of reading it remotely line by line rather than having to download the whole thing then process it
tgraham has joined #ruby
deryl has quit [Quit: Leaving.]
TomJ has quit [Quit: TomJ]
jgwong has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
jeffreybaird has quit [Quit: jeffreybaird]
awestroke has joined #ruby
deadghost has quit [Ping timeout: 256 seconds]
BMF has joined #ruby
lggr has joined #ruby
indian has quit [Ping timeout: 246 seconds]
br4ndon has joined #ruby
F1skr has joined #ruby
swarley has joined #ruby
thinkclay has joined #ruby
ZubKonst_ has joined #ruby
<workmad3>
thehodge: you could wrap a simple service around the CSV file that allows you to specify line-ranges
<thehodge>
workmad3: I don't have control of the csv its an external service
frogstarr78 has quit [Remote host closed the connection]
dopamean has joined #ruby
<workmad3>
any idea whether the service exposing it supports some form of chunking?
<dopamean>
hey ive got a question about qt
<thehodge>
workmad3: they do not
VegetableSpoon has quit [Ping timeout: 246 seconds]
<dopamean>
i get a no such file to load error on the line "require 'Qt4'"
<workmad3>
thehodge: I'm not sure there's an easy way to do what you want then :(
<thehodge>
dammit
lggr has quit [Ping timeout: 246 seconds]
samuel02 has quit [Ping timeout: 260 seconds]
ZubKonst has quit [Ping timeout: 252 seconds]
tgraham has quit [Quit: Leaving...]
<workmad3>
thehodge: without some form of chunking at the service or http level, you'd need to drop down into getting your hands on the network packets to control the flow of information, afaik
<thehodge>
thats a shame.. looks like I'll just have to download it it
<workmad3>
thehodge: otherwise the server will be just sending data to you in a stream
qos has joined #ruby
andy has joined #ruby
<workmad3>
maybe you can get your hands on something a bit more fine-grained to stream a http response as it comes in, purely client side
<workmad3>
but it's how much control you get then
<workmad3>
and whether it's good enough :)
qos has quit [Client Quit]
lggr has joined #ruby
andy is now known as rowsdower
cyberchibcha has quit [Quit: Ex-Chat]
awestroke has quit [Remote host closed the connection]
swarley has quit [Ping timeout: 245 seconds]
<rowsdower>
I'm writing an engine and would like the user to be able to choose settings before using the engine.
awestroke has joined #ruby
phantasm66 has quit [Quit: *sleeeeep*]
<rowsdower>
Right now I'm using a module full of constants, but when the user changes a setting I get a warning (because it's a constant).
<rowsdower>
What's the popular way to allow settings? They must be set before the engine starts.
saschagehlich has quit [Quit: saschagehlich]
frogstarr78 has joined #ruby
<workmad3>
rowsdower: context? what do you mean by 'engine' here?
saschagehlich has joined #ruby
<rowsdower>
A game logic library that other programs use.
<rowsdower>
So it's separate from the actual game.
lggr has quit [Ping timeout: 245 seconds]
hbpoison has joined #ruby
VegetableSpoon has joined #ruby
arturaz has joined #ruby
jamjam has joined #ruby
Morkel has quit [Quit: Morkel]
lggr has joined #ruby
phantasm66 has joined #ruby
hbpoison has quit [Ping timeout: 248 seconds]
busybox42 has quit [Ping timeout: 244 seconds]
hakunin has quit [Remote host closed the connection]
<workmad3>
rowsdower: ok, so is this an engine you've written or just one you're using?
hakunin has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
dakine has joined #ruby
phantasm66 has quit [Client Quit]
<rowsdower>
One I'm just starting. The only settings so far are speed and screen size. I'm just wondering how to best make these alterable by a user.
dakine has quit [Client Quit]
<workmad3>
if you're just starting it, I'd suggest you just pass in the settings when you create the engine
<rowsdower>
You mean like "my_engine_settings_init(:fps => 60, :screen_size => 800, 480)" ?
<workmad3>
and then you can either have a simple ruby file that a user can edit, or you can load data from a config file of some form (yaml, ini file, xml)
neurotech has quit [Remote host closed the connection]
<workmad3>
something like that, but syntactically valid
<workmad3>
;)
hakunin has quit [Ping timeout: 246 seconds]
<rowsdower>
Or I could have it automatically search for my_engine_config.rb
<workmad3>
probably not worth it yet tbh
lggr has quit [Ping timeout: 252 seconds]
<workmad3>
you're at the point where you basically know the least about what your engine is going to look like and how it will work
kiyoura has joined #ruby
jtdowney has joined #ruby
<workmad3>
you don't know what config data it needs, what sort of structures it will come in, or how it's actually going to need to change
dakine has joined #ruby
<workmad3>
so you want to keep your config flexible and easy to change, and the easiest code to change is simple code
raul782 has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
<workmad3>
so right now, keep things simple and obvious is my advice
<workmad3>
don't try and add magic and automatic searching until you know you need it ;)
`brendan has joined #ruby
<rowsdower>
Should something that can be optionally set to something different not be a constant?
<workmad3>
probably not
lggr has joined #ruby
<rowsdower>
Ex. SCREEN_SIZE is a constant as long as the game is playing, but can be set arbitrarily
<rowsdower>
I could just change it to a module-level variable MyEngine::Settings.screen_size
dakine has quit [Remote host closed the connection]
tommyvyo has joined #ruby
drchaos has quit [Quit: WeeChat 0.3.7]
v0n has joined #ruby
jtdowney has quit [Ping timeout: 245 seconds]
<chiel>
anyone know if there's a way to compile less files in ruby?
<chiel>
or a string of less styles, rather.
seanlee has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
saschagehlich has quit [Quit: saschagehlich]
headius has quit [Quit: headius]
stopbit has joined #ruby
lggr has joined #ruby
und3f has quit [Quit: Leaving.]
williamherry has quit [Quit: WeeChat 0.3.7]
linoj has joined #ruby
dopamean has quit []
VegetableSpoon has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 260 seconds]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
emmanuelux has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
headius has joined #ruby
cjs226 has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
thinkclay has quit [Quit: Leaving.]
sebastorama has joined #ruby
recycle has joined #ruby
waxjar has quit [Ping timeout: 245 seconds]
recycle has quit [Remote host closed the connection]
fteem has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
jtdowney has joined #ruby
lggr has joined #ruby
<shevy>
wait what
newbism has joined #ruby
<shevy>
compile less files? compile how and where
<chiel>
shevy: on the fly
<chiel>
shevy: i want to add preprocessor support to tinker.io
<shevy>
I do not understand at all sorry
<shevy>
hmmmm
<chiel>
basically they put in "less" code (lesscss.org)
jtdowney has quit [Read error: Connection reset by peer]
tk__ has quit [Quit: ばいばい]
<A124>
shevy: less is css style in essence
<shevy>
aaaah
<shevy>
I thought it is an english word
<chiel>
i'm trying to figure out the best way to compile it from ruby
<chiel>
hah :)
<chiel>
sorry
<chiel>
i should've been clearer perhaps
<shevy>
or they should have picked another name hehe
<chiel>
yeah :p
yakitori has joined #ruby
mengu has quit [Read error: Operation timed out]
<A124>
gem install less ?
headius has quit [Quit: headius]
<chiel>
hmm
<chiel>
still depends on the js bits though :(
<chiel>
i was hoping there was some kind of port of it
berkes has quit [Quit: Ex-Chat]
<chiel>
otherwise i may as well just execute a command line command
linoj has quit [Quit: linoj]
lggr has quit [Ping timeout: 240 seconds]
Goles has joined #ruby
Z0idberg has quit [Ping timeout: 245 seconds]
Goles has quit [Client Quit]
thehodge has quit [Read error: Connection reset by peer]
seanlee has quit [Remote host closed the connection]
lggr has joined #ruby
kermes has quit [Remote host closed the connection]
ltsstar has quit [Quit: ltsstar]
hbpoison has joined #ruby
t0rc has joined #ruby
rowsdower has left #ruby ["Konversation terminated!"]
BMF has left #ruby [#ruby]
<A124>
nyuszika7h: How's it going?
Vinz_ has joined #ruby
<shevy>
hey does one of you know
<shevy>
if I do something like
lggr has quit [Ping timeout: 252 seconds]
<shevy>
pp array
<shevy>
is there a way to specify default padding to the left side?
<A124>
But.. I don't see a clear and nice way to do it.
hackeron has joined #ruby
<shevy>
:(
Jellyg00se has quit [Ping timeout: 245 seconds]
<Mon_Ouie>
Instanciate PP yourself and set the indentation to something else before printing the object
<Mon_Ouie>
(The core formatting methods come from the PrettyPrint class)
<A124>
Or. That.
<A124>
shevy: Look for pp.rb
awarner has quit [Remote host closed the connection]
<shevy>
ok wait
<Mon_Ouie>
Or just click on the parent class on the page you linked
<Mon_Ouie>
Oh, doesn't work; you have to select the prettyprint library before that
<chiel>
if you execute a shell command using system() does the program halt while it's being executed, or does it execute asynchronously in the background?
<Mon_Ouie>
Or you could use ri
raul782 has quit [Remote host closed the connection]
lggr has joined #ruby
ipoval has quit [Quit: ipoval]
<nyuszika7h>
A124, haven't messed with it too much, I'll try later
Z0idberg has joined #ruby
<heftig>
chiel: it waits
<A124>
nyuszika7h: I have a working client already. Could you let me know when you do? I'm interested in that one.
<nyuszika7h>
sure
<chiel>
heftig: ah k, cool
<A124>
Thanks :)
<chiel>
too bad it doesn't seem to be working. :(
raul782 has joined #ruby
sailias has joined #ruby
Alt-255 has joined #ruby
thinkclay has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
minver has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
recycle has joined #ruby
lggr has joined #ruby
<chiel>
hmm this is really weird.. I am creating a new Tempfile instance, writing some data to it, and then running it through the `cat` tool on the cli to another file
chimay has joined #ruby
<chiel>
when I then read from the destination file, it's empty
waxjar has joined #ruby
<chiel>
however, if I .read the tempfile before `cat`ing, it works fine..
<chiel>
i don't understand... :s
<canton7>
flushing issue?
duper has joined #ruby
<canton7>
(well, lack of flushing)
<chiel>
how do you mean?
<chiel>
hmm
<chiel>
no idea
<chiel>
how would I ensure it?
<chiel>
I create two files
<canton7>
how do you write data to it? do you close the file after doing so?
<chiel>
write some stuff to the source file, cat to the destination file
Vinz_ has quit []
<chiel>
destination file is empty
<chiel>
ah, no i don't
<chiel>
lemme try that.
<canton7>
does the source file contain the data before you cat it to the dest file?
<chiel>
not unless i do source.read on it first, but source.close seems to fix the problem
<chiel>
so i guess it doesn't actually execute the write until some other operation is done on it, or so
<canton7>
the data gets written to a buffer, then flushed to file every now and then
lggr has quit [Ping timeout: 244 seconds]
<canton7>
so call file.flush, or close the file, or perform some other operation on the file to actually flush the buffer to file
<shevy>
then look at what response actually contains via pp
<A124>
cjs226: Yes. It's array my bad. No need to do it other way, sorry.
<shevy>
pp will pretty print the data structure in a readable way for your eyes
<arturaz>
minver, in a functional world you would return either a valid voucher or a list of errors. Here just combine errors and raise the exception if voucher cannot be generated
<arturaz>
if that's an error
<shevy>
voucher sounds kinda french :)
<Virunga>
cjs226: sorry, i was searching online a definition of the fog gem, but even on the fog web site, i couldn't find a satisfying one. Could you help me? :)
wallerdev has joined #ruby
<arturaz>
or check out ActiveModel::Validation
sterNiX has joined #ruby
lggr has joined #ruby
Xeago has quit [Remote host closed the connection]
<StartFr>
hi has anyone used cucumber + mongoid before ? in a not rail project ?
<arturaz>
Jackneill, close your terminal and open it again
Goles has quit [Quit: Computer has gone to sleep.]
<Jackneill>
it's win7, but ok
<arturaz>
although i forgot how devkit actually works
<Jackneill>
"start command prompt win ruby" its name
<cjs226>
shevy: thx!
<Jackneill>
:)
<cjs226>
virunga, thx shevy helped me out
busybox42 has joined #ruby
<Virunga>
Because i have to make a proposal to my boss, and i can't say to him fog is an interface for the cloud.
<pskosinski>
In PHP I can do <?php ?><div>blah blah</div><?php code; Can I do something like this in Ruby? ^^
<Virunga>
That's poor informtion. The fact is that i never use it.
<pskosinski>
Or maybe I'm asking wrong question...
<Spaceghostc2c>
pskosinski: Why would you? The problem is that you don't use anything php-ish in that line.
<Spaceghostc2c>
pskosinski: Also, erb.
<Jackneill>
pskosinski, you can do <% ... %>html code <% ... %> in rails
chrishunt has joined #ruby
<arturaz>
or erb more specifically
<Spaceghostc2c>
lahwran: And anywhere else that includes an erby gem.
<Spaceghostc2c>
erubis is the win on that front.
vaclavt has joined #ruby
CaptainJet has joined #ruby
<Jackneill>
arturaz: should a paste the gem_make.out?
<lahwran>
Spaceghostc2c: hi
lggr has quit [Ping timeout: 256 seconds]
<arturaz>
Jackneill, is there a make in your path?
<Jackneill>
im in c:/users/Jackneill/desktop and i think it's not
<cjs226>
sorry, pp did make the output pretty but (sorry I'm new), i still don't know how to retrieve the amount for Average. https://gist.github.com/3804539
<arturaz>
Jackneill, if you type make into console, do you get anything?
<Spaceghostc2c>
lahwran: Oh. Hm.
<Virunga>
cjs226: why do you use fog?
BMF has left #ruby [#ruby]
<Spaceghostc2c>
Virunga: Because fog is fucking awesome.
<Jackneill>
make is not recognized as a command, program or batch file
<Virunga>
cjs226: i mean, what do you use it fot?
<Virunga>
for
<Spaceghostc2c>
Jackneill: Windows. :(
<Jackneill>
thats what i've got
<Jackneill>
Spaceghostc2c, yeah:D
<Jackneill>
linux rulz..
<Jackneill>
gentoo \o/
<Virunga>
Spaceghostc2c: i know, i want to know for what he's using it.
<Spaceghostc2c>
Jackneill: Use a virtual machine maybe?
<cjs226>
I'm using it as while we're currently on AWS, fog allows me to use other providers in the future with less headache
<Jackneill>
Spaceghostc2c, i dont want to, its too much memory consuption
<Virunga>
Spaceghostc2c: really?
<cjs226>
virunga, yes, currently using it to interace with AWS
<Spaceghostc2c>
Jackneill: You're constrained on memory? Can't use 2gigs for development or whatever?
<Spaceghostc2c>
Virunga: Probably, yeah.
<Jackneill>
i have 2 GB
<Jackneill>
only
<Jackneill>
:D
<Virunga>
You tell me.
<Spaceghostc2c>
Oh.
<arturaz>
Jackneill, well, you could get cygwin make
<Spaceghostc2c>
Virunga: I am.
<Jackneill>
and win with a browser takes about 1,64 of it
<Virunga>
You're really smart.
<Jackneill>
:D
<arturaz>
I remember there was easier way, but we've switched to jruby 2 years ago
<Spaceghostc2c>
Virunga: Not really!
<Virunga>
No, you are.
<Jackneill>
:(
<Spaceghostc2c>
Virunga: Stop trying to get into my pants. :(
<Spaceghostc2c>
arturaz: I fucking love jruby. 3
<Spaceghostc2c>
<3
<Virunga>
Just because you asked.
lggr has quit [Ping timeout: 240 seconds]
<arturaz>
Spaceghostc2c, it has its own share of bugs...
<arturaz>
especially if you use jruby/scala project :)
<arturaz>
jruby magic doesn't mix with scala magic nice
<Spaceghostc2c>
arturaz: Well, yeah.
<Spaceghostc2c>
But all the JVM magic. :(
<headius>
too many magics!
<arturaz>
magic magic magic
<arturaz>
headius, i see 1.7 is running along
<arturaz>
perhaps its time to run our tests on it
<headius>
indeed!
<arturaz>
and break all your assumptions that ir runs correctly
<arturaz>
:D
<arturaz>
it*
<Spaceghostc2c>
headius: Mister sir.
mfridh has quit [Ping timeout: 240 seconds]
<headius>
hello there!
<arturaz>
although I don't even have the time to move away from some build of 1.6-head to 1.6.8...
<Spaceghostc2c>
headius: I got to meet the #torquebox guys!
<Spaceghostc2c>
Well, the majority of them.
wz has quit [Quit: Ухожу я от вас]
<shevy>
off-topic anyone knows if .jpg files can contain meta information like when the picture was taken? i.e. year 1992? ideally I'd like to query this information then from via a ruby script
BMF has joined #ruby
lggr has joined #ruby
<Spaceghostc2c>
shevy: They do. But I don't know how. :(
shevy2 has joined #ruby
<pskosinski>
Hm... how can I in easy way insert into a variable
<pskosinski>
/ blah blah
<pskosinski>
/blah blag
<pskosinski>
eh, two slashes
<pskosinski>
I have a big long text and don' want to escape everything ^^
Nisstyre-laptop has quit [Quit: Leaving]
hbpoison has joined #ruby
vaclavt has quit [Quit: vaclavt]
<pskosinski>
I was trying var = <<-blah my text\nblah; puts blah
<Virunga>
pskosinski: a multiline string is what you want ?
lggr has quit [Ping timeout: 260 seconds]
<pskosinski>
Yes
<pskosinski>
Which can contain \t // and it's not interpreted
lggr has joined #ruby
<arturaz>
%q{foo\t//bar}
duper has quit [Quit: Lost terminal]
<pskosinski>
Ah, it works, ty. :)
nari_ has quit [Ping timeout: 252 seconds]
rabidpraxis has joined #ruby
elico has joined #ruby
brianpWins has joined #ruby
RegEchse has joined #ruby
BMF has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 252 seconds]
d-best has quit [Quit: Reconnecting]
d-snp has joined #ruby
lggr has joined #ruby
jgrevich has joined #ruby
headius has quit [Quit: headius]
jsmonkey has joined #ruby
niklasb has quit [Ping timeout: 245 seconds]
<jsmonkey>
Hi, was sometimes I did something other then normally rest routing and such for web apps in ruby. can oneone tell me a good lib or practive etc for writing a an array with json to an json file?
lggr has quit [Ping timeout: 256 seconds]
jsmonkey has quit [Client Quit]
hbpoison has quit [Ping timeout: 255 seconds]
butblack has joined #ruby
A124 has quit [Quit: Leaving.]
_7894 has quit [Quit: Odcházím]
lggr has joined #ruby
Alt-255 has quit [Ping timeout: 246 seconds]
aces1up has quit [Remote host closed the connection]
JonnieCache has quit [Read error: Connection reset by peer]
aces1up has joined #ruby
CaptainJet has quit []
tgraham has joined #ruby
aces1up has quit [Remote host closed the connection]
rabidpraxis has quit [Remote host closed the connection]
yekta has quit [Quit: yekta]
workmad3 has joined #ruby
<v1n3>
How does an experience rubyist track down a no method error in someone else code? I don't know how to instrument my sinatra+puma app to pin point this error. https://gist.github.com/6e86fb54db828872827a
lggr has quit [Ping timeout: 246 seconds]
<newbism>
im trying to gem install gecode but get this:
<newbism>
gecode.hh:8:28: fatal error: gecode/kernel.hh: No such file or directory
<newbism>
wth?
daniel_hinojosa1 has joined #ruby
samphippen has joined #ruby
wedtm|away is now known as wedtm
samphippen has quit [Client Quit]
niklasb has joined #ruby
<v1n3>
newbism: do you have gecode installed?
arietis has joined #ruby
<newbism>
v1n3: isnt that what the gem install does?
arturaz has quit [Read error: Connection reset by peer]
<v1n3>
I missed that it was included, sorry.
<catphish>
does anyone know how to determine a block device size in ruby?
bsilwal1 has joined #ruby
t0rc has quit [Quit: WeeChat 0.3.8]
<bsilwal1>
Linked List and Hash are there any difference between these two?
arturaz has joined #ruby
<shevy2>
bsilwal1 what is a linked list
lggr has joined #ruby
<shevy2>
Hash in ruby is of class Hash
<bsilwal1>
oops thinking about it, in linked list every node knows the next node.
<shevy2>
hash = {}; hash['cat'] = 'Tom'
<shevy2>
hash['cat'] # => "Tom"
<shevy2>
aha
jtdowney has joined #ruby
diegoviola has joined #ruby
<bsilwal1>
is it ok to term data inside hash as elements?
<shevy2>
then a ruby Hash by default does not qualify for a linked list
<bsilwal1>
okay
<bsilwal1>
because they dont know what comes next.
<arturaz>
bsilwal1, there are no linked lists in ruby stdlib
<shevy2>
dunno. I suppose so. for arrays I call the elements usually members
samphippen has joined #ruby
<arturaz>
there is some library somewhere
<shevy2>
or entries
carlyle has joined #ruby
<arturaz>
and if you use jruby you can always just java.util.LinkedList.new
<bsilwal1>
so I can try creating my own class structure to support the theory behind linked list.
<shevy2>
I suppose you can rebuild the hash constantly
<v1n3>
catphish: when in doubt `cat /proc/partitions`
<shevy2>
when an element is added or removed, you rebuild it
<shevy2>
so that it points to the proper entry again
<shevy2>
it sounds a bit more like an array though
<shevy2>
[1,2,4]
<heftig>
IIRC ruby hashes are linked lists combined with a hashmap for lookup
<shevy2>
[1] -> [2], [2] -> [4]
Jork1 has quit [Quit: Jork1]
<bsilwal1>
but its not possible to define order of hash keys is there?
<catphish>
v1n3: seemed like cheating :)
shevy2 is now known as shevy
<heftig>
bsilwal1: hashes are ordered by insertion
<shevy>
isn't that what linux is all about... cheating your way through life :D
<bsilwal1>
ok fine, I think there is no relation between them.
<v1n3>
catphish: i've been cheating for years then
<bsilwal1>
in linked list nodes are actually objects.
<shevy>
in ruby (almost) everything is an object
<shevy>
:D
<heftig>
only in OOP
<bsilwal1>
hash elements are also objects, but probably doesnt have a property to define order.
<heftig>
linked lists exist outside of OOP
<v1n3>
catphish: then again, I'm struggling to track down a no method error so take my suggestion with a grain of salt
<newbism>
I have an array of hashes and im trying to get a difference of hashes selected vs what is left I tried array_hashes.delete_if {|h| array_hashes.include? h[:name]} but all i get is the full array of hashes. I think I messed up and should have just one large hash with keys to the sub hashes?
Bart-_ has joined #ruby
<bsilwal1>
ok i am done time to dig!
bsilwal1 has quit [Quit: Leaving.]
<Spooner>
newbism : Not sure I get you. Can you paste up an example?
<catphish>
v1n3: there's probably no method on the class ;)
frogprince_mac has quit [Ping timeout: 245 seconds]
<v1n3>
catphish: speaking of cheating
<catphish>
v1n3: i'm trying to programatically determine the size of a file i have open, unfortunately File#size returns 0 if it's a block device
<v1n3>
catphish: it is getting thrown in puma of all things, but I'm not sure how to quickly find what is triggering it, as not all calls throw this
<newbism>
Spooner: sorry if its really crufty atm :-/
<catphish>
and BLKSIZE returns garbage if it's a file
<Spooner>
shevy : In Ruby everything acts like an Object (even if it is implemented not quite in that way).
lggr has quit [Ping timeout: 252 seconds]
Jork1 has joined #ruby
<shevy>
well there are some evil cheaters... TypeError: cant define singleton method "hi" for Float
<catphish>
bah, my mouse just stopped working
<shevy>
Float is an evil poser object!
<newbism>
Spooner: around lines 92 - 97 is when I load students into the pod but Id like to continue recursion of the reamining students into another pod
<Spooner>
newbism : So what are you trying to do with them (in respect to your code).
<catphish>
v1n3: just remembered how i solved this last time! seek :)
<newbism>
Spooner: knapsack students into pods based on course weight to total weight of pod (knapsack)
LouisGB has joined #ruby
<newbism>
cant really find a good scalable ruby example that I eventually want to build a rails app and having trouble understanding the algorithm plus best practices
<Spooner>
newbism : Don't use += for arrays used this way (since it is "create a new array from the concatenation of the old and new array). Should use << (append)
philcrissman has quit [Remote host closed the connection]
<catphish>
v1n3: you'll have to read that line to see what split was being called on
pskosinski has quit [Remote host closed the connection]
<lazyPower>
When using ActiveRecord based models, is there a good design pattern to handle extra attributes from a form, for example the acceptance of ToS checkboxes? It creates an extra property during submit and throws the mass assignment error. How could i ignore these extra fields?
<catphish>
it may throw some light on what part of the http request is missing
<Spooner>
newbism : YEah, you << differently. a += [b] should be a << b
ryanf has joined #ruby
<v1n3>
catphish: ya, it is in the header parsing.. turns out I was passing it a non-string
<workmad3>
lazyPower: you don't ignore them
<Spooner>
newbism : It is complaining that you are trying to reference an array with a symbol, rather than an integer.
<v1n3>
catphish: is there a programattic way to retrieve more of the stack trace?
<workmad3>
lazyPower: you add them as virtual attributes and make them accessible with attr_accessible
pskosinski has joined #ruby
<workmad3>
lazyPower: incidentally, it can be a good idea to explicitly store that someone clicked that checkbox ;)
<lazyPower>
so, adding it as attr_accessible would not map it back to the database? I was under the impression that every property added to a rails model would attempt to be serialized back into the database when added to the model.
<v1n3>
more of the stack trace before it went wrong, preferably still in my file
<catphish>
v1n3: isn't that stack trace complete?
v0n has joined #ruby
<workmad3>
lazyPower: you were under the wrong impression
<workmad3>
lazyPower: the only things that map back to the database are attributes based off database columns
jgrevich_ has joined #ruby
<workmad3>
lazyPower: you need both an attr_accessor to define a virtual attribute and the addition to the attr_accessible line to make it mass assignable though
carlyle has quit [Remote host closed the connection]
jtdowney has quit [Remote host closed the connection]
bsilwal has joined #ruby
lggr has joined #ruby
CaptainJet has joined #ruby
joeycarm_ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
glyytchy has joined #ruby
lurraca has joined #ruby
etehtsea has quit [Quit: Computer has gone to sleep.]
bluOxigen has joined #ruby
<v1n3>
catphish:: what does the rest of the code look like? I'm not quite sure how/why you would even open this
jbw has joined #ruby
gvz has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<shevy>
with a bazooka
<shevy>
that is how I would open it
jimeh4 has joined #ruby
jeffreybaird has joined #ruby
Asher has quit [Remote host closed the connection]
dfmoser has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
BMF has joined #ruby
lggr has joined #ruby
hbpoison has joined #ruby
lurraca has quit [Quit: This computer has gone to sleep]
BlissOfBeing has joined #ruby
<BlissOfBeing>
anyone know if there is a way to include another gem's assets in your gem if you add that gem as a dependency?
<minver>
What can I use as a param placeholder in my URL? The following is not a valid url: http:/foobar.com?value={placeholder} since curly brackets isn't allowed in urls. What should you use?
Asher has joined #ruby
tgraham|away is now known as tgraham
vaclavt has joined #ruby
Bart-_ has quit [Quit: Leaving...]
beneggett has joined #ruby
hbpoison has quit [Ping timeout: 260 seconds]
seanwash has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 246 seconds]
emmanuelux has joined #ruby
chimay has quit [Quit: WeeChat 0.4.0-dev]
lggr has joined #ruby
mikepack has quit [Remote host closed the connection]
reuf has quit [Ping timeout: 255 seconds]
jimeh4 has quit [Ping timeout: 245 seconds]
Markvilla has quit [Quit: Computer has gone to sleep.]
<TTilus>
minver: how about http:/foobar.com?value=placeholder
havenn has joined #ruby
<TTilus>
minver: what are you actually tryung to do?
icy` has joined #ruby
icy` has quit [Changing host]
icy` has joined #ruby
<TTilus>
BlissOfBeing: "include" as in distribute as part of your gem?
xyzodiac has joined #ruby
manizzle has joined #ruby
seoaqua has joined #ruby
Takehiro has quit [Remote host closed the connection]
<Spooner>
BlissOfBeing : You just add the other gem as a dependency in your gem in the gemspec: s.add_dependency "bleh", "=> 0.2.1"
<mulinux>
hello
<minver>
TTilus: A service where the user inputs a url to example.com/http://anyurl.com?value=placeholder and the service redirects the user to anyurl.com and replaces the placeholder with an important value. So I want to have clear placeholder name and then I thought it would be nice to wrap it with curly brackets
xyzodiac has quit [Quit: Computer has gone to sleep.]
GoHuyGo has joined #ruby
jblack has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<BlissOfBeing>
Spooner: Yes, I added the dependency. The part I was missing is I forgot to 'require gem-name' in my gem, so of course it didn't know about it. I added that require and it works fine now.
rakl has joined #ruby
<Spooner>
BlissOfBeing : Ah!
lggr has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
starship has joined #ruby
xyzodiac has joined #ruby
beneggett has joined #ruby
VegetableSpoon has joined #ruby
arietis has joined #ruby
xuser has joined #ruby
BMF has quit [Remote host closed the connection]
gani has joined #ruby
GoHuyGo has quit [Quit: Leaving]
jgwong has quit [Ping timeout: 245 seconds]
BlissOfBeing has quit [Quit: This computer has gone to sleep]
colinbm has joined #ruby
ryanf has quit [Ping timeout: 248 seconds]
wallerdev has quit [Quit: wallerdev]
BMF has joined #ruby
jblack has quit [Ping timeout: 245 seconds]
slainer68 has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
lushious has quit [Remote host closed the connection]
<thinkclay>
Spaceghostc2c ya, but that'll probably take more work than going coffee script and doing it all on the client side
<thinkclay>
Which has secondary benefits with load and such.. so I think it's the better choice. Was just trying to see if I could go the lazy route with a gem first
asshopo has quit [Read error: Connection reset by peer]
<Spaceghostc2c>
thinkclay: One might think, sure. I bet it would.
<thinkclay>
gotta jet. Thanks for the feedback guys!
asshopo has joined #ruby
thinkclay has quit [Quit: Leaving.]
butblack has quit [Quit: butblack]
daniel_hinojosa1 has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 245 seconds]
bobbbo has quit [Read error: Connection reset by peer]
saschagehlich has quit [Quit: saschagehlich]
dfmoser has quit [Quit: dfmoser]
bobbbo has joined #ruby
<havenn>
catphish: "I'm a string".bytes.to_a.each_slice(3).each { |three_bytes| p three_bytes.pack 'c*' }
ben_alman has quit [Excess Flood]
imami|afk is now known as banseljaj
sebastorama has quit [Quit: Computer has gone to sleep.]
moshef has joined #ruby
<catphish>
havenn: thank, will try that
niklasb has quit [Read error: Operation timed out]
JonnieCache has joined #ruby
falieson has joined #ruby
lggr has joined #ruby
gvz has quit [Quit: Leaving]
<falieson>
mind if I run some pseudocode by you?
hbpoison has quit [Ping timeout: 255 seconds]
<catphish>
havenn: thanks, that's much faster than my method: while(s = slice!(0,3))
<catphish>
which is a horrible encoding wise method
butblack has joined #ruby
<moshef>
iterating over a hash (say {:key => 'hi', :key2 => 'bye', :key3 => 'moshe'}) and I'd like to build text that looks something like - ":key - hi, :key2 - bye', :key3 - moshe". I use ', ' to combine the keys/values, but I want to remove the last comma.
<moshef>
any nice way to do it other than .strip.chop?
VegetableSpoon has quit [Ping timeout: 248 seconds]
xorgnak has quit [Remote host closed the connection]
<mytec>
I'm building a SQL insert string (insert ..values()..values…) and using + works fine. It's just very slow when there are 1,000 values strings to append. When I change + to << it's works significanly faster but in each insert, there is a missing , between one pair of value strings (1, 2, 3, 4)(2, 3, 4, 5) instead of (1, 2, 3, 4),(2, 3, 4, 5). Just one comma in a different place in each built insert statement. It can occur with as few as 13 concat
<mytec>
Is there some side effect I should know about <<?
mikepack has joined #ruby
Jork1 has quit [Quit: Jork1]
tomaw has quit [Read error: Connection reset by peer]
lggr has joined #ruby
tomaw has joined #ruby
<RubyPanther>
mytec: you probably have a bug in your loop :o
<Mon_Ouie>
String#+ creates a new string, String#<< alters its receiver — meaning every reference to it is affected by the modification
butblack has quit [Quit: butblack]
<mytec>
RubyPanther: I've inserted just over 2.3 billion rows using + to generate the insert statements. If there is a bug, I unfortunately don't see it.
wedtm|away is now known as wedtm
<RubyPanther>
mytec: + you're creating a new string and then assigning it to the var. << you're appending. Otherwise it is about the same. Trust me padiwan, you have a bug.
<RubyPanther>
I can feel the disturbance from here
<mytec>
lol
<shevy>
mytec << will always be faster than +=
jimeh4 has quit [Ping timeout: 244 seconds]
philcrissman has joined #ruby
<mytec>
shevy: yeah, which is why I want to use it
<GeekOnCoffee>
essentially it's putting that method in a variable, that you then call `.call` on
maletor has quit [Quit: Computer has gone to sleep.]
Goles has quit [Quit: Computer has gone to sleep.]
pskosinski has quit [Ping timeout: 276 seconds]
awestroke has quit [Remote host closed the connection]
<RubyPanther>
It is functional programming in Ruby, by exploiting that methods are objects. It is sort of a joke. A simple Ruby MOO.
<RubyPanther>
Consider the source ;)
<bsilwal>
i still dont get it, tbh.
wez_ has joined #ruby
lggr has joined #ruby
<bsilwal>
its passing a variable in a method() method. :S
<RubyPanther>
the name of the method you're asking for
<bsilwal>
and assigning to another variable. what does method() actually do?
voodoofish has quit [Quit: Leaving]
havenn has joined #ruby
<RubyPanther>
you're sending the message "method" to self. With one argument, the name of the method you want. And you get a Method instance. That you can call #call on.
<RubyPanther>
It is like saying send(:foo) except you're saying that the method you're going to call is called :foo now, but actually calling it later.
<RubyPanther>
In the context of the code in question, that is just a way of writing bad code in order to make a point and expose some features.
<RubyPanther>
And to make it harder. Because it is not learncodetheeasyway.
pskosinski has joined #ruby
<bsilwal>
:0 is there any good example of understanding this. :D
<RubyPanther>
Yeah, a good example of understanding it is never ever ever call #method
glyytchy has joined #ruby
<RubyPanther>
It exists but use it. :) Otherwise, understand the finer points of the documentation.
pac1 has quit [Quit: I got it one line of code at a time]
reset has joined #ruby
alanp_ has joined #ruby
Goles has joined #ruby
<havenn>
falieson: Just to confirm, with same 12/9/18: day_select = Date.new(2012,9,18); source.filter(:t_timestamp.like(day_select.strftime '%Y-%m-%d%')).count
<havenn>
falieson: In your second one you are checking a different date, is it for sure incorrect?
<workmad3>
falieson: is timestamp a date or a datetime in the db?
Z0idberg has joined #ruby
Goles has quit [Client Quit]
<workmad3>
falieson: also, what exactly is the issue?
<workmad3>
falieson: is it because line 9 and line 11 produce different counts?
<falieson>
workmad3: the issue is that using the var my count=0, using the written out date I'm getting a count of around 700
<workmad3>
falieson: yeah... that's because (and this is weird), they're *different* :P
<falieson>
DateTime :t_timestamp
<havenn>
bsilwal: The forest is real, but not evil. Just dark at night. The evil queen is actually a beautiful princess, and she is adopting a new puppy called 'Refinements'.
<workmad3>
falieson: line 9 is a date in september, the date you've created is in augest :P
<workmad3>
*august
<havenn>
9 != 8
<workmad3>
^^
<falieson>
.....
<falieson>
*le sigh*
lggr has quit [Ping timeout: 245 seconds]
<falieson>
yeah
<falieson>
it works
<falieson>
thanks workmad3
<falieson>
havenn:
<workmad3>
np :)
kiyoura has joined #ruby
* falieson
hangs head in shame
<workmad3>
in fairness, most people have spent hours staring at code, wondering why it's doing different things, without realising they have a 1 char difference :D
<falieson>
lollll
lggr has joined #ruby
tgraham is now known as tgraham|away
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
Targen has joined #ruby
Goles has joined #ruby
ElderFain_ has quit [Ping timeout: 272 seconds]
<bsilwal>
havenn: interesting will be looking forward to tap the head of this puppy.
LouisGB has joined #ruby
ElderFain has joined #ruby
rakl has quit [Quit: sleeping]
chimkan_ has quit [Quit: chimkan_]
lggr has quit [Ping timeout: 244 seconds]
dpk has joined #ruby
wedtm is now known as wedtm|away
reuf has joined #ruby
ElderFain has quit [Ping timeout: 272 seconds]
lggr has joined #ruby
saschagehlich has quit [Read error: Connection reset by peer]
Takehiro has joined #ruby
saschagehlich has joined #ruby
jamjam has quit [Ping timeout: 245 seconds]
arietis has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-rc2)]
jenrzzz has quit [Ping timeout: 246 seconds]
hbpoison has joined #ruby
Takehiro has quit [Ping timeout: 260 seconds]
macmartine has joined #ruby
ElderFain has joined #ruby
<falieson>
I can't find the Sequel command for select order random - either of you know this?
lggr has quit [Ping timeout: 245 seconds]
reset has quit [Quit: Leaving...]
<falieson>
I know I can send the raw but trying to do it through the ORM
futilegames has joined #ruby
futilegames has quit [Client Quit]
mikepack has quit [Remote host closed the connection]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
glyytchy has quit [Quit: Leaving...]
banseljaj is now known as imami|afk
lggr has joined #ruby
butblack has quit [Quit: butblack]
ereslibre has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
jblack has joined #ruby
falieson has quit [Ping timeout: 240 seconds]
mxweas has joined #ruby
butblack has joined #ruby
<matti>
SO.
<matti>
Yes.
<matti>
Calculating FizzBuzz from 1 to 1_000_000_000_000 does take time.
<matti>
;d
slicekick has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<GeekOnCoffee>
matti: there's probably a more efficient solution if you're doing it to scale… most ruby solutions are elegant over efficient
butblack has quit [Quit: butblack]
friskd has joined #ruby
wargasm has joined #ruby
snorkdude has quit [Ping timeout: 246 seconds]
<matti>
GeekOnCoffee: Well, I wrote it in such a way that you will get Enumerator.
<GeekOnCoffee>
gist? :)
Xeago has joined #ruby
<matti>
GeekOnCoffee: Imagine .to_a on 1 to 1_000_000_000_000 :) How may TB of RAM do you have? ;]
bier has quit [Ping timeout: 260 seconds]
<matti>
GeekOnCoffee: github.com/kwilczynski/fizzbuzz -- support for Bignum was just added by me, I will push in a moment.
<matti>
krzysztof@samsung:~$ time ruby -rrubygems -e 'require "fizzbuzz" ; p FB.new(1, 1_000_000_000_000).each {|i| p [i, i.class] }' > fizzbuzz.log
lggr has joined #ruby
<matti>
100% CPU2
<matti>
;d
<matti>
GeekOnCoffee: BTW, this entire project is to have some fun ;]
cantonic has quit [Quit: cantonic]
vitor-br has joined #ruby
cantonic has joined #ruby
<GeekOnCoffee>
matti: it's a rotating pattern of 15, you might be able to do something efficiency wise with the pattern
jenrzzz has quit [Ping timeout: 245 seconds]
<matti>
GeekOnCoffee: I am doing. I use score-based approach.
<matti>
GeekOnCoffee: Look at .h
ryanf_ has quit [Quit: leaving]
<matti>
GeekOnCoffee: And it works for arbitrary large values.
<matti>
GeekOnCoffee: Unless I helve set in chunks and do parallel computation on multiple CPU cores / CPUs. Then it will be rather slow with default Ruby model ;]
lggr has quit [Ping timeout: 240 seconds]
napolean has quit [Quit: Page closed]
<matti>
GeekOnCoffee: Hehe, imagine BOINC taks ;p
<matti>
GeekOnCoffee: Finding biggest FizzBuzz ;p
* matti
is silly
timonv has quit [Remote host closed the connection]
<GeekOnCoffee>
finding one fizz buzz value is easy though
<matti>
I know ;]
lggr has joined #ruby
<GeekOnCoffee>
and fast
slicekick has quit [Remote host closed the connection]
glyytchy has joined #ruby
<matti>
GeekOnCoffee: FB#[] does this.
snorkdude has joined #ruby
bobbbo has quit [Quit: bobbbo]
Criztian has quit [Remote host closed the connection]
freeayu has joined #ruby
bier has joined #ruby
lurraca has joined #ruby
<havenn>
Tried doing really fast FizzBuzz with EM::Symphony, but it choked. Celluloid on the other hand is flying!: https://gist.github.com/3805403