<this_dude>
this one is gonna screw me..idk how to write the string[i] when given multiple strings
<this_dude>
what is the total sum of a-z.ord?
<Radar>
this_dude: how would you find out if "this is a sentence" contained the letter a?
<this_dude>
why ?
<Radar>
this_dude: because if you can find that out, then you can also check for b, c, d, etc.
<Radar>
Finding out if it contains a is a small step towards solving this problem
<this_dude>
im gonna try to write this to just add the .ord value of each string and if its equal to the sum of all letters a-z print true else false
<Radar>
ok, sure.
<this_dude>
but idk what the sum of a-z is
<Radar>
[11:14:07] <Radar>this_dude: how would you find out if "this is a sentence" contained the letter a?
<this_dude>
>> (a..z).ord.sum
<ruby[bot]>
this_dude: # => undefined local variable or method `a' for main:Object (NameError) ...check link for more (https://eval.in/1046898)
<Radar>
this_dude: You asked for hints and I'm dropping them.
<this_dude>
>> ("a".."z").ord.sum
<ruby[bot]>
this_dude: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<Radar>
this_dude: plz stop obsessing about .ord. It is not the answer.
<this_dude>
i=0 while i < string.length if string[i]=="a" return true else false end i+=1 end
<this_dude>
2847 is the sum of the alphabet
<Radar>
this_dude: is there a shorter way
<Radar>
this_dude: Maybe there's a way to check if a string INCLUDES a particular substring?
<this_dude>
if there is its a method im unfamiliar with...like .scan or something
<this_dude>
the fact that input is a number of strings, and then the strings is messing me up
<this_dude>
because they only start the function as def isPangram(strings)
<this_dude>
so idk where its gonna put the number of strings
Rootsudo has joined #ruby
<Radar>
So what's strings then?
<Radar>
Can you get it to output what they are?
<this_dude>
the test code inputs this 4 we promptly judged antique ivory buckles for the next prize we promptly judged antique ivory buckles for the prizes the quick brown fox jumps over the lazy dog the quick brown fox jump over the lazy dog
<blood>
basically deleting anything that doesnt have that attribute
<Radar>
!unmute this_dude
<blood>
I know I can just loop through each node and handle it but wondering if there was a shorter way like it is done in this repo
aphprentice_ has quit [Quit: Connection closed for inactivity]
gheegh has joined #ruby
wildermind has quit [Quit: Connection closed for inactivity]
apeiros has joined #ruby
apeiros has quit [Ping timeout: 272 seconds]
tty has quit [Quit: tty]
fmcgeough has quit [Quit: fmcgeough]
tty has joined #ruby
arescorpio has joined #ruby
apeiros has joined #ruby
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has quit [Ping timeout: 260 seconds]
maryo has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
maryo has quit [Client Quit]
<blood>
got it all working in Nokogiri =)
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
mrush has quit [Read error: Connection reset by peer]
Rootsudo has joined #ruby
cadillac_ has quit [Quit: I quit]
alfiemax has joined #ruby
mroutis has quit [Ping timeout: 256 seconds]
aniarya82 has joined #ruby
braincrash has quit [Quit: bye bye]
apeiros has joined #ruby
<Radar>
blood: congrats :)
gix has joined #ruby
apeiros has quit [Ping timeout: 256 seconds]
braincrash has joined #ruby
_whitelogger has joined #ruby
ciro has quit [Quit: WeeChat 2.2]
z3uS has quit [Quit: /dev/null]
thy0 has quit [Quit: TTFN]
z3uS has joined #ruby
apeiros has joined #ruby
apeiros has quit [Ping timeout: 272 seconds]
<blood>
Radar: thanks, im just having trouble with generating xml files properly.
<blood>
files that do not exist
mrush has joined #ruby
<blood>
@document = Nokogiri::XML::Builder.new(:encoding => 'UTF-8').to_xml , shouldn't this work for an empty xml document
s2013 has joined #ruby
s2013 has quit [Client Quit]
<mrush>
is there a way to set a default string encoding for an entire script
s2013 has joined #ruby
s2013 has quit [Client Quit]
<mrush>
i think i need to override the default
<mrush>
encoding for the string class
c_h_s has joined #ruby
arescorpio has quit [Quit: Leaving.]
herbmillerjr has joined #ruby
apeiros has joined #ruby
Rootsudo has quit [Read error: Connection reset by peer]
DTZUZO has joined #ruby
mroutis has joined #ruby
blood has quit []
kapil___ has joined #ruby
aniarya82 has quit [Remote host closed the connection]
apeiros has quit [Ping timeout: 256 seconds]
mojtaba has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
s2013 has joined #ruby
mozzarella has quit [Remote host closed the connection]
sylario has quit [Quit: Connection closed for inactivity]
mozzarella has joined #ruby
mroutis has quit [Remote host closed the connection]
<mrush>
can i manually place a gem into c:\ruby192\lib\
ryuteki has joined #ruby
<mrush>
in python you just drop libraries into c:\python\Lib\
duderonomy has joined #ruby
p4p0l0 has joined #ruby
\void is now known as Time-Wrap
Time-Wrap is now known as \void
Inline has quit [Quit: Leaving]
\void is now known as Time-Wrap
Time-Wrap is now known as \void
aufi has joined #ruby
c_h_s has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mrush>
nm
agent_white has quit [Ping timeout: 260 seconds]
kevinsjoberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
agent_white has joined #ruby
alfiemax has quit [Remote host closed the connection]
dellavg has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
apeiros has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
dviola has quit [Quit: WeeChat 2.2]
dionysus69 has joined #ruby
ur5us has quit [Remote host closed the connection]
varesa_ has joined #ruby
Freshnuts has joined #ruby
Freshnuts has quit [Max SendQ exceeded]
Freshnuts has joined #ruby
apeiros has quit [Remote host closed the connection]
Freshnuts has quit [Max SendQ exceeded]
Freshnuts has joined #ruby
apeiros has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dhollin is now known as dhollinger
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
DTZUZO has quit [Ping timeout: 244 seconds]
mojtaba has quit [Quit: Leaving.]
dionysus69 has joined #ruby
p4p0l0 has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
p4p0l0 has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Burgestrand has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
p4p0l0 has quit [Ping timeout: 268 seconds]
asphyxia has joined #ruby
clemens3 has joined #ruby
mroutis has joined #ruby
mroutis has quit [Remote host closed the connection]
ferhaty has joined #ruby
dellavg has quit [Read error: Connection reset by peer]
dellavg has joined #ruby
Dbugger has joined #ruby
ryuteki has quit [Quit: leaving]
aufi has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
c0ncealed2 has quit [Remote host closed the connection]
Some-body_ has joined #ruby
DarthGandalf has quit [Ping timeout: 260 seconds]
Some-body_ is now known as DarthGandalf
c0ncealed2 has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has quit [Ping timeout: 272 seconds]
alex`` has joined #ruby
mikecmpbll has joined #ruby
<asphyxia>
hi guys, if I have a function outside of the main program, calling an integer variable that I use later on in the program, how can I declare it as an integer in the global function?
<asphyxia>
Because currently I get told that it's undefined
<asphyxia>
e.g. in another language I would say myValue: Integer
<ruby[bot]>
asphyxia: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<asphyxia>
oh so that's what you meant by gist I thought meant it as an expression of speech haha
moei has quit [Quit: Leaving...]
<tbuehlmann>
okay, and what exactly is the error you're getting?
<tbuehlmann>
oh I see
<tbuehlmann>
your calculate_age method uses year_born, but the method doesn't know about it. so you could simply have a second method parameter for that and call the method like calculate_age(prompt, year_born)
<asphyxia>
so I don't need to declare the data type in that function?
<asphyxia>
I'm very new to ruby, sorry if that seems like a silly question
lxsameer has joined #ruby
wildermind has joined #ruby
erratic has joined #ruby
psychicist__ has joined #ruby
Beams has joined #ruby
conta has joined #ruby
tristanp has joined #ruby
yokel has joined #ruby
tristanp has quit [Ping timeout: 248 seconds]
<asphyxia>
As Ruby is dynamically typed, it does not require
<asphyxia>
type information on parameters and return values
<asphyxia>
1/2 hr later
<tbuehlmann>
right, you can't do that
reber has joined #ruby
Freshnuts has quit [Quit: Leaving]
moei has joined #ruby
Beams has quit [Quit: .]
tty has quit [Quit: tty]
claudiuinberlin has joined #ruby
Beams has joined #ruby
teclator has joined #ruby
Burgestrand has quit [Quit: Closing time!]
gregf_ has joined #ruby
Emmanuel_Chanel has joined #ruby
alfiemax has joined #ruby
alex`` has quit [Ping timeout: 248 seconds]
dellavg has quit [Remote host closed the connection]
dellavg has joined #ruby
dellavg has quit [Remote host closed the connection]
dellavg has joined #ruby
Pip has joined #ruby
amelliaa has joined #ruby
agent_white has quit [Quit: night]
Pip has quit [Quit: Leaving]
mikecmpbll has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
Beams has quit [Quit: .]
sticaz has joined #ruby
aufi has joined #ruby
tristanp has joined #ruby
Beams has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
evdubs has quit [Ping timeout: 265 seconds]
tristanp has quit [Ping timeout: 240 seconds]
Burgestrand has joined #ruby
gheegh has joined #ruby
snickers has joined #ruby
Tempesta has quit [Quit: See ya!]
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
dionysus70 is now known as dionysus69
Beams has quit [Quit: .]
Beams has joined #ruby
Tempesta has joined #ruby
cabotto has joined #ruby
conta has quit [Quit: conta]
mondz has quit [Remote host closed the connection]
<baweaver>
apeiros_: _might_ have been watching too much Archer and Baccano.
<cthulchu>
I missed out
<cthulchu>
no idea what the idea was
<cthulchu>
also debugging in Ruby is very-very easy
<cthulchu>
try debugging in asm
hotpancakes has quit [Remote host closed the connection]
<baweaver>
Mind, the target audience is newbies.
<mroutis>
unfair comparison, everything in assembly is hard
<cthulchu>
oh, well, the cartoons would be really good for kids
<baweaver>
Meaning that it very well may not be easy for them.
<havenwood>
baweaver: 5, but I'm a a sucker for investigations!
<cthulchu>
mroutis, the point was everything in Ruby is easy :)
<havenwood>
baweaver: What do you call an alligator in a vest?
<baweaver>
investigator
<apeiros_>
baweaver: given how "dick tracey" the tracy lends itself to "trace", I'm amused you didn't use something in that direction as a name (tho, I guess dick tracy isn't really "noir")
apeiros_ is now known as apeiros
gheegh has joined #ruby
s2013 has joined #ruby
<havenwood>
Point Tracey, the TracePointer.
<cthulchu>
ha
<cthulchu>
I like it
<baweaver>
You can't pay me enough to get on stage and say dick tracey though
ogres has quit [Quit: Connection closed for inactivity]
<cthulchu>
lol
<baweaver>
The idea is to make stories to cover basic concepts, and maybe a few advanced ones.
alfiemax has joined #ruby
<mroutis>
baweaver: 5 (not target audience, tho it would be awesome that beginners understand how to debug/understand what's going on with their code)
kevinsjoberg has joined #ruby
<mroutis>
it could help to reduce the frustration at the start of their learning curve
<baweaver>
Other ideas include "The Pattern Matching Express" (===, patterns, western), "The Most RSpectacular Show on Earth!" (testing, circus)
wildermind has quit [Quit: Connection closed for inactivity]
<baweaver>
"It's a Jungle Out There" (refactoring, Madagascar)
<Caerus>
saw the slides for the one you just did. Couldn´t find the actual talk though
gigetoo has joined #ruby
<baweaver>
It's not out yet.
<baweaver>
Remember the talk only happened about a week and a half ago
Freshnuts has joined #ruby
jenrzzz has joined #ruby
<baweaver>
Hrm. Na, "Professor When" may make a good Git talk. Screwing around with timelines and such
sauvin has quit [Read error: Connection reset by peer]
bsamorim has joined #ruby
mroutis has quit [Ping timeout: 240 seconds]
<bsamorim>
Hi, given MRI's GIL, do I have to use synchronization mechanisms such as locks for sharing an array between two threads? My case is a bit more specific: the threads would just push/pop to/from the array, respectively. The order in which the push and pops would actually be executed would be irrelevant - I just wanted to know if they could be considered atomic.
<bsamorim>
Please interpret "MRI" as "Most popular ruby interpreter for > 2.0 rubies"
wildermind has joined #ruby
<apeiros>
bsamorim: yes
akaiiro has quit [Remote host closed the connection]
<bsamorim>
apeiros: k, thx
<apeiros>
bsamorim: GIL does not magically remove race conditions for shared resources.
<bsamorim>
apeiros: it doesn't, but it certainly helps to enable these operations to be thread-safe by default
<bsamorim>
they are in python, for instance
<bsamorim>
*in CPython
<apeiros>
thread-safe is a word most people sadly completely misunderstand.
orbyt_ has joined #ruby
<bsamorim>
apeiros: it isn't really a formal concept ;)
<bsamorim>
I explained what I meant by thread-safe in the first message's last sentence
<apeiros>
I'm not sure it really isn't. I have an understanding of what it is supposed to be, but never bothered with looking up whether there's a formal definition for that.
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros>
anyway, amending what I previously wrote: if you're only using push & pop and don't mind which item is actually popped, and pop occasionally returning nil (depending on how your threads use the array it's a possibility), then you don't need to synchronize.
Freshnuts has quit [Quit: Leaving]
<bsamorim>
apeiros: that's fine by me...thanks!
<apeiros>
but honestly, you still should. atomic behavior of push/pop is not guaranteed.
<bsamorim>
apeiros: k, thanks!
<apeiros>
<3 pry-doc's ability to dig into C sources
agent_white has joined #ruby
jalcine has quit [Ping timeout: 240 seconds]
fmartingr has quit [Quit: Connection closed for inactivity]
fmcgeough has quit [Quit: fmcgeough]
reber__ has joined #ruby
akaiiro has joined #ruby
reber has quit [Ping timeout: 256 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
Samian has joined #ruby
<Samian>
Anyone here use a company wiki at work? My company uses team services and we have a office 365 subscription, so we could host a wiki through those things, but they're both slow. SO I'm looking for alternatives
<sonOfRa>
Essentially, once any block is entered, user (or any variable that gets assigned user, or any of its contents) becomes nil
<baweaver>
instance_eval of some sort I'd guess.
<baweaver>
where's connect defined?
<apeiros>
why do you use abort instead of e.g. p?
<apeiros>
baweaver: user is an lvar, though
<sonOfRa>
needed a quick way to print it out to the screen in rails
<apeiros>
so a method shouldn't be able to shadow it
<apeiros>
sonOfRa: use p twice instead of abort. otherwise we're not sure the context is the same
<apeiros>
you can use something like `puts "="*100` if you want to highlight it in the output
<apeiros>
sonOfRa: also, you write "This fails because user is suddenly nil" - please provide the exact error. you wouldn't be the first to misrepresent an exception.
<sonOfRa>
NoMethodError (undefined method `dn' for nil:NilClass): is the actual error
<baweaver>
Is this called once, or multiple times?
LenPayne_ is now known as LenPayne
<sonOfRa>
With p it seems to be now called multiple times, actually, and I don't quite see why (yet)
<sonOfRa>
hang on
<baweaver>
because I'd bet a nil user got passed into another call somehow if it is called multiple times.
<baweaver>
hence apeiros's context mention above.
<apeiros>
yeah, hence abort = bad for figuring stuff :)
<apeiros>
so first call you have a user, and any subsequent call you don't
<sonOfRa>
gist is updated with the update. Interesting. I wonder where the user went
<sonOfRa>
d'oh
<apeiros>
yeah, so it gets called twice. and second call with a nil arg.
<sonOfRa>
Left some of the old to-be-refactored code in there
<sonOfRa>
Thanks for the hint, this would have taken ages with the abort way
<apeiros>
and don't do `p user.inspect`, just `p user`
<apeiros>
p already invokes inspect.
<sonOfRa>
I see
<sonOfRa>
Been a while since I last touched this project, and it's the only ruby thing I've ever done
<sonOfRa>
Removing the old code did the trick
<apeiros>
which btw. means you can do handy stuff like: `p some_label: some_value, some_other_label: some_other_value`
dviola has joined #ruby
Eiam_ has joined #ruby
Puffball has quit [Remote host closed the connection]
Rootsudo has joined #ruby
Eiam has quit [Ping timeout: 276 seconds]
Puffball has joined #ruby
alex`` has quit [Ping timeout: 240 seconds]
hotpancakes has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 265 seconds]
hotpancakes has joined #ruby
dviola has quit [Quit: WeeChat 2.2]
GodFather has quit [Ping timeout: 240 seconds]
akaiiro has quit [Ping timeout: 248 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
sanscoeu_ has quit [Remote host closed the connection]
sanscoeur has joined #ruby
mojtaba has joined #ruby
gheegh has joined #ruby
GodFather has joined #ruby
wildermind has quit [Quit: Connection closed for inactivity]
beowuff has quit [Ping timeout: 244 seconds]
tty has joined #ruby
dreamthese has joined #ruby
nicesignal has quit [Remote host closed the connection]
dreamthese has quit [Remote host closed the connection]
nicesignal has joined #ruby
augcesar has quit [Quit: Connection closed for inactivity]
beowuff has joined #ruby
Dbugger has quit [Ping timeout: 265 seconds]
dviola has joined #ruby
hotpancakes has quit [Remote host closed the connection]