havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.0, 2.7.2, 2.6.6: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.org | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | BLM <3
TCZ has joined #ruby
Rounin has quit [Ping timeout: 265 seconds]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
s3nd1v0g1us has quit [Quit: WeeChat 2.8]
akem_ has joined #ruby
akem has quit [Ping timeout: 264 seconds]
va5c0 has joined #ruby
va5c0 has quit [Quit: WeeChat 3.0]
Technodrome has joined #ruby
TCZ has quit [Remote host closed the connection]
va5c0 has joined #ruby
va5c0 has quit [Client Quit]
va5c0 has joined #ruby
va5c0 has quit [Client Quit]
va5c0 has joined #ruby
va5c0 has quit [Client Quit]
s3nd1v0g1us has joined #ruby
ur5us has joined #ruby
Rudd0 has quit [Remote host closed the connection]
gix has quit [Ping timeout: 246 seconds]
dviola has quit [Quit: WeeChat 3.0]
dviola has joined #ruby
ur5us_ has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
orbyt_ has joined #ruby
baojg has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 264 seconds]
danielk43[m] has joined #ruby
elcontrastador has quit [Ping timeout: 246 seconds]
yokel has quit [Remote host closed the connection]
teardown has quit [Ping timeout: 268 seconds]
teardown has joined #ruby
yokel has joined #ruby
chouhoulis has quit [Remote host closed the connection]
elcuervo has joined #ruby
cuerbot has quit [Ping timeout: 264 seconds]
ChmEarl has quit [Quit: Leaving]
Rudd0 has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
tpanarch1st has joined #ruby
tpanarch1st has quit [Remote host closed the connection]
ur5us_ has quit [Ping timeout: 264 seconds]
s3nd1v0g1us has quit [Quit: WeeChat 2.8]
m27frogy has quit [Ping timeout: 272 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jla has joined #ruby
akem_ has quit [Ping timeout: 256 seconds]
fercell has joined #ruby
dviola has quit [Quit: WeeChat 3.0]
dfucci has joined #ruby
Taserface has left #ruby [#ruby]
teardown has quit [Ping timeout: 268 seconds]
teardown has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
cnsvc has quit [Remote host closed the connection]
cnsvc has joined #ruby
afisher has quit [Ping timeout: 260 seconds]
jnoon has quit [Ping timeout: 260 seconds]
chromis has quit [Ping timeout: 260 seconds]
jnoon has joined #ruby
afisher has joined #ruby
chromis has joined #ruby
jla has quit [Read error: Connection reset by peer]
venmx has quit [Ping timeout: 256 seconds]
fercell has quit [Ping timeout: 240 seconds]
fercell has joined #ruby
dfucci has joined #ruby
cd has quit [Quit: cd]
nofxx__ has joined #ruby
akem has joined #ruby
schaerli has joined #ruby
nofxx_ has quit [Ping timeout: 272 seconds]
venmx has joined #ruby
vondruch has joined #ruby
venmx has quit [Ping timeout: 256 seconds]
Rudd0 has quit [Ping timeout: 264 seconds]
teclator has joined #ruby
_whitelogger has joined #ruby
trautwein2 has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
venmx has joined #ruby
postmodern has quit [Quit: Leaving]
totoro2022 has quit [Read error: Connection reset by peer]
totoro2022 has joined #ruby
venmx has quit [Ping timeout: 260 seconds]
schne1der has joined #ruby
venmx has joined #ruby
jenrzzz has joined #ruby
t3hyoshi_ is now known as t3hyoshi
pwnd_sfw has quit [Ping timeout: 264 seconds]
klaas_ has joined #ruby
schaerli_ has joined #ruby
schaerli has quit [Ping timeout: 246 seconds]
pwnd_sfw has joined #ruby
klaas has quit [Ping timeout: 258 seconds]
shokohsc has quit [Ping timeout: 240 seconds]
schaerli__ has joined #ruby
schaerli_ has quit [Ping timeout: 240 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has quit [Read error: Connection reset by peer]
shokohsc has joined #ruby
Rudd0 has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
duderonomy has joined #ruby
jla has joined #ruby
bukkitgerman8608 has joined #ruby
duderonomy has quit [Client Quit]
jla has quit [Read error: Connection reset by peer]
trautwein2 has quit [Quit: WeeChat 3.0]
vondruch has joined #ruby
ua has quit [Remote host closed the connection]
stdedos has joined #ruby
duderonomy has joined #ruby
klaas_ has quit [Quit: ZNC 1.8.2 - https://znc.in]
ua has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
vondruch has quit [Quit: vondruch]
vondruch_ has joined #ruby
vincent_ has joined #ruby
klaas has joined #ruby
jla has joined #ruby
m27frogy has joined #ruby
vincent_ has quit [Remote host closed the connection]
vincent_ has joined #ruby
vincent_ has quit [Remote host closed the connection]
stdedos has quit [Quit: Connection closed]
jla has quit [Ping timeout: 264 seconds]
moldorcoder7 has quit [Ping timeout: 240 seconds]
moldorcoder7 has joined #ruby
silviu2 has quit [Remote host closed the connection]
vondruch_ has quit [Quit: vondruch_]
vondruch_ has joined #ruby
silviu has joined #ruby
jenrzzz has joined #ruby
towo has quit [Remote host closed the connection]
_aeris_ has quit [Remote host closed the connection]
towo has joined #ruby
orbyt_ has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
_aeris_ has joined #ruby
vondruch_ has quit [Quit: vondruch_]
linoge has joined #ruby
weaksauce has quit [Ping timeout: 272 seconds]
Tempesta has quit [Quit: See ya!]
Tempesta has joined #ruby
chouhoulis has joined #ruby
vondruch_ has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
Rounin has joined #ruby
<rapha> hi all
<rapha> i never did a GUI of any kind in ruby
<rapha> can a window quickly be thrown together where you have a text entry field in the top half where you can paste some YAML and in the bottom half you have the output of YAML.parse (i.e., any error messages)? or would that be a more involved procedure?
<rapha> (Linux only, no need for cross platform blah)
<rapha> (According to stackoverflow, "FXRuby" is supposed to be "good"?)
<rapha> Hmm but the website doesn't exist anymore ... that's what I was afraid of.
cow[moo] has joined #ruby
<adam12> rapha: Maybe Glimmer? https://github.com/AndyObtiva/glimmer
<rapha> last commit 3 days ago, that looks promising
<rapha> and they have a tetris example :-D
<rapha> but you have to apparently make a choice between various backends. hmm.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rapha> So what if I'm a Muslim or a Hindu?!?
jla has joined #ruby
<rapha> The world of software never ceases to amaze, socially.
chouhoulis has joined #ruby
akem has quit [Quit: leaving]
<rapha> adam12: okay, so, after a good half hour of trying to get various projects' "hello world" scripts to work, these are unfortunately out: FXRuby, glimmer-dsl-swt, glimmer-dsl-tk, glimmer-dsl-opal, qtbindings, gtk3. i think i'll simply do this in Python's Kivy and call Ruby's YAML.parse via os.system().
al2o3-cr has quit [Ping timeout: 256 seconds]
yokel has quit [Ping timeout: 240 seconds]
vondruch_ has quit [Quit: vondruch_]
vondruch_ has joined #ruby
akem has joined #ruby
akem has quit [Quit: leaving]
akem has joined #ruby
envex has quit []
al2o3-cr has joined #ruby
vondruch_ has quit [Quit: vondruch_]
vondruch_ has joined #ruby
jla has quit [Ping timeout: 256 seconds]
zapata_ has joined #ruby
zapata has quit [Ping timeout: 258 seconds]
venmx has quit [Ping timeout: 264 seconds]
venmx has joined #ruby
jenrzzz has joined #ruby
<adam12> rapha: O_O
<adam12> rapha: What about Shoes?
<rapha> (note I'm on Solus Linux and a lot of stuff, such as Fox TK isn't packaged there, while other stuff, such as Gtk3 is too new, which does complicate things)
jenrzzz has quit [Ping timeout: 265 seconds]
<rapha> shoes4 is out for jruby (again, not packaged) and shoes3 insists on being easy to use because you don't need either linux nor ruby and then if you do want to use with linux and ruby, it doesn't even tell you what to require, again requiring you to dive in (yes, https://github.com/shoes/shoes3/blob/master/lib/shoes.rb exists, but "require 'shoes'" only yields you a slap on your hand: "Sorry, this gem currently
<rapha> does nothing. Team Shoes is working on Gemifying Shoes, and this is just a placeholder until then." ... so shoes3 and shoes4 are also out.
<adam12> Heh
<adam12> Kivy looks nice.
<rapha> makes one almost want to create one's own GUI TK for Ruby and call it yarguitkwdwootb
<rapha> Kivy _is_ nice, yeah. Sad that Ruby doesn't have something like it.
<adam12> I can't tell what it uses for GUI support per platform. Any idea?
<rapha> Since we were talking about why ... there also used to be https://github.com/whymirror/unholy :-P
<rapha> Hmm good question, no clue!
<rapha> SDL, it seems.
<apotheon> I've noticed people talking about Why twice in the last year, I think, but before that I hadn't heard about him for years.
<apotheon> His "disappearance" after efforts to "unmask" him was a bit sad.
<rapha> what do you mean by efforts to unmask him?
<adam12> apotheon: The publishing of his book for BrightonRuby was nice. I actually read the entirety of it when I received it.
* rapha learned about him quite early after starting with Ruby on Rails around the 1.0 mark
<apotheon> rapha: He was pseudonymous as Why, and really didn't advertise his legal identity. Some people underook the minor detective work to find out more about him, and he just decided to fade out after that, I think.
<apotheon> I'm not entirely clear on the details of it, though. I know he had shown up at a couple of conferences, so I'm not sure how strong a pseudonymous screen he could've kept up anyway.
<apotheon> I'm not even entirely sure the two things were related -- the "unmasking" and his dropping out.
<apotheon> He made some comments at the time about dissatisfaction with some aspects of a life in programming, I think, too.
<rapha> hmm okay fair enough on his part to retreat if he didn't want to be known
<rapha> sad in a way because he did loads of cool stuff, but still his own business in the end
<rapha> and the latter thing i can relate to quite well
* rapha is still overcome by the yearly urge of becoming an off-coast windfarm maintenance technician
<rapha> s/-coast/shore/
<apotheon> Yeah, I don't blame him for dropping out of things like that. I miss his presence in the Ruby world, though.
vondruch_ has quit [Ping timeout: 256 seconds]
<apotheon> Come to think of it, I guess it was shortly after he dropped out that I started feeling less connected to the community myself, and unconsciously, gradually scaled back my involvement.
<rapha> also with something as the aforelinked "unholy", curious why noone picked up where he left off
<rapha> you must have somehow emphasized with his assummed? supposed? sentiments...
schaerli__ has quit [Ping timeout: 264 seconds]
<nakilon> to rewrite the current line if you didn't yet print "\n", it print the "\r", right?
<apotheon> s/emphasized/empathized/ ?
<rapha> judging from the work that he put out before leaving, he was a pretty strongly-charactered person
<nakilon> but is it possible to rewrite two last lines?
<rapha> oh, epathized, thanks
<rapha> so something that would lead him to retreat completely only lead you to retreat partially, even if, perhaps, it were similar feelings
<apotheon> Maybe a little.
<rapha> nakilon: that might require getting into something like curses
<apotheon> I still love the Ruby language, but I don't feel connected to the community the same way I did.
<rapha> sounds a little like regret?
<nakilon> rapha (
<apotheon> Another part of it might just be the fact that email became more and more of a chore; back then, ruby-talk had been sort of the focal point for my involvement, in some ways.
pwnd_sfw6 has joined #ruby
<nakilon> ruby community is mostly toxic and has nothing to love it for
<rapha> hey, communication as a whole developed in a way since then that has i think overwhelmed _many_ people who used to feel completely at home online
<rapha> let me just say ... Discord
<nakilon> I mean, under the "ruby community" we can mean pretty much different sets of people
<rapha> hmm
<rapha> okay, i know of nothing bad here in #ruby, for example
<apotheon> I just can't do the Slack/Discord thing so much. It requires such complete, focused immersion to even keep up that I feel like I always have something better to do than deal with it.
<rapha> in fact, it's probably _the_ least toxic channel i frequent
<apotheon> IRC is still pretty laid back by comparison, and yeah, this channel is nice.
pwnd_sfw has quit [Ping timeout: 240 seconds]
pwnd_sfw6 is now known as pwnd_sfw
<rapha> #reprap perhaps is similar, but if you look at places like ##electronics where basically you can't even begin to belong if you don't participate in the shit-talk
<nakilon> channels you hate don't deserve you to discuss them
<apotheon> I mostly just stay away from toxic channels altogether, and the niceness of this channel despite its reasonably large user list is pretty impressive.
<rapha> and i think my general analytical thinking has benefited more from Ruby and the Ruby community (i.e. this channel) than from any teacher i ever had in any school, ever
<nakilon> the best impression about Ruby was in around 2010 from folks who were responding on SO
<rapha> nakilon: i wouldn't say i hate, to stay with the example, ##electronics. not at all actually. but i'm acutely aware that if a female person were to try and hang out there, she would _very_ quickly leave in disgust. and that _is_ an alarming and very uneasy feeling.
<nakilon> they aren't there now, the place became ****
<apotheon> rapha: Yeah, that seems like a bad state of affairs.
<apotheon> Well . . . it's time for me to go. Ta.
<nakilon> the tin man, chuck, phrogz, sepp2k, and that guy with long name who makes Windows Installer -- these were the most useful people in SO at that time
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 240 seconds]
<rapha> see you around apotheon o/
ChmEarl has joined #ruby
<rapha> adam12: you still around? if you're interested, here's the finished thing: https://gist.github.com/sixtyfive/ab24550182dfac24ed293a9ee290685f
akem has quit [Quit: leaving]
dfucci has quit [Ping timeout: 264 seconds]
schaerli has joined #ruby
akem has joined #ruby
pgib has joined #ruby
ua_ has joined #ruby
ua has quit [Ping timeout: 256 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schaerli has quit [Ping timeout: 246 seconds]
dfucci has joined #ruby
surrounder has quit [Quit: host migration]
<adam12> rapha: nice.
dfucci has quit [Ping timeout: 265 seconds]
schne1der has quit [Ping timeout: 265 seconds]
surrounder has joined #ruby
croberts has joined #ruby
phI||Ip_Alternat has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
Torrone has joined #ruby
Aguiar has joined #ruby
<Torrone> Hello, this is a highly simplified version of my code: https://gist.github.com/salami-art/7224b00fcf9532a7eceec5c535406291 . I have my query object ( in the last function defined as variable 'q') that seems to be mutating despite all my efforts. I cannot figure out why this is happening but maybe I'm just being stupid and you can guess what's wrong
jenrzzz has quit [Ping timeout: 240 seconds]
<Torrone> Basically, every time I inspect the query provided as an argument within the combine_query object, I get the query plus the "piece" I added before
<Torrone> * combine_query function
jla has joined #ruby
pavelz has joined #ruby
<pavelz> hola
<pavelz> how do i convert ":id" to :id without doing str.sub(":","").to_sym ?
<pavelz> concern here is leaking memory
dinfuehr has quit [Ping timeout: 264 seconds]
dinfuehr has joined #ruby
mohsen_in has joined #ruby
<havenwood> pavelz: Is it safe to mutate the string?
<havenwood> pavelz: str.slice!(1..)
mohsen_in has quit [Client Quit]
mohsen_in has joined #ruby
mohsen_in has quit [Client Quit]
<havenwood> pavelz: Otherwise, yeah, it could put some pressure on the GC.
<havenwood> pavelz: The intermediary Strings would get collected.
<havenwood> pavelz: I don't see memory leaking.
<havenwood> pavelz: Pressure on GC, yes.
<Torrone> It was this little caveat about copying hashes with .dup or .clone : https://stackoverflow.com/questions/4157399/how-do-i-copy-a-hash-in-ruby
<Torrone> solution: deep_dup
<Aguiar> Good afternoon people,
<Aguiar> Please, I would like a help, I have read some articles and I was unable to implement. I am looking to make a system call as follows.
<Aguiar> 1) In the file I created a variable that receives Process.pid. As far as I read I get the current process number, that is, when I run the program I get the value of this process.
<Aguiar> 2) Still in the file, below, I created another variable that receives a Fork (), which creates a child process. Looking at the "ps aux" I see both processes.
<Aguiar> 3) I created a method called "print (" number_process "," name_process ") that prints the following message:" I am printing from process # {number_process} - # {name_process}
<Aguiar> My need is when running this program, check that process is running at that moment, and print the process number on the message and if it's the parent or child.
<Aguiar> They already mention using Open3 or Open4, but as I am learning, I am not getting more detailed material to help me finish my college assignment.
<Aguiar> As I don't speak English I used the translate and anticipated the possible errors.
dinfuehr has quit [Ping timeout: 260 seconds]
dinfuehr has joined #ruby
<Aguiar> havenwood already gave me some more tips I couldn't implement =(
dfucci has joined #ruby
surrounder has quit [Quit: brb]
surrounder has joined #ruby
<phaul> Aguiar: is the assignment in English?
teardown has quit [Remote host closed the connection]
teardown has joined #ruby
<Aguiar> phaul it's not in portuguese, i'm brazilian. I also know that it is essential to know English in this area, but unfortunately I am starting now so I have to appeal to the translators.
<havenwood> Aguiar: Can you share the assignment in Portuguese?
<Aguiar> :]
Aguiar has quit [Quit: Ping timeout (120 seconds)]
Aguiar has joined #ruby
mohsen_in has joined #ruby
<havenwood> Aguiar: What you said today helps clarify what you're doing, but it doesn't mention how the message is to be passed (if it matters?).
<phaul> Aguiar: try online paste service if you post the assignment like https://dpaste.org
weaksauce has joined #ruby
missionary has joined #ruby
<phaul> also could you run it through english translate and post that as well. My Portuguese is lacking
<missionary> howdy im trying to scrape reddit with nokogiri but i see they've mangled their ids and classes to make that difficult for me - is there a way around it?
mohsen_in has quit [Read error: Connection reset by peer]
<Aguiar> havenwood the message matters! What I understood is that the message must be printed on the screen while the program is running. In order not to be in an infinite loop, it is put inside a while.
mohsen_in has joined #ruby
<Aguiar> phaul without problems, we are going on as we can, in any case I am very grateful for the strength. :] (y)
<havenwood> Aguiar: That looks like something you could do with `require 'io/console'` and `$stdin.getch` but it doesn't say how the processes are communicating.
<havenwood> Aguiar: There are different ways to do IPC (inter-process communication).
jenrzzz has joined #ruby
vondruch_ has joined #ruby
Torrone has quit [Quit: Leaving]
htmnc has joined #ruby
<htmnc> I'm going to search for it on freenode's web portal but anyone know if there's a rails channel on this network?
<havenwood> htmnc: #RubyOnRails but feel free to ask here.
<htmnc> thank you!
<havenwood> Aguiar: For example, you could use a named pipe here, or a UNIX socket, etc.
<havenwood> Aguiar: Can you give any more details about the assignment, or is it up to you?
mohsen_in has quit [Quit: Powered by WinIRC]
Rush has quit [Remote host closed the connection]
mohsen_in has joined #ruby
<Aguiar> please, a moment I answer
JoL1hAHN has quit [Ping timeout: 244 seconds]
mnemon has quit [Ping timeout: 244 seconds]
Rush has joined #ruby
bthompson90 has quit [Ping timeout: 244 seconds]
jo-so has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
mnemon has joined #ruby
<Aguiar> havenwood for you too :]
<havenwood> Aguiar: I don't like the idea of relying on a *lower* value PID to presume it's a child.
<Aguiar> havenwood phaul as the code is, it was how i idealized it, but of course it is not wrong from what i read.
<havenwood> Aguiar: It's typical for PIDs to loop back to minimum after hitting maximum, so a newer process may be lower PID.
<Aguiar> havenwood phaul an important piece of information that I forgot to mention, the activity is to simulate competition.
jo-so has joined #ruby
bthompson90 has joined #ruby
<pavelz> havenwood: thanks!
JoL1hAHN has joined #ruby
<Aguiar> havenwood It's true, but as the child process is created right after the program is executed, that is, the father, I didn't see much importance here in worrying about the PID, because essentially every time I run the program, it will have a new PID either in a low or high number. I may even be wrong with that thought.
<havenwood> Aguiar: They go up until a limit then start back at the bottom, at least that's typical, so a new PID *might* be lower, though it only happens once in a blue moon.
<Aguiar> havenwood if you run this program you will see that the parent and child PIDs are sequential, for example, parent PID 4000, child PID 4001.
<havenwood> Aguiar: Are you on Linux?
<havenwood> Aguiar: See: man 5 proc
<phaul> Aguiar: on OpenBSD for instance pids are random
<phaul> on linux Im sure you can do a setting to make them random
<havenwood> Aguiar: "the value at which PIDs wrap around"
<havenwood> Aguiar: And like phaul says, macOS and BSDs randomize it.
<havenwood> Aguiar: But even on Linux they don't just increment forever.
<havenwood> Aguiar: They wrap, so you can't rely on a new PID as higher.
gix has joined #ruby
<havenwood> Aguiar: quando o numero chega no valor maximo, o proximo PID volta para o valor mais baixo
<havenwood> e isso e apenas para o linux, para macOS e aleatoriamente
<Aguiar> havenwood I am using linux. I am aware of how PID's work, they are random. What I meant is that the PID number does not matter in this task, after all, the PID's involved in this process are "created" immediately when the program is executed, therefore, every time I ran the program the numbers of the PID's are neighbors , never far from each other.
<Aguiar> And as it is a task that only aims to show the teacher how the process competition for the processor works, it is not to worry too much about the PID details you mentioned. What I want to show the teacher is that when executing the program, I created a child process from it, and then print out a message, passing the number of the father and son
<Aguiar> process. Only that!!
<Aguiar> :]
vondruch_ has quit [Quit: vondruch_]
vondruch_ has joined #ruby
vondruch_ has quit [Client Quit]
vondruch_ has joined #ruby
<Aguiar> I really wanted to be able to speak, understanding would be better, but ... =(
Aguiar has quit [Ping timeout: 248 seconds]
thelounge5815 has joined #ruby
thelounge5815 has quit [Client Quit]
mohsen_in has quit [Read error: Connection reset by peer]
teardown has quit [Remote host closed the connection]
teardown has joined #ruby
jenrzzz has joined #ruby
Aguiar has joined #ruby
chouhoulis has quit [Remote host closed the connection]
mohsen_in has joined #ruby
mohsen_in has left #ruby [#ruby]
<Aguiar> havenwood I hope you weren't upset
ritsch_master has joined #ruby
mohsen_in_ has joined #ruby
carbone5 has joined #ruby
vondruch_ has quit [Read error: Connection reset by peer]
mohsen_in_ has quit [Read error: Connection reset by peer]
Mrgoose has quit [Ping timeout: 240 seconds]
<JanHebler[m]> <phaul "Aguiar: on OpenBSD for instance "> No, on Linux you can't. The last implementation of random pid's for linux was in the grsecurity-patches, but they abadone it 2006.
ua has joined #ruby
<JanHebler[m]> <phaul "on linux Im sure you can do a se"> No, on Linux you can't. The last implementation of random pid's for linux was in the grsecurity-patches, but they abadone it 2006.
ua_ has quit [Ping timeout: 264 seconds]
fieldtensor has joined #ruby
Mrgoose has joined #ruby
cd has joined #ruby
howdoi has joined #ruby
<phaul> JanHebler[m]: mea culpa, I made assumtions thinking it must be there without checking / knowing :) good to know. Doesn't take away from the point we were making though
<Aguiar> JanHebler[m] right, what would be the way to create a process, and from it create a child process. Then go out by printing a message which process is running, whether the parent or the child. This activity is a way to show or simulate competition on the processor.
<JanHebler[m]> <phaul "Jan Hebler: mea culpa, I made as"> To be honest, i also have to google it, and i'm administering Linux since 1996 🤣
<havenwood> Aguiar: No, not upset. I'm just multitasking. :)
<phaul> Aguiar: the right way to decide whether you are in the child or the parent process is checking whether fork returned nil
jla has quit [Ping timeout: 260 seconds]
<phaul> See:
<phaul> &ri Kernel#fork
<phaul> " the fork call returns twice, once in the parent, returning the process ID of the child, and once in the child, returning nil. "
<fieldtensor> Also, if you're doing a lot of fork()'ing, be aware of wait() and child process cleanup. Zombies can be gross and clog up `ps` output, to name just one issue.
<Aguiar> phaul I did this, and he returned NIL when he passed through the while, consequently, he left the program, I gave up this line of thought because he thought he was wrong.
fieldtensor has quit [Quit: leaving]
<JanHebler[m]> Aguiar: fork and friends is something you have to play with for a while. I for myself need some time to realize that after you call fork your progamm ...well.... forks :-) and are basically now 2 progams.
neshpion has joined #ruby
<Aguiar> JanHebler[m] precisely, there are only two programs, what I am unable to do is "call" these programs and print a message on the screen informing when the parent or child process is being executed, simulating a competition. ;(
venmx_ has joined #ruby
klaas_ has joined #ruby
meinside_ has joined #ruby
Iambchop_ has joined #ruby
rubydoc_ has joined #ruby
zapata has joined #ruby
kermit_ has joined #ruby
hahuang65_ has joined #ruby
Atro_ has joined #ruby
iamgr00t_ has joined #ruby
jinie_ has joined #ruby
<Aguiar> JanHebler[m] did you see what i sent by dpaste?
Some-body_ has joined #ruby
<JanHebler[m]> Aguiar: Sorry, i think i dont have seen the whole discusssion. If i ge you right, you want to have 2 (or maybe more) programs, one master and n childs. And the master should be able to communicate with the childs somehow, at least to tell them to finish. right?
<JanHebler[m]> I will scroll back....
al2o3-cr has quit [Ping timeout: 256 seconds]
mnem has joined #ruby
_phaul has joined #ruby
Fire-Dragon-DoL- has joined #ruby
<JanHebler[m]> Sorry, didn't find it
hahuang65_ has quit [Max SendQ exceeded]
hahuang65_ has joined #ruby
nemesit|znc_ has joined #ruby
znz_jp0 has joined #ruby
mnemon has quit [*.net *.split]
venmx has quit [*.net *.split]
zapata_ has quit [*.net *.split]
klaas has quit [*.net *.split]
bukkitgerman8608 has quit [*.net *.split]
henk[m]1 has quit [*.net *.split]
meinside has quit [*.net *.split]
Atro has quit [*.net *.split]
Iambchop has quit [*.net *.split]
kermit has quit [*.net *.split]
jinie has quit [*.net *.split]
Fire-Dragon-DoL has quit [*.net *.split]
hahuang65 has quit [*.net *.split]
DarthGandalf has quit [*.net *.split]
turt2live has quit [*.net *.split]
phaul has quit [*.net *.split]
znz_jp has quit [*.net *.split]
rubydoc has quit [*.net *.split]
iamgr00t has quit [*.net *.split]
nemesit|znc has quit [*.net *.split]
Fire-Dragon-DoL- is now known as Fire-Dragon-DoL
kermit_ is now known as kermit
Iambchop_ is now known as Iambchop
Some-body_ is now known as DarthGandalf
meinside_ is now known as meinside
Atro_ is now known as Atro
<havenwood> JanHebler[m]: Those ^ are logs, fwiw.
bamdad has joined #ruby
<Aguiar> JanHebler[m] Not exactly finished!
<Aguiar> When the program is executed, I take the PID of the program (that is, the process) for the variable PID_, right after that I create another process, and give the name PID_FILHO, with that I have two processes. Right after, inside a WHILE, I want to keep asking which process is being executed, if it is the parent or child, and print a message
<Aguiar> stating which one it is until I finish the program.
<Aguiar> JanHebler[m] https://dpaste.org/6Opd
bamdad has quit [Remote host closed the connection]
bamdad has joined #ruby
henk[m]1 has joined #ruby
Mia has quit [Read error: Connection reset by peer]
Axy has joined #ruby
<JanHebler[m]> OK, i will take a look and let's see how far it goes if an german and an brasilian talking english 🤣
<Aguiar> JanHebler[m] I know that the construction of the code is wrong, especially when it comes to wanting to know what the process is and printing the message, but it was so that friends could have an idea of ​​what I want.
ur5us_ has joined #ruby
Mrgoose has quit [Ping timeout: 256 seconds]
carbone5 has quit [Quit: carbone5]
<Aguiar> JanHebler[m] I'm brasilian, I'm in Natal city of state Rio Grande do Norte
<Aguiar> :]
turt2live has joined #ruby
carbone5 has joined #ruby
al2o3-cr has joined #ruby
<JanHebler[m]> hopefully i get you right
<Aguiar> JanHebler[m] https://en.wikipedia.org/wiki/Natal,_Rio_Grande_do_Norte - for those who want more information about this wonderful place, modest part. It was here that there were 4 world cup games, including the USA played here.
<JanHebler[m]> Aguiar: i try to simplified it as much as possible.
<Aguiar> JanHebler[m] thank you, i will test here
<JanHebler[m]> <Aguiar "Jan Hebler https://en.wikipedia."> That place looks beautiful, i really like the sea. Too bad i live in Bernau, an Suburb of Berlin, the Capital of Germany. The Sea is more than 200km away and right now we have -9C
_phaul is now known as phaul
<phaul> &renick
rubydoc_ is now known as rubydoc
<rubydoc> okay
<JanHebler[m]> <Aguiar "Jan Hebler https://en.wikipedia."> https://www.natalriograndedonorte.com/natal-brazil-diving/ now i'm really jealous.....
Aguiar has quit [Quit: Connection closed]
Aguiar has joined #ruby
linoge has quit [Remote host closed the connection]
fercell has quit [Ping timeout: 256 seconds]
Technodrome has joined #ruby
ruurd has quit [Quit: bye folks]
<Aguiar> JanHebler[m] here it is doing 32º C, it is rarely here below 25º C. The link you sent is broken. 8)
<JanHebler[m]> https://dpaste.org/4JW7 this one?
dfucci has quit [Ping timeout: 272 seconds]
dfucci has joined #ruby
carbone5 has quit [Quit: carbone5]
ur5us_ has quit [Ping timeout: 264 seconds]
dfucci has quit [Ping timeout: 265 seconds]
carbone5 has joined #ruby
carbone5 has quit [Client Quit]
carbone5 has joined #ruby
evdubs has quit [Quit: Leaving]
ur5us_ has joined #ruby
shokohsc has quit [Ping timeout: 256 seconds]
evdubs has joined #ruby
shokohsc has joined #ruby
silviu has quit [Remote host closed the connection]
shokohsc has quit [Quit: Ping timeout (120 seconds)]
silviu has joined #ruby
Mrgoose has joined #ruby
shokohsc has joined #ruby
dfucci has joined #ruby
akem has quit [Quit: leaving]
GodFather_ has quit [Quit: Ex-Chat]
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
akem has joined #ruby
akem has quit [Client Quit]
GodFather has joined #ruby
<Aguiar> JanHebler[m] Like the code I posted, it always only prints the father process. According to my teacher, there should be a competition between the father and the child process, one hour I would print the message stating that the process would be from the father, another time I would show the message stating that it was the child.
dfucci has quit [Ping timeout: 258 seconds]
akem has joined #ruby
al2o3-cr-tmp has joined #ruby
akem has quit [Client Quit]
al2o3-cr has quit [Ping timeout: 256 seconds]
<JanHebler[m]> <Aguiar "Jan Hebler Like the code I poste"> Only the father? Not here: https://dpaste.org/EQQO
<JanHebler[m]> I'm Luke number XY is the Childprocess, the rest of the output is the parent process
al2o3-cr-tmp is now known as al2o3-cr
chouhoulis has joined #ruby
mnem has joined #ruby
mnem has quit [Changing host]
mnem has quit [Quit: leaving]
<JanHebler[m]> Aguiar: If you want to see some kind of "race" between fater an child, try this one: https://dpaste.org/G13W
Xiti has quit [Quit: Leaving]
ritsch_master has quit [Ping timeout: 264 seconds]
<Aguiar> JanHebler[m] I think I found something like that - https://tweetegy.com/2012/04/forking-ruby-processes-or-how-to-fork-ruby/
akem has joined #ruby
<Aguiar> JanHebler[m] I will need to go away
<JanHebler[m]> OK, no Prob :-)
Tempesta_ has joined #ruby
al2o3-cr-tmp has joined #ruby
Tempesta has quit [Ping timeout: 240 seconds]
al2o3-cr has quit [Ping timeout: 256 seconds]
schne1der has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
mic_e_ has quit [Quit: So it has come to this.]
cuerbot has quit [Read error: Connection reset by peer]
chouhoulis has quit [Ping timeout: 240 seconds]
Aguiar has quit [Ping timeout: 248 seconds]
elcuervo has joined #ruby
schne1der has quit [Ping timeout: 258 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
Technodrome has joined #ruby
carbone5 has quit [Quit: carbone5]
gray-_-wolf has joined #ruby
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Quit: WeeChat 2.8]
<deimos_> I have silly question: i want to find "1 or 2 months ago from now" and correctly account for year boundaries. t = Time.now; DateTime.civil(t.year, t.month -2) results in a date error, because obviously there is no 0 month.I started writing a some logic to handle the year and month like integers and then do the if/then check for if month = 0 : month = 12 ::, etc
dfucci has joined #ruby
ur5us_ has quit [Ping timeout: 264 seconds]
gray-_-wolf has quit [Quit: WeeChat 3.0]
<havenwood> deimos_: TZs are a such a pain you might even consider cherry picking ActiveSupport::TimeWithZone and just do a: 1.month.ago
<deimos_> i can assume t = Time.now.getgm
<deimos_> or whatever the correct way to force utc
<deimos_> Time.now.utc
Aguiar has joined #ruby
<havenwood> deimos_: DateTime.now.utc - 2_592_000
neshpion has quit [Quit: neshpion]
<havenwood> deimos_: You can do the maths if you prefer.
<havenwood> deimos_: I mean, you can do the maths for your own formula given only a day/month/year number, but given it seems to already be a DateTime or Time I'd just have the Ruby class look backwards.
<havenwood> deimos_: Maybe say more about why you're doing it the way you're doing it and someone might have a better idea.