<ihatehonkies>
bruh I was in dogecoin channel and some op was treating me like I was his nigger by trying to make me do shit and obey his orders its like no bitch do I look like a nigger to you? I ain't gonna do shit for no bitch ass cracker
ghr has quit [Ping timeout: 246 seconds]
<sevenseacat>
!ban ihatehonkies !T 1d
ihatehonkies was kicked from #ruby by ChanServ [User is banned from this channel]
braincrash has quit [Quit: bye bye]
Channel6 has joined #ruby
PotHeadAww is now known as Aww
mcpierce has quit [Ping timeout: 272 seconds]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
lol
quimrstorres has joined #ruby
<sevenseacat>
good morning.
braincrash has joined #ruby
quimrstorres has quit [Ping timeout: 244 seconds]
ismaelga has joined #ruby
keen___________3 has joined #ruby
chinmay_dd has quit [Remote host closed the connection]
keen___________2 has quit [Ping timeout: 244 seconds]
chinmay_dd has joined #ruby
AlexRussia has joined #ruby
rodfersou has quit [Quit: leaving]
chinmay_dd has quit [Remote host closed the connection]
<Ox0dea>
shevy: `warn` prints a newline.
duoi has joined #ruby
<shevy>
hmm
scripore has quit [Quit: This computer has gone to sleep]
balazs has quit [Remote host closed the connection]
frem has quit [Quit: Connection closed for inactivity]
<shevy>
Hongo if you use only one ruby version, it may be easier for you
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<Hongo>
yeah im reading a book for beginners and i need 2.0.0
The_Phoenix has joined #ruby
<Hongo>
so if i do the apt-get ruby2.0 should i need to unistall the other version?
<xxneolithicxx>
then you already got it, i wouldnt mess with rvm just for that yet. just replace commands for ruby with ruby-2.0 or #!/usr/bin/ruby with #!/usr/bin/ruby-2.0
<xxneolithicxx>
no you dont
<xxneolithicxx>
they cant sit there just fine just make sure to call the right one
cubesandcode has joined #ruby
<xxneolithicxx>
otherwise uninstall the ruby one if you really want to be sure and leave ruby-2.0
<shevy>
whenever you use .each, you can also use .each_with_index
<shevy>
if you need the index
<xxneolithicxx>
3 template strings and you are good to go
mansel has joined #ruby
<Diabolik>
in the render method?
<xxneolithicxx>
and use a transpose on the first row to get the vertical side
<xxneolithicxx>
yes
CorySimmons has joined #ruby
<xxneolithicxx>
first row is print the join of the range, second is print the separator to the right length and all others are for each element in transpose of the first row print the element and then the join of the products
<al2o3-cr>
Diabolik: what does ruby main.rb supposed to show?
<Diabolik>
a multiplication table of prime numbers
<al2o3-cr>
ah ok
dopie has quit [Quit: This computer has gone to sleep]
<xxneolithicxx>
i would make that a function, i was lazy there.
<Diabolik>
its in lib/prime_grid.rb
<Ox0dea>
xxneolithicxx: Ruby doesn't have functions.
arescorpio has quit [Quit: Leaving.]
Vainglory has joined #ruby
<xxneolithicxx>
methods, whatever, same difference
<xxneolithicxx>
Diabolik: yes before the each
<xxneolithicxx>
you will want to compute the max column width matrix
<Vainglory>
my program is getting /usr/bin/two_factor_ssh:11:in `gets': Interrupt from /usr/bin/two_factor_ssh:11:in `<main>' - when doing ctrl+c to close. how can i catch all exceptions and simply exit without showing anything?
zarubin_ has quit [Ping timeout: 272 seconds]
<al2o3-cr>
Vainglory: you can rescue Interrupt for ctrl+c
commondream has quit [Remote host closed the connection]
commondream has joined #ruby
draughtpunk is now known as pipework
serivich has quit [Ping timeout: 265 seconds]
chinmay_dd has joined #ruby
<Vainglory>
al2o3-cr: i'm not quite sure what that means
<Ox0dea>
Vainglory: Yes, because you're using Exception.
commondream has quit [Remote host closed the connection]
<Ox0dea>
al2o3-cr: Rescuing StandardError doesn't handle the Interrupt exception, for example, which defeats the purpose.
Vainglory has left #ruby [#ruby]
baweaver has joined #ruby
Exponential has quit [Client Quit]
senayar has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
ohaibbq has joined #ruby
<al2o3-cr>
Ox0dea: I thought he was using trap for that my bad
mello has quit [Ping timeout: 264 seconds]
Sawbones has quit []
senayar has quit [Ping timeout: 245 seconds]
Darryl___ has joined #ruby
nateberkopec has quit [Quit: Leaving...]
yh has joined #ruby
pengin has quit [Remote host closed the connection]
pengin has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
codeFiend has quit [Quit: codeFiend]
iamninja has joined #ruby
ghr has joined #ruby
bMalum has joined #ruby
jeaye has joined #ruby
havenwood has joined #ruby
mahmoudmahfouz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pengin has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
ghr has quit [Ping timeout: 246 seconds]
blt has quit [Quit: WeeChat 1.2]
greenbagels has joined #ruby
Musashi007 has quit [Quit: Musashi007]
duderonomy has joined #ruby
_blizzy_ has quit [Ping timeout: 265 seconds]
CloCkWeRX has left #ruby [#ruby]
quimrstorres has joined #ruby
starless has joined #ruby
athos_diddy has quit []
Sawbones has joined #ruby
bronson has joined #ruby
dseitz has joined #ruby
commondream has joined #ruby
mary5030 has quit [Remote host closed the connection]
quimrstorres has quit [Ping timeout: 256 seconds]
Robr3rd has joined #ruby
charliesome has quit [Quit: zzz]
charliesome has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
<Robr3rd>
Perhaps I'm thinking about this the wrong way, but I can't help but wonder what the best way would be to get a list (so Array) of instance objects of a class. For example, `Class.getAllInstances` would return "[InstanceObject1, InstanceObject2, InstanceObject3]" for 3 instances.
riotjones has joined #ruby
commondream has quit [Remote host closed the connection]
Deck- has joined #ruby
yh has quit [Ping timeout: 265 seconds]
riotjones has quit [Read error: Connection reset by peer]
jamesbrink has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 272 seconds]
<Robr3rd>
So I take it al2o3-cr's method would be the "proper" way to go with this? (This is something that will be interacted with frequently.)
greenbagels has quit [Read error: Connection reset by peer]
<baweaver>
Probably, but why do you need to?
User458764 has joined #ruby
greenbagels has joined #ruby
ismaelga has quit [Remote host closed the connection]
<Robr3rd>
So the scenario would probably be the most helpful. To learn Ruby, I am making a Taxt-based RPG (typical, I know). I am currently making the battle engine -- more specifically the targeting system AI for the computer enemies. So my thinking is, if I have multiple players then (at least for now) I want it to pull a random character (instantiated by the Character class).
<Robr3rd>
So something like `Character.getCharacter(rand(0...Character.getAllCharacters))` or something along those general lines.
<Ox0dea>
al2o3-cr: Why the #map?
michael_mbp has joined #ruby
<michael_mbp>
hmm rather quiet.
<al2o3-cr>
Ox0dea: because it returns an enumerator
<al2o3-cr>
to_a
jpfuentes2 has joined #ruby
<Ox0dea>
Yes.
mistermocha has quit [Remote host closed the connection]
jpfuentes2 has quit [Client Quit]
<Ox0dea>
map(&:itself) just looks really silly is all.
<al2o3-cr>
Ox0dea: just rushing and not thinking is all
<Ox0dea>
Fair enough.
yh has joined #ruby
A205B064 has quit [Ping timeout: 272 seconds]
CorySimmons has quit [Quit: Bye!]
bkxd has joined #ruby
<Robr3rd>
Or I guess this might be more helpful to convery where my mind is: `character_instance = Character.getCharacter(rand(0...Character.getAllCharacters.size)); character_instance.damage(5)``
Sawbones has quit [Remote host closed the connection]
konsolebox has joined #ruby
<Robr3rd>
There are some obvious logical issues in that code, but you get the gist of it. But yeah, so am I going about this the right way baweaver such that I have a legitimate reason to go down this line of thought, or am I missing a better methodology?
<Ox0dea>
Robr3rd: You should probably structure your code such that getting a random character is as simple as `characters.sample`.
Exponential has joined #ruby
Musashi007 has joined #ruby
<baweaver>
Just make an array for your characters
<baweaver>
Look into Practical Object Oriented Design in Ruby
<baweaver>
That should cover about anything you need to know about structure
Sawbones has joined #ruby
aryaching has joined #ruby
<Robr3rd>
baweaver, Thank you. Bookmarked for now. In the short-term, my struggle is where I should keep that array such that it is easily accessible when necessary. Coming from a PHP background, Ruby's variable scopes are *just* different enough to throw me for a loop sometimes.
<baweaver>
Very short variant of it
<baweaver>
Create objects for everything
<baweaver>
then make a script that builds / runs the script
charliesome has quit [Quit: zzz]
<Robr3rd>
So I should have a Character object for handling each instance of a character and then a Characters object that is able to interact with them all on a macro scale?
<baweaver>
So you have characters, enemies, and a map
<baweaver>
You could make a team class
<baweaver>
but keep all actions you can in the character
<Robr3rd>
Another part I'm undecided on is how to do skills. In PHP I would make it a static class, although I'm not sure what the "Ruby Way" to do this is. Essentially, each method would be a skill and the code for that skill (passing the source and target)
joneshf-laptop has joined #ruby
<baweaver>
So you have the objects so far: Entity, Character < Entity, Enemy < Entity, Team, Map
<maquriaf>
I've been trying to load couple pages from Ruby script and I keep getting this error: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
tesuji has joined #ruby
<maquriaf>
After looking around it seems like there's something wrong with the SSL certificates file far as I read, so I tried updating by: apt-get install ca-certificates
<elev>
but jhass how can I fix it? I think its all line 3 wrong
<maquriaf>
it's installed and still having error.
<elev>
I dont think I can code it in that way
<maquriaf>
I also tried changing the certificate file by using:
<sevenseacat>
maquriaf: try updating your rubygems
<maquriaf>
since that's the place certificates files seem to be at in my system (Ubuntu 14.04), but I'm still having the same error.
<sevenseacat>
maquriaf: gem update --system
<jhass>
elev: do you even try to understand your mistake?
<elev>
yes
<sevenseacat>
then undo all of the stuff you did stuffing around with certificates
<jhass>
you don't make the impression
<jhass>
elev: you've been given about 5 hints by now, none to which you responded and just continued whining that it doesn't work
Yzguy has quit [Quit: I'm sleeping, go away.]
<toretore>
sounds to me like you've been given homework and you come here to ask incessently until someone gives you the answer and you don't have to think or learn
mistermocha has quit [Ping timeout: 265 seconds]
<elev>
so everything its good before the string+
wookiehangover has quit [Ping timeout: 265 seconds]
<sevenseacat>
elev: you ask yourself why you're making it into a string
<elev>
can I make it to anything else?
dudedudeman_ has joined #ruby
yh has joined #ruby
<elev>
is that possible?
<sevenseacat>
elev: what *should* it be?
<dudedudeman_>
hey jhass, are you around?
<jhass>
elev: yes, you already did
Limix has joined #ruby
banister has quit [Client Quit]
<jhass>
.to_i makes things into a Fixnum
<elev>
I got to_f now
<jhass>
that makes things into a Float
<elev>
yup
<jhass>
I guess you're still making that Float into a String though
<elev>
this is wrong right? "#{user}"
<jhass>
this makes user into a String
<sevenseacat>
google "string interpolation"
<jhass>
dudedudeman_: sup?
<dudedudeman_>
jhass: you helped me with my activerecord query yesterday, and i'm wanting to expand upon that using .last
<dudedudeman_>
i'm just not sure where to put it: y = x.joins(:dream_color_monitor).where(["calibrations.date < ?", 76.days.ago]).pluck("dream_color_monitors.tag")
Limix has quit [Read error: Connection reset by peer]
Yzguy has joined #ruby
<elev>
but every time I want a variable to come I need to "#{}
<elev>
right?
RegulationD has joined #ruby
<sevenseacat>
elev: no. are you doing that on line 2?
<shevy>
elev you could think of "gets" as "get string"
<elev>
but the code worked
<elev>
puts "Type an integer: "
<elev>
user = gets.to_f
<elev>
print Math.sqrt user
<elev>
ok
<shevy>
yeah you can assign any arbitrary name to a variable
<sevenseacat>
we saw it the first time you pasted it. don't spam the channel.
<shevy>
like
<shevy>
not_user_input = $stdin.gets.chomp
jenrzzz has joined #ruby
<sevenseacat>
use gist when pasting multiple lines of code.
pigoz has quit [Ping timeout: 265 seconds]
<elev>
ok sorry sevenseacat
mase-chatter has quit [Quit: Leaving]
<elev>
yes shevy :) variables can be any sring
<elev>
well ok, thanks guys :) bye
elev has left #ruby [#ruby]
<dudedudeman_>
i have an active record query and it's showing me all records past a certain amount of days. but, i want to see if the last record is past the specified days, not all of them. gist here: https://gist.github.com/anonymous/f3107d328da67eb99c1e
<shevy>
toretore made him quit
RegulationD has quit [Ping timeout: 264 seconds]
<dudedudeman_>
i have spent some time toying with .last, i just don't know where to put it?
<jhass>
dudedudeman_: in other words you want to know if any is past that amount of days?
balazs has joined #ruby
<jhass>
or you want the oldest record if there's one past x days?
mahmoudmahfouz has joined #ruby
m8 has joined #ruby
<dudedudeman_>
newest record that's past days
senayar has joined #ruby
<jhass>
order("date DESC").limit(1)
<jhass>
or just .first I guess
<jhass>
that won't pluck anymore though
<dudedudeman_>
y = x.joins(:dream_color_monitor).where(["calibrations.date < ?", 76.days.ago]).order("date DESC").limit(1).pluck("dream_color_monitors.tag")
<jhass>
yeah, does that work?
<dudedudeman_>
i think it does. i'm playing in irb and it gave me 1 result
<havenwood>
dorei: Whatcha looking for or just wandering in general?
jpfuentes2 has joined #ruby
_blizzy_ has joined #ruby
<miah>
lol. i read nlp and though neurolinguistic programming.
bruno- has quit [Ping timeout: 240 seconds]
<dorei>
it's the same acronym :p
<dorei>
havenwood: a language classifier, given a text detect its language
balazs has joined #ruby
jpfuentes2 has quit [Remote host closed the connection]
banister has joined #ruby
balazs has quit [Remote host closed the connection]
dseitz has joined #ruby
jpfuentes2 has joined #ruby
balazs has joined #ruby
pigoz has joined #ruby
podman has joined #ruby
jstanton has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
Meow-J has joined #ruby
banister has quit [Read error: Connection reset by peer]
pengin has quit [Remote host closed the connection]
<dudedudeman_>
jhass, i think that .order .limit one is not quite what I was looking for. that's probably because i worded my question in correctly
pengin has joined #ruby
allcentury has joined #ruby
olistik has joined #ruby
<dudedudeman_>
i think this makes more sense: i want to look at all of the records for that particular monitor, and then look at the most recent of those records and then see if it's over the amount of days i specify
pigoz has quit [Ping timeout: 256 seconds]
<jhass>
so you want to now if all records that exists are older?
olistik has quit [Remote host closed the connection]
garyserj has quit []
User458764 has joined #ruby
olistik has joined #ruby
<dudedudeman_>
yes.. it's basically to keep track of whether or not these monitors are out of their calibration spec
growlove has quit [Remote host closed the connection]
Channel6 has joined #ruby
pigoz has joined #ruby
pengin has quit [Ping timeout: 246 seconds]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
ta has quit [Ping timeout: 252 seconds]
<jhass>
mh, that's gonna be tricky in a single query via AR, does it need to be fast?
User4587_ has joined #ruby
railsForDaiz has joined #ruby
User458764 has quit [Ping timeout: 272 seconds]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pigoz has quit [Ping timeout: 252 seconds]
<dudedudeman_>
say monitor 123456 has 20 calibration records, all on different dates, i only care if the most recent one is out of the date
<dudedudeman_>
oh, not really. it's not a huge db, and it's only 2 tables
banister has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
<dudedudeman_>
there's 80 monitors, and each will only get a new record every 3 months.. so we're talking only adding 1000 rows to the table a year
blt has joined #ruby
ghr has joined #ruby
Brozo has joined #ruby
Blaguvest has quit [Remote host closed the connection]
<dudedudeman_>
i guess i could get all the latest entries before i even pass it through the join and the pluck
kenichi has joined #ruby
<dudedudeman_>
x = Calibration.all.last... something like that
ghr has quit [Ping timeout: 244 seconds]
Blaguvest has joined #ruby
maquriaf has left #ruby ["Leaving"]
andrewcarroll has joined #ruby
<andrewcarroll>
hello
coderhs has joined #ruby
<zotherstupidguy>
andrewcarroll hello
<andrewcarroll>
how's it going?
yh has quit [Ping timeout: 245 seconds]
nateberkopec has quit [Quit: Leaving...]
<zotherstupidguy>
liseting to smooth jazz and watchin MIT markov chains lec. opencourseware
<zotherstupidguy>
you?
Brozo has quit [Quit: Leaving...]
<dudedudeman_>
maybe a conditional would be better...
mrsolo has joined #ruby
mistermocha has joined #ruby
<noethics>
that sounds like the most hipster thing of my life
sevenseacat has quit [Quit: Me dun like you no more.]
tomaw has quit [Quit: Quitting]
<noethics>
not music, not jazz, smooth jazz. not a video, not about markov chains, an MIT video about markov chains. that's how it's going, bro
<noethics>
deal with it
<andrewcarroll>
lol
lennae has quit [Ping timeout: 244 seconds]
<andrewcarroll>
my afternoon is a bit less interesting. just mowed back lawn, and now i'm trying to figure out the right search terms to find what i'm looking for on google
<noethics>
what kind of lawn mower did you use?
<noethics>
that's important information
<zotherstupidguy>
lol
vikaton has quit []
<andrewcarroll>
the kind with an engine, and without a seat
yh has joined #ruby
<andrewcarroll>
i'm not a connoisseur
<andrewcarroll>
of lawn mowers
<dudedudeman_>
pleb
<noethics>
i hear those are the best
<dudedudeman_>
lol
<andrewcarroll>
well it's worked solidly for over 20 years I am told
<andrewcarroll>
so that's something
tomaw has joined #ruby
<noethics>
sounds like a good machine you have there
<dudedudeman_>
i just want to live somewhere that requires me to own a lawnmower
<noethics>
no, you really don't
<noethics>
mowing lawns is something that should be avoided if possible
jpfuentes2 has joined #ruby
mary5030 has joined #ruby
<andrewcarroll>
it's not that bad, if the lawn is flat and featureless
mistermocha has quit [Ping timeout: 265 seconds]
<andrewcarroll>
but it's not really something i'd look forward to
<zotherstupidguy>
can you train a dog to do your lawn?
<zotherstupidguy>
i am sure its on youtube =)
olistik has quit [Remote host closed the connection]
mello has joined #ruby
<andrewcarroll>
hm
<andrewcarroll>
not without huge risk of harm to the animal i'd imagine
<zotherstupidguy>
well,if mexicans can do it! nah i didnt just say tht :P
<Jello_Raptor>
I'm futzing around with rake, and is there any way to create a rule which will run if *any* (rather than all) of its prereqs are satisfied?
enebo has quit [Client Quit]
<andrewcarroll>
@shevy cats use, they do not get used
tomaw has quit [Remote host closed the connection]
<Jello_Raptor>
Ideally that works without breaking Rake::task.prerequisite_tasks() since i'm using that mapping for shenanigans.
tomaw has joined #ruby
<zotherstupidguy>
Jello_Raptor i dont think its that flexiable
_seanc_ has joined #ruby
kenichi has joined #ruby
<zotherstupidguy>
you guys saw the two legged cat?
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mello has quit [Ping timeout: 245 seconds]
<shevy>
wat
<shevy>
cats have four legs man
ismaelga has quit [Remote host closed the connection]
<shevy>
we need to get back to the basics in school
<Jello_Raptor>
zotherstupidguy: darn :/ *grumbles about rake prereqs not being an algebra*
<zotherstupidguy>
shevy not the ultra cute ones :P
delianides has joined #ruby
<andrewcarroll>
does anybody know how to present a separate view in a terminal, like vim does when called? as in, when you call vim for example, it creates a separate view for its editor, and when you close it, the previous shell view (with command history) is preserved. is there a way to do that with ruby?
<shevy>
they need to learn how to regrow limbs
ismaelga has joined #ruby
olistik has joined #ruby
<hoelzro>
andrewcarroll: I believe that's a terminal feature called alternate screen or something
kinduff has joined #ruby
<Diabolik>
can someone explain the orthogonality principle to me?
<Diabolik>
in terms of ruby
sinkensabe has quit [Remote host closed the connection]
sinkensabe has joined #ruby
<andrewcarroll>
@hoelzro thank you i believe that put me on the right track
pigoz has joined #ruby
Agoldfish has joined #ruby
<noethics>
andrewcarroll, use tmux
<noethics>
screen is old tech
ta has joined #ruby
<andrewcarroll>
i don't believe alternate screen is the same thing as screen
mujou has quit [Quit: Leaving...]
<noethics>
oh you mean jus tthe vim thing?
delianid_ has quit [Ping timeout: 272 seconds]
bronson has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<noethics>
uh yeah this is tmux but more user friendly and less powerful
User4587_ has quit [Ping timeout: 244 seconds]
<sandstrom>
What's a good way of encapsulating internal methods of a module? (stuff that doesn't need to be accessible from the class that includes the module)
<noethics>
ruby cant do that
kobain has joined #ruby
<zotherstupidguy>
sandstrom private methods?
pontiki has joined #ruby
<shevy>
yeah, private - but note that ruby still allows you to bypass things, via e. g. .send() sandstrom
<noethics>
for semantics it's good i guess
<noethics>
but yeah it's basically pointless
<noethics>
functionally
<sandstrom>
zotherstupidguy they are accessible to the class including the module
jpfuentes2 has joined #ruby
<zotherstupidguy>
if you really need it! you can override .send() in the module level to raise an exception
<noethics>
:|
<noethics>
pls dont
User458764 has joined #ruby
<andrewcarroll>
it's not pointless, it clearly communicates that they're not supposed to be touched, but in true ruby fashion gets out of your way if you want to be a rebel
zarubin has joined #ruby
<noethics>
yeah as i said it's good for semantics
jpfuentes2 has quit [Client Quit]
<noethics>
let's fight about it
<andrewcarroll>
rar
olistik has quit [Remote host closed the connection]
delianides has quit [Remote host closed the connection]
<shevy>
perhaps it's a german nick
<sandstrom>
close
pigoz has quit [Ping timeout: 264 seconds]
allcentury has quit [Ping timeout: 256 seconds]
<zotherstupidguy>
sandstrom the german cup final is today?
patteh has quit [Remote host closed the connection]
<sandstrom>
I wouldn't know, I'm not german and I don't follow cups.
patteh has joined #ruby
pigoz has joined #ruby
<shevy>
perhaps scandinavia?
jenrzzz has quit [Ping timeout: 264 seconds]
<zotherstupidguy>
sandstrom there is hack for what you want
<sandstrom>
shevy you are right!
<sandstrom>
'sandström' in Swedish
<zotherstupidguy>
sandstrom you can make some private methods on the class, and inside of them you can extend the Private Module, and use its own methods
<zotherstupidguy>
oh, somthing wrong with my client
pigoz has quit [Ping timeout: 252 seconds]
soulcake has quit [Quit: Quack.]
yqt has quit [Ping timeout: 252 seconds]
codeFiend has joined #ruby
soulcake has joined #ruby
vickleton has joined #ruby
Aearnus has joined #ruby
<Aearnus>
Alright, I have probably the weirdest problem anybody's going to hear all day. I'm not quite sure where to ask about it, but here is probably the closest to the best place.
<Aearnus>
I have a CGI script that's supposed to run through webrick
<shevy>
yay!
<shevy>
ruby cgi
<Aearnus>
I kept getting an error saying "Premature end of script headers" bla bla bla
<Aearnus>
(also :P)
ghr has joined #ruby
<shevy>
WEBrick::HTTPServlet::CGIHandler
<shevy>
yeah I think you sent the wrong header Aearnus
<Aearnus>
No, hold on
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Aearnus>
this is where it gets weird
<shevy>
can you view the source of the page?
* zotherstupidguy
excited
<Aearnus>
I'm sending the headers correctly, the issue is that when the CGI script tries to run, it doesn't output the headers or anything
<shevy>
I usually have something like "<!DOCTYPE html>\r\n" or similar to that
vikaton has joined #ruby
<shevy>
your script works when you use lighttpd or apache-httpd?
<Aearnus>
It just outputs ": No such file or directory"
<shevy>
hmm
<shevy>
my .cgi files exist :D
<Aearnus>
Like, I think it's a problem with rbenv
<shevy>
oh... ok. I don't have rbenv... I use plain ruby in /usr prefix
<Aearnus>
Because if I run any ruby file with ./ and a shebang at the top it does that.
tmadsen has joined #ruby
<Aearnus>
(Which is what exec does, which is what runs the CGI scripts, which is why I'm having this problem)
Sawbones has quit [Remote host closed the connection]
tmadsen has left #ruby [#ruby]
allcentury has joined #ruby
pigoz has joined #ruby
ghr has quit [Ping timeout: 240 seconds]
krz has joined #ruby
<Aearnus>
When I type "file <my script>", it has the correct output (Ruby script, ASCII text executable, with CRLF line terminators)
<Aearnus>
It just refuses to run with ./ :(
<pontiki>
Aearnus: what's the full #! line?
<Aearnus>
#!/usr/bin/env ruby
djbkd has joined #ruby
<jhass>
what's the exact output?
<jhass>
maybe make a gist with the script and the output
hsps_ has joined #ruby
<pontiki>
do you have that in the PATH / ENV of the context where that's running? probably not your own login shell
<Aearnus>
The script itself isn't important, this happens with every ruby script I've tried on my system
<jhass>
what does type -a ruby say?
<Aearnus>
/usr/bin/env ruby --version outputs ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux] as it should
<Aearnus>
type -a ruby outputs "ruby is /home/spng453/.rbenv/shims/ruby \n ruby is /usr/bin/ruby"
<Aearnus>
Which also seems correct
rkazak has joined #ruby
<Aearnus>
I think I might know the issue, is there a command to directly dump the data from a file? Like, without encoding
<jhass>
hexdump
<Aearnus>
I think that I was editing all these scripts on windows and it added a carriage return to the shebang
<jhass>
oh right, file reports CRLF
<jhass>
dos2unix your_script.rb
<jhass>
can't do harm
coderhs has quit [Ping timeout: 264 seconds]
<Aearnus>
That... that was the stupidest issue I've ever had to deal with
<Aearnus>
dos2unix worked though
RegulationD has joined #ruby
<Aearnus>
Thanks!
<shevy>
I am sure there more stupid issues will crop up in the future
gaboesquivel has joined #ruby
<jhass>
yeah, line ending issues are stupid
Zai00 has quit [Quit: Zai00]
<Aearnus>
Alright, at least I know what it looks like when that happens now, lol
<jhass>
or just stop using cgi :P
<noethics>
jhass, why ;o
mahmoudmahfouz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
because we got rack!
<noethics>
but
<jhass>
sshh
Asher has quit [Quit: Leaving.]
kalusn has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
hsps_ has quit [Quit: Leaving]
Asher has joined #ruby
RegulationD has quit [Ping timeout: 250 seconds]
<Aearnus>
I would, but this was supposed to be a 2 minute thing, I just wanted to show my friend all the gifs I had :(
aryaching has quit []
<Aearnus>
In a convenient web page format, of course
<pontiki>
why not just pop up a local web server on the directory?
banister is now known as banisterfiend
<Aearnus>
Because I put them into a little gallery and added css animations to them and it looks cool :P
<pontiki>
all of that works
<pontiki>
it's basically a static site
<Aearnus>
True, but I have a *lot* of gifs that I didn't want to type out into a static site
<Aearnus>
And I needed to brush up on my ruby skills a little
<pontiki>
wut?
<pontiki>
write a script
shuber_ has joined #ruby
<Aearnus>
Eh, same thing. Sure, it's not the most conventional use of CGI, but if it works, it works :P
olistik has joined #ruby
<jhass>
middleman \o/
<jhass>
(yes, total overkill for that)
<noethics>
i think that's probably the #1 idiom from the "real world" that doesn't convert to programming. "if it works it's not stupid"
lennae has quit [Ping timeout: 244 seconds]
jenksy is now known as dijikul
someword has quit [Quit: Leaving.]
dijikul is now known as jenksy
Ropeney has joined #ruby
starless has joined #ruby
bMalum has quit [Quit: bMalum]
gaboesquivel has quit [Remote host closed the connection]
yqt has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nettoweb has joined #ruby
jpfuentes2 has joined #ruby
balazs has joined #ruby
tejasmanohar has quit [Ping timeout: 276 seconds]
Limix has joined #ruby
tejasmanohar_ has joined #ruby
scripore has joined #ruby
balazs has quit [Ping timeout: 255 seconds]
delianides has joined #ruby
The_Phoenix has quit [Quit: Leaving.]
<Obfuscate>
noethics: I can assure you that's not the case in the real world either.
I has joined #ruby
I is now known as Guest50824
bluish has quit [Quit: bluish]
tejasmanohar_ has quit [Ping timeout: 250 seconds]
mrsolo has quit [Quit: This computer has gone to sleep]
andrewcarroll has left #ruby [#ruby]
ito42 has joined #ruby
claptor has quit [Quit: this channel is bakas]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<_seanc_>
Obfuscate: +1
olistik has quit [Remote host closed the connection]
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
CustosLimen has joined #ruby
a346 has joined #ruby
bMalum has joined #ruby
yqt has quit [Ping timeout: 264 seconds]
Guest50824 has quit [Quit: This computer has gone to sleep]
mary5030_ has joined #ruby
mary5030_ has quit [Remote host closed the connection]
<jhass>
ito42: as with most concurrency problems, it heavily depends on your workload, there are few generally applicable solutions to concurrency
yh has joined #ruby
<jhass>
oh and afaik .value joins the thread, so the join is redundant
nettoweb has joined #ruby
<jhass>
you can also replace the manual array concats with flat_map and map
kinduff has quit [Ping timeout: 250 seconds]
plashchynski has joined #ruby
Meow-J has quit [Quit: Connection closed for inactivity]
mary5030 has quit [Ping timeout: 264 seconds]
bMalum has quit [Quit: bMalum]
<ito42>
jhass: do you think is gonna be better if i wrote it with mutex and enumerable.next?
<jhass>
see above
<jhass>
for example it might be worth to see if (for your workloads) creating a bunch of queues and c consumers for these might be more efficient than spawning n/c threads
<jhass>
well, n threads even
<jhass>
after all thread creation is a bit expensive
ndrei_ has joined #ruby
Lucky__ has joined #ruby
olistik has joined #ruby
ndrei has quit [Ping timeout: 265 seconds]
ghr has joined #ruby
delianides has quit [Remote host closed the connection]
momomomomo has joined #ruby
mistermocha has joined #ruby
bMalum has joined #ruby
jenrzzz has joined #ruby
momomomomo has quit [Read error: Connection reset by peer]
mrsolo has joined #ruby
ghr has quit [Ping timeout: 272 seconds]
pengin has joined #ruby
someword has joined #ruby
kinduff has joined #ruby
kinduff has joined #ruby
GnuYawk has quit [Read error: Connection reset by peer]
wildroman2 has joined #ruby
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shuber_ has quit []
Limix has quit [Quit: Limix]
__chris has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
Limix has joined #ruby
juanda has joined #ruby
RegulationD has joined #ruby
evlute has joined #ruby
<evlute>
hello - i wanna know what evironment variables i have to set, to get rack/rackup working as a system.d service file
<evlute>
i get the error: require : cannot load such file -- rack (LoadError)
<havenwood>
elev: Instead of `gistfile1.txt` name your Gists with a .rb extension. That way they have nice syntax highlighting and they're easier for folk to clone and try.
workmad3 has quit [Ping timeout: 272 seconds]
<elev>
ah ok
<havenwood>
elev: Change your editor to use two-space soft tabs (where tabs are represented by two spaces) rather than hard tabs.
<elev>
what you mean by that?
riotjones has quit [Ping timeout: 272 seconds]
<_seanc_>
What editor do you use?
<elev>
sublime text
<jhass>
havenwood: I hope you do have those canned
<_seanc_>
You’ll find soft-tabs in everyone’s style guide.
<havenwood>
elev: Will look nicer on Github and be consistent across text editors regardless of tab settings. It's a firmly ingrained community standard.
gambl0re has joined #ruby
<elev>
ok
<havenwood>
elev: Change the preferences as _seanc_ linked to make it stick.
jstanton has quit [Ping timeout: 265 seconds]
namester has quit [Ping timeout: 244 seconds]
scripore has joined #ruby
namester_ has joined #ruby
<Jello_Raptor>
hmm, rake adds string.pathmap_explode and a few other functions as protected methods. How can i play around with them in irb?
<Jello_Raptor>
require 'rake' doesn't seem to do much
jpfuentes2 has joined #ruby
namester_ has quit [Client Quit]
<_seanc_>
Jello_Raptor: you can use send(:symbol) to access protected/private methods if you’re playing around.
<_seanc_>
I’d avoid using that in production code as you may experience unintended consequences.
OrbitalKitten has joined #ruby
elev has quit [Quit: Lost terminal]
delianid_ has quit []
<Jello_Raptor>
_seanc_: i'm nto sure i understand.
<Jello_Raptor>
ahh nevermind
<Jello_Raptor>
that's useful
<Jello_Raptor>
thanks :)
<_seanc_>
YW!
<_seanc_>
Let me know if you need a hand :)
DerisiveLogic has joined #ruby
<Jello_Raptor>
_seanc_: heh <_< i'm trying to futz with rake so that it can precompute a full dependancy graph for a system which includes tools that read files to analyse their dependancies :V
<Jello_Raptor>
/o/ monkey-patches ahoy
michael_mbp has quit [Excess Flood]
elev has joined #ruby
<_seanc_>
Sounds cool!
michael_mbp has joined #ruby
kinduff has quit [Ping timeout: 276 seconds]
scripore has quit [Quit: This computer has gone to sleep]
codecop has quit [Remote host closed the connection]
elev has quit [Quit: Lost terminal]
<shevy>
dumdedum
senayar has joined #ruby
centrx has joined #ruby
zarubin has joined #ruby
<shevy>
is there a way to have rdoc or yard apply custom-formatting rules to .rb files?
__chris has joined #ruby
senayar has quit [Ping timeout: 258 seconds]
Encapsulation has quit [Quit: Leaving]
_ixti_ has joined #ruby
__chris has quit [Client Quit]
soahccc has quit [Ping timeout: 240 seconds]
ixti has quit [Ping timeout: 272 seconds]
zarubin has quit [Ping timeout: 272 seconds]
soahccc has joined #ruby
senayar has joined #ruby
maloik has quit [Remote host closed the connection]
duckson has quit [Ping timeout: 272 seconds]
senayar has quit [Changing host]
senayar has joined #ruby
maloik has joined #ruby
qwertme has joined #ruby
Yzguy has joined #ruby
wildroman2 has joined #ruby
watchtheblur has joined #ruby
duckson has joined #ruby
centrx has quit [Quit: Shutting down, Please wait...]
crus` has joined #ruby
crus has quit [Ping timeout: 255 seconds]
ito42 has quit []
Pupeno has joined #ruby
Pupeno has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rindolf has quit [Quit: Leaving]
maloik has quit [Ping timeout: 244 seconds]
maloik has joined #ruby
yh has quit [Ping timeout: 265 seconds]
a346 has quit [Quit: a346]
allcentury has quit [Ping timeout: 256 seconds]
commondream has quit [Remote host closed the connection]
commondream has joined #ruby
commondream has quit [Remote host closed the connection]
commondream has joined #ruby
wildroman2 has quit [Remote host closed the connection]
Yzguy has quit [Remote host closed the connection]
commondream has quit [Remote host closed the connection]
commondream has joined #ruby
aef has quit [Remote host closed the connection]
aef__ has joined #ruby
__chris has joined #ruby
stoddart has quit [Quit: leaving]
DefV has quit [Ping timeout: 272 seconds]
DefV has joined #ruby
__chris has quit [Client Quit]
yardenbar has quit [Quit: Leaving]
commondream has quit [Ping timeout: 255 seconds]
qwertme has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<flynn>
Does anyone know how to change desktop resolution using Windows API? I can read information into my program but I don't seem to be able to influence any change to windows. I've read through the 'ChangeDisplaySettings' function documentation but, in truth, its all beyond me and mostly applies to C+ which I'm even less capable in than ruby.
hollywood has quit [Ping timeout: 272 seconds]
hollywood has joined #ruby
segfalt has joined #ruby
gluten_hell_ has quit [Quit: Computer has gone to sleep.]
SebastianThorn has quit [Remote host closed the connection]
SebastianThorn has joined #ruby
qwertme has joined #ruby
<shevy>
the windows API is very annoying
ndrei_ has quit [Ping timeout: 246 seconds]
<shevy>
usually the ruby API is a direct mapping to that
decoponio has quit [Read error: Connection reset by peer]
atmosx has quit [Quit: parting / quiting]
commondream has quit [Ping timeout: 258 seconds]
Limix has quit [Client Quit]
decoponio has joined #ruby
coderhs has quit [Quit: Leaving]
qwertme has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomaszbalon has quit [Remote host closed the connection]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ghr has quit [Ping timeout: 256 seconds]
mandarinkin has quit [Quit: Leaving]
toretore has quit [Quit: This computer has gone to sleep]
balazs has quit [Remote host closed the connection]
byteoverfl0w has quit [Read error: Connection reset by peer]
byteoverfl0w has joined #ruby
HotFlower has quit [Ping timeout: 252 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mrsolo has quit [Quit: This computer has gone to sleep]
Xiti has joined #ruby
Brozo has quit [Remote host closed the connection]
juanda has quit [Quit: juanda]
juanda has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
mello has joined #ruby
ddarkpassenger has joined #ruby
scripore has joined #ruby
Power88 has joined #ruby
<Power88>
is anyone here a web developer?
<Diabolik>
yes Power88
assembledbits has joined #ruby
<Power88>
how much would you charge to setup an etsy page?
mattp__ has joined #ruby
<assembledbits>
but the interpolation isn't working, it just spits out as string.. what's the correct format?
<assembledbits>
i tried concatenation with ' + but that throws an error
<Diabolik>
Power88 what do you mean
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mattp_ has quit [Quit: WeeChat 0.4.2]
<Diabolik>
and this probably isn't the right channel for this
greenbagels has joined #ruby
<assembledbits>
Hey guys, I have this as html_safe output, flash[:notice] = '<div class="alert alert-success" role="alert">Category <strong>#{category.name}"</strong> destroyed successfully.</div>' ^^
<Power88>
like how much would it cost to make an etsy page if I were to hire you
mello has quit [Ping timeout: 252 seconds]
greenbagels has quit [Max SendQ exceeded]
HotFlower has joined #ruby
<assembledbits>
anyone know why the interpolation isn't working
<assembledbits>
I'm not sure how to escape string for interpolation in that format
<Power88>
escape is always \
<Power88>
\
Joufflu has joined #ruby
<Power88>
backslash
bluOxigen has quit [Ping timeout: 272 seconds]
HotFlower has quit [Client Quit]
<assembledbits>
That prints "Category \#{category.name}" destroyed successfully."
<existensil>
assembledbits: looks like yu're trying to use interpolation with single quotes
HotCoder has joined #ruby
<existensil>
you can't do that
<assembledbits>
If I use the single quotes in the html is that fine
<existensil>
use double quotes, or %{} or one of the many other interpolation enabled
<existensil>
just escape your quotes if you use double quotes
Rickmasta has joined #ruby
<assembledbits>
AHA!
<assembledbits>
there we go, thanks man
<assembledbits>
<3
<assembledbits>
I only just learned ruby (on rails) a few weeks ago
<existensil>
I understand
Power88 has quit [Remote host closed the connection]
Guest50824 has quit [Quit: This computer has gone to sleep]
<assembledbits>
Yeah, I'm using to PHP and single / double quote eye sores
<existensil>
there are many more ways to represent strings in Ruby. But no interpolation with '' or %q{}
ArchRogem has joined #ruby
<assembledbits>
<3
Guest50824 has joined #ruby
ArchRogem has quit [Client Quit]
byteoverfl0w has quit [Quit: Leaving... have a good one...]
<assembledbits>
What's a clean way to resolve when you click the back button and it tries to reload an item but it can't find that ID
last_staff has quit [Quit: last_staff]
<assembledbits>
rather than give an error, can I make it auto forward to index
zarubin has joined #ruby
<existensil>
redirect_to in your controller to the index you want when the lookup fails. You might want #RubyOnRails though
Cache_Money has joined #ruby
<existensil>
or don't have objects that would disappear when you press back
Musashi007 has quit [Quit: Musashi007]
<assembledbits>
so if I'm using @category = Category.find(params[:id]) for show, then I'd do if !@category .. redirect_to ?
<existensil>
yes, but only if you use find_by_id instead of find
<existensil>
find throws an error when it doesn't find anything
<existensil>
find_by_id just returns nil
jpfuentes2 has joined #ruby
<assembledbits>
okay, nice.. works
frowmanjo has joined #ruby
zarubin has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
yfeldblum has quit [Remote host closed the connection]
<frowmanjo>
Free SEO Analyzer/Optimizer + PDF Generator without shit signups or paying. thought i'd share - https://www.criosphinx.net/seo-checker SAVE & SHARE
frowmanjo has quit [Client Quit]
qwertme has joined #ruby
<assembledbits>
oh man that's slick
blackmesa has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
Cache_Money has joined #ruby
Jackneill has quit [Read error: Connection reset by peer]
Cache_Money has quit [Client Quit]
starless has joined #ruby
banisterfiend is now known as Xtopherus`
Musashi007 has joined #ruby
Pupeno has joined #ruby
Pupeno has joined #ruby
segfalt has quit [Quit: segfalt]
bkxd has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
allcentury has joined #ruby
ghr has joined #ruby
<assembledbits>
New problem.. when testing, my the destroy command throws an error referencing that a table doesn't exist
<assembledbits>
and I have no idea why it's pointing to that tabl
<postmodern>
is there a ruby class for working with durations?
<postmodern>
or can I get away with using Time.parse for that?
allcentury has quit [Ping timeout: 246 seconds]
ddarkpassenger has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dseitz has joined #ruby
segfalt has joined #ruby
tejasmanohar has quit [Quit: WeeChat 1.1.1]
Xoro has quit [Read error: Connection reset by peer]
<assembledbits>
NVM fixed that too
ghr has quit [Ping timeout: 265 seconds]
RegulationD has joined #ruby
Pupeno has quit [Quit: Leaving...]
<shevy>
postmodern I think "duration"
<shevy>
I also think that apeiros once wrote something like that too
<shevy>
hmm wait
<shevy>
the "duration" gem at rubygems.org is not the one I mean... last update 2007 :\
<shevy>
apeiros would probably know :) ... or was it chronos gem? hmmm
<postmodern>
every lib seems to do activesupport style
vickleton has quit [Remote host closed the connection]
<postmodern>
i just need to parse time codes (00:04:13) and do arithmetic on them
<shevy>
arithmetic is simple the moment you have a time object
<shevy>
like when you add +3 means add +3 seconds; or if you have a date object, then I think this will be +3 days
<postmodern>
yeah, and i suppose i could just parse them down to seconds
<postmodern>
and format them back out to XX:XX:XX
juanda has quit [Quit: juanda]
RegulationD has quit [Ping timeout: 264 seconds]
mujou has joined #ruby
veduardo has joined #ruby
Pupeno has joined #ruby
<jhass>
I think you'll run into issues with using Time
sandstrom has quit [Quit: My computer has gone to sleep.]
mrsolo has quit [Client Quit]
mrsolo has joined #ruby
watchtheblur has quit [Ping timeout: 276 seconds]
joneshf-laptop has quit [Ping timeout: 255 seconds]
juanda has joined #ruby
allcentury has joined #ruby
xxneolithicxx has quit [Quit: Leaving.]
kinduff has joined #ruby
assembledbits has quit [Quit: Leaving]
arescorpio has joined #ruby
gluten_hell_ has quit [Quit: Computer has gone to sleep.]
Kudos2Me has joined #ruby
centrx has joined #ruby
centrx has quit [Client Quit]
starless has quit [Quit: Leaving]
centrx has joined #ruby
<Kudos2Me>
Send 100% completely unbranded e-mails by us free, forever, try it on yourself first if you don't believe me! Send it from any made up name + email at http://bit.ly/1cqkqvW
Kudos2Me has quit []
balazs has joined #ruby
kinduff_ has joined #ruby
chipotle has quit [Quit: cheerio]
kinduff has quit [Ping timeout: 252 seconds]
mistermocha has joined #ruby
workmad3 has joined #ruby
_seanc_ has quit [Read error: Connection reset by peer]
Guest50824 has quit [Quit: This computer has gone to sleep]
workmad3 has quit [Ping timeout: 276 seconds]
<Jello_Raptor>
_hmm, so i'm trying to monkey-patch rake so that I can change how some of its internals work (make some rules non-mandatory, keep track of dependencies in a slightly different way, etc)
<jhass>
forking might be easier?
mistermocha has quit [Ping timeout: 256 seconds]
Brozo has joined #ruby
Guest50824 has joined #ruby
<Jello_Raptor>
jhass: hmm, i'd like to keep all of the rest of the (non-rake) state around though, since I'm doing a few other things besides.
_seanc_ has joined #ruby
Pupeno_ has joined #ruby
Pupeno has quit [Read error: Connection reset by peer]
CloCkWeRX has joined #ruby
<Jello_Raptor>
before I can start on the modifications to rake :/ :w
Pupeno_ has quit [Client Quit]
<Jello_Raptor>
ahh yeah :/ it doesn't look reasonable, forking it'll have to be.