duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch has quit [Ping timeout: 250 seconds]
matsaman has joined #ruby
uplime has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
AndreYuhai has joined #ruby
matsaman has quit [Ping timeout: 258 seconds]
<AndreYuhai>
Hello how can I write the xPath for this HTML https://paste.ofcode.org/a2egTxG6tEeKP8QFmaT3qJ I want to get the a tag. Is there any other way besides "//section[@class='pv-contact-info__contact-type ci-email']/div/a" ?
<AndreYuhai>
I mean any shorter or better way
Azure has joined #ruby
matsaman has joined #ruby
tdy has quit [Read error: Connection reset by peer]
tdy has joined #ruby
ixti has quit [Quit: WeeChat 2.3]
cschneid has joined #ruby
houhoulis has quit [Remote host closed the connection]
rkazak has joined #ruby
AndreYuhai has quit [Quit: Page closed]
cthulchu has joined #ruby
<cthulchu>
guys. using #{} is not formatting, right?
<cthulchu>
what do you call it?
<cthulchu>
I'm trying to find something like that in py now
tiff has joined #ruby
tdy has quit [Ping timeout: 258 seconds]
<mozzarella>
cthulchu: string interpolation?
<cthulchu>
thanks
hutch has joined #ruby
cthu| has quit [Ping timeout: 246 seconds]
cschneid has quit [Remote host closed the connection]
conta has joined #ruby
braincrash has quit [Quit: bye bye]
cschneid has joined #ruby
braincrash has joined #ruby
conta has quit [Ping timeout: 250 seconds]
uplime has quit [Quit: WeeChat 2.2]
cthulchu is now known as cth
cth is now known as cthulchu
cthulchu is now known as cthu
cthu is now known as cthu|
dellavg_ has joined #ruby
cthu| is now known as cthulchu
cthulchu is now known as cthu
cthu is now known as cthulchu
rkazak has quit [Quit: Sleep.....ing....]
Nicmavr has quit [Read error: Connection reset by peer]
cschneid has quit [Remote host closed the connection]
duderonomy has joined #ruby
Nicmavr has joined #ruby
moei has quit [Ping timeout: 246 seconds]
matsaman has quit [Read error: Connection reset by peer]
faraazahmad has joined #ruby
hutch has quit [Ping timeout: 246 seconds]
nowhere_man has joined #ruby
agent_white has joined #ruby
cnsvc has joined #ruby
hutch has joined #ruby
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
solocshaw has joined #ruby
hutch has quit [Ping timeout: 240 seconds]
marmotini_ has joined #ruby
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #ruby
marmotini has joined #ruby
marmotini_ has quit [Client Quit]
code_zombie has quit [Quit: Leaving]
eckhardt has quit [Ping timeout: 245 seconds]
nowhere_man has quit [Ping timeout: 252 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nadir has quit [Quit: Connection closed for inactivity]
tdy has joined #ruby
cschneid has joined #ruby
conta has joined #ruby
marmotini_ has joined #ruby
nowhere_man has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
segy has quit [Ping timeout: 246 seconds]
marmotini has quit [Ping timeout: 258 seconds]
marmotini_ has quit [Ping timeout: 258 seconds]
marmotini_ has joined #ruby
segy has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
aupadhye_ has joined #ruby
aupadhye has joined #ruby
aupadhye_ has quit [Client Quit]
Dbugger has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
cschneid has joined #ruby
solocshaw has quit [Ping timeout: 252 seconds]
comet23 has joined #ruby
<comet23>
is there a way to convert ">" to >
dbugger_ has joined #ruby
Dbugger has quit [Ping timeout: 264 seconds]
<baweaver>
?xy
<ruby[bot]>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
johnny56_ has quit [Ping timeout: 272 seconds]
johnny56_ has joined #ruby
faraazahmad has quit [Quit: Connection closed for inactivity]
<comet23>
baweaver: basically i want to refactor my code and the only logical solution i came up with is if there was a way to convert string <> signs back to their respective signs
<baweaver>
What's your code?
<baweaver>
because chances are high you don't need to do that.
<comet23>
will i be seeing a lot of code like that professionally>
Puffball has joined #ruby
<leftylink>
save a line by changing the reduce to a .with_object
<baweaver>
You'd be far far more likely to see `array.rotate(1)`
<baweaver>
with_index makes the arg order kinda gnarly
<baweaver>
but otherwise pretty much
<baweaver>
Very rarely do you need to implement your own functions like that in the real world, though eventually it's nice to know how they work
<baweaver>
reduce and each_with_object just happen to be absurdly overpowered functions capable of reimplementing any of the other Enumerable functions.
<baweaver>
Including combinations thereof
<comet23>
so why are we going through the pain of all these coding challenges?
<comet23>
is it just to get a grasp for logical thinking?
<baweaver>
It teaches you to think and consider things
<baweaver>
You're not going to come to immediate solutions to things when starting out
<baweaver>
Instead take time to write it out, get a feel for how the data flows, and try and find patterns
<baweaver>
once you build that recognition you start noticing a lot of problems look awfully similar
aupadhye has joined #ruby
za1b1tsu has joined #ruby
nowhere_man has joined #ruby
virmagicis has joined #ruby
clemens3 has joined #ruby
akosednar has quit [Ping timeout: 272 seconds]
vondruch has quit [Quit: vondruch]
aupadhye has quit [Ping timeout: 258 seconds]
aupadhye has joined #ruby
akosednar has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aupadhye has quit [Ping timeout: 272 seconds]
aupadhye has joined #ruby
lunarkitty7 has joined #ruby
phredus has joined #ruby
apparition has joined #ruby
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
faraazahmad_ has quit []
vondruch has joined #ruby
faraazahmad_ has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
jottr_ has quit [Quit: WeeChat 2.2]
rippa has joined #ruby
DTZUZO has joined #ruby
faraazahmad_ has quit [Client Quit]
cthulchu has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
mikecmpbll has quit [Client Quit]
nowhere_man has quit [Ping timeout: 252 seconds]
nowhere_man has joined #ruby
themsay has quit [Ping timeout: 245 seconds]
mikecmpbll has joined #ruby
Sina has joined #ruby
cschneid has joined #ruby
aupadhye has quit [Ping timeout: 244 seconds]
aupadhye has joined #ruby
jsrn has joined #ruby
aupadhye has quit [Ping timeout: 244 seconds]
apparition has quit [Quit: Bye]
aupadhye has joined #ruby
cd has joined #ruby
themsay has joined #ruby
olspookishmagus has quit [Ping timeout: 245 seconds]
cschneid has quit [Ping timeout: 264 seconds]
kapil____ has joined #ruby
TomyLobo has joined #ruby
comet23 has quit [Quit: Connection closed for inactivity]
queip has quit [Ping timeout: 246 seconds]
cschneid has joined #ruby
catphish has joined #ruby
queip has joined #ruby
<catphish>
it would be really nice if ruby offered direct access to pipe2() with flags
sameerynho has joined #ruby
tinyhippo has left #ruby ["WeeChat 2.3"]
<catphish>
may need to write a gem for it, though i've never written a C gem before
esrse has quit [Ping timeout: 246 seconds]
themsay has quit [Ping timeout: 250 seconds]
themsay has joined #ruby
cschneid has quit [Ping timeout: 250 seconds]
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
themsay has quit [Ping timeout: 258 seconds]
themsay has joined #ruby
drale2k_ has joined #ruby
dripup has quit [Remote host closed the connection]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drale2k_ has joined #ruby
dminuoso has joined #ruby
dminuoso has left #ruby ["WeeChat 2.0.1"]
drale2k_ has quit [Client Quit]
conta has quit [Ping timeout: 240 seconds]
conta has joined #ruby
aupadhye has quit [Ping timeout: 245 seconds]
aupadhye has joined #ruby
tdy has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
aupadhye has quit [Ping timeout: 250 seconds]
aupadhye has joined #ruby
jlebrech has joined #ruby
vondruch has quit [Ping timeout: 250 seconds]
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #ruby
vondruch has joined #ruby
<jlebrech>
i want to pack a string into a hexadecimal value, but pack is a method of array and not string
Guest86938 has quit [Remote host closed the connection]
Guest86938 has joined #ruby
discopatrick has joined #ruby
cschneid has quit [Ping timeout: 245 seconds]
<go|dfish>
emers2n: looking at the docs page for that api it says 'Requests are made with a GET request to the specified endpoint with a single parameter, data, which is a base64 and JSON encoded string.'
<go|dfish>
emers2n: ok so you're using the lists api which is different however it says 'The arguments should be sent as content type application/json' on https://www.klaviyo.com/docs/api/v2/lists
<go|dfish>
emers2n: this means post_form() is incorrect here
<emers2n>
go|dfish: Wow, thank you. That's exactly what I was doing wrong, and I've adjusted the code to see successful calls now.
<go|dfish>
emers2n: cool :)
<jlebrech>
i have a strange issue where i get a template error but it's rendering correctly
<jlebrech>
ActionView::Template::Error (undefined method `[]' for nil:NilClass)
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
RougerRR_ is now known as RougeR
gnufied has quit [Quit: Leaving]
Eiam_ has joined #ruby
Eiam has quit [Ping timeout: 268 seconds]
tdy has joined #ruby
millerti has joined #ruby
cthulchu has joined #ruby
cthulchu_ has joined #ruby
planigan has quit [Ping timeout: 250 seconds]
maryo has joined #ruby
cthulchu has quit [Ping timeout: 258 seconds]
catphish has quit [Quit: Leaving]
davidw_ has quit [Remote host closed the connection]
davidw_ has joined #ruby
\void has joined #ruby
conta has joined #ruby
galaxie has joined #ruby
conta has quit [Remote host closed the connection]
<galaxie>
Hi, I finally got annoyed enough to try and solve this problem. Basically I'm using RVM and it has worked for some time but since maybe 6 months ago it doesn't like anything with native extensions and spews garbage about extensions not being built for all these gems and they can't be found.
Guest86938 has quit [Ping timeout: 272 seconds]
galaxie has quit [Quit: ircII EPIC4-2.10.6 -- Are we there yet?]
galaxie has joined #ruby
<galaxie>
Sorry, bad connection. I tried restoring all gems to pristine condition but that failed too.
<galaxie>
I also use LXTerminal and tried integrating it but even bash -l no longer seems to work.
<uplime>
what do you mean doesn't work?
<galaxie>
As in, same error. No native extensions.
gnufied has joined #ruby
jsrn has quit [Ping timeout: 258 seconds]
<galaxie>
Using different versions of Ruby also doesn't help, so it probably is rvm's fault.
tdy has quit [Ping timeout: 250 seconds]
tdy has joined #ruby
<galaxie>
Gems that I install right now with native extensions that seem to install correctly are then not found and ignored.
aufi has quit [Ping timeout: 250 seconds]
<uplime>
what does `type gem` say?
<galaxie>
It's a function linked to rvm.
reber has joined #ruby
conta has joined #ruby
<phaul>
galaxie: paste all error logs you have (full logs please), including the commands you executed.
conta2 has joined #ruby
<galaxie>
Wait a minute, I think I somehow alias'd ruby to something other than rvm's shem or whatever and forgot about it. Wow, that worked.
davidw_ has quit [Remote host closed the connection]
davidw_ has joined #ruby
Swyper has joined #ruby
Eiam_ is now known as Eiam
cthulchu has joined #ruby
Swyper has quit [Remote host closed the connection]
GodFather has quit [Ping timeout: 252 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
film42 has joined #ruby
orbyt_ has joined #ruby
<film42>
I was wondering if it would be worth experimenting with caching of zero-values in ruby. Where [], {}, and "" literals are shared references and only dup'd on mutation.
davidw_ has quit [Remote host closed the connection]
<film42>
The hypothesis being that we often return empty arrays and hashes in rack middlewares.
davidw_ has joined #ruby
<film42>
Might not actually be worth the effort, but wanted to bounce it off #ruby before trying anything.
r29v has joined #ruby
clemens3 has quit [Ping timeout: 246 seconds]
orbyt_ has quit [Max SendQ exceeded]
<uplime>
i thought string literals were already frozen? would they still need to be "cached"?
sanscoeur has joined #ruby
Swyper has joined #ruby
RougeR has quit [Ping timeout: 252 seconds]
conta2 has joined #ruby
tdy has quit [Remote host closed the connection]
orbyt_ has joined #ruby
<film42>
uplime: String literals might be. I'm thinking about array and hash literals as well.
<film42>
And not frozen as in "immutable" but cached as in memory is shared until modified. Like the zero-value is an immutable value that is dup'd before mutation.
hovis has joined #ruby
Aqo has joined #ruby
conta2 has quit [Ping timeout: 258 seconds]
hutch has quit [Ping timeout: 244 seconds]
KeyJoo has joined #ruby
indocomsoft has joined #ruby
<catbusters>
Hi
mikecmpbll has joined #ruby
<catbusters>
I'm trying to create a method inside a class that can only be called from within that class. Here's my code (http://tpcg.io/1REYkr) but I can't get it to work
<catbusters>
What am I doing wrong?
planigan has joined #ruby
hutch has joined #ruby
<phaul>
catbusters: you are mixing instance methods and class methods.
<phaul>
add is an instance method. call is a class method. calling add from call doesn't work as without explicit receiver it is sent to the class, but the class doesn't have such method
<catbusters>
phaul: How can I fix it? I want to be able to do Something.call (without creating a new instance), and the call method needs to call other private methods
<catbusters>
In the example above, I removed `private` from the add definition and made it `self.add` which makes it work, but I don't want `Something.add` to be callable
kapil____ has joined #ruby
Sou|cutter has joined #ruby
emers2n has quit [Quit: Page closed]
<phaul>
make it private, and make it class method. open the singleton class with class << self .. end syntax, declare a private scope, and define the method (without self)
chouhoulis has quit [Remote host closed the connection]
<catbusters>
phaul: Alright. And what I'm trying to do is create a Rails service object, so does this way of doing it make sense or am I off track?
sanscoeu_ has joined #ruby
marmotini_ has joined #ruby
sanscoeur has quit [Ping timeout: 272 seconds]
<phaul>
I'm not sure, I am not a big fan of thsese design patterns in Ruby, I fail to see why just PORM (plain old ruby modules) are not enough to factor code out if the code is separable enough from the rest of the class. But someone else might see things differently
marmotini has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
marmotini_ has quit [Ping timeout: 246 seconds]
FastJack has joined #ruby
davidw_ has quit [Remote host closed the connection]
davidw_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
discopatrick has quit [Quit: Connection closed for inactivity]
<catbusters>
So many ways to do things 😅
<catbusters>
Would just defining a method inside a module be enough?
<uplime>
are modules able to make use of [public, protected, private] like classes?
<phaul>
havenwood: when you said they are different things, I think you misunderstood the question. even though catbusters missed the full code I think it was about private_class_method vs class << self; private def blah .. Those are semantically equivalent right? Just using different syntax to achieve the same
<phaul>
in other words a making the instance method of the class' singleton class private is the same as making a class method of the class private.
<phaul>
&>> module M; class << self; private def blah; 1; end; end; end; M.blah
<rubydoc>
# => private method `blah' called for M:Module (NoMethodError) (https://carc.in/#/r/5y0o)
reber has quit [Remote host closed the connection]
<phaul>
uplime: ^
<uplime>
neat
themsay has joined #ruby
<uplime>
but M#blah (did i use that right?) is still accessible within M right?
planigan has quit [Remote host closed the connection]
za1b1tsu has quit [Ping timeout: 268 seconds]
reber has joined #ruby
<uplime>
guess i could just try it out myself :}
<uplime>
thanks phaul
hutch has quit [Ping timeout: 244 seconds]
orbyt_ has joined #ruby
Tharbakim has quit [Ping timeout: 268 seconds]
themsay has quit [Ping timeout: 245 seconds]
orbyt_ has quit [Read error: Connection reset by peer]
planigan has joined #ruby
orbyt_ has joined #ruby
hutch has joined #ruby
maryo_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sou|cutter has quit [Quit: WeeChat 1.4]
maryo has quit [Ping timeout: 250 seconds]
Swyper has quit [Remote host closed the connection]
orbyt_ has joined #ruby
RedNifre has joined #ruby
RougeR has quit [Ping timeout: 268 seconds]
ramfjord has joined #ruby
conta has quit [Quit: conta]
marmotini has quit [Ping timeout: 250 seconds]
dellavg_ has quit [Ping timeout: 246 seconds]
SeepingN has joined #ruby
<havenwood>
phaul: Ah, gotcha. You're right, I misunderstood the question.
perique has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krawchyk_ has quit [Quit: krawchyk_]
Sou|cutter has joined #ruby
gix has joined #ruby
ur5us has joined #ruby
krawchyk has joined #ruby
mn3m has joined #ruby
RedNifre has quit [Ping timeout: 252 seconds]
RedNifre has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
davidw_ has quit [Remote host closed the connection]
davidw_ has joined #ruby
polishdub has quit [Remote host closed the connection]
maryo_ has quit [Ping timeout: 244 seconds]
orbyt_ has joined #ruby
fiachetti has quit [Ping timeout: 258 seconds]
tdy has joined #ruby
orbyt_ has quit [Ping timeout: 268 seconds]
conta has joined #ruby
sqbell has joined #ruby
marmotini has joined #ruby
conta has quit [Ping timeout: 246 seconds]
lytol has joined #ruby
dbugger_ has quit [Remote host closed the connection]
dviola has quit [Quit: WeeChat 2.3]
conta has joined #ruby
tdy has quit [Remote host closed the connection]
marmotini has quit [Ping timeout: 268 seconds]
davidw_ has quit [Remote host closed the connection]
RedNifre has quit [Ping timeout: 252 seconds]
davidw_ has joined #ruby
sanscoeu_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
RedNifre has joined #ruby
conta has quit [Ping timeout: 272 seconds]
sanscoeur has quit [Ping timeout: 245 seconds]
sqbell has quit [Ping timeout: 244 seconds]
hutch has quit [Ping timeout: 258 seconds]
Aqo has quit [Ping timeout: 250 seconds]
Tharbakim has joined #ruby
hutch has joined #ruby
szulak_ has joined #ruby
donofrio has quit [Ping timeout: 245 seconds]
sanscoeu_ has quit [Remote host closed the connection]
sanscoeur has joined #ruby
donofrio has joined #ruby
davidw_ is now known as davidw
davidw has quit [Remote host closed the connection]
davidw_ has joined #ruby
agent_white has quit [Quit: bbl]
reber has quit [Remote host closed the connection]
lunarkitty7 is now known as lunarkittychan
KeyJoo has quit [Quit: KeyJoo]
szulak_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lytol has quit [Ping timeout: 268 seconds]
davidw_ is now known as davidw
davidw has quit [Remote host closed the connection]
<comet23>
so there is absolutely no reason to use the english versions
<baweaver>
For where you're currently at in programming, no.
<baweaver>
There are exceptions to every rule, but typically you want to play by those rules where possible to avoid confusion.
<baweaver>
Much the same with metaprogramming and eval. 99% of the time you don't need them, but every beginner wants to use them at every turn because they have a shiny new tool and it looked fun
<baweaver>
More often than not they end up creating a pretty big mess of it when a single-line would have done the same thing if they hadn't been fixating on that.
<comet23>
i'm going through app academy's free ruby course
<comet23>
they put their whole curriculum out online for free
<comet23>
and, or, and not are near-synonyms of &&, ||, and !. The sole difference is that they have lower precedence in the order of operations. For the purposes of this course, we will only be using &&, ||, and ! -- we strongly discourage (at least for now) ever using and, or, and not. Once you've finished the course and are out in the real world, you may find useful applications for these operators, but for now we will not be using
<comet23>
them.
ansraliant has joined #ruby
<comet23>
i'm sorry i thought it was going to put it in the irccloud pastebin
<Radar>
All good. It's only two lines.
<kankava>
@baweaver thanks
sanscoeu_ has joined #ruby
<baweaver>
That's a fair assessment by them. There are uses but they're rare and are rarely justifiable