« first day (3099 days earlier)      last day (1843 days later) » 

4:02 PM
Hmm, I don't even know what it would look like if you tried to make a PR on the contents of a wiki page... The markdown data isn't in source control, I don't think.
I don't think we have a formal workflow in place for suggesting improvements to wiki pages that you don't already have edit rights for
 
@Kevin Aha that makes sense then :)
 
Yup I'm way off base, I'll leave this up to those who know :)
 
@Kevin What if we just made Ctrl-v automatically trigger whatever code is fired by Ctrl-k?
 
It's annoying that Chat formatting isn't consistent with the main site. But at least we can have formatted code here. Physics, Maths, and other science stacks have MathJax, a dialect of LaTeX for formatting equations. But Stack Exchange refuses to implement it in the Chat rooms. So those rooms have to use userscripts or bookmarklets for LaTeX support, and instruct newbies in how to install them. And of course there's a learning curve to MathJax.
 
@toonarmycaptain Perhaps we could make a script that does that, but it would be strictly opt-in. The user would have to install Greasemonkey (or equivalent) and download the auto-ctrl-k script themselves
There's no way to inject a script into the chat page so that all users are subjected to it automatically
 
4:08 PM
@Kevin ...except for Ctrl-k?
 
0
A: Which dupe tag shall appear in Mjölnir close vote when I have multiple Mjölnirs?

Antti HaapalaNo. Rather list all gold badge tags. Consider for example python vs sqlalchemy - there is no conceivable SQLAlchemy question that wouldn't haveĀ been tagged python. However, gold in sqlalchemy is the one that qualifies one to authoritatively locate the duplicates for questions about that behemoth...

that's silly... mjölnired questions always get the tag from the first gold badge in alphabetical ordering.
 
@toonarmycaptain If you're saying "surely it's possible to add scripts to the page, since there is already a script that detects the ctrl-k keyboard shortcut". You are correct. Scripts can be added to the page... By the Stack Overflow development team, not us.
 
@Kevin Ah. Also...I just figured out that Ctrl-k is probably meant to be mnemonic/cognate with Ctrl-code, using k instead of c because c was taken...as opposed to Ctrl-i for indent...
Is there some huge reason why triple backticks can't indicate multiline code? Or is it just that that makes sense to me because of python's triple quoted docstrings?
 
@toonarmycaptain because no one cares for chat
 
@AnttiHaapala It is silly. I like this idea:
I think we should be able to choose which dupehammer we want to use, or even choose not to use any and only cast a normal vote. — Oriol Jun 21 '16 at 19:55
 
4:20 PM
Hello Everyone !
actually i have a question :
Is Dejango framework better in building websites than React.js ?
or can't we compare between both ? as i see they are both doing a great job
 
@RemonAtef you're comparing apples to bolts.
 
@Dodge I moved the ctrl-k passage to the top of the "formatting an entire multi-line message as code" section. I also made it bold. I'm not opposed to making it even more prominent, but I need to consider how to do so without disrupting the flow of the page.
 
@PM2Ring got a downvote already :D
 
Putting a big red box at the very top saying "TRY CTRL-K BEFORE YOU TRY ANYTHING ELSE" would be maximally prominent, but it goes against my aesthetic principles
 
@AnttiHaapala I assume you mean it should list all badges on the question that the badger holds. And although all sql-alchemy questions should be tagged python, we do get tag edit requests to add the python tag to them. The same goes for Pandas & Django.
 
4:30 PM
@PM2Ring fixed
 
If it literally listed all gold tag badges that the badger holds, pages would get rather cluttered when people like Martijn close them. :D
 
@Kevin I'm on 67.0b6...
@RemonAtef I can't answer (probably nobody can) but it's called Django, 6 letters
 
we should have a bot called clippy here.
 
At your service
 
user image
3
lol I tried
>>> '{[5]}'.format({"": "empty", '""': "not really empty", " ": "spaaaaaace!"})
in Python 2.
and the key error message was "interesting" :d
KeyError: 5L
 
4:47 PM
@AnttiHaapala I'm not saying that comment should get you banned from the room, but...
 
Interesting. I guess 5 gets converted to a long int without regard for the fact that a nonlong int would have been sufficient.
 
@PaulMcG @Dodge PyTexas are still looking for volunteers, if y'all are interested.
 
5:04 PM
@toonarmycaptain ok I'll ban myself right away
@Kevin perhaps even because it was backported from python 3
 
