<jla>
i see 'require 'socket' ' in the simple code sample .rb ... may i run 'gem install socket' or am i getting confused with gems and libraries ?
<Qchmqs>
jla, unrelated note, but it's usually prefered to use bundler to install dependencies locally rather than gem to install them globally
<baweaver>
For the sake of simple experiments just use gem instal
<baweaver>
Worry about bundler later once you get into making gems, scripts, apps, or otherwise.
<Qchmqs>
baweaver, I had my young sibling experiment with ruby, when he was interested in programming, using gem can quickly become cumbersome
<baweaver>
For just testing in a REPL (IRB, Pry) gem install is fine
<baweaver>
For just getting started it's fine.
<Qchmqs>
another approach he ended up using, he found on some online tutorial, was to use a docker image with ruby installed, and have your REPL inside it
<jla>
thX Qchmqs ... yes, as best practice.
<baweaver>
"I want to try this" should not be encumbered quite so fast with package management
<baweaver>
Though it will be an eventual step, yes.
Rounin has joined #ruby
<jla>
yet, i see my socket divertimento works... without gem (socket) install,
<Qchmqs>
baweaver, the opposite was true in my experience, while experimenting, you end up installing a lot of stuff
<baweaver>
Then that's your experience
<Qchmqs>
jla, sockets is shipped with ruby, there are bunch of similar stuff
<jla>
may i guess i've just learned the difference between gems and libraries ?
<jla>
ah
<baweaver>
What I'm saying is it's wise to minimize
<baweaver>
gems == libraries
<Qchmqs>
jla, gems are just libraries, it's just some are standard, and the rest are community provided
<jla>
oh
<baweaver>
Start simple, add tools as you go. Things like Docker are a few steps removed unless someone has familiarity there already.
<baweaver>
Unless you're on Windows then bets are kind of off
<Qchmqs>
baweaver, yeah in my case, my brother had me to bug about stuff, so it makes sense
<baweaver>
Then it's into WSL2 / etc and some real interesting rabit holes.
<jla>
may i say that sockets is a standard ruby library , hence ...no need to 'gem it ' ?
<baweaver>
Ruby's STDLIB is gemified, or rather they're mostly gems
<Qchmqs>
it's a gem, that just happens to be shipped by default
<baweaver>
^
<baweaver>
That's done so they can update those gems rather than releasing a whole new Ruby version to change something minor
<Qchmqs>
jla, if you're starting out with programming, don't forget to get the basics of algorithms and data structures
<Qchmqs>
it's more important than any language syntax
<baweaver>
It does help to know enough syntax to implement them though ;)
<jla>
baweaver ... i see your site ... Octopress ? Just curious...
<baweaver>
Ah that one?
<baweaver>
Real old
<baweaver>
Should fix it later but don't quite care enough
<jla>
yes Qcmqs ...say i'm re-starting
<jla>
i used it ... in the past (just simple Jekyll now ) wasn't Octopress kind of deprecated kind of ?
<Qchmqs>
if you already know the basics, then it might also be worth your while to learn more in depth OOP, like design patterns, it goes alongside exploring ruby
blackmesa has quit [Ping timeout: 258 seconds]
<Qchmqs>
you'll love ruby more the more you learn
vondruch has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
al2o3-cr has joined #ruby
Rudd0 has quit [Ping timeout: 240 seconds]
jla has quit [Ping timeout: 240 seconds]
MalkbabY has quit [Remote host closed the connection]
teclator has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
MalkbabY has joined #ruby
tosaraja_ is now known as tosaraja
blackmesa1 has quit [Ping timeout: 240 seconds]
akem_ has joined #ruby
brigitte is now known as aloy
akem has quit [Ping timeout: 265 seconds]
akem_ has quit [Ping timeout: 240 seconds]
<banisterfiend>
jla socket prrogramming is a very intense way to start your programming career :)
<banisterfiend>
I think game dev is the best route, check out the library libgosu.org
<banisterfiend>
sockets are a pain in the ass, u have to learn about endianness, dns ,address families, file descriptors, threads most likely, and so on
lurkless has joined #ruby
akem has joined #ruby
<banisterfiend>
then there's the kerfuffle over ipv4 vs ipv6 too, which can be the source of a lot of confusion for everyone
akem has quit [Ping timeout: 265 seconds]
akem has joined #ruby
baojg has quit [Remote host closed the connection]
GankMove has joined #ruby
GankMove is now known as StayinPaid
baojg has joined #ruby
gearnode has joined #ruby
akem_ has joined #ruby
akem has quit [Ping timeout: 260 seconds]
vondruch has quit [Ping timeout: 252 seconds]
blackmesa1 has joined #ruby
akem_ has quit [Ping timeout: 268 seconds]
akem has joined #ruby
akem_ has joined #ruby
akem has quit [Ping timeout: 260 seconds]
jla has joined #ruby
shtirlic has joined #ruby
<jla>
can you recommend me any forum ( 'Discourse' like ... ? ) on ruby in general and/or RoRails in particular ?
akem has joined #ruby
akem_ has quit [Ping timeout: 260 seconds]
vondruch has joined #ruby
<banisterfiend>
jla why ruby though? it seems like the language isn't so hot these days
<banisterfiend>
if i was starting out again now, i'd probably focus on Python or Go
<banisterfiend>
actually if i was starting out again, i'd avoid web dev like the plague; it's the least interesting kind of proogramming and a day working as a web developer is just the same day on repeat (unless you're extremely lucky)
<banisterfiend>
i spent 5 years as a web dev, and it was a ground-hog day style nightmare
<banisterfiend>
create model -> create controller -> endpoint, endpoint -> maybe a little bit of auth, now some boring ass javascript in whateever is the flavor of the day framework; and if i'm ReALLY lucky i can do some CSS
<banisterfiend>
it's a spirit crushing nightmareee
<banisterfiend>
better alternatives to being a web monkey: devops, data science, system devleopment, mobile development
blackmesa1 has quit [Quit: WeeChat 3.1]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Qchmqs>
I was thinking of going devops too
<Qchmqs>
for exactly this reason, being a web monkey is all about dem controllers logic, some models thinking, and then boring ass tiring and clunky JSX or wandering accross tempates and doing html with a twist in vue
<Qchmqs>
I've done some mobile, it's even lamer, and reminds me of my early days as a Qt/C++ dev
<Qchmqs>
data science isn't for me, it's more math than IT
<Qchmqs>
sys dev ? idk much about that, but C always scared me
<banisterfiend>
devops is great, you get to mess with some cutting edge tech too; BPF, namespaces, cgroups, etc
Qchmqs_ has joined #ruby
JanHebler[m] has quit [Quit: Idle for 30+ days]
Qchmqs_ has quit [Client Quit]
crankharder has joined #ruby
Qchmqs_ has joined #ruby
<banisterfiend>
Qchmqs if you did C++, not sure why C would scare you :) C++ is 100x scarier than C :D
<Qchmqs_>
what to do when I get disconnected and my name is suddenly still in use ?
<Qchmqs_>
banisterfiend, not to me xD
<Qchmqs_>
I worked as a C++ dev for a while, I still found C scary
Qchmqs has quit [Ping timeout: 240 seconds]
Qchmqs_ is now known as Qchmqs
<banisterfiend>
not sure ehwo you can think that, c++ is just C with more features, it's essentially a super set
<Qchmqs>
C feels like my abandoned childhood all over again
<banisterfiend>
C is extremely simple
<Qchmqs>
you gotta handle everything
<banisterfiend>
ya it's cumbersome sometimes
<banisterfiend>
but if you can just stick everything on the stack as much as possible yoou dont have to woorry about managing memory
<Qchmqs>
I prefer ruby and crystal nowadays
<Qchmqs>
and even swap js for coffee when I can
<Qchmqs>
> but if you can just stick everything on the stack as much as possible yoou dont have to woorry about managing memory
cd has joined #ruby
<Qchmqs>
aka if you worry the whole time about worrying, you won't have to worry
<banisterfiend>
not surre what you meean, that's the emodern approach even in c++
<jla>
banisterfiend ... i don't care about hot, or 'coolness' ... in a programming language :-) , really
crankharder has quit [Ping timeout: 260 seconds]
<banisterfiend>
jla i figured u'd care about employabiliity :)
<Qchmqs>
banisterfiend, I mean it's not really much of a help, it's still worrying about memory, that I'd rather not do nowadays
<banisterfiend>
Qchmqs no, if someone is on the stack it gets cleared up automatically, u dont have to expllicitlly free it
<Qchmqs>
jla, if you care about employability, it's all TypseScript and NodeJs out there
<banisterfiend>
something*
<Qchmqs>
banisterfiend, wow, the Cpp world isn't painful anymore ?
<jla>
devops ...yeah, i rings me a bell, banisterfiend , data science too ... One day ?
<banisterfiend>
modern c++ is amazing actually
<banisterfiend>
Qchmqs auto filteredPeople = peopleVector
<Qchmqs>
so the rust rewrite of firefox was unneccessary after all N
<jla>
or, trying to associate with some (more successful) colleagues... or dream about a coop ?
<banisterfiend>
welll, i'd say the c++ in firefox was written in ancient and leaky c++98
<Qchmqs>
the cpp I know
<banisterfiend>
if they rewrote it in c++20 it would be much better
<banisterfiend>
but rust is just as good i guess
<Qchmqs>
rust gives me cozy feels
<Qchmqs>
nothing scary
<banisterfiend>
c++ has some advantages over rust though, compile-time programming in Rust isn't even close to C++
<banisterfiend>
c++ also has variadic templates, which rust doesn't have
<banisterfiend>
'concepts' are also very cool
<Qchmqs>
rust doesn't do macros with a preprocessor
<Qchmqs>
I always thought of templates as a confusing ass thing, it took me a while to wrap my head around them
<banisterfiend>
macros are mainly a C thing, keept in c++ for compat reasons
<Qchmqs>
man I'm glad I switched to dynamic languages, ruby and php and js for years now
<banisterfiend>
tho they can be handy sometimes
<Qchmqs>
won't touch anything else
shtirlic has quit [Remote host closed the connection]
<banisterfiend>
i feel exacttly the oppositee
<banisterfiend>
i transitioned from ruby -> c++ and c++ is infinitely more fun
<banisterfiend>
the variety of things i work on now is sky high
<banisterfiend>
from very high level UI things in QT
rafadc has quit [Ping timeout: 240 seconds]
<banisterfiend>
to extreemely low level kernel extension and driver code
<Qchmqs>
I migrated exactly from the opposite lol
<Qchmqs>
from Qt4 when I stopped doing apps and went web into php, then discovered rails
<banisterfiend>
what qtt apps were you working on tho?
<banisterfiend>
what was the product
<Qchmqs>
stock management
<Qchmqs>
and similar stuff
<banisterfiend>
there u go :)
<Qchmqs>
what are you working on ?
<banisterfiend>
the domain i'm working on is system-level networrking, and it's a veery competitive industry, so the more creative and wacky and low-level we go, the more powerful we make our product
<banisterfiend>
VPN
<banisterfiend>
s
va5c0 has joined #ruby
<Qchmqs>
interesting, explains why you're not bored with it
<Qchmqs>
my work in Cpp was mostly lame ass products that are sold as solutions to traders and so on
<banisterfiend>
tjhere's always crazy-ass problems to solve
<Qchmqs>
it might help clear things up when you know I'm from north africa
<Qchmqs>
the economy here is a factor
<Qchmqs>
no one's is building a complex product
<banisterfiend>
recently we had to figure out how to implement split tunneling on macos after they took away kernel extensions
rafadc has joined #ruby
<banisterfiend>
our previouos approach was to just write a kernel extension to control routing behaviour for specific app traffic, but that no longer works on big sur
<Qchmqs>
and I'm here writting php
<banisterfiend>
so we had to figure out a completely different approach :) We're currently the only VPN that offerers split tunneling on big sur, no one else could figure it out
<Qchmqs>
and worrying about my gf waiting the train delay to come back home
<Qchmqs>
with her luggage
<banisterfiend>
you'er in europe?
<Qchmqs>
nope, north africa
<Qchmqs>
algeria
<banisterfiend>
you're from there originallly? or mved there?
<Qchmqs>
I'm from here originally yes
<Qchmqs>
local berber fella
<banisterfiend>
haha
<banisterfiend>
i was in tangier morocco a few years back
<banisterfiend>
had an incrrediblle time, wish i'd visited algeeria too
<Qchmqs>
I'll invite you for a beer if you ever visited
<Qchmqs>
yes we have bars in the berber regions :')
<banisterfiend>
is algiers similar to morocco?
<banisterfiend>
i visited berber hill tribes while i was in morocco
<Qchmqs>
never been to morroco
<Qchmqs>
so I don't know
<banisterfiend>
they were in the middle of some kind of festival where a guy dressed up like a goat and chased the children over the roof tops
<banisterfiend>
he beat them with a stick when he caught them
<Qchmqs>
we don't have that
<Qchmqs>
what we have are two main cultures, the norther and the southern
<Qchmqs>
the northern is liberal to an extent, the southern is conservative
<Qchmqs>
I moved out from the south to here, because down south, you can't even get alcohol legally
<Qchmqs>
it's "haram"
<Qchmqs>
so if you visit, don't wander far from the capital
<banisterfiend>
can u easily visit spain?
<banisterfiend>
it was a couple hour boat ride from malaga to morocco
<Qchmqs>
if I wanted to, but I'm not interested in visiting any place, I have a lot to handle this year
<Qchmqs>
the aftermath of 2020
<banisterfiend>
i'm thee opposite
<banisterfiend>
so stuck in this stupid country i wanna travel again asap
<Qchmqs>
didn't you have a 2020 ?
<banisterfiend>
2020 was a good year for thte VPN industry
<banisterfiend>
everyone at home online
<Qchmqs>
I had to dismantle my team and go on loner again
<banisterfiend>
yea that sucks
<banisterfiend>
most industries had a rough year, but a few did betterr
<banisterfiend>
i got lucky that's all
<Qchmqs>
well, good for you folks
<banisterfiend>
my gf lost her job
<banisterfiend>
so it's not all sunshine in my house
<Qchmqs>
we postponed marriage a year :v
<Qchmqs>
talking of that, I have to get dinner ready now
<banisterfiend>
dinner?
<banisterfiend>
waht's the time there?
<banisterfiend>
10:30am right?
va5c0 has quit [Ping timeout: 240 seconds]
StayinPaid has quit [Ping timeout: 240 seconds]
akem has quit [Ping timeout: 240 seconds]
akem has joined #ruby
Rudd0 has joined #ruby
Tziltzal has quit [Ping timeout: 268 seconds]
infinityfye has joined #ruby
HeavenDestroyer has joined #ruby
john___ has joined #ruby
infinityfye_ has joined #ruby
infinityfye__ has joined #ruby
infinityfye has quit [Ping timeout: 240 seconds]
infinityfye has joined #ruby
infinityfye_ has quit [Ping timeout: 240 seconds]
infinityfye__ has quit [Ping timeout: 240 seconds]
HeavenDe1troyer has joined #ruby
<HeavenDe1troyer>
HeavenDe1troyer: hi
HeavenDe1troyer has quit [Client Quit]
HeavenDestroyer has quit [Quit: leaving]
HeavenDestroyer has joined #ruby
va5c0 has joined #ruby
HeavenDestroyer has quit [Quit: leaving]
HeavenDestroyer has joined #ruby
andremedeiros has joined #ruby
HeavenDestroyer has quit [Client Quit]
ur5us_ has joined #ruby
va5c0 has quit [Quit: WeeChat 3.1]
HeavenDestroyer has joined #ruby
crankharder has joined #ruby
m27frogy has joined #ruby
vondruch has quit [Ping timeout: 260 seconds]
crankharder has quit [Ping timeout: 240 seconds]
baojg has quit [Remote host closed the connection]
jla has quit [Ping timeout: 260 seconds]
ejjfunky has joined #ruby
ur5us_ has quit [Ping timeout: 258 seconds]
StarOnD has joined #ruby
jla has joined #ruby
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
TCZ has joined #ruby
xf3rno has joined #ruby
StarOnD has quit [Quit: Connection closed]
maroloccio has joined #ruby
crankharder has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
alexherbo2 has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
xf3rno has quit [Ping timeout: 260 seconds]
jetchisel has quit [Ping timeout: 260 seconds]
vondruch has joined #ruby
jetchisel has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 260 seconds]
john___ has quit [Quit: Connection closed for inactivity]
jla has quit [Ping timeout: 260 seconds]
Technodrome has joined #ruby
maroloccio has quit [Quit: WeeChat 2.3]
Emmanuel_Chanel has quit [Ping timeout: 265 seconds]
ejjfunky has quit [Quit: Leaving]
crankharder has joined #ruby
deviantfero has quit [Quit: WeeChat 3.1]
<splud>
I want to run an .each against an array to invoke a function, and assign the result of the function to a variable. basically: tweaker=(-5..5).to_a.each {|x| f(x)}
<splud>
the ellipse expansion is what gets assigned. How can I get the results from f(x) ?
<clemens3_>
v << f(x) inside the each loop
clemens3_ has quit [Quit: WeeChat 2.7]
clemens3 has joined #ruby
<splud>
oh, duhr.
Rudd0 has quit [Ping timeout: 260 seconds]
infinityfye has quit [Quit: Leaving]
croberts has joined #ruby
Emmanuel_Chanel has joined #ruby
<splud>
thanks for that. btw.
<splud>
got busy trying to get gnuplot to work with the data.
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
splud: foo = (-5..5).map { |x| f(x) }
<splud>
ah, clemens3 's suggestion worked, but yea, map is what i was originally after.
<splud>
ATM, my chief issue is with gnuplot. Trying to sort how I can just pass it the x and y values for a plot.
<splud>
because I can't just give it the function (which is in ruby, not gnuplot)
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #ruby
shtirlic has joined #ruby
TCZ has quit [Quit: Dowidzenia]
jetchisel has quit [Ping timeout: 260 seconds]
ChmEarl has joined #ruby
TCZ has joined #ruby
konsolebox has joined #ruby
jetchisel has joined #ruby
HannaM has joined #ruby
TCZ has quit [Quit: Dowidzenia]
jla has joined #ruby
explorier has joined #ruby
cthulchu has joined #ruby
explorier has quit [Ping timeout: 265 seconds]
explorier has joined #ruby
explorier has quit [Ping timeout: 265 seconds]
SeepingN has joined #ruby
MalkbabY has quit [Remote host closed the connection]
MalkbabY_ has joined #ruby
desnudopenguino has joined #ruby
TCZ has joined #ruby
TorpedoSkyline has joined #ruby
explorier has joined #ruby
Rudd0 has joined #ruby
HannaM has quit [Read error: Connection reset by peer]
Qchmqs has quit [Quit: leaving]
jla has quit [Ping timeout: 240 seconds]
ua has quit [Ping timeout: 240 seconds]
VeryBewitching has joined #ruby
Technodrome has joined #ruby
ua has joined #ruby
howdoi has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
TCZ has quit [Quit: Dowidzenia]
crankharder has quit [Ping timeout: 252 seconds]
HannaM has joined #ruby
roshanavand__ has joined #ruby
gix has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schne1der has joined #ruby
Xiti` has joined #ruby
cthulchu_ has joined #ruby
gearnode has quit [Ping timeout: 260 seconds]
cthulchu has quit [Ping timeout: 240 seconds]
Xiti has quit [Ping timeout: 240 seconds]
gearnode has joined #ruby
robotbee has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
cuerbot has quit [Read error: Connection reset by peer]
dinfuehr has joined #ruby
elcuervo has joined #ruby
mnathani has quit [Remote host closed the connection]
mnathani has joined #ruby
crankharder has joined #ruby
gearnode has quit [Ping timeout: 260 seconds]
Technodrome has joined #ruby
towo_ has quit [Quit: I am the vanguard of your destruction. This exchange is over.]
towo has joined #ruby
neshpion has joined #ruby
neshpion has quit [Quit: neshpion]
explorier has quit [Ping timeout: 240 seconds]
maroloccio has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jla has joined #ruby
gix has quit [Quit: Client exiting]
SeepingN has joined #ruby
gix has joined #ruby
thinkpad has quit [Ping timeout: 260 seconds]
maroloccio has quit [Quit: WeeChat 2.3]
thinkpad has joined #ruby
lockweel has joined #ruby
konsolebox has quit [Remote host closed the connection]
hiroaki has joined #ruby
konsolebox has joined #ruby
explorier has joined #ruby
vondruch has quit [Read error: Connection reset by peer]
<Vaevictus>
my ruby's a bit rusty... i've got an array of strings and objects that have matching strings as attributes... how can i create an array of the objects that contains the matching objects?
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Vaevictus>
slightly misworded... i've two arrays, one of strings, one of objects (with the attributes to match against)
crankharder has quit [Ping timeout: 246 seconds]
<Vaevictus>
hmm... (it's from ldap, the users are objects, the attributes are "canonical names" aka cn) ... i suppose i could Users.select{ |u| theotherlist.include?(u[:cn])}
<havenwood>
Vaevictus: Yeah, that's the typical way, #select those than #include?.
<Vaevictus>
thanks... my ruby book is at home and it's been a long while :D nice to derust though :D
<havenwood>
Vaevictus: In Rails, there's also #in? as an alternative to #includes? if you prefer.
<Vaevictus>
i learned rails and ruby together ages ago, this project is just ruby :D
<leftylink>
&>> begin raise; :not_rescued; rescue; false.each end
<rubydoc>
# => -e:4:in `rescue in <main>': undefined method `each' for false:FalseClass (NoMethodError)... check link for more (https://carc.in/#/r/asd6)