michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tkuchiki has joined #ruby
nettoweb has joined #ruby
ValicekB has joined #ruby
nettoweb has quit [Max SendQ exceeded]
ffranz has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nettoweb has joined #ruby
havenwood has quit [Remote host closed the connection]
ndrei has joined #ruby
cndiv has quit [Ping timeout: 244 seconds]
mikepack has quit [Remote host closed the connection]
<sevenseacat>
looks like code.
slyslick has quit [Ping timeout: 240 seconds]
skammer1 has joined #ruby
<ferr>
lol
mastr_bennett[x] has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
freerobby has joined #ruby
aspires has quit []
nhhagen has joined #ruby
tokik has joined #ruby
boombadaroomba has joined #ruby
Cache_Money has joined #ruby
aspires has joined #ruby
skammer1 has quit [Ping timeout: 260 seconds]
mollitz has joined #ruby
Olipro has quit [Read error: Connection reset by peer]
nhhagen has quit [Ping timeout: 260 seconds]
emmesswhy has joined #ruby
jasooon has joined #ruby
boombadaroomba has quit [Ping timeout: 250 seconds]
Channel6 has joined #ruby
moritzschaefer has quit [Ping timeout: 246 seconds]
Cache_Money has quit [Quit: Cache_Money]
charliesome has joined #ruby
wolves_cs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
modernbob has quit [Quit: Konversation terminated!]
bricker`work has joined #ruby
modernbob has joined #ruby
<jhass>
ferr: ancestors includes modules, not only superclasses
aleatorik has joined #ruby
<ferr>
I see now
<ferr>
So in this case I should use enumerator to find all subclasses?
<ferr>
*superclasses
Sawbones has quit [Remote host closed the connection]
Mso150 has joined #ruby
Sawbones has joined #ruby
zeroNones has joined #ruby
<jhass>
for finding the first superclass that defines it starting from the passed object something with inject would work I guess, but you should find the first child that defines it starting from BasicObject. So you'll need some iteration and two flags
<jhass>
or yeah, build up the whole inheritance chain to look at, reverse it and call find/detect
kobain has joined #ruby
<ferr>
Which way would you use?
slyslick has joined #ruby
kobain has quit [Max SendQ exceeded]
kobain has joined #ruby
<jhass>
I'm not sure :)
<jhass>
I'd probably code up both and see which feels nicer :P
kobain has quit [Max SendQ exceeded]
kobain has joined #ruby
xcv has joined #ruby
Sawbones has quit [Ping timeout: 272 seconds]
agjacome has quit [Quit: leaving]
emmesswhy has quit [Quit: This computer has gone to sleep]
zorak8 has quit [Ping timeout: 272 seconds]
duncannz has quit [Ping timeout: 245 seconds]
mary5030 has joined #ruby
benzrf is now known as benzrf|offline
emmesswhy has joined #ruby
j_mcnally has quit [Ping timeout: 272 seconds]
benzrf|offline is now known as benzrf
wallerdev has quit [Quit: wallerdev]
bwilson has quit [Quit: bwilson]
mary5030 has quit [Ping timeout: 246 seconds]
emmesswhy has quit [Client Quit]
ghr has joined #ruby
AmBienCeD has quit []
bluehavana has joined #ruby
yfeldblum has quit [Remote host closed the connection]
<eam>
apeiros: when I said rvm was slow as hell, guess what: it was actually due to some crazy instrumentation on bash
govg has quit [Ping timeout: 260 seconds]
<eam>
which happened to have a severe impact on rvm's routines
arescorpio has joined #ruby
<eam>
now I'm back to a snappy .45ms
<eam>
er, 450ms
deric_skibotn has quit [Ping timeout: 246 seconds]
voodoofish has quit [Ping timeout: 258 seconds]
deric_skibotn has joined #ruby
abdulsattar has joined #ruby
icebourg has joined #ruby
govg has joined #ruby
VBlizzard is now known as Blizzyy
Suchit____ has joined #ruby
Blizzyy is now known as VBlizzard
Suchit__ has quit [Ping timeout: 272 seconds]
kinesis has joined #ruby
<jhass>
gizmore: er, line 42 should be paths = Dir["#{directory}#{'/**' if recursive}/#{pattern}"] but you get the idea
emocakes has quit [Ping timeout: 244 seconds]
<kinesis>
What's the best way to get "Chef Experience" (no jobs on ElanceOdesk have this and most system administrator jobs require 5 years of it)
Suchit___ has quit [Ping timeout: 245 seconds]
<sevenseacat>
use chef to administer servers?
voodoofish has joined #ruby
centrx has joined #ruby
krz has quit [Read error: No route to host]
centrx has quit [Remote host closed the connection]
emocakes has joined #ruby
staticshock has quit [Quit: leaving]
krz has joined #ruby
Channel6 has joined #ruby
Suchit____ has quit [Ping timeout: 244 seconds]
pwh has quit []
_maes_ has joined #ruby
jasooon has quit [Ping timeout: 272 seconds]
thomasxie has joined #ruby
coderdad has joined #ruby
coderdad has quit [Remote host closed the connection]
zorak8 has quit [Read error: Connection reset by peer]
chihhsin_wego has joined #ruby
<kinesis>
I guess so. SO put $500 into an Amazon EC2 account and just practice scaling a mock infrastructure?
oo_ has quit [Remote host closed the connection]
Kricir has joined #ruby
chihhsin_wego has quit [Client Quit]
oo_ has joined #ruby
Kricir has quit [Remote host closed the connection]
<sevenseacat>
well no... either have a developer job that also involves some devops, or actually build your own apps that require deployment, etc.
aleatorik has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Kricir has joined #ruby
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
abdulsattar has quit [Ping timeout: 246 seconds]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chihhsin_wego has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
oo_ has quit [Ping timeout: 244 seconds]
one_egg_each has left #ruby [#ruby]
Logomachist has quit [Remote host closed the connection]
Kricir has quit [Ping timeout: 244 seconds]
AlexRussia has quit [Ping timeout: 245 seconds]
jimmyy has joined #ruby
krisquigley has joined #ruby
<kinesis>
RIght, you're correct in that approaching companies direct from their online job postings isn't working out. You have to know someone inside.
ghr has joined #ruby
<sevenseacat>
i didnt say that :/
gsd has joined #ruby
duncannz has joined #ruby
<kinesis>
I don't know what else to do though, Bay Area is expensive and I need some $$$. It's tempting to put up with writing some Ruby / DSL for a decent income
<kinesis>
I'm coming from PHP writing, and did some Ruby in the past.
jonr2219 has joined #ruby
KC9YDN has quit [Ping timeout: 244 seconds]
bricker`LA has quit [Quit: leaving]
Photism has joined #ruby
one_egg_each has joined #ruby
<benzrf>
kinesis: eewk
jonr2219 has quit [Client Quit]
<dkphenom>
this maybe really stupid, but i have a question on substring matching... i have a class that finds the substring im looking for with a regex and in my if statement should return a properly formatted substring instead it prints the original substring im matching on... feel like im going in circles :/
Sawbones has quit [Remote host closed the connection]
carlyle_ has joined #ruby
<jhass>
you made it in php instead of ruby? not very convincing :P
<sevenseacat>
hah
carlyle_ has quit [Read error: Connection reset by peer]
j_mcnally has joined #ruby
<dkphenom>
@jhass, i did it in pastebin, here it is: http://pastebin.com/jshBvNn2... id like my output to be like it's in the comment at the bottom of the file
Adran has quit [Quit: Este é o fim.]
<dkphenom>
any help would be much appreciated
<gizmore>
jhass: in fact i use a rewrite rule that calls a brainfuck cgi ;)
<gizmore>
This paste has been removed!
<dkphenom>
eh?
Sawbones has joined #ruby
Sawbones has quit [Remote host closed the connection]
Adran has joined #ruby
duncannz has quit [Quit: Leaving]
voodoofish has quit [Read error: Connection timed out]
<jhass>
dkphenom: you store the result in @ph, puts calls to_s on your object which uses @arg
duncannz has joined #ruby
<jhass>
btw use better variable names please
<jhass>
also result won't be available that way in your other methods
zorak8 has joined #ruby
<jhass>
and I've no idea why you assign that local in to_s
duncannz has quit [Remote host closed the connection]
coderdad has joined #ruby
<dkphenom>
still learning ruby probably lots of mistakes
thomasxie has left #ruby [#ruby]
<dkphenom>
could you pastebin your suggestion?
abdulsattar has joined #ruby
<jhass>
it's no suggestions, it's an explanation for your current behavior
voodoofish has joined #ruby
<jhass>
you might need to read up again on the difference between local_variable and @instance_variable
<dkphenom>
but im explicityly returning ph
kyb3r_ has joined #ruby
<jhass>
where?
<dkphenom>
in my if statement
<dkphenom>
when it finds a match
<jhass>
well, yeah main's return value becomes the rhs side of the assignment since that's the value of that expression and thus it becomes the return value of initialize, but the return value of initialize is ignored
<jhass>
new returns a new instance of your class, always
alvaro_o has quit [Quit: Ex-Chat]
<gizmore>
dkphenom: line 14 ... @arg = to_s should be @arg = arg.to_s
agrinb has quit [Remote host closed the connection]
<jhass>
doesn't matter much as he then isn't using @arg as argument for match
<dkphenom>
yeah i fixed that gizmore, i was trying to have a dedicated to_s method, but im still getting the same result
<gizmore>
dkphenom: and your pattern makes no sense at all
Logomachist has joined #ruby
<gizmore>
unless area code is something without country code
agrinb has joined #ruby
<dkphenom>
pattern works for all my test cases
<dkphenom>
correct no country code
<gizmore>
well... you can do this in 1 line then?
<dkphenom>
jhass, im trying to follow what you're saying but getting a bit confused
<dkphenom>
which line do i need to change?
<gizmore>
so 5 lines for a nice class and clean code
<gizmore>
you need to rewrite it in only 5 lines :P
<jhass>
dkphenom: again no suggestions, just explanations
chrishough has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<kinesis>
thanks Gizmore.
mary5030 has quit [Remote host closed the connection]
coderdad has quit [Remote host closed the connection]
<gizmore>
dkphenom: let me check if i can come up with a nice class definition for you :)
<dkphenom>
gizmore, im trying to learn not really concerned with elegance right now
<kinesis>
I'm not exactly a 'beginner' just someone who stopped using it and can pick back up quickly.
<dkphenom>
just stuck on returning the right thing at the moment
<gizmore>
is attr_reader a ruby kernel function?
<jhass>
dkphenom: what do you think .new does?
chipotle has quit [Quit: cya]
<jhass>
gizmore: Module I think
<dkphenom>
jhass, instantiates teh class to an object based on that class
<dkphenom>
should return whats in main, specifically whats in teh if bloc, if it's successful on matching then it should return a proper phone number otherwasie an exception
<jhass>
gizmore: /topic
arup_r has quit [Quit: Leaving.]
duncannz has joined #ruby
tylersmith has quit [Remote host closed the connection]
<jhass>
dkphenom: now let me repeat me myself: .new returns an object of your class, always
tylersmith has joined #ruby
<jhass>
dkphenom: your assumptions on what new returns are wrong, you should go reread that chapter of whatever tutorial/book you follow ;)
<gizmore>
it worked for me... i called Phone.new, and i got a new mobile phone number \o/ *kiddings*
<gizmore>
phyiscally ... sry
fabrice31 has quit [Ping timeout: 272 seconds]
<dkphenom>
gizmore, so the regex is right :)
x1337807x has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<dkphenom>
what abou the rest of the class other than the constructor?
justinmburrous has quit [Remote host closed the connection]
<jhass>
we'll come back to that after you understood the current issue ;)
russt has quit [Quit: russt]
<gizmore>
in my code above, the instance/member variables @area_code, @prefix and @root are set ... if something does not work, an exception is thrown
tylersmith has quit [Ping timeout: 272 seconds]
justinmburrous has joined #ruby
<gizmore>
dkphenom: i use the * to expand the pregmatch result and multi assign all 4 vars
russt has joined #ruby
agrinb has joined #ruby
VBlizzard has quit [Ping timeout: 260 seconds]
skammer1 has joined #ruby
nhhagen has joined #ruby
<gizmore>
dkphenom: with the attr_reader above, i create 3 functions: def area_code; return @area_code; end - def prefix; @prefix; end - and the other one
<jhass>
dkphenom: no offense but I think you're way over his head right now
<jhass>
er, gizmore ^ sorry
<gizmore>
jhass: i think learning by doing is best... because practice > books
<dkphenom>
thanks gizmore, really appreciate it
<jhass>
sure, but you won't help with throwing a bunch of new things at him
<gizmore>
but i have to admit, i should read a book first, before i start picking around
hiyosi has joined #ruby
<gizmore>
jhass: lets just solve his problem in a way he understands and learns from
<jhass>
I see people moving on when "it works" way too often
awong_web has joined #ruby
<gizmore>
i think he knows classes and objects a bit... just because he does not get it 100% right does not mean he should solve his problem first
<jhass>
well, that's clearly an exercise to learn classes and objects
<jhass>
that's the actual problem to solve
<jhass>
not parsing phone numbers so much
<gizmore>
i don´t see a problem of that kind in his code, but.... yep, classes should be quite well understood, and ruby, additionally, has some quirks (class_variables vs instance_variables)
<dkphenom>
gizmore, im getting nils for those values when i try to call it with new(1234567890)
sevvie has quit [Ping timeout: 245 seconds]
<gizmore>
not an exception?
<dkphenom>
that shouldn't produce an exception
<gizmore>
maybe because of your pattern
<gizmore>
try an easier pattern, ... your regex is ugly as my face
<dkphenom>
no that fits the pattern, it's a 10 digit number
skammer1 has quit [Ping timeout: 240 seconds]
jasooon has joined #ruby
<gizmore>
the ugly pattern was the first thing i saw was ugly :P
nhhagen has quit [Ping timeout: 245 seconds]
<gizmore>
and getting the parse right, is the raise and fall of your phone numbers ;)
<dkphenom>
gizmore, can I pm you?
<gizmore>
yes, please :) unless someone else would like regex101 course
<gizmore>
else #ricergame :)
hiyosi has quit [Ping timeout: 258 seconds]
abdulsattar has quit [Ping timeout: 272 seconds]
<gizmore>
jhass: i have to thank you again for your map and proc help earlier. and very often i am disagreeing with people who do thinks correctly
lolmaus has quit [Read error: Connection reset by peer]
jasooon has quit [Ping timeout: 272 seconds]
gccostabr has quit [Client Quit]
lolmaus has joined #ruby
<awong_web>
This an okay channel to ask a nokogiri question on?
<jhass>
yup
<awong_web>
yay!
<awong_web>
I'm trying to extend nokogiri-xmlsec for xmlsig signatures with a URI in the References node. The underlying libxmlsec1 library requires a DTD that specifies the ID type for a given document otherwise it fails early.
abdulsattar has joined #ruby
<awong_web>
To work around this...I want to get Nokogiri to add a Doctype like <!DOCTYPE Assertion [ <!ELEMENT Assertion (#PCDATA)> <!ATTLIST Assertion ID ID #IMPLIED> ]>. That sounded easy in theory, but I've been pouring over APIs for hours and I can't figure out how to do that.
<awong_web>
Anyone know how to modify the Doctype on a nokogiri document?
Guest50373 has joined #ruby
<jhass>
that's quite specific :P I don't know the proper answer but I'd consider working around it by rendering the document to a string, do some simple string manipulation and feed it back into Nokogiri
<Guest50373>
Any guys here who'd done any SOA ?
<Guest50373>
Question being: how is model duplication avoided between services without coupling each service to shared code?
cerberblue has joined #ruby
oo_ has joined #ruby
<awong_web>
jhass: Hah...yeah. I've been banging my head at xmlsig/xmlenc for about 3 days now. It's painful. Good idea with the string manipulation. I'll give that a shot.
<Guest50373>
The question seems to embed a contradiction, so it seems that either one requirement tends to cede in SOA - or there's an entire paradigm shift that I'm unaware of, going on
<awong_web>
I was really just hoping for Nokogiri to have somethin glike document.dtd= [provider your own DTD that you newed here] but it doesn't seem to.
slester has quit [Ping timeout: 240 seconds]
spicerack has joined #ruby
AlexRussia has joined #ruby
carlyle_ has joined #ruby
carlyle_ has quit [Read error: Connection reset by peer]
ffranz has quit [Quit: Leaving]
echevemaster has quit [Remote host closed the connection]
Channel6 has quit [Quit: Leaving]
chrishough has joined #ruby
agrinb has quit [Remote host closed the connection]
shadowfios has joined #ruby
agrinb has joined #ruby
ghr has joined #ruby
thomasxie has joined #ruby
<shadowfios>
hello, i'm trying to make a web application with ruby, how would one get data from the client's url or GET request?
<shadowfios>
how would the server be able to get the 1234
chihhsin_wego has quit [Quit: leaving]
agrinb has quit [Ping timeout: 260 seconds]
ghr has quit [Ping timeout: 260 seconds]
pagioss has quit [Ping timeout: 272 seconds]
mary5030 has joined #ruby
<jhass>
shadowfios: that depends on the framework you use
<shadowfios>
Rack with camping (or maybe sinatra if I have to change)
AlexRussia has quit []
chihhsin_cloud has quit []
chihhsin_znc has joined #ruby
thomasxie has quit [Quit: Leaving.]
nettoweb has joined #ruby
<benzrf>
bye
nettoweb has quit [Max SendQ exceeded]
<jhass>
shadowfios: quick glance at docs seem to suggest @input
<jhass>
"You might also notice that we use @input.content. The @input-hash contains any extra parameters sent, like those in the forms and those in the URL (/posts?page=50)."
benzrf is now known as benzrf|offline
<shadowfios>
in camping?
chihhsin_znc has left #ruby [#ruby]
ProLoser has joined #ruby
havenwood has joined #ruby
<shadowfios>
ah found it, thank you
<shadowfios>
goodbye
shadowfios has quit [Quit: Page closed]
jhass is now known as jhass|off
nrsk has joined #ruby
arescorpio has quit [Excess Flood]
spastorino has quit [Quit: Connection closed for inactivity]
cndiv has quit [Quit: WeeChat 0.4.3]
jonmorehouse has quit [Ping timeout: 272 seconds]
<ProLoser>
what do i need to do to get `bundle install` to work in the terminal?
thrasymachus has joined #ruby
havenwood has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 272 seconds]
d4nk has quit []
<sevenseacat>
depends on why its not working for you now
<ProLoser>
it just doesn't recognize the bundle command
<ProLoser>
i've never coded ruby
<sevenseacat>
do you have bundler installed?
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ProLoser>
how do i install it?
ta has quit [Remote host closed the connection]
<sevenseacat>
`gem install bundler`
<ProLoser>
danke
<Guest50373>
i wonder if bundler should just be in core
<Guest50373>
why bother having such an integral tool as a rubygem
nonmadden has quit [Remote host closed the connection]
<Guest50373>
does it have any realstic competition anyway
<Guest50373>
realistic*
grenierm has joined #ruby
nonmadden has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
<sevenseacat>
some people dont like or use it
nhhagen has joined #ruby
ProLoser has quit []
ClarusCogitatio has quit [Ping timeout: 260 seconds]
skammer1 has joined #ruby
sinkensabe has joined #ruby
<Guest50373>
sevenseacat: how do they handle their ruby deps?
<sevenseacat>
i have no idea. probably with freat difficulty.
<sevenseacat>
*great
<Guest50373>
i was going to spout "convention over configuration" but that's Rails rather than Ruby
hiyosi has joined #ruby
boombadaroomba has joined #ruby
ClarusCogitatio has joined #ruby
rubyonrailed has joined #ruby
nonmadden has quit [Ping timeout: 240 seconds]
pagioss has joined #ruby
nhhagen has quit [Ping timeout: 250 seconds]
jhass|off is now known as jhass
jasooon has joined #ruby
skammer1 has quit [Ping timeout: 250 seconds]
hiyosi has quit [Ping timeout: 245 seconds]
boombadaroomba has quit [Ping timeout: 258 seconds]
<jhass>
Guest50373: there's work in integrating the core parts of bundler into rubygems, you can already use rubygems to install gems from a Gemfile for example
synergyz has quit [Remote host closed the connection]
yfeldblum has joined #ruby
dawkirst has quit [Remote host closed the connection]
dawkirst has joined #ruby
fgo has joined #ruby
yfeldblum has quit [Remote host closed the connection]
tylersmith has quit []
yfeldblum has joined #ruby
<maasha>
"Ruby is Perl's younger and prettier sister"
Xeago has joined #ruby
IceDragon has quit [Quit: Space~~~]
havenwood has joined #ruby
apeiros has joined #ruby
jusmyth has joined #ruby
Mso150 has joined #ruby
Darryl has joined #ruby
<Hanmac>
maasha: i thought ruby is like pythons evil twin ;P
sevvie has quit [Ping timeout: 245 seconds]
<maasha>
Hanmac: The above quote is something I picked up somewhere. Possibly here in #ruby
nhhagen has joined #ruby
nhhagen has quit [Remote host closed the connection]
vcoinminer______ has joined #ruby
nhhagen has joined #ruby
sevvie has joined #ruby
robbyoconnor has joined #ruby
charliesome has quit [Quit: zzz]
Suchit____ has joined #ruby
skammer1 has joined #ruby
mollitz has quit [Ping timeout: 258 seconds]
hiyosi has joined #ruby
Soda has quit [Remote host closed the connection]
jasooon has joined #ruby
arup_r has joined #ruby
sandelius has joined #ruby
jle` has quit [Quit: WeeChat 0.4.2]
krisquigley has joined #ruby
skammer1 has quit [Ping timeout: 272 seconds]
hiyosi has quit [Ping timeout: 260 seconds]
jasooon has quit [Ping timeout: 250 seconds]
charliesome has joined #ruby
davasaurous has quit [Ping timeout: 260 seconds]
justinmburrous has quit [Remote host closed the connection]
krisquigley has quit [Ping timeout: 272 seconds]
Advocation has joined #ruby
jle` has joined #ruby
DavidDuke has quit [Ping timeout: 246 seconds]
<arup_r>
I am using HttpParty gem to make request... I am thinking to raise a custom exception when url request results in Page not found.. What should I consider to raise this.. I am thinking to validate the STATUS code...
<arup_r>
Am I thinking correct way ?
fnordperfect has quit [Read error: Connection reset by peer]
dawkirst has quit [Remote host closed the connection]
fnordperfect has joined #ruby
nhhagen has quit [Remote host closed the connection]
dawkirst has joined #ruby
zarubin has quit [Quit: Leaving.]
bobishh has joined #ruby
<atmosx>
anyone implemented tags? hm, the way my schema works, I have to make a call for each tag associated with a product, usually this must be 3-4 calls per product. DOesn't seem much, but I wonder if this can be made simpler some way
alex88 has joined #ruby
<atmosx>
having 3 tables I'm not sure if it can be done (mysql)
HelperW__ has quit [Quit: Computer has gone to sleep.]
<sevenseacat>
so... what framework are you using, might be a good starting question
HelperW__ has joined #ruby
<atmosx>
sevenseacat: sinatra/sequel
<atmosx>
what that has do to with the db scheme?
<sevenseacat>
well the ORM usually provides helpers to preload data
<sevenseacat>
to stop n+1 problems
<sevenseacat>
activerecord does
<atmosx>
hm, AR is more advanced when it comes to associations IIRC
<atmosx>
whatever, I'll optimize later on. See if this works for now (prototyping anyway)
<shevy>
havenwood well I solved it yesterday but now I have an even larger problem
workmad3 has joined #ruby
<shevy>
I need to find the solution to chemical equations that are not balanced
<shevy>
and a computer can not "think", whereas a human brain can easily see what the proper coefficients are
nhhagen has quit [Remote host closed the connection]
nhhagen has joined #ruby
skammer1 has joined #ruby
havenwood has quit [Ping timeout: 264 seconds]
<workmad3>
shevy: maybe look into the techniques used for symbolic differential-equation solvers?
<shevy>
that sounds very complicated
<shevy>
my brain stops at complexity levels exceeding 3 apples + 5 bananas
<workmad3>
shevy: I doubt a chemical equation checker would need to be as complex as a DE solver... but some of the techniques may be useful (such as how they pull apart a symbolic DE into something usable, normalise it, etc.)
<shevy>
yeah
<shevy>
there are some constraints
<shevy>
a + b = y + z
<shevy>
where both sides must be balanced in the amount of net element numbers
sandelius has joined #ruby
<workmad3>
yeah, so you're basically looking at splitting it apart on the '=', pulling it apart into terms, then elements and making sure the 'buckets' of each element on each side match
abdulsattar has joined #ruby
Advocation has quit [Quit: Advocation]
nhhagen has quit [Ping timeout: 240 seconds]
nhhagen has joined #ruby
alem0lars has joined #ruby
qba73 has quit [Remote host closed the connection]
<mwlang>
Is anyone aware of a some scripts to facilitiate copying a selected few rows of data and all supporting data from production and saving it into development? Basically, if I wanted to grab a few users and their orders and line items etc. I could just selected_user = User.find(X) and save_to_development(selected_user) and it would save that user and all the associated data for that user.
b00stfr3ak has joined #ruby
<mwlang>
ugh, that’s a Rails question — didn’t mean to post it here.
Guest36548 has quit [Client Quit]
JohnBat26 has joined #ruby
{xenomorph} is now known as xenomorph
JohnBat26 has quit [Client Quit]
JohnBat26 has joined #ruby
Wolland has joined #ruby
<Hanmac>
shevy: you mean balance the molecules or the mol counts ? do you want to check only have a checker or should that also try to solv it ? like you give a + b = y + ? and it does try to guess what might fit the hole?
jespada has joined #ruby
startupality has quit [Quit: startupality]
nonmadden has joined #ruby
ahhMichael has quit [Ping timeout: 256 seconds]
<shevy>
I need one to solve it
<workmad3>
well, a solver automatically entails a checker ;)
dangerousdave has joined #ruby
abdulsattar has quit [Ping timeout: 260 seconds]
nonmadden has quit [Remote host closed the connection]
qba73 has quit [Remote host closed the connection]
Wolland has quit [Ping timeout: 240 seconds]
<Hanmac>
shevy & workmad like having C + AlO2 = Al + (?) ... then ? might be calculated as CO2 ? or does the program should try to solve the mol count for CO ?
qba73 has joined #ruby
startupality has joined #ruby
moritzs has joined #ruby
sk87 has joined #ruby
<shevy>
no
<shevy>
input and output is given
<shevy>
only the coefficients are missing
<shevy>
so on the right side the 2 would be missing
Takle has quit [Remote host closed the connection]
Takle has joined #ruby
<Hanmac>
hmm give me a sample
alem0lars has quit [Quit: AFK..]
<workmad3>
shevy: the co-efficients are available on the lhs?
<workmad3>
shevy: so it would be 'C + AlO2 = Al + CO'?
<shevy>
it could be wrong on either side
<shevy>
the thing is there is only one logical solution (smallest amount of coefficients that gives a right equation)
<shevy>
I think I need to somehow formulate a dependency
<workmad3>
shevy: ah, so each 'equation' has 2 possible solutions - one from the LHS being wrong, one from the RHS being wrong
<shevy>
e. g. in the above equation, on the right hand side Al is separate, but on the left hand side, Al is tied to O (2x O)
sarkis has quit [Ping timeout: 258 seconds]
Takle has quit [Read error: No route to host]
<workmad3>
shevy: so you'd generate both equations, and then pick the 'right' one based on lowest number of co-efficients?
<shevy>
so I can change Al freely on the right side, but on the left side when I modify it, I also modify O2 automatically
Takle has joined #ruby
<shevy>
yeah workmad3
<workmad3>
shevy: sounds like a strategy then ;)
<shevy>
I guess a dumb way would be to generate a table with 100 combinations possible for each element
b00stfr3ak has quit [Ping timeout: 260 seconds]
<Hanmac>
'C + AlO2 = Al + CO' might be solved to 'C + AlO2 = Al + CO2' but also to '2C + AlO2 = Al + CO' ... that why i am asking ...
<shevy>
yeah well as I said
<shevy>
<shevy> no
<shevy>
<shevy> input and output is given
<workmad3>
Hanmac: wouldn't that then be 'AL + 2CO'?
qba73 has quit [Remote host closed the connection]
<shevy>
C + AlO2 = Al + (?) is not a possibility
<Hanmac>
workmad3: yeah you are right
VBlizzard has quit [Ping timeout: 260 seconds]
<workmad3>
Hanmac: however, 'C + AlO = Al + CO' would be a potential solution to a naive solver too :)
<shevy>
yeah
<shevy>
it has: 1 + 1 = 1 + 1 as coefficient
<shevy>
oh cool
<shevy>
there are javascript solvers
<workmad3>
shevy: is modifying terms allowable then? as in 'AlO2' could be modified to 'AlO'?
<Hanmac>
workmad3: hm ok i need to look if AluminiumMonoOxid is possible ...
<workmad3>
shevy: or is it just co-efficients of terms?
qba73 has joined #ruby
<shevy>
no, the compounds must stay together
<shevy>
well
<workmad3>
ok, so the solver can't be that naive :)
<shevy>
as part of their respective side
<shevy>
of course a compound can dissociate or build a new one on the other side
tyll has quit [Ping timeout: 240 seconds]
<workmad3>
shevy: so with the 'C + AlO2 = Al + CO' example, the only real solution you'd consider would be '2C + AlO2 = Al + 2CO'?
<workmad3>
shevy: as you wouldn't be allowed to modify CO to CO2
<shevy>
let me count lol
<shevy>
yeah, that would be the minimal correct solution
tyll has joined #ruby
<shevy>
so the wrong coefficients of 1 + 1 = 1 + 1 will become 2 + 1 = 1 + 2
yacks has joined #ruby
<workmad3>
shevy: I can envisage methods that should help with that... but they may have issues if the equation is unbalancable
<shevy>
well we must assume that these equations are solvable
<workmad3>
:)
<shevy>
because new matter can not arise from out of nowhere
<maasha>
So I am using a Queue that is being written to from one thread and read to from another. How can I ensure that reading waits until something has been written?
fabrice31 has quit [Remote host closed the connection]
<workmad3>
shevy: so you're not allowing fusion or fission reactions... or high-energy reactions with subatomic particles ;)
<shevy>
you first have to walk before you want to run
jasooon has joined #ruby
<shevy>
in order to outcompete Usain Bolt
<workmad3>
if you want to outcompete Usain Bolt, you first need to be born with the genetics for brilliant distance running (stamina, long legs, large lung capacity, etc.)
<workmad3>
but maybe that's over-analysing things? :)
hiyosi has joined #ruby
<shevy>
well he has that advantage due to height
<rdark>
Usain bolt is a sprinter?
<workmad3>
rdark: I know he runs... that's about it
<shevy>
it's interesting though that when he was not in best shape then he could be beat by others
<rdark>
you're thinking of the other black guy
<Hanmac>
workmad3: rincewind did run too ;P
arup_r_ has joined #ruby
<workmad3>
Hanmac: yes. but rincewind is *fictional* :P
<Hanmac>
thats your PoV ;P
<workmad3>
Hanmac: meaning he isn't constrained by physical reality in the same way as the rest of us :)
ndrei has quit [Ping timeout: 260 seconds]
bigkevmcd has quit [Remote host closed the connection]
jasooon has quit [Ping timeout: 260 seconds]
ndrei has joined #ruby
bigkevmcd has joined #ruby
arup_r has quit [Ping timeout: 260 seconds]
hiyosi has quit [Ping timeout: 250 seconds]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oo_ has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
oo_ has joined #ruby
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Wolland has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
pskosinski has joined #ruby
roolo has quit [Remote host closed the connection]
oo_ has quit [Read error: Connection reset by peer]
oo__ has joined #ruby
oo__ has quit [Remote host closed the connection]
oo_ has joined #ruby
Takle has quit [Ping timeout: 272 seconds]
fgo has quit [Remote host closed the connection]
fgo has joined #ruby
moritzs has quit [Ping timeout: 258 seconds]
sevenseacat has joined #ruby
<workmad3>
maasha: you can't test that a blocking call is definitely blocking in a single-threaded setup
<workmad3>
oh wait, I was scrolled back... maasha, ignore that if you're already sorted
fgo has quit [Read error: No route to host]
oo_ has quit [Ping timeout: 240 seconds]
fgo has joined #ruby
sk87 has joined #ruby
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
maasha.sorted? # => true
<Hanmac>
shevy & workmad3 i did begin with that chemical pasrser ... it does look like that currently: m = Molecule.new; m.add_part([:C, :O, :O, :H],2); m.to_s #=> "[COOH]2" m.to_h #=> {C: 2, O: 4, H: 2} ... but thats only the begin
anaeem1_ has quit [Remote host closed the connection]
anaeem1 has joined #ruby
<maasha>
I am good now. It works.
ahhMichael has joined #ruby
GriffinHeart has joined #ruby
MCDev has joined #ruby
HelperW__ has quit [Quit: Computer has gone to sleep.]
HelperW__ has joined #ruby
<maasha>
Hanmac: better aim for CH3CH2OH
<Hanmac>
maasha: "[COOH]2" was only a sample for grouping ... CH3CH2OH can be the next sample
sandelius has joined #ruby
Wolland has joined #ruby
GriffinHeart has quit [Ping timeout: 250 seconds]
Beoran_ has quit [Ping timeout: 260 seconds]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<maasha>
I once got a random mail by accident. It appeared to be two researchers discussing the formula of some chemical compound. From the structure I could see that it was a dopamine derivative looking a lot like MDMA. So I responded that the mail was sent to the wrong guy and maybe I should sent it to the police. Never heard from them again.
HelperW__ has quit [Ping timeout: 246 seconds]
<maasha>
If you are discussing designer drugs via mail don't miss send to a biochemist ...
<maasha>
missend
<maasha>
?
yalue has joined #ruby
starkhalo has joined #ruby
fnordperfect has quit [Read error: Connection reset by peer]
fnordperfect has joined #ruby
Wolland has quit [Ping timeout: 272 seconds]
aclearman037 has joined #ruby
lewix has joined #ruby
arup_r_ has quit [Remote host closed the connection]
fgo has quit []
fsapo has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
jottr_ has quit [Ping timeout: 245 seconds]
cocotton has joined #ruby
havenwood has quit [Ping timeout: 264 seconds]
spastorino has joined #ruby
arup_r has joined #ruby
agjacome has quit [Quit: leaving]
Takle has joined #ruby
Beoran_ has joined #ruby
Advocation has quit [Quit: Advocation]
nhhagen has joined #ruby
<Hanmac>
maasha: hm my parser currently does parse "CH3CH2OH" into "CH3" "CH2" "OH" sections then [[:C, 1],[:H, 3]] [[:C, 1]. [:H, 2]] [[:O, 1],[:H, 1]] and then {:C=>2, :H=>6, :O=>1}
humd1ng3r has quit [Quit: Leaving]
fgo has joined #ruby
<Hanmac>
hm yeah that section parsing might not make sense for all molecules but it does make it a bit easier for me
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<workmad3>
Hanmac: I'd have been tempted to parse it out int "C", "H3", "C", "H2", "O", "H" personally
<Hanmac>
hm yeah it does in the second step ... but first it does try to parse in groups
toretore has joined #ruby
<workmad3>
Hanmac: I'm not sure I see a reason for doing it in two steps is all :)
Advocation has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<TieSoul>
so I'm using windows and after installing the devkit, the file "dk.rb" that should be there does not exist.
jasooon has joined #ruby
Advocation has quit [Client Quit]
<TieSoul>
I downloaded the 64-bits version of Ruby 2.1.3 and the DevKit
<Hanmac>
workmad3: if you have groups like "[COOH]2" it does have the part "COOH" with extra multiplicator 2
hiyosi has joined #ruby
andrewbredow has quit [Ping timeout: 240 seconds]
Norrin has quit [Ping timeout: 272 seconds]
AlexRussia has quit [Ping timeout: 258 seconds]
ddv has joined #ruby
Macaveli has joined #ruby
Soda has joined #ruby
imjoik has joined #ruby
andrewbredow has joined #ruby
jasooon has quit [Ping timeout: 272 seconds]
klaut has quit [Remote host closed the connection]
dangerousdave has joined #ruby
St_Marx has quit [Quit: Ex-Chat]
<danijoo>
Hanmac: for complex molecules like 2 COOHs groups you usually dont define them like that
MCDev has quit [Read error: Connection reset by peer]
<danijoo>
or at least chemists dont . Then its just a formula that dont represent the groups
GriffinHeart has joined #ruby
MCDev has joined #ruby
hiyosi has quit [Ping timeout: 246 seconds]
sarkis has joined #ruby
<danijoo>
for example for glutamic acid which has 2 COOHs any chemist would just write C5H5NO4
<Hanmac>
danijoo: okay in my time then learning we learned that both might be okay ... hm yes the group parser might not be detect something like "COOHCOOH" but the groups are currently only for visual repensenation and dont make big difference in the to_h output
Mdgd` has quit [Remote host closed the connection]
<danijoo>
studied chemist here :)
<danijoo>
but I agree the best solution might be to just filter for common groups
<Hanmac>
the current group filter is /\[?([[:alpha:]]+\d*)\]?(\d*)/ ... that does split "CH3CH2OH" into "CH3" "CH2" "OH" ... spliting on the numbers
Norrin has joined #ruby
Xeago has quit [Remote host closed the connection]
St_Marx has joined #ruby
<danijoo>
Im not sure if its done with a simple regex..
GriffinHeart has quit [Ping timeout: 258 seconds]
grenierm has quit [Quit: grenierm]
<Hanmac>
danijoo: shevy only wanted a reaction solver where you has a × A + b × B = x × X + y × Y where you give them the big ones (ABXY) and it does try to calc the small ones like (abxy)
MCDev has quit [Ping timeout: 250 seconds]
sarkis has quit [Ping timeout: 272 seconds]
<danijoo>
For example some chemists tend to write COOH as CO2H
workmad3 is now known as wm3|away
<Hanmac>
the grouping was only for me in parsing
qmfnp has joined #ruby
AlexRussia has joined #ruby
<danijoo>
Why do you need to parse into CH3 CH2 etc for simple equation solving?
snath has quit [Ping timeout: 245 seconds]
<danijoo>
if you know al products and educts, you could just calculate the Hs, Cs, etc of every component and work with that
VBlizzard has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Xeago has joined #ruby
Aaaal has joined #ruby
codecop has joined #ruby
<danijoo>
Once you know all educts and products, calculate the number for each atom (CH3CH2OH would be 2xC, 6xH, 1xO). Then you can put those in a matrix and you get a linear system of equations
<danijoo>
this can then be solved with a gaussian algorythm
dangerousdave has joined #ruby
zeroNones has joined #ruby
zeroNones has quit [Max SendQ exceeded]
zeroNones has joined #ruby
spyderman4g63 has joined #ruby
zeroNones has quit [Max SendQ exceeded]
tokik has joined #ruby
<Hanmac>
danijoo: like i said the grouping is only for me, and it does already count all values for the molecules, and for the gaussian algorythm i might look later
<danijoo>
yeah if its just for representation i think its ok :) thought you might write this for some kind of fancy library or such :)
Tricon has joined #ruby
grenierm has joined #ruby
ferr has quit [Ping timeout: 250 seconds]
nonmadden has joined #ruby
wald0 has joined #ruby
endash has joined #ruby
Tiberias has joined #ruby
AtumT has joined #ruby
pwh has joined #ruby
fnordperfect has quit [Read error: Connection reset by peer]
noop has joined #ruby
fnordperfect has joined #ruby
krisquigley has joined #ruby
Tiberias has quit [Quit: Tiberias]
cocotton has quit [Remote host closed the connection]
geggam has quit [Ping timeout: 272 seconds]
Tiberias has joined #ruby
krisquigley has quit [Ping timeout: 245 seconds]
jottr_ has joined #ruby
skammer1 has joined #ruby
rkalfane has joined #ruby
Takle has quit [Remote host closed the connection]
Veidit has quit [Read error: Connection reset by peer]
Veidit has joined #ruby
alem0lars has joined #ruby
Takle has joined #ruby
sdwrage has quit [Ping timeout: 246 seconds]
mastr_bennett[x] has joined #ruby
nettoweb has joined #ruby
PierreRambaud has quit [Remote host closed the connection]
alem0lars has quit [Client Quit]
nettoweb has quit [Max SendQ exceeded]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
danijoo has quit [Read error: Connection reset by peer]
nettoweb has joined #ruby
jottr_ has quit [Ping timeout: 272 seconds]
nettoweb has quit [Max SendQ exceeded]
Wolland has joined #ruby
danijoo has joined #ruby
nettoweb has joined #ruby
alem0lars has joined #ruby
dangerousdave has joined #ruby
klaut has joined #ruby
Takle has quit [Ping timeout: 245 seconds]
sevenseacat has quit [Remote host closed the connection]
alem0lars has quit [Client Quit]
alem0lars has joined #ruby
sdwrage has joined #ruby
klaut has quit [Remote host closed the connection]
ciampix__ has joined #ruby
ciampix has quit [Quit: Ex-Chat]
jottr_ has joined #ruby
nhhagen_ has joined #ruby
ciampix__ has quit [Client Quit]
ciampix has joined #ruby
Wolland has quit [Ping timeout: 260 seconds]
Takle has joined #ruby
banister has joined #ruby
Heartbroken has quit [Ping timeout: 246 seconds]
ddv has quit [Changing host]
ddv has joined #ruby
nhhagen_ has quit [Read error: Connection reset by peer]
nhhagen__ has joined #ruby
havenwood has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
nhhagen has quit [Ping timeout: 258 seconds]
Xeago has joined #ruby
HelperW__ has joined #ruby
sdwrage has quit [Ping timeout: 260 seconds]
aleatorik has joined #ruby
terlar has quit [Ping timeout: 260 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
wm3|away has quit [Ping timeout: 258 seconds]
Heartbroken has joined #ruby
t_p has joined #ruby
twohlix has joined #ruby
agrinb has joined #ruby
sk87 has joined #ruby
ciampix has quit [Quit: Ex-Chat]
havenwood has quit [Ping timeout: 264 seconds]
nhhagen__ has quit [Ping timeout: 250 seconds]
sandeepdb has joined #ruby
fgo has quit [Remote host closed the connection]
HelperW__ has quit [Ping timeout: 260 seconds]
nhhagen has joined #ruby
agrinb has quit [Ping timeout: 272 seconds]
coderdad has joined #ruby
abdulsattar has joined #ruby
t_p has quit [Ping timeout: 245 seconds]
nhhagen has quit [Remote host closed the connection]
ddv has quit [Quit: *poof*]
IrishGringo has quit [Ping timeout: 244 seconds]
alem0lars_ has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alem0lars has quit [Ping timeout: 260 seconds]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jasooon has joined #ruby
fgo has joined #ruby
nettoweb has joined #ruby
nettoweb has quit [Max SendQ exceeded]
boombadaroomba has joined #ruby
MewFree has quit [Quit: leaving]
sdwrage has joined #ruby
arup_r has quit []
nettoweb has joined #ruby
alem0lars has joined #ruby
mleone has joined #ruby
alem0lars_ has quit [Ping timeout: 245 seconds]
sailias has joined #ruby
GriffinHeart has joined #ruby
hiyosi has joined #ruby
boombadaroomba has quit [Ping timeout: 258 seconds]
jasooon has quit [Ping timeout: 258 seconds]
GriffinHeart has quit [Ping timeout: 246 seconds]
dumdedum has quit [Quit: foo]
startupality has quit [Quit: startupality]
dblessing has joined #ruby
dblessing has quit [Remote host closed the connection]
twohlix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
abdulsattar has quit [Ping timeout: 246 seconds]
sarkis has joined #ruby
sinkensabe has quit [Remote host closed the connection]
t_p has joined #ruby
iamjarvo has joined #ruby
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maasha has quit [Quit: Page closed]
rclsilve1 has quit [Quit: leaving]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mastr_bennett[x] has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
twohlix has joined #ruby
cherwin has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cpruitt has joined #ruby
fnordperfect has quit [Read error: Connection reset by peer]
sarkis has quit [Ping timeout: 245 seconds]
livingstn has joined #ruby
fnordperfect has joined #ruby
ddv has joined #ruby
dblessing has joined #ruby
nettoweb has joined #ruby
mary5030 has joined #ruby
<shevy>
danijoo gaussian algorithm?
nettoweb has quit [Max SendQ exceeded]
alem0lars has quit [Quit: alem0lars]
<danijoo>
yeah?
<danijoo>
whats wrong with gaussian? :)
<shevy>
I don't know what that is
nettoweb has joined #ruby
nettoweb has quit [Max SendQ exceeded]
<shevy>
I refer to this sentence:
<shevy>
danijoo> Once you know all educts and products, calculate the number for each atom (CH3CH2OH would be 2xC, 6xH, 1xO). Then you can put those in a matrix and you get a linear system of equations
<danijoo>
its an algorythm to solve linear equation systems
<danijoo>
uhmm how do I expain...
nettoweb has joined #ruby
nettoweb has quit [Max SendQ exceeded]
<dblessing>
this might be a very specific question for this room, but does anyone know how i might test the options given to HTTParty via rspec? i include httparty in my class and in the rspec i call one of my methods that passes down to httparty. i want to ensure the options hash is passed all the way down
nettoweb has joined #ruby
gsd has joined #ruby
claymore has quit [Quit: Leaving]
Xeago has quit [Remote host closed the connection]
<danijoo>
lets say you have this formula: H2 + O2 -> H2O
<danijoo>
ok bad example....
<danijoo>
:D
ddv has quit [Quit: *poof*]
ddv has joined #ruby
<danijoo>
lets say you have this: x C3H5N3O9 -> a CO2 + b H2O + c N2 + d O2
paulfm has joined #ruby
<danijoo>
you can dissasemble it into equations for each atom. for C that would be:
abdulsattar has joined #ruby
<danijoo>
3 x = a
<danijoo>
for H: 5x = 2b
<danijoo>
for O: 9x = 2a + b + 2d
<danijoo>
etc.
mary5030 has quit [Remote host closed the connection]
<danijoo>
then you have a "linear system of equations" with the factors x,a,b,c,d
mary5030 has joined #ruby
<danijoo>
and the mathematical algorythm to solve those systems is called gaussian algorythm
<danijoo>
its easy to write function for that algorythm and its how most computer programs solve chemical equations (and how we learned to do it by hand for complex formulas in chemistry)
jottr_ has quit [Ping timeout: 260 seconds]
alem0lars has joined #ruby
<shevy>
hmmmm
<danijoo>
it looks complex I know ^^;
<shevy>
you wrote for H it is 5x
<shevy>
but when you modify H, you also modify O
<danijoo>
yes.
sdwrage has quit [Ping timeout: 260 seconds]
c107 has joined #ruby
cocotton has joined #ruby
<danijoo>
thats the problem with those equations. every factor depends on the other ones. so if you change x for example, this results in a change in a,b,c,d
cocotton has quit [Remote host closed the connection]
<danijoo>
what the gaussian algorythm does is setting one vactor to a chosen value.
<danijoo>
for example you say: x = 1 at the beginning
cocotton has joined #ruby
startupality has joined #ruby
<danijoo>
then it calculates a,b,c,d depending on x=1. You might get odd values for those other parameters
Takle has quit [Remote host closed the connection]
emocakes__ has joined #ruby
<danijoo>
then you find the lowest common denominator for all params and you are done
moritzs has joined #ruby
Takle has joined #ruby
alem0lars_ has joined #ruby
snath has joined #ruby
<shevy>
hmmmm
<danijoo>
since you always get the same amount of unknown variables then you have equations, there are infinite possible solutions for those equations.
<shevy>
ok but
klaut has joined #ruby
cherwin has joined #ruby
<danijoo>
and the gaussian algorythms solve it and choses the lowest one
<shevy>
how does one write something like a Guassian elimination in ruby?
isthisreallife has joined #ruby
alem0lars has quit [Ping timeout: 260 seconds]
abdulsattar has quit [Ping timeout: 250 seconds]
alem0lars_ is now known as alem0lars
<Hanmac>
or better question, is there already a gem for it?
<danijoo>
: D
<shevy>
hehehe
<danijoo>
im pretty sure there is
<shevy>
danijoo wrote about a matrix
<danijoo>
but its not that hard to implement though
j2p2 has joined #ruby
<shevy>
well how would I do this?
slester has joined #ruby
<danijoo>
basically you have a matrix where each column is a param. so first colum is a, second colum is b ...
<shevy>
do I use a hash for those a,b,c,d values?
<danijoo>
and each row is one aquation
emocakes has quit [Ping timeout: 258 seconds]
dawkirst has quit [Remote host closed the connection]
msmith has joined #ruby
jerius has joined #ruby
<danijoo>
the row for H would look like: 3 1 0 0 0
<danijoo>
(3x = 1a + 0b + 0c + 0d)
Ankhers has joined #ruby
<danijoo>
and so on for all rows
<danijoo>
and then you have three base operations on the matrix. you can swap positions (a and b)
<shevy>
<Hanmac> danijoo: like i said the grouping is only for me, and it does already count all values for the molecules, and for the gaussian algorythm i might look later
tokik has joined #ruby
havenwood has quit [Ping timeout: 264 seconds]
Macaveli has joined #ruby
<shevy>
at about the time they made futurama, the simpsons started to suck :(
benzrf|offline is now known as benzrf
<danijoo>
but he still has to do those gaussian stuff if you tries to build a formula solver for chemistry ;)
<apeiros>
danijoo: many native speakers in both german and english write it wrongly too
<danijoo>
i dont think there is another implementation that can be written in code
<danijoo>
apeiros: german here. thats my problem..
<apeiros>
"algorithm is no dancer" was my mnemonic
<shevy>
well right now I have zero implementations so
<danijoo>
and im usually writing faster then i think <.<
hellangel7 has quit [Read error: Connection reset by peer]
<apeiros>
danijoo: well, it's the same in german too. Algorithmus and Rhythmus
<Hanmac>
danijoo: german too, good that we both have a long weekend ne? ;P
<danijoo>
yeah. and im wasting it with IT : D
<danijoo>
i think I once built the exact same program you are trying to build ^^
<danijoo>
but no ruby
wm3|away is now known as workmad3
AndChat| has quit [Ping timeout: 246 seconds]
ahhMichael has quit [Ping timeout: 256 seconds]
dangerousdave has joined #ruby
Tiberias has quit [Remote host closed the connection]
fnordperfect has quit [Read error: Connection reset by peer]
Sylario has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fnordperfect has joined #ruby
<danijoo>
yeah i think i did it in java or sth like that
Tomme has quit [Ping timeout: 245 seconds]
IceDragon has joined #ruby
jasooon has joined #ruby
<danijoo>
or python.. mh
<Sylario>
If have class foo that include httparty, immediatly after i can call the base_uri() function from the included class httparty. How does "calling a class function at the root of the class" is called? Is it a special namespace? when is it called first?
govg has quit [Ping timeout: 272 seconds]
freezey has joined #ruby
GriffinHeart has quit [Ping timeout: 258 seconds]
ursooperduper has joined #ruby
nerium has joined #ruby
willgo has quit [Remote host closed the connection]
tagrudev has quit [Remote host closed the connection]
mastr_bennett[x] has quit [Read error: Connection reset by peer]
<workmad3>
rubie: eep... that's the first edition, iirc... so it's ruby 1.6
<rubie>
i think my PDF is an older version. plus that link is what was on the Rubular site, so i guess i'll start using that book
ptrrr has quit [Ping timeout: 272 seconds]
<workmad3>
rubie: yeah, the preface there states 'This book documents Version 1.6 of Ruby, which was released in September 2000.'
<rubie>
oh and my pdf is 1.8
<shevy>
lol
<shevy>
ruby 1.6
zeroNones has joined #ruby
<workmad3>
rubie: you really want the 4th edition which covers 2.0
<shevy>
rubie is only 14 years late
<rubie>
hah but its free!
<shevy>
welcome back to the future rubie :)
<workmad3>
rubie: free isn't much good if it's entirely wrong :P
Ulrike_Rayne has quit [Ping timeout: 246 seconds]
<rubie>
haha relevant point
<workmad3>
rubie: or, as is the case with that book, incorrect in many places that an experienced rubyist can spot but a newcomer will have no idea about
<workmad3>
as a lot of it will still work
<workmad3>
but you won't know which until you know ruby...
roger_rabbit has joined #ruby
Affix has joined #ruby
GriffinHeart has quit [Ping timeout: 246 seconds]
<rubie>
the Ruby Paradox
fabrice31 has quit [Ping timeout: 260 seconds]
nettoweb has joined #ruby
Ulrike_Rayne has joined #ruby
<shevy>
in the end, the only way to learn ruby is to write ruby code by yourself
<rubie>
yes but its hard to write code if you can't get it do what you want
zarubin has quit []
<rubie>
and apparently i need regular expressions
moritzs has joined #ruby
<rubie>
so im reading about them
kristofferR has joined #ruby
<rubie>
but my reading selection is making that process more difficult
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
twohlix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dawkirst has joined #ruby
jasooon has joined #ruby
rkalfane has joined #ruby
lxsameer has quit [Remote host closed the connection]
ahhMichael has quit [Ping timeout: 256 seconds]
twohlix has joined #ruby
Juanchito has quit [Quit: Connection closed for inactivity]
ciampix has joined #ruby
startupality has joined #ruby
slyslick has joined #ruby
cocotton has quit [Remote host closed the connection]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Xeago has quit [Remote host closed the connection]
<shevy>
rubie it's really not so important; if you understood the general concept about regexes then any transition is simple, even into other languages
<shevy>
and rubular.com helps build a proper regex online
<railis>
there is probably no language as easy to learn as ruby
icarus has joined #ruby
icebourg has joined #ruby
<wasamasa>
there are actually
phao has joined #ruby
<rubie>
regex isn't ruby tho
<phao>
Hi, studying ruby, sometimes I see the term "internal encoding". Is that the same as "source code encoding"?
<railis>
+ as easy to read?
HelperW__ has joined #ruby
<rubie>
and i understand the basics of regex and what its suppose to do
Hanmac has quit [Ping timeout: 258 seconds]
b00stfr3ak has joined #ruby
<railis>
wasamasa: which one?
fsapo has quit [Remote host closed the connection]
<wasamasa>
railis: scheme
<shevy>
phao ruby has default encodings for internal and external datasets
<shevy>
consider this phao
<wasamasa>
railis: ruby has tons of special syntax and allows you to come up with your own coding style
<phao>
shevy, internal datasets being what comes after __END__ ?
<shevy>
Encoding.default_external = 'ASCII 8bit'
<shevy>
phao no, I think it is the defaults when you build a string like: x = 'blaa'
<shevy>
you can test it; p x.encoding
<phao>
AHhh I see.
<shevy>
and some methods like File.readlines() allow you to pass a default encoding in its argument list too
<wasamasa>
railis: while it's nice since it allows you to express ruby idioms succinctly, it's not easy to learn :P
<phao>
Sure, but what I'd like to know if internal encoding and source code encoding are the same thing. Do you know if they are?
<shevy>
I don't know what is source code encoding hehe but you can set that with the line after the shebang line
<phao>
=D
<workmad3>
phao: the data section will have the same encoding as the source code
benzrf is now known as benzrf|offline
sarkis has joined #ruby
<workmad3>
phao: which defaults to ASCII in 1.9 and UTF8 in 2.0, and can be set with the 'encoding' magic comment
<phao>
It's the encoding of the source code file. You specify it so ruby knows how to read the file.
<shevy>
workmad3 why can I have not more than one __END__ entries in a .rb file btw?
speaking1ode has quit [Remote host closed the connection]
<workmad3>
shevy: because after the __END__, the rest of the file is just read in as a text string
<workmad3>
shevy: it's not parsed
<phao>
workmad3, Ok.
<shevy>
yes I like that
`Liberation has joined #ruby
<shevy>
I wanna toggle a .rb file in parts that can be parsed and parts that can not be at will :)
<phao>
So it seems internal encoding, default external encoding and source code encoding are 3 different concepts. Is that right then?
c107 has quit [Remote host closed the connection]
<shevy>
phao I've never heard source code encoding before
dangerousdave has joined #ruby
<workmad3>
phao: what are you counting as 'internal encoding'?
<phao>
workmad3, it's what you can set with the second argument to the -E option
startupality has quit [Quit: startupality]
<shevy>
Encoding has only two setter methods in this regard:
<shevy>
Encoding.default_external=
<shevy>
Encoding.default_internal=
iamjarvo has joined #ruby
<shevy>
I don't see a Encoding.default_source_code=
<phao>
Sure.
<phao>
The source code encoding you set with the coding comment, like you mentioned.
<workmad3>
phao: ah, ok... it's what I generally call 'read encoding' and 'write encoding'
<workmad3>
oh wait, no...
Advocation has quit [Quit: Advocation]
<phao>
workmad3, they're respectively those shevy mentioned (Encoding.default_external [1st parameter to -E] and Encoding.default_internal [2nd parameter to -E]).
<phao>
I'm using "source code encoding" because it's the term the book I'm reading uses.
<workmad3>
yeah
<phao>
It's the encoding of the source code file.
<shevy>
so we can have 3 different encodings?
<workmad3>
you can have as many encodings as you like in-play in a ruby program
<phao>
shevy, That's how it is in many programming languages.
sarkis has quit [Ping timeout: 260 seconds]
<workmad3>
the default internal and external encodings control the behaviour of IO objects... when you read from an IO object, the data is transcoded from external to internal... when you write to it, data is transcoded from internal to external
fsapo has joined #ruby
<phao>
I see.
<workmad3>
and the source code encoding is the magic 'encoding' comment for the ruby runtime that tells it what character encoding to use when reading the source file (as phao said :) )
oleo has quit [Quit: Verlassend]
ahhMichael has joined #ruby
<workmad3>
source encoding can only be ASCII or UTF8 in ruby, but internal and external encodings can be pretty much anything
<shevy>
hey
slyslick has quit [Ping timeout: 240 seconds]
<shevy>
I use "# Encoding: ASCII-8BIT"
<workmad3>
you can specify a specific encoding at any point for IO objects though... you can have a default of UTF8 but then specify that a certain file is read in as cp1252...
havenwood has joined #ruby
havenwood has quit [Remote host closed the connection]
<workmad3>
or decide to store data from a certain file internally as UTF-16 instead of UTF-8... or whatever :)
<workmad3>
shevy: I don't think that's valid... it's likely to just be ignored :P
sevvie has joined #ruby
oleo has joined #ruby
skolman_ has joined #ruby
<workmad3>
oh wait, seems it *is* valid
robustus|Off is now known as robustus
fsapo has quit [Remote host closed the connection]
<shevy>
\o/
<shevy>
it's the encoding I call
<shevy>
"leave me alone!"
iceden has joined #ruby
<workmad3>
shevy: nah, the 'leave me alone' encoding is UTF-8 :P
t0rc has joined #ruby
ptrrr has joined #ruby
nhhagen has quit [Ping timeout: 272 seconds]
<workmad3>
shevy: ASCII-8BIT is "I don't give a shit, let's malform your data!"
speakingcode has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
justinmburrous has joined #ruby
startupality has joined #ruby
wjimenez5271 has joined #ruby
<shevy>
hey my data is ok
compuser_ has joined #ruby
carraroj has joined #ruby
compuser has quit [Ping timeout: 245 seconds]
DrCode has quit [Remote host closed the connection]
fnordperfect has quit [Read error: Connection reset by peer]
compuser_ has quit [Ping timeout: 258 seconds]
fnordperfect has joined #ruby
ALVAN has joined #ruby
charliesome has quit [Quit: zzz]
robustus is now known as robustus|Off
aspires has joined #ruby
DrCode has joined #ruby
go|dfish has quit [Remote host closed the connection]
<gaussblurinc1>
is anybody here? how to configure data for POST in faraday?
gsd has joined #ruby
<ALVAN>
hi all .. what gem is require for attribute function to work correctly
zarubin has joined #ruby
<ALVAN>
i have ruby 1.8.6 and used attribute in a class .. and receive compile error
sarkis has joined #ruby
thejamespinto has quit [Remote host closed the connection]
thejamespinto has joined #ruby
moritzs has quit [Ping timeout: 260 seconds]
jbw has quit [Ping timeout: 260 seconds]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wallerdev has joined #ruby
<shevy>
no ALVAN
sinkensabe has joined #ruby
<shevy>
you must show the 100% precise error you get
dawkirst has quit [Remote host closed the connection]
<shevy>
not "receive compile error"
<shevy>
and the second step is - you must show the code as-is you use, ideally on something like gist github
jamz has joined #ruby
lkba has quit [Ping timeout: 245 seconds]
jbw has joined #ruby
thejamespinto has quit [Ping timeout: 272 seconds]
joonty has quit [Ping timeout: 240 seconds]
dawkirst has joined #ruby
Wolland has joined #ruby
ghostmoth has joined #ruby
iamjarvo has joined #ruby
iceden has quit [Ping timeout: 258 seconds]
AlexRussia has quit [Ping timeout: 260 seconds]
zeroXten has quit [Remote host closed the connection]
carraroj has quit [Ping timeout: 240 seconds]
j_mcnally has joined #ruby
cocotton has quit [Remote host closed the connection]
Hobogrammer_ has joined #ruby
ciampix has quit [Ping timeout: 240 seconds]
Takle has quit [Remote host closed the connection]
Takle has joined #ruby
jonmorehouse has quit [Ping timeout: 272 seconds]
mikecmpbll has quit [Quit: i've nodded off.]
GriffinHeart has joined #ruby
Takle_ has joined #ruby
Takle has quit [Read error: Connection reset by peer]
Wolland has quit [Ping timeout: 260 seconds]
Takle_ has quit [Remote host closed the connection]
Takle has joined #ruby
grzywacz has joined #ruby
apeiros has joined #ruby
zorak8 has joined #ruby
icebourg has quit []
zarubin has quit [Quit: Leaving.]
icebourg has joined #ruby
Cache_Money has joined #ruby
nhhagen has joined #ruby
echevemaster has quit [Remote host closed the connection]
michaeldeol has joined #ruby
tokik has quit [Ping timeout: 258 seconds]
TorpedoSkyline has joined #ruby
jonmorehouse has joined #ruby
obscured has joined #ruby
Takle has quit [Ping timeout: 260 seconds]
qba73 has quit [Remote host closed the connection]
t0rc has quit [Quit: WeeChat 1.0.1]
ndrei has joined #ruby
iceden has joined #ruby
rubie has quit [Quit: Page closed]
ptrrr has quit [Quit: ptrrr]
Xeago has joined #ruby
justinmburrous has quit [Remote host closed the connection]
Macaveli has joined #ruby
GriffinHeart has quit [Ping timeout: 272 seconds]
jonmorehouse has quit [Ping timeout: 260 seconds]
ptrrr has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
coderhs has quit [Quit: Leaving]
wallerdev has quit [Quit: wallerdev]
ghr has quit [Ping timeout: 260 seconds]
justinmburrous has joined #ruby
W0rmDr1nk has quit [Ping timeout: 245 seconds]
jthomp has joined #ruby
jcdesimp has joined #ruby
jottr has joined #ruby
jasooon has joined #ruby
alex88 has quit [Quit: Leaving...]
sinkensa_ has joined #ruby
jottr_ has quit [Ping timeout: 246 seconds]
mikeg has joined #ruby
jthomp_ has joined #ruby
jthomp has quit [Read error: Connection reset by peer]
bricker`work has joined #ruby
sinkensabe has quit [Ping timeout: 260 seconds]
Xeago_ has joined #ruby
jasooon has quit [Ping timeout: 250 seconds]
Cache_Money has quit [Quit: Cache_Money]
russt_ has joined #ruby
russt_ has quit [Client Quit]
benzrf|offline is now known as benzrf
krisquigley has joined #ruby
SCHAAP137 has joined #ruby
dawkirst has quit [Remote host closed the connection]
skolman_ has quit [Read error: Connection reset by peer]
maestrojed has joined #ruby
wallerdev has joined #ruby
<apeiros>
eam: yeah, depends a bit on how cinch uses it
<eam>
yeah I don't know either, figured I'd mention
rubyonrailed has joined #ruby
codezomb has joined #ruby
codezomb has quit [Client Quit]
<Mia>
well since the string is lowercase, is it possible to make the symbol downcase?
codezomb has joined #ruby
<apeiros>
eam: sorry. thanks for bringing it up, it's a valid point :)
<Mia>
I still have difficulty to understand ruby notation of things :)
<apeiros>
Mia: the symbol is about which events you care about
<apeiros>
i.e. :message does not need to be changed.
<shevy>
Mia but this is simple, on() is a method. first argument is a symbol, obviously the second can be a regex. and the {} is always available to all methods in ruby as a block Mia
<apeiros>
and "hello" (probably) exists to filter down *which* events of type :message you care about
gaussblurinc1 has quit [Quit: Leaving.]
Takle has joined #ruby
freezey has quit [Remote host closed the connection]
<Mia>
hm
<Mia>
so I need to somehow make the string "comparable"
<Mia>
(I should learn what regex is btw, googling)
<apeiros>
yes, which is why you should use a regex instead of a string. a regex exists for the purpose of matching strings
<apeiros>
and the i in /hello/i says "perform matching case insensitive"
<eam>
a regex is a mini-language for representing patterns (instead of an exact string match)
<shevy>
Mia you have to learn what a regex is only once; it will work in most good programming languages. I learn it from a perl book, but you can also test online at: rubular.com
<apeiros>
Mia: by consulting the documentation of `on`
<shevy>
Mia yes, go to rubular.com and test strings
<Mia>
Yes I'll definitely learn it shevy
<apeiros>
it depends on the method you pass it whether it can work with a regex
Xeago__ has quit [Remote host closed the connection]
b00stfr3ak has quit [Ping timeout: 260 seconds]
clocKwize has quit [Disconnected by services]
<shevy>
Mia if your regex does not apply to your given string, you will receive nil
<eam>
shevy: another example of ruby programmers referring to perl documentation ;-)
sinkensa_ has quit [Remote host closed the connection]
abdulsattar has joined #ruby
<shevy>
it's true
<shevy>
I bought a perl book
justinmburrous has quit [Remote host closed the connection]
clocKwize_ has joined #ruby
<shevy>
in the ancient days
echevemaster has joined #ruby
chthon has quit [Ping timeout: 260 seconds]
<eam>
why do I suspect that to you "ancient days" is still post-y2k
<shevy>
yeah very early 200x something, I think 2002 or 2003
<eam>
sigh
* eam
shakes his cane
<apeiros>
shevy: get off of eam's lawn!
<shevy>
hey I pretend I was not yet born in the 1990es
<rpag>
is perl like the reference for regex?
<eam>
yes ruby RE is basically a copy of perl regex
<Mia>
shevy, apeiros it worked yes
<apeiros>
rpag: there's a reason it's called pcre - perl compatible regular expression ;-)
<Mia>
however, what if it didn't
<Mia>
how would I let ruby read the string ignoring case?
<eam>
rpag: there are many regex flavors though. Posix specifies basic RE and extended RE, which are what grep and grep -E use
rippa has joined #ruby
<eam>
PCRE is by far the most feature rich
<Mia>
like, I'm searching for something similar to "string".ignorecase
ursooperduper has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
startupality has quit [Quit: startupality]
startupality has joined #ruby
<eam>
Mia: typically you would .downcase everything and work in a uniform case
<shevy>
Mia can't you use .include?
<twohlix>
Mia: dowcase and compare.
<twohlix>
damn, beat me to it
justinmburrous has joined #ruby
<shevy>
and you can also work on each character
roolo has quit [Quit: AAAAaaaaAAAAAAA]
<shevy>
ruby is syntactic sugar over C
<Mia>
eam, twohlix becasue I can't downcase a symbol
<eam>
Mia: right, so in this case the interface may prevent it
<Mia>
Ok, the second thing I want to ask is: right now I have a twitter stream (tanks to a gem) on a keyword
skolman__ has quit [Remote host closed the connection]
<Mia>
How can I put it to a web page realtime?
ciampix has joined #ruby
<Mia>
I expected this to be an easy thing but the page never loads, and I now realized that it's meaningfull since the page is never "complete"
cocotton has joined #ruby
<Mia>
so, what's the correct way to establish things like that
ghostmoth has joined #ruby
ldnunes has quit [Quit: Leaving]
sevvie has quit [Remote host closed the connection]
<eam>
Mia: that's a pretty complicated question, you'd be best suited to asking in a forum dedicated to web frameworks and mechanics (and you'll be using javascript)
<eam>
I don't get why ?a ?a doesn't concat like "a" "a"
<Mia>
I epected this to be an esay thing honestly, when you can do the same in 5 minutes using nodejs - I'm not comparing, don't get me wrong but "this should be simple" is how I felt
<shevy>
comes from you having to pick twitter streaming to web pages!!!
<shevy>
nodejs can use javascript right
<Mia>
shevy, right
<shevy>
javascript is a part of browsers
St_Marx has quit [Remote host closed the connection]
<eam>
Mia: there likely are simple tools in for example rails -- it's just not a question about the ruby language
<shevy>
this all does not feel to be on equal levels like ruby itself
<eam>
it's a question about the frameworks on top of them
<shevy>
I mean javascript put a lot of stuff into asynchronisation right? so you'd have to use some async stuff in ruby too Mia
<eam>
and in all cases, javascript in the browser will be handling the dynamic updates
cherwin has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
they recommend Fibers and EventMachine
mikepack has quit [Read error: Connection reset by peer]
wallerdev has quit [Quit: wallerdev]
<shevy>
but walk in baby steps Mia
<shevy>
the world will still be there tomorrow morning
mikepack has joined #ruby
<Mia>
this meant to be a baby step :(
<shevy>
this is a giant leap for mankind!
ahhMichael has quit [Ping timeout: 256 seconds]
<Mia>
:)
cndiv has joined #ruby
<shevy>
you are twitterbombing
St_Marx has joined #ruby
troyready has joined #ruby
root3d has joined #ruby
St_Marx has quit [Remote host closed the connection]
<shevy>
usually you load a webpage and be done with it right?
<shevy>
you could also check into webpage IRC clients too
<eam>
I publish more ruby on twitter than on github
<shevy>
yeah, you are cursing a lot
iamjarvo has joined #ruby
<Mia>
:)
freezey has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Mia>
well I think I need some sort of socket conenction
<Mia>
that's handled in nodejs with sockets.io
cocotton has quit [Remote host closed the connection]
zlude has joined #ruby
<Mia>
socket.io I mean
froggy_ has joined #ruby
<shevy>
ruby has sockets too
<zlude>
Hello guys! I have a route that / and /index go to same controller#view, but i have to lines with get '/' and get '/index'. Can i use just one line to do that? because / and /index go to the same place.
Hobogrammer_ has quit [Ping timeout: 260 seconds]
mikepack has quit [Read error: Connection reset by peer]
rubyonrailed has quit [Remote host closed the connection]
pskosinski has quit [Ping timeout: 264 seconds]
fenicks has joined #ruby
<shevy>
ericwood dunno, I am doing boring stuff. right now I am rewriting about 15 different .rb files from a project completely, it is so boring... 4 done so far
<rubie>
yes but then you would have to write 26 senarios
bluOxigen has quit [Ping timeout: 245 seconds]
<rubie>
for each letter of the alphabet
<rubie>
.count "a"
<rubie>
.count "b"
<rubie>
..etc
treehug8_ has quit [Ping timeout: 245 seconds]
larissa has joined #ruby
<apeiros>
rubie: no
<rubie>
oh but you can use (a...z).map
<apeiros>
still no
<apeiros>
there's a better way
<apeiros>
do you, as a human, go through a-z to figure out which letter is repeated 12 times?
axl_ has quit [Quit: axl_]
freerobby has quit [Quit: Leaving.]
<rubie>
no
<apeiros>
so what do you do?
<rubie>
only look at the numbers in the string, or array
<apeiros>
I don't think that's the first thing you do :)
<rubie>
count how many letters there are
<apeiros>
first thing you do is you look at the first character, and then count how many times *that character*, which you have seen, occurs
silkfox has quit [Ping timeout: 245 seconds]
justinmburrous has joined #ruby
<apeiros>
and now you go and code precisely that as ruby code ;-)
jasooon has joined #ruby
dawkirst has joined #ruby
abdulsattar has quit [Ping timeout: 272 seconds]
michaeldeol has joined #ruby
lewix has joined #ruby
freerobby has joined #ruby
blackoperat has joined #ruby
blackoperat has quit [Client Quit]
benzrf|offline is now known as benzrf
yalue has quit [Quit: Leaving]
hackeron has quit [Ping timeout: 245 seconds]
<dfedde>
ls
<dfedde>
whoops wrong terminal
hackeron has joined #ruby
manzo has quit [Ping timeout: 272 seconds]
tomgavin has joined #ruby
jasooon has quit [Ping timeout: 258 seconds]
dc__ has quit [Remote host closed the connection]
robbanp has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
<robbanp>
Sending text over UDP, are there any size limits?
maniacal_ has joined #ruby
oso96_2000 is now known as oso|away
<atmosx>
hello
<atmosx>
The field size sets a theoretical limit of 65,535 bytes (8 byte header + 65,527 bytes of data) for a UDP datagram.
<atmosx>
However it is possible to include IP options which can increase the size of the IP header to as much as 60 bytes.
<atmosx>
IPv4 maximum reassembly buffer size is 576, IPv6 has it at 1500. Subtract header sizes from it.
Jinkins has joined #ruby
<atmosx>
so there you go...
mikeg has quit [Ping timeout: 258 seconds]
<atmosx>
refactoring is a huge pain but feels nice.
<robbanp>
thanks
<atmosx>
robbanp: np
aleatorik is now known as wolves_cs
<robbanp>
trying to push data to graylog2 from sidekiq, but that is hard :/
HelperW__ has joined #ruby
larissa has quit [Ping timeout: 258 seconds]
kamilc__ has joined #ruby
alvaro_o has joined #ruby
nhhagen has joined #ruby
graydot has joined #ruby
nhhagen has quit [Client Quit]
HelperW__ has quit [Read error: Connection reset by peer]
HelperW__ has joined #ruby
chrishough has joined #ruby
kamilc__ has quit [Client Quit]
nonmadden has quit [Remote host closed the connection]
BTRE has joined #ruby
BTRE has quit [Remote host closed the connection]
chrishough has quit [Client Quit]
chrishough has joined #ruby
BTRE has joined #ruby
j2p2 has quit [Ping timeout: 272 seconds]
larissa has joined #ruby
HelperW__ has quit [Ping timeout: 250 seconds]
<shevy>
hey atmosx
<atmosx>
hey shevy!
<shevy>
I am rewriting an old project. that is such a boring task
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
phutchins has joined #ruby
<atmosx>
shevy: I'm re-writing a current one :-P (sort of)
dawkirst has quit [Remote host closed the connection]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<atmosx>
adding translation (i18n) and modifying models... I have to write a large chunk heh
<atmosx>
but I stopped now, I think I'm gonna grab my friend Neal Stephenson and head over to bed... see what Jack Shaftoe is going to do with Leibniz!
freerobby has quit [Quit: Leaving.]
|\|370 has joined #ruby
manzo has joined #ruby
Xiti has quit [Quit: Leaving]
j2p2 has joined #ruby
freerobby has joined #ruby
iamjarvo has joined #ruby
ryanleesipes has quit [Quit: Leaving]
gsd has joined #ruby
ducklobster has joined #ruby
silkfox has joined #ruby
tomeara has joined #ruby
tomeara has quit [Remote host closed the connection]
Mia has quit [Read error: Connection reset by peer]
hellangel7 has quit [Remote host closed the connection]
freerobby has joined #ruby
freerobby has quit [Client Quit]
bwilson has joined #ruby
pwh has quit []
jcdesimp has quit [Remote host closed the connection]
jeremy04 has quit [Ping timeout: 244 seconds]
jasooon has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
nerium has quit [Quit: nerium]
larissa has joined #ruby
larissa has quit [Client Quit]
tkuchiki has joined #ruby
mferrier_ has joined #ruby
mferrier_ has quit [Client Quit]
maniacal_ has quit [Remote host closed the connection]
jcdesimp has joined #ruby
jasooon has quit [Ping timeout: 260 seconds]
tomgavin has quit [Quit: ircII EPIC5-1.1.2 -- Are we there yet?]
mferrier has quit [Ping timeout: 246 seconds]
mleone has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mikeg has joined #ruby
jcdesimp has quit [Remote host closed the connection]
HelperW__ has joined #ruby
tkuchiki has quit [Ping timeout: 272 seconds]
slester has quit [Quit: slester]
jerius has quit []
justinmburrous has quit [Remote host closed the connection]
HelperW___ has joined #ruby
HelperW__ has quit [Ping timeout: 260 seconds]
Mohd_ has quit [Ping timeout: 246 seconds]
ldnunes has quit [Quit: Leaving]
Xiti has joined #ruby
silkfox has quit [Ping timeout: 260 seconds]
cocotton has quit [Remote host closed the connection]
Soda has joined #ruby
cocotton has joined #ruby
cocotton has quit [Remote host closed the connection]
jimmyhoughjr has joined #ruby
treehug88 has quit []
HelperW___ has quit [Ping timeout: 260 seconds]
nerium has joined #ruby
Jinkins has quit [Quit: This computer has gone to sleep]
omosoj has quit [Ping timeout: 250 seconds]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
GriffinHeart has joined #ruby
vext1 has joined #ruby
<vext1>
So I was trying to gem install something and am a little confused by the error I get, hoping someone can shed some light (or shame me into running away):
<Nieralyte>
is there a better way of doing `Dir.foreach('C:\Windows') {|x| puts(x) if File.directory?("C:\\Windows\\#{x}")}` (to output all the foldes)?
GriffinHeart has joined #ruby
troyready has quit [Quit: Leaving]
aspires has quit []
mary5030 has joined #ruby
kriskropd has joined #ruby
bobishh has quit [Ping timeout: 272 seconds]
apeiros has quit [Remote host closed the connection]
mary5030_ has joined #ruby
niklasb has quit [Ping timeout: 260 seconds]
apeiros has joined #ruby
HelperW___ has quit [Ping timeout: 260 seconds]
spastorino has joined #ruby
fabrice31 has joined #ruby
aspires has joined #ruby
mikecmpbll has quit [Ping timeout: 246 seconds]
sevvie has quit [Ping timeout: 258 seconds]
<benzrf>
whyy use windows :|
GriffinHeart has quit [Ping timeout: 246 seconds]
pygospa has quit [Read error: Connection reset by peer]
mary5030 has quit [Ping timeout: 240 seconds]
vedis has quit [Remote host closed the connection]
sinkensabe has quit [Remote host closed the connection]
jimmyhoughjr has joined #ruby
fabrice31 has quit [Ping timeout: 272 seconds]
<rubie>
apeiros: how would you get it in 2.2? do you submit something?
Aaaal has joined #ruby
<jimmyhoughjr>
anyone know of a place offering courses in Ruby?
<rubie>
jimmyhoughjr: what do you mean?
yfeldblum has quit [Ping timeout: 272 seconds]
<jimmyhoughjr>
I'm getting some assistence to retrain in my career so I'd like to maybe find a commerical online course to have my benefactors pay for
sevvie has joined #ruby
<rubie>
ahh i heard treehouse.com and codeschool.com are both good
<jimmyhoughjr>
or if there is something free that is as structured I'd do it on my own time
<rubie>
codeacademy is a good place to start
<jimmyhoughjr>
ive done a little bit of ruby using frank-cucumber on ios
<rubie>
a good book would be "The Pragmatic Programmers' Guide, Fourth Edition"
Deele has quit [Ping timeout: 260 seconds]
agrinb has quit [Remote host closed the connection]
<jimmyhoughjr>
i hitnk i might have that one in my kindle library
<jimmyhoughjr>
and I have an old print book i got form my old job
<jimmyhoughjr>
ive also worked though some of the koans
agrinb has joined #ruby
<rubie>
does that help? or were you looking for something different?
<Bish>
can somebody help me and tell me what the gem fcgi actually does? i mean it does handle fcgi requests, but how? do i have to spawn a service? do i have to tell my webserver(nginx) to execute the script itself?
wd413 has joined #ruby
<jimmyhoughjr>
I think that will help. I'm going to take some java courses probably later this month, so ill ask around there as well
<waxjar>
did anyone else receive an email from omniref?
<Bish>
wow, can anyone help me please before i go nuts?
j2p2 has quit [Ping timeout: 240 seconds]
zeroNones has joined #ruby
zeroNones is now known as NSA
<rubie>
hi all: is this a good way of looking at the sort method? ...a.sort { |x,y| y <=> x } .... i imagine that x is the first string, y is the last string, and we are telling ruby to sort the array with the last sting now as the first, and the first string as the last
<Bish>
i have installed the fcgi ruby gem, i can start the sample, but how do i tell my webserver to f*** connect to it.
<jimmyhoughjr>
is your server using another bundle or seomthing?
<Bish>
jimmyhoughjr, bundle?!
<zenspider>
rubie: "we are telling ruby to sort the array with the last string now as the first" ?
<jimmyhoughjr>
i recall the gems we used at work were in bundler
<jimmyhoughjr>
Bish does the gem tell you what port it is running on?
NSA is now known as tictactoe
<rubie>
sort the array in reverse
<zenspider>
You're reversing x & y args such that they're comparing with `y <=> x`... which just means you're sorting descending
<Bish>
it's not running on any port, that is what confuses me
<jimmyhoughjr>
you sure? i forget the command to show all open ports
<Bish>
yes i am sure.
<jimmyhoughjr>
idk much about ruby, and nothing about that gem
<zenspider>
Bish: fcgi? any reason why?
<Bish>
zenspider, alternatives for running rubyscripts in nginx?
<jimmyhoughjr>
sounds like a problem if its not listening on any ports
<Bish>
jimmyhoughjr, you're not helping.
<Bish>
im going nuts because i am not able to google it.
tictactoe is now known as monkeypatch
<zenspider>
I haven't done anything with fcgi is AGES... but the gist was that you configured it similar to regular cgi and it took care of the persistent process / communication.
<Bish>
can i connect a program with a unix socket? like when i cannot to it, the program answers/listened?
<zenspider>
which documents the API and gives an example right there
thumpba has joined #ruby
agrinb has quit [Ping timeout: 244 seconds]
<Bish>
yeah and it's the fukin script i am running.
<Bish>
which does nothing, but listen on stdin
justinmburrous has quit [Remote host closed the connection]
<zenspider>
again, I said chill the fuck out
<Bish>
i just told you i am using the "fcgi" gem
<Bish>
what do you think you just linked to me
<Bish>
the fcgi gem.
graydot has quit [Quit: graydot]
mary5030_ has quit [Remote host closed the connection]
<zenspider>
ok. we're done you prick. have fun.
oleo is now known as Guest56953
oleo__ has joined #ruby
<Bish>
zenspider, yeah i am sad now since you 2 have been so helpful
jasooon has joined #ruby
<Bish>
telling me stuff i already knew and told you
sinkensabe has quit [Remote host closed the connection]
jimmyhoughjr has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<zenspider>
Funny. I thought we were working through your problem. Given that I have fcgi experience and you don't... One might figure you'd want to not be such an ass.
<zenspider>
enjoy my /ignore
<havenwood>
Rack.
MCDev has joined #ruby
<zenspider>
havenwood: then you have two problems :P
vext1 has left #ruby [#ruby]
<zenspider>
three if you count regexps :D
thumpba_ has quit [Ping timeout: 250 seconds]
<havenwood>
and that's four problems because of the off by one error
justinmb_ has joined #ruby
<Bish>
zenspider, yeah i never used fcgi before.
<Bish>
i told you a few lines above, that i have, i know exactly how it works, but there does not seem to be an easy way to use it with ruby
Guest56953 has quit [Ping timeout: 272 seconds]
<shevy>
Bish and plain .cgi already works?
<Bish>
that is something i never used
jhass is now known as jhass|off
<asklov>
hello, I'm trying to create a real foreign key using activerecord. I have put the :foreign_key and belongs_to, but when I see how it was created in the database, it is just an int column, not a real foreign key. Is it possible to do such thing ? I'm not using rails
<Bish>
last time i tried, i remember it being as frustrating as this.
troulouliou_dev has quit [Ping timeout: 245 seconds]
<Bish>
that's all, how is that supposed to be hard at all, i could write it by myself, but don't want to, since i was thinking ruby has to have something for it
<shevy>
lol
krisquigley has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<eam>
Bish: when writing it yourself you will probably develop the skills necessary to debug your current problems
wjimenez5271 has quit [Remote host closed the connection]
<eam>
it's not a bad idea and I agree, it's pretty simple
<Bish>
eam ack.
<Bish>
i think, if i modify that gem, that the fukin socket listens on tcp:8000
<Bish>
but i would be even more mad than before, because using sockets only to let it listen on stdin, would be so stupid.
<Bish>
let me atleast specify what it listens on
<Bish>
sorry that i was annoying. im done now.
<eam>
no problem, computers can be pretty frustrating
klaut has quit [Remote host closed the connection]
Tricon has quit [Read error: Connection reset by peer]
coderdad_ has quit [Remote host closed the connection]
<Bish>
i have this cool ruby script which is beautiful, and i wanted to make a webservice out of it, and thought to myself "wow that would be cool, if i could simply let it putout json on http"
GinoMan has joined #ruby
Tricon has joined #ruby
krisquigley has quit [Ping timeout: 246 seconds]
ndrei has quit [Ping timeout: 272 seconds]
<Bish>
"alright there is a gem for fastcgi, which is what nginx uses, which i already use, because it is least frustrating"
<Bish>
so i thought.
b00stfr3ak has joined #ruby
ghr has joined #ruby
klmlfl has quit [Ping timeout: 244 seconds]
<benzrf>
Bish: why are you using cgi.
<eam>
benzrf: he's using fastcgi
<benzrf>
that, either
blackmesa has quit [Quit: WeeChat 1.0]
<eam>
fcgi is good
j_mcnally has joined #ruby
<eam>
I use it =/
<Bish>
i think so too, if it worked, i could easily transfer stuff to a webpage
IrishGringo has quit [Ping timeout: 240 seconds]
cerberblue has quit [Remote host closed the connection]
slester has joined #ruby
yfeldblum has joined #ruby
justinmb_ has quit [Remote host closed the connection]
sepp2k has quit [Read error: Connection reset by peer]
iliketurtles has quit [Quit: zzzzz…..]
ghr has quit [Ping timeout: 272 seconds]
fmcgeough has joined #ruby
lewix has quit [Ping timeout: 272 seconds]
lewix has joined #ruby
<Bish>
and i am supercurious, what that fcgi gem is for, like if there is a webserver which allows a pipe as fcgi server?
livingstn has joined #ruby
skolman_ has quit [Remote host closed the connection]
<Bish>
am i SUPPOSED to modify it or create a new class
rubyonrailed has joined #ruby
xcv has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 245 seconds]
skolman_ has joined #ruby
<eam>
Bish: what do you mean?
deric_skibotn has quit [Ping timeout: 240 seconds]
<mayhew>
Bish: is there a reason you don't just use Rack or Sinatra and proxy_pass instead of fcgi_pass from nginx?
justinmburrous has joined #ruby
jcdesimp has joined #ruby
GidorahFedora has joined #ruby
<Bish>
mayhew, well i don't know of these solutions
<Bish>
that is something i was expecting when asking here
skolman_ has quit [Ping timeout: 272 seconds]
ephemerian has quit [Remote host closed the connection]