A compelling explanation.
 
@toonarmycaptain won't be in Austin until late Friday night, I thought they were seeking help in the days leading up to the event so I did not bother to volunteer
@Kevin it looks like everyone got their wish, let's see if that helps newcomers with formatting issues
 
@Dodge It looks mostly like greenroom/rego desk/av stuff in 1 hour sessions during Sat/Sun
I'm driving down tomorrow arvo myself.
 
Clippy bringing back the memories
 
@Kevin Might be a personal mental stumble - but Ctrl-k over Ctrl-K (which to me implies Ctrl-Shift-k, which doesn't work).
 
5:15 PM
    my model.py

    start_date = models.DateTimeField(auto_now_add=True)
    end_date = models.DateTimeField(auto_now_add=True)


    HTML:
    <div class="pv2">
    			<input type="date" name="startdate">
    		</div>
    ```
 
@toonarmycaptain ok, edited
 
but when I select a date, it only saves the current datetime
 
All the changes I made to the guide today were carried out with the expectation that they would help 0 additional readers. For it is written, "If you make something fool-proof, someone will just make a better fool"
I wanted it to look better for me, and it does, so I am satisfied
 
Thanks for making that effort, Kevin.
3
 
yup
 
5:19 PM
@ConnelBLAZE I wonder if it matters that the .py file has start_date and the html has startdate. What happens if you make them match?
 
i have a view:
start_date = request.POST['startdate']
    end_date = request.POST['endate']
 
OK. Do you have an <input> that matches end_date?
 
nope
 
wim
@Aran-Fey unfortunate to have a mod that will not participate in the chat discussions and just does whatever they feel like
@AndrasDeak good call
 
to be fair, we only made him aware of the chat discussion afterwards
 
5:28 PM
yeah, he couldn't have known a priori
it might not have even been obvious to him that the question had just been unhammered
 
wim
it's obvious enough in the timeline
 
wim
5:41 PM
@HardikGajjar no it is 100% sync, but you can configure it with an async handler if you want.
@Arne I have heard that argument too, and it's convincing
one problem with the argument is that if Python logging is configured at INFO or WARNING level, then it can be a significant performance boost to be able to drop millions of DEBUG events on the floor. if you're just logging stdout to be slurped up by syslog, like the 12 factor methodology would suggest, then you lose that advantage.
 
wim
5:57 PM
@AnttiHaapala that is weird, why it converts to a long
 
user7437554
def fix_start(s):
  snew = s.replace('s','a')
  return snew
fix_start('santisgo')
 
user7437554
Anyone can help me to understand what's wrong with the function?
 
Tell us what's wrong with the function first
 
wim
@Kevin is it too late to say "the guide is already perfect, don't touch it"?
 
Looks OK to me. The function replaces all instances of 's' with 'a', returning aantiago. I assume this is the intended behavior.
 
6:01 PM
Yeah, behaves exactly as I'd expect it to
 
If you're thinking "actually I wanted it to return 'santiago'. I need it to somehow deduce which S to replace in order to become an existing placename", you're not going to be able to do that with just string functions. Strings don't know anything about placenames.
 
@wim True, but the backport theory makes sense. I guess we could also test in 2.6, since it also got the .format backport.
 
i can take a few guesses with the function name, but you need to actually say what you wanted
oh, and another thing i suppose. if you wish to use the return of the function, assign the return of the function call into a variable.
 
wim
aantiago, laughing mao..
 
If you're thinking "I don't need it to return 'santiago'. I need it to return 'aantisgo'. It doesn't matter if it looks like a placename. I just need to replace only the first instance of the letter 's'", then you should supply a value to replace's count parameter.
>>> s = "santisgo"
>>> s.replace("s", "a", 1)
'aantisgo'
 
6:04 PM
@wim :D
 
user7437554
def fix_start(s):
  if indice in s.index()>=1:
    snew=s.replace('s','a')
    print(snew)
fix_start('santisgo')
 
user7437554
The last one should be better
 
I can't provide any more assistance unless you explain the problem in words.
 
What do you expect this line to do: if indice in s.index()>=1:
 
1 hour ago, by Antti Haapala
@Kevin perhaps even because it was backported from python 3
 
6:18 PM
@Kevin Computer not do thing. Not put money in pocket.
 
I think github.com/python/cpython/blob/2.7/Objects/stringlib/… is where Python 2.7 converts "5" to 5L. No explanation given of why it's using PyLong_FromSsize_t rather than conditionally converting to long or int as appropriate
python.org/dev/peps/pep-3101 only requires that it be treated like "a number", so at least it's working as specified.
Incidentally that document also explicitly mentions that not all keys are accessible with index syntax: "Because keys are not quote-delimited, it is not possible to specify arbitrary dictionary keys (e.g., the strings "10" or ":-]") from within a format string."
 
I'd expect code backported to Py 2 from Py 3 to minimize the differences, as far as is practical. Why allow the code to diverge more than it needs to? Having to maintain divergent versions is a pain, and can lead to unnecessary inconsistency of behaviour between versions.
 
That's fine, I just wanted to see if there was any explicit commentary.
I guess I can't expect to see /* use the same code that we had in 3.X, even if it makes the typing a little weird */ every time they write a version-intercompatible function
 
6:37 PM
no one cares about python 2.
 
I care about it in the same way I care about nuclear waste. How can we contain it so our primitive descendants don't dig it up and hurt themselves?
 
yet again "doesn't speak English" == "primitive" :PP
 
@AndrasDeak I think Kevin is envisioning a post-apocalyptic scenario.
 
6:52 PM
Primarily, but a simple societal decline would do in a pinch. Sudden catastrophes not required.
 
@AnttiHaapala We had a visitor here in the last few days that they have to use Python 2 for their project because their organization has too much code to port to Python 3.
 
the problem is that in 10k years even with a continuous stream of advanced societies you might just lose the memory of how English worked, and maybe even basic stuff like skull with crossbones
 
We just need a century where nobody bothers to read or maintain documentation about nuclear waste containment methods and/or programming best practices. When the last textbook gets eaten by mold, that's where the story opens.
 
Plus in 10k years an advanced society probably won't take "don't go in there, you'll die" icons seriously, even if they understood. "Superstitious ancestors, ha!"
 
wim
It also says
> The rules for parsing an item key are very simple. If it starts with a digit, then it is treated as a number, otherwise it is used as a string.
but that's not true because of "{[0x0]}".format({0: 'zero'})
 
6:54 PM
I suspect most builders nowadays don't carry around Geiger--Müller tubes
 
cbg
 
There are people fully employed to come up with universally recognised symbols for exactly this issue. Since it's clearly indeterminate whether whatever you pick could ever work, and basically just involves coming up with pictures, sounds like a good number tbh
 
yup
The good news is we have the theory to jump into the future to see what culture will be like in 10k years.
(The bad news is we don't have the theory to jump back to tell us :P)
 
:P Just wheel Machio Kaku in and pay him millions of dollars to reverse his thinking process on utterly irrelevant insights into the far future that TV keeps paying him millions of dollars for
 
"Send someone into the future 10,000 years via cryogenic freezing and/or relativistic trickery to see if any trace of our civilization still exists" is a self-fulfilling approach because at least one trace will exist: the person we sent into the future
 
7:02 PM
Cryo won't work, not foolproof enough.
 
Yeah. Rocketing around the galaxy at .9c has its share of hazards too
 
I imagine it's much more robust to send a spacecraft on a long orbit than to make sure that the cooling system works for 10k years on Earth, across wars and tectonic movements and whatever
planets and asteroids are much less fickle than the surface of the Earth
 
Coincidentally, the top question on the Physics active page a few moments ago is about fission reactors: physics.stackexchange.com/q/471908/123208 The OP has some serious misconceptions...
 
Until they get obliterated by some of our space trash
 
I have studied about nuclear reactors and also know their functionality.But some how i couldn't get answers for some my questions.

1) During fission reaction enormous amount of heat is produced and this heat is in the form of flames?
 
7:05 PM
@AndrasDeak ...I've always argued a storage place in Neptune's clouds or something was a much more novel, if low tech, concept. With much potential in pretty and 50s sci-fi styled promotional materials.
 
yeah, I was thinking Earth-specific, but you're right
 
If we develop the technology to keep a person alive in stasis for 10k years, that pretty much answers the question of "will anything of ours persist for 10k years?" without us actually having to do anything
 
"without us actually having to do anything" except invent a way to keep someone in statis for 10k years, that is :P
That's a pretty big up-front cost!
 
If we can keep something as squishy and fragile as a human intact for that long, then we can probably build a monolith out of {super_strong_material} that lasts a hundred times longer
 
For what might ultimately keep the global existential crisis at bay for a night
 
7:11 PM
@roganjosh Once you get them frozen though, you just have to keep the temp down, right? Hello Neptunian post-retirement community in the clouds.
 
@Kevin yeah, that's why I like the relativistic case. Don't need 10k years.
 
"Ten thooouuusand years...will give you such a crick in the neck!"
 
@toonarmycaptain well, we can already freeze people
People can do that to themselves quite easily, too
The fact that the ice crystals destroy every cellular structure could, I suppose, be hand-waved
 
@roganjosh yeah, stealing tricks from salamanders or tardigrades or something
 
"We're just gonna inject you with tardigrade DNA. You might feel a small sting"
 
7:17 PM
Do you watch Star Trek Discovery? :P
 
That's what gives rise to Predator :P
 
@roganjosh What I was responding to to was keeping them cool for 10k years in spite of tectonic plates, thunderstorms, dramatic elections, etc. I presume if one can keep someone in cryo on earth, it would be 'relatively' trivial to come up with a device that could passively maintain this state, given specific environmental conditions.
 
I think I watched half of it
 
.9c doesn't buy you much time dilation. Google says sqrt(1-.9^2) ~= 0.4358. And going really fast so that you get significant time dilation chews up a lot of fuel, and means any dust & gas you bump into has serious kinetic energy that your ship has to resist.
If you go fast enough, the starlight & CMB becomes blue-shifted to dangerous gamma radiation that you have to be shielded from. The dust & radiation shielding is a minor technical issue, but any solutions will increase the ship's mass, and therefore its fuel energy & reaction mass requirements.
 
Yeah,I did. My dad used to watch it and I was thoroughly confused by joining half the way through and then listening to his bizarre synopsis of where we were up to :P
 
7:22 PM
@PM2Ring just build the hull out of unobtainium
@roganjosh yeah, that must have been confusing
 
Will somebody please think of the Na'vi!?
Grr, what was that incredible material we made that died with the creator? Ends in "lite"?
Ah, Starlite
 
I read a great article in Scientific American about 20 years ago that had a great suggestion about storage of radioactive waste. The author had conducted preliminary tests, but the project got canned, mostly for political reasons, not technical ones.
The idea is to bury it in the vast abyssal plains in the middle of the big oceans, far away from the tectonic plate boundaries. These plains have stable clay deposits 100s of metres thick. You drill shafts to about 150 m, and drop steel drums of waste in the shaft, and seal the shaft when you get to the 100 m level.
It takes high tech and time to reopen a shaft, making it hard for rogue states to plunder them. And when the drums corrode after many centuries, the radioactives take a long time to diffuse through the clay. He estimates about 1 metre takes 1000 years.
 
They basically do that now anyway, just skip the burying part
 
^ easy peasy. out of sight, out of mind.
 
nuclear waste management is such a huge pain we should just skip to fusion energy
it's been around the corner for decades, so any minute now
 
7:35 PM
Writing prompt: the government begins its abyssal plains waste disposal project. Progress is halted when their first drill shaft opens up into a chamber filled with steel drums. Testing indicates they're tens of thousands of years old.
 
And I really don't like the idea of just putting things in the sea anyway (even if it's in the seabed). I mean, the giant underground natural reactor in Africa is one thing, but we really do concentrate this stuff up so it goes beyond any argument that these are naturally occurring substances already in the ground
 
Yeah, that's dumb. And bans on sea dumping were a big influence on shutting down this project. The core idea of this process is the deep burial in clay. The water on top just makes it harder for idiots to get at.
 
@Kevin nice
@roganjosh nobody said it is, the claim seems to have been "it takes a long time to diffuse" and I guess by that time it decays significantly away
but I wouldn't be too fond of the idea myself
 
@Kevin Strange inverted tree symbols line the drum rims. No one quite understands what they mean.
 
I know a guy who made "pigs" for major oil companies
These are objects that you put in pipelines that get carried along with the fluid flow and basically scrub the walls of the pipes
 
7:40 PM
The symbols are perfectly clear if you have W-shaped pupils that can detect the polarization of light, however
 
They put ultrasound sensors on the sides of the pigs to detect defects in the pipe walls. They kept finding bore holes made by amateurs. Some of these pipes are at 40 bar and people are diving down and drilling into the sides of them!
 
... For profit? How do you even sell an actual barrel of oil
 
No idea how that market works, or how you'd even hope to connect anything to the hole you're making
I guess the sea pressure might do something to make the pressure manageable once you breach the walls. If you were to do that on land you're basically drilling into death
 
There was a video about a disaster a few months ago, I think from India. A huge gas pipe ruptured (or was drilled?) and people were swarming with buckets to gather loot. At least I think it was gas. Well then it went up in a fireball...
oh, it was probably gas as in petrol
 
@AndrasDeak Yes. Most of the dangerous isotopes in waste have fairly short halflives, many less than a century, most less than a millennium. Only a few, notable plutonium, uranium, and thorium have really long halflives. And as you know (but others may not) the energy of radiiactive emissions is roughly inversely proportional to halflife.
 
7:44 PM
yup
 
IL ^^ (-:
 
@Kevin When I was working on anti-malarial drugs, one of the companies I was working for got into real issues because pirates stole the boat of raw materials - a load of shredded plants. You'll always find a market for these kinda things
 
Hence so-called depleted uranium, which is U-238 with the fissile stuff extracted, gets used for stuff like tank armour & jet plane nosecones. Yes, it's radioactive, but it cannot fission (unless bombarded with neutrons, eg in a breeder reactor), and the alpha particles it emits are so feeble you can stop them with a sheet of paper. They can't penetrate skin, but you certainly wouldn't want to grind up U-238 to dust & breathe it in, since it will be able to damage sensitive lung tissue.
 
So it's just alpha radiation?
 
@roganjosh Black market tonic, eh?
 
7:53 PM
@toonarmycaptain for sure. In fact, before the 70's it really was a tonic boiled up on open fires and it does actually work
 
Solid U-238 is less dangerous than granite or coal, both of which contain natural uranium, with a mixture of isotopes, and which can produce dust. U-238 in a confined space with poor air circulation can emit a little radon gas though, which can be problematic, once again because you can breathe it.
 
@roganjosh What, to concentrate the quinine?
 
Not quinine, artemisinin
 
@roganjosh That's not what's in tonic water though, right? (I may have this backwards).
 
Oooh, I thought you meant "tonic" in a general sense sorry
 
7:54 PM
@AndrasDeak I remember that scenario happening in Africa a decade or 2 back, in Nigeria, IIRC.
 
@roganjosh lol. I've read, and I'd believe it, that g&t was so popular in the colonies because it combined two things many colonials deemed essential - gin and resistance to malaria ;)
 
Yeah, quinine is used. It's had it's day though, sadly
And I'd be ok with a prescription for G&T
One of the companies in Africa that we worked with did not like my industrial supervisor at all. He made them wear respirators when working with the reactor
Previously they opened the relief valve to the 5 tonne tank of 96% boiling alcohol with no guards. They were basically drunk all day.
 
@AndrasDeak I think you're right, I remember a story. Which reminded me of a subplot in episode of M*ASH.
 
@roganjosh Yes. U-238 itself normally only undergoes alpha decay, with a halflife of billions of years. Some of the isotopes in its decay chain can emit beta & gamma, but you don't get a lot of that due to the long halflife. Bananas, OTOH, contain potassium-40, which decays by both kinds of beta decay. So when you eat a banana you ingest an antimatter emitter. ;)
 
@PM2Ring well you're bombarded by potassium-40 decay products when you stand too near to another human. Or when you go to a cemetery.
 
user10925323
8:01 PM
HHhhhhheheeeyyy ppl
 
@AndrasDeak I have fully transitioned out of chemical engineering when muscle memory won't even let me write "valve" any more :P
 
user10925323
How old are you guys
 
@roganjosh Apparently that's part of the problem the Germans (and later, I believe) Russians had with their early rocketry programs - when your fuel is essentially 100% alochol, it tends to go missing.
 
Potassium ions are an essential component in the electrochemistry of neurons.
 
@NoahGerard hello, please dial down on the letters
 
user10925323
8:02 PM
Sorry
 
user10925323
I'm new to chat
 
which is to say, "too old"
 
user10925323
I just found it
 
welcome
 
user10925323
Hey
 
8:03 PM
@NoahGerard or 'cabbage'
 
user10925323
Guess what
 
user10925323
I'm 13
 
I know
 
user10925323
Wdym?
 
I'm a psychic. Either that or you wrote it in your profile.
 
8:04 PM
@toonarmycaptain alcohol is "denatured" here if you buy it in labs. It will mess you up big-time. You have to get a license to buy non-denatured alcohol without paying duty. ~6 years ago when I was working on this, that was the difference between £7 for 2.5 litres and £120
 
user10925323
Oh. Lol. I'm dumb.
 
user10925323
So is this chat about python, or alcoholic rocket fuel combined with cabbage?
 
primarily the former
 
user10925323
haha
 
@toonarmycaptain Yep. Quinine for the malaria, gin for the boredom. They wouldn't have been so bored if they tried to explore the richness of millennia of Indian culture, instead of isolating themselves in their little expat compounds, but there you go.
 
8:05 PM
(he means alcoholic rocket fuel)
 
user10925323
I'm indian.
 
@roganjosh I think that's most places, UK/US/Australia anyway, which is my experience.
 
user10925323
How do I make a chat room like this with js?
 
user10925323
Is there a room for js?
 
you don't have to, there's already one
 
user10925323
8:06 PM
?
 
search the rooms at chat.stackoverflow.com/rooms
 
user10925323
I want to make one
 
you probably can't
 
@NoahGerard If you're a teenager, I'm probably older than your parents.
 
user10925323
8:07 PM
Ha. My Dads 46
 
@PM2Ring I'm sure one could find a way to enjoy both. ;) I say that as an expat lol
 
user10925323
I made a multiplayer game
 
user10925323
Anybpdy wanna play it with me?
 
user10925323
No?
 
user10925323
Ok...
 
8:09 PM
apparently not
 
anyway, rhubarb all, anyone at PyTexas this weekend, say hi :)
 
rbrb
 
@PM2Ring Honest question; how much of the debate about nuclear waste is hyped by the media? Obviously it's a big problem, but it's a topic where sensationalism can also get a grip because, well, the word "nuclear"
rbrb toon
 
user10925323
Welp
 
when you need to unacronymise ITER because it contains "thermonuclear" in its name...
 
8:11 PM
If we're using it to make mundane things like nosecones then it suggests we can find uses where you might have human contact of some kind
 
user10925323
I gtg
 
user10925323
bye
 
@roganjosh Human, maybe. But also military human :P
bye
 
@roganjosh We still have some denatured alchohol here that's denatured with methanol, or other nasty things, for some industrial purposes, but it's very rare. Decades ago, the standard methylated spirits for general use was replaced with ethanol denatured with Bitrex, but it still gets sold under the name of methylated spirits, and has the slang name of metho. We decided it was inhumane to poison metho drinkers with methanol. That's evil stuff. :(
 
denatured alcohol contains pyrimidine (or pyridine?) here
 
8:13 PM
It was methanol here when I last bought it
 
@roganjosh that just smells like alcohol, right? The denatured we have smells odd
 
No, methanol smells different
I'm trying to think how to describe the smell
 
good luck with that :P
 
We used to rinse glassware with methanol to remove trace elements adsorbed to glassware and then put it in the oven. The problem with working in a lab is that you get complacent with chemicals so I definitely evaporated methanol off. It's "duller" than the smell of ethanol
@AndrasDeak I suppose they did expose them to nuclear explosions. Maybe I need to rethink the practicalities here :P
 
@AndrasDeak Wiki suggests pyridine. Which isn't great, but a lot kinder than methanol.
 
8:18 PM
yeah, also smells pretty bad so you can't drink it by accident
well, people also drink antifreeze by accident, I shouldn't underestimate a thirsty drunk
 
I suspect there are multiple methods for denaturing alcohol in use
Since it could well screw up spectrographic analysis
 
Hmm?
I would imagine that anyone doing analytical chemistry will use pure ethanol...
 
Methanol would be less harmful to, say, LC/MS or NMR because it is structurally similar to ethanol
Depends on the steps for sample prep
 
my understanding of denatured alcohol is "OK, the people need alcohol for stuff like burners or as a mild polar solvent, but what do we do so they don't drink it?"
 
You will always have trace amounts going through the process, and it's pretty expensive to do the entire process using azeotropic ethanol the whole way
@AndrasDeak nope. You can buy non-denatured alcohol just fine
You just have to pay alcohol duty
 
8:23 PM
well yeah, that's the point
 
So the lab would just have to bankroll the drunk
 
Hello I have a question about sockets, servers, and classes. I will type in the example code and then my question.
#!/usr/bin/env python3

import socket

HOST = '127.0.0.1'  # Standard loopback interface address (localhost)
PORT = 65432        # Port to listen on (non-privileged ports are > 1023)

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.bind((HOST, PORT))
    s.listen()
    conn, addr = s.accept()
    with conn:
        print('Connected by', addr)
        while True:
            data = conn.recv(1024)
            if not data:
                break
            conn.sendall(data)
 
@NoahGerard 46? He's just a kid. ;)
 
@AndrasDeak the point being that it has nothing to do with consideration of who might drink it, it's purely so you don't dodge tax
 
8:25 PM
@roganjosh yes. Because if people could drink it then they wouldn't pay tax. Hence "don't drink it".
I never said "don't drink it because poor them"
 
My question is if I am writing a class could I add a socket as a class property like so?
class SockFun:
    def __init__():
        self.socket = socket.socket()
 
I'm not sure the average Joe could get a Fisher delivery of alcohol
 
@roganjosh It's complicated. ;) I'll write a longer answer in a few minutes. I need to make another coffee, first.
 
@ex080 that's an instance attribute, not a class attribute, assuming you'll have self in the signature of __init__
 
The history of alcohol tax is fascinating.
 
8:26 PM
I would like each instance to have it's own server.
 
@ex080 Yes, and while using that socket somewhere else in your class, you'll want to use with self.socket as s
 
oh ok
got it
 
Sockets are not servers
 
@PM2Ring I am new to programming, one of my friends send it to me. I am just trying to learn how to write a better program for a given problem.
 
They generally close after a single serving
 
8:27 PM
well I want to call bind and listen on my instance
 
if you want to continuously listen, you may want to consider websockets
 
Is there any reason to go so low-level?
Depending on the application you're trying to develop, I suspect there's already a well-established library for it
 
import socket

class SockFun:
    def __init__(self ):
        self.ip = '127.0.0.1'
        self.port = 3000
        self.socket = None

    def shutdown(self):
        if self.status:
            self.status = False
        return self.get_details()

    def startup(self):
        if not self.status:
            self.status = True
            with self.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
              s.bind((self.host, self.port))
              s.listen()
              conn, addr = s.accept()
 
This is all just code without much context. Can you explain more about what you actually want to do first please?
 
ok sure
 
8:32 PM
minor issue, you have self.ip as the address but use self.host in startup()
also note the second you call startup() your code isn't going to advance to the next line until the break occurs.
 
I would like to simulate some sensors, so I want to create a sensor class. Each sensor instance is going to run on it's own VM. I would like each sensor to be able to receive commands and send information to other sensors.
@AlexanderReynolds thanks let me fix that
 
@AndrasDeak grrr, I can now recall the smell of methanol perfectly and still can't find the words. Don't ask such frustrating questions in future :P
 
It's smells like methanol obviously :P
 
@roganjosh I didn't...
 
@ex080 is this for work or for a project or? I might strongly suggest to consider using Redis---the new Redis Streams data type works really well for pipelining sensor data, and it's really easy to throw a VM or Docker container up with Redis running on it
@ex080 if you're interested in how you might use Redis for this, check out this talk from the creator of Redis showing it being used for sensor data streaming: youtube.com/watch?v=qXEyuUxQXZM
 
8:37 PM
This is for simulation. I don't have the money to buy actual sensors so I need to simulate them. I am going to end up using docker or vms. The part I dont understand is if my instance is listening then it is stuck in a while loop.
ok ill check out redis
not familiar will need to learn
thank you
 
@AndrasDeak I've conflated it a little it seems in my quest to find the words :/
 
It's pretty cool for this kinda stuff IMO, I use it a lot. Otherwise, another option that you can do is use asynchronous programming to have multiple listeners for sensor data.
This is easily achievable with the websockets python library
 
@ex080 why do you need separate VMs to simulate signals?
 
@roganjosh I'd never ask someone to describe a smell, same way I'd never ask someone to describe a colour :)
 
Basically each "sensor" will be a server sending mock data, and then you can just have a single program asynchronously listen to all the "sensor" servers, ingesting data when it comes in from wherever, and passing off to the next message when it's done.
 
8:39 PM
it simulates unique devices with unique connections
 
So would multiple programs running on a VM
 
no just 1 instance of the class on each vm
 
But what exactly is the VM itself adding?
 
@taritgoswami It's a good puzzle. Fairly easy to explain, and not too hard to write a brute-force solution. But it's probably a bit advanced for someone who's very new to programming. I still think there's a clever way to do it faster, but I haven't thought about it much since yesterday.
 
I think you're making more work for yourself
 
8:40 PM
Yeah you defo don't need a VM for each sensor, you're probably fine with one process/thread per sensor.
 
ok would i then run them on different ports?
 
Sure, that's one way
 
You are testing the consumer of the signals, right? As in, the bit that's going to take all the incoming connections?
 
yes I need to know that each sensor can receive and send info
over the internet
So in the future Im going to buy lots of iot devices with onboard sensors
 
Then yeah, websockets or redis is the way to go IMO. I use both for sensor data collection, and both options work well.
 
8:43 PM
So the origin of the signals doesn't matter, only how you handle the incoming connections and make sure you reply to them individually, appropriately
 
and connect them to the wan
yeap
 
You could set that up easily enough on a single system
 
so i plan on running this class on each end device and just get the reads from the sensors and pass them
 
Ah so you want VMs because at the end of the day, each sensor will be on it's own platform.
 
yes
Basically I am trying to set up the communication between the sensors now. And worry about reading the sensors later.
 
8:44 PM
I'm confused, something is conflicting here in what's been said
 
I think that's fine. Each VM gets a little webserver, you can either publish a websocket connection or a connection to the Redis server running locally---if websocket, then every client that connects to that machine will get "push" updates from the websocket server. With Redis, you'll do a blocking XREAD until new data comes bubbled up from that machine.
 
yeap
each vm gets a little webserver
 
@roganjosh I think what they are getting at is that they want to build a system which will connect to multiple IoT devices and ingest data from them. Until they get the actual sensors, they just want to mock this setup with VMs.
 
I know I can code the socket connection like I would normally and set it to listen, but I was trying to add it into the class
 
Makes sense to me.
 
8:46 PM
Yeap exactly sorry english is not my first language
 
If they want to ingest data then it doesn't need to come from multiple VMs
That can be simulated in a single system
 
Yes but in this way, with VMs, when the actual sensors come you just install the same environment as your VM on the sensors and you're done/
 
Assume that the "mini web servers" on the individual devices work. All you want to know is how the single central system responds to requests
 
I'm trying to simulate the connection portion so that when i get devices I can easily hook up
I want to understand how to add a mini web server to my class.
so each instance gets a server
 
@roganjosh Fresh radioactive waste is certainly hazardous, mostly because of the high activity, short halflife stuff in it. You definitely don't want to cart it around in drums on the back of a truck in an unstabilized form. Cleaning up the resulting mess if the truck got into a collision wouldn't be fun. Binding it into a glassy substrate would make it safer to transport, etc.
But doing that processing is itself somewhat hazardous. Even extracting useful isotopes from it is expensive because you have to be very careful if you don't want a contaminated factory or contaminated personnel.
 
8:50 PM
let me code an example
and then share it
maybe that will help
 
@ex080 I'm not saying that the approach is wrong, btw. Only that I think you're making life harder for yourself than it needs to be.
@PM2Ring I guess it's caked and so inherently liable to just make dust clouds
 
yellow caked, to be specific
 
:/
 
Or is that why it's called yellow cake?
 
That's the starting material
Caked is, unless my memory really has gone, just compressed powder to a "pseudosolid" if you can call it that
 
8:55 PM
ah
 
The kinda stuff like makeup that you can easily brush off the surface of what looks like a solid block
 
So radioactive waste really needs to be processed on-site, where its created. Ideally, you bombard it with neutrons to create safer & more useful isotopes. Those useful isotopes could be used as fuel, and in medicine. That would get rid of around 80% or more of the useless dangerous isotopes.
But doing that neutron irradiation requires a breeder reactor, and those things are highly discouraged because they can also be used to create weapons-grade fissionable isotopes. So the main difficulty is political, not technical.
 
@roganjosh yeah, that defines it well
 
@PM2Ring This really makes me dislike the tech even more
 
Nobody wants fission power. But it's the best we've got.
 
8:58 PM
@roganjosh Yeap I know you are trying to understnad what I am trying to do to help me best. Thanks
I will be back shortly
with example
 
Hope we finally get fusion working, so many problems would be solved by doing that.
 
@ex080 if it helps, I also have built a system in a factory talking to ~50 machines, so I'm not just guessing :)
 

« first day (3099 days earlier)      last day (1843 days later) »