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

9:00 PM
@PM2Ring Ok.
 
@AndrasDeak It is actually, IMO, mis-sold in politics
 
@roganjosh It's in various physical states, but it is prone to crumbling, etc. Fission & radioactive decay induce structural flaws in materials. Yellow cake is refined uranium ore, before it's made into fuel rods. New rods or pellets are solid & have good structural integrity, used ones are brittle & crumbly.
 
The billions it costs just to decommission the plant, let alone the legacy of the nuclear waste, is almost always skimmed over
@AndrasDeak the objection to "nuclear" is enough to detract from the idea that this thing will cost a yam load of money just to shut down, but that's in the future. The economics are not great
 
how do Ignore 0 in this instance?
a = [6,9,4]
b = [3,0,0]

c = [min(*item) for item in zip(a, b)]

print(c)`
 
Far beyond whatever spin you can put on the up-front investment you're making while you're in power. "Yes, it costs £10bn to build but LOOK, I bring you light!"
 
9:05 PM
@user7716943 ignore how?
 
i want the output to be [3,9,4]
 
@roganjosh here it's easy: have the Russians build it and classify everything related to the contract for 30 years ¯\_(ツ)_/¯
 
Plutonium presents special problems. Its isotopes have a wide range of halflives. Some of them are relatively safe, and just emit alpha, like Pu-238, with a halflife of 78 years, that emits 11 watts of heat per gram, when it's fresh. Here's a pellet, glowing from its own heat:
 
@PM2Ring I think the problem is hard for me, so I left hope to find a better solution. Please share if you get any clever way to solve it.
 
>>> a = [6,9,4]
... b = [3,0,0]
...
... c = [min(*item) for item in zip(a, b)]
... c2 = [min(val for val in item if val != 0) for item in zip(a, b)]
...
... print(c)
... print(c2)
[3, 0, 0]
[3, 9, 4]
but you need to handle what happens if both values are 0, possibly through the default keyword argument of min
 
9:10 PM
Most Pu isotopes aren't fissile, and converting them to fissile forms, and extracting those isotopes from the other stuff is really hard, it's a lot easier to just run a uranium plant.
 
@Andras yeah, the first value will never have 0. so no problem. thanks
 
@PM2Ring you speak quite knowledgeably about this, even putting the "Physicist" label aside. I assume it's something you're actively involved in?
 
@user7716943 then another option is [val1 if not val2 else min(val1,val2) for val1,val2 in zip(a,b)]
 
Not just knowledgeably, but somewhat enthusiastically :)
Maybe not on the power side, but something to do with radioactive substances
 
I think PM's the kind of enthusiast who puts professionals to shame :)
 
9:15 PM
And in programming too. Many strings to the bow :)
 
at least I know he's a self-taught programmer
 
But the nasty thing about all plutonium isotopes is that on top of the radioactivity, they are chemically toxic, both the pure metal, its oxides, and all of its various ions. Chromium has some mildly dangerous oxidation states, and some really scary ones. All of plutonium's ions are scary. It makes mercury, cadmium, and lead look like rank amateurs.
So when you try to do any chemical processing on it, you have to be yamming careful. And of course if you want to do isotopic separations on it, you're going to be using hydrofluoric acid, which is scary enough in its own right on a good day.
 
@AndrasDeak is that better than the first one?
 
@user7716943 honestly, I don't think it matters.
if you have a lot of zeros then the latter will probably be marginally faster...
choose what you find easier to read
 
@roganjosh No. I was a top maths & science student in high school, but have almost no further formal training. But I learned how to learn when I was a kid, and have never stopped learning. I grew up during the Cold War, and was fascinated by atomic stuff. I had a basic idea of how atomic bombs worked by the time I was 9.
Access to good libraries was helpful. And in recent decades, the internet has been a boon, both as a source of info, and as a means to get feedback to make sure I had my facts straight.
 
9:26 PM
@PM2Ring concentrated sulphuric acid used to scare the crap out of me. Horrible viscous stuff that used to spread on paper towel turning it black like a flame propagating. I once got an invisible drop on my skin and the pain is ridiculous compared to the size of exposure
 
@roganjosh I use to have fun pouring it onto sugar. :)
 
it takes out the water, precious
 
It's horrible stuff
That was, I think beyond the steroid powders, the only thing I was genuinely quite scared of in the lab. Chloroform I feared a mass spillage, and once I got acetonitrile all down my leg, just packed my jeans with tissue and went for a cig in the sun, but concentrated sulphuric acid... nope.
 
Concentrated nitric's pretty intense too. And an insane oxidizing agent. But the highly dilute stuff's ok. I remember accidentally spilling a little on my lab notebook at school & noticing that it instantly turned the ink from my red ballpoint pen to green.
 
I always approached chemical experiments with a healthy dose of will to live
i.e. safe distance :D
 
9:32 PM
When you use litres every day, you get complacent
But some will still scare you
 
One of my chem teachers (the one who was also an astronomer that I mentioned the other day), bragged that when he was a student, most of the kids in his class made nitrocellulose. :)
 
my chem teacher bragged that when they were at a chem competition for a few days in the countryside they concocted sodium azide, spread it on the corridor of the dormitory they stayed at, so that when the teachers came long in the morning the crystals would pop under their feet
 
The stuff that goes on in Chemistry labs in Uni is somewhat ridiculous, even now. Or, at least, what I experienced in chemical engineering. I really doubt chemists take more precautions than the engineers, though
 
People who work regularly with sulfuric invariably have labcoats that are riddled with holes.
 
my chem teacher in high school introduced us to a variety of explosives during one class period. The one I remember was some powder on the table that would explode by just slapping it with a ruler. About 15 minutes into class the lab was so full of smoke that he just dismissed us.
 
9:36 PM
or was it iodine azide, I'm not sure
@Code-Apprentice we had a nitroglycerin demo once, it was memorable
 
@Code-Apprentice I see that and raise you me accidentally evacuating the chemistry block by spilling bromine solution from a pipette
 
@roganjosh that doesn't sound as fun
 
Thankfully they weren't completely ridiculous and called the fire brigade which, as explained to me at the time, was the correct procedure. It was gone in like 30 seconds
 
oh, now you reminded me of the "don'tsuckitup don'tsuckitup don'tsuckitup" worries from titration practice...
 
@Code-Apprentice Purple smoke? That'd be nitrogen triiodide. It goes bang when you hit it.
 
9:38 PM
@AndrasDeak ahaha, you may well be showing your age there. That's way before my time
 
I don't think so
titration is a common deal in chem education here
and pipettes you (or a plastic ball) suck on is commonplace
 
I'm talking about the crappy throw-away plastic pipettes here. Completely useless for Bromine that just evaporates and fires itself back out. But sucking on pipettes has been gone for a long time AFAIK
 
Damn what the hell crazy chemistry stuff did you do :O Was that at university or high school?
 
Pipette balls are nice because you don't swallow sodium hydroxide, but it's much easier to do precision work with your mouth. And anyway if you make sure that the tip of the pipette is in the liquid you won't suck it up...
@Hakaishin my experience is high school
 
We used mouth pipettes at school. I once got a tiny bit of potassium ferricyanide solution in my mouth. But it's not as scary as it sounds, the cyanide is strongly bound to the iron.
 
9:41 PM
wow sweet, our chemistry was super boring
 
@PM2Ring perhaps...I don't remember exactly...and there were several other examples, some of which we set off under the ventilation hood...and some we didn't
that was quite a few years ago
 
@Hakaishin well I had a science-oriented class in high school, and I took chemistry extracurriculars
 
Once you get to Uni, things just get worse
 
My performance in national competitions in high-school was Russian > chemistry > physics. Of course I became a physicist :D
 
We used to have multi-tonne blocks of concrete that they were blowing apart with microwaves. A long time (maybe a year?) later I found that they were leaking into the office above where I worked
 
9:44 PM
you were the control group
 
There was also a guy in the microwave group that had thermal runaway in a fume cupboard, daren't go shut it down, so decided instead to film his reactor exploding and implanting the top half in the ceiling of the fume cupboard
 
...so I think I've been tracking a non-existent bug for two hours.
 
@AndrasDeak same :D
 
@roganjosh:
in The h Bar on The Stack Exchange Network Chat, Feb 15 at 13:30, by PM 2Ring
You also need to read Max Gergel's Excuse Me Sir, Would You Like to Buy a Kilo of Isopropyl Bromide? It's hillarious. And a little scary to read about the blasé attitude to safety and environmental protection they had back then.
in The h Bar on The Stack Exchange Network Chat, Feb 15 at 13:36, by PM 2Ring
Here's a sneak preview, which includes a link to the whole PDF. You don't need to be a chemist to enjoy Gergel's memoir, but a bit of chem knowledge helps. https://blogs.sciencemag.org/pipeline/archives/2010/05/27/max_gergels_memoirs?r3‌​f_986=https://www.google.com.au/
Also highly recommended: John D. Clark's Ignition!, a nice history of the major period in the 20th century research into rocket fuel chemistry.
 
10:03 PM
A moment aside from that discussion, am I right in thinking that this can basically never exist as an approach in Python? I'm not sure my assertion is correct but it just doesn't look right. In the same vein, am I just expecting everything can be built up from existing libraries and you might have to resort to that?
 
Oh well. I got +1 & -1 on this Physics answer, which is a lot better than the other answers. physics.stackexchange.com/a/472077/123208 I originally posted that as a comment, after dupe voting the question, but someone talked me into posting it as an answer.
 
@roganjosh language agnostic. 2* ((-1)**jj[j])
That's not meant to be read...
 
@AndrasDeak :/ I just looked at it and had a "yeah, no" response, but it seems flawed if you even try understand part of it.
 
they even have numpy, they just need a few vectorized operations, probably
 
@roganjosh It's not clear what those things he's appending to are, but I assume their Numpy arrays. And appending to Numpy arrays is invariably a bad idea. But overall, the code has the aesthetic appeal of cat vomit.
 
10:12 PM
you can't .append to a numpy array
 
yes, as opposed to numpy.ndarray.append
 
Ah, ok. And I'm well-aware of the issues with it. I have to say that it wasn't the first issue to catch my eye :P
 
Haha my codebase I inherited is 90% like that post :(
 
@Hakaishin I will pray for you
 
10:18 PM
It's soon over :D
 
It's a tough one because I know the person behind the screen actually battled to put that together :/
 
But my biggest mistake was not changing everything much earlier. I tried to stay close to the source and do things similar like my predecessor. BIG mistake. Tear down everything in a crappy project, the second you see it. Even if it means refactoring and changing things for days. It's worth it.
Like how do people even not realize circular dependencies ugh :P
 
Not gonna argue with that. The only hurdle is getting it past management
 
luckily It's academia so there is no management :P
 
nor tests
 
10:22 PM
or imports that can only be imported when other imports happpened :D and lots of global everything. Everything is global you know, so much easier... And the same function 3 times doing the same things, once with an underscore once with a 2 at the end.
anyways :P
it's better now :)
 
did you put it into git?
 
@roganjosh True, so I felt obliged to post a comment. But I doubt he'll be able to transform it into an answerable question. And even if he does, it's unlikely to be of much interest to future readers, but maybe I'm being too cynical, and it could end up as a nice modeling exercise. But I'll believe it when I see it.
 
It's almost compelling enough for me to go back to academia. But not quite.
 
@AndrasDeak me? Yes
why?
 
just to gauge the level of insanity you're facing
 
10:27 PM
@PM2Ring I didn't suggest an MCVE because I fear they might waste time trying to make that intelligible but I doubt it will get an answer. As I conveyed in my comment, I don't even know what to suggest. But I feared sending them off to polish a turd
 
we don't even know what's wrong...
interesting how the syntax highlighter broke on )#comment
 
@AndrasDeak Yeah, it needs whitespace before the hash.
I don't like inline comments in Python code. Comments should enhance the visual structure of the code by acting as a heading of the section of code they explain. Inline comments don't do that, and make lines longer than they need to be. It's not so big a deal in languages that use braces (or other block delimiters), but in Python we need to support the whitespace structuring at every opportunity.
 
10:51 PM
Hello I am back cbg
 
@roganjosh He's now added a MCVE, allegedly. And a newbie's posted a tentative answer, but that was done before the MCVE.
 
As far as speculation goes, and for a new user, I guess it's not a bad job
 
:)
 
Separably, I am bored of the MySQL library using %s as a placeholder in queries. It's beyond ridiculous how much confusion this causes
Even when the OP that's learning tried to do things right, like this question, they'll face problems
The DBAPI should have just booted %s out from the start
 
11:09 PM
@roganjosh Definitely. It's a major source of MySQL questions on SO, and that confusion surely is a prime contributor to SQL injection code in every language that supports %-style formatting.
 
The cynic in me, well just me, thinks they must have just sat around and discussed how to make SQLI more prevalent
 
cbg
 
:)
I almost got an apprenticeship, but they came up with a pretty horrid task to perform
I mean, it doesn't look so bad, but I'm having a major problem with it
I got to this point, and now I have to perform calculations on every possible path from top to bottom of the "wall"
rows[0]                                    [['801'],
rows[1]                                ['913', '942'],
rows[2]                            ['839', '916', '817'],
rows[3]                        ['861', '844', '996', '927'],
rows[4]                    ['977', '850', '927', '850', '941'],
rows[5]               ['822', '897', '966', '909', '889', '944'],
rows[6]            ['992', '980', '806', '911', '897', '906', '955'],
rows[7]         ['939', '912', '896', '896', '832', '859', '874', '968'],
 
This is for an apprenticeship? What country?
 
11:19 PM
are you asking a question?
 
^ and that
 
it's actually a fraction of it
yeah, i'm getting there , just trying to formulate it. haha
basically you can only move within 2 elements below so, say
801 can only go down through 913, and 942
then 942 can only go down through 916 and 817
 
Ok, but, as was asked, are you asking us a question or just stating a problem?
 
asking a question on how to approach it
I thought about trees and recursion, but jeez... it's a hard concept
and coming here is the last resort. I sat on it for 10 hours today
don't worry about the pyramid structure, i've just made it so it looks clear
from the actual task: "Each pathway can only move from one layer to the next by
passing through either of the two bricks directly underneath."
any ideas? :>
 
What are you supposed to do as you traverse the tree?
 
11:24 PM
Well have you got anywhere with the problem yourself?
I mean, this is the job you are going for, not us
 
@Code-Apprentice sooo basically divide each number by 990 and then multiply the whole "path" all together, then compare all the resultus
 
And then what?
 
What do you mean "multiply the whole path all together"? So starting at the 801 at the top, then what do you do? Do you need to traverse both paths down? or do you need to select one?
 
How did you generate the path?
 
@roganjosh yeah, i'm pretty surprised they gave me this task for an apprenticeship, cause it's pretty complex, they said it's gonna take me a week to do it... a bit over the line if you ask me for a low paid job
would you like to see the whole task?
 
11:26 PM
sure
 
i suck at explaining and it's a bit hard to just give you a snippet
ok
 
your paraphrasing seems to leave out some crucial details
 
The task is not easy, for sure. But I'm reluctant to help here tbh because it's a sorting mechanism for the company and you've just outlined an approach
 
s/sorting/filtering/
I'd be wary of a job interview that gives you a task to work on for a week...
 
@PawelFlajszer no, because it's your task
 
11:28 PM
@roganjosh don't get me wrong, I'm not expecting to get an answer or ready code
 
@Code-Apprentice It's not uncommon. I had one and I screwed up on one part of reading math notation
@PawelFlajszer sure but our input should probably be minimal. I'm out.
 
lol, publicly posted link, smooth
or is that a file share service to which you uploaded a new copy?
 
yeah, I just removed it
thought it's against the rules or something,
 
OK, then it's not as bad as I thought, I thought that was a link to the company (before I clicked it)
well, there are possible ethical/legal issues here but that's between you and the company
anyway, I'm off the bed, rhubarb
 
rbrb
 
11:31 PM
see ya
ahhh, never mind guys. I was just looking for a little guidance, not a ready answer. I literally sat in front of this for the past 13 hours without any success
 
Day 1 of 7?
Because giving it some sleep will probably do wonders.
 
@AndrasDeak how would you know that? :P
 
day one, but they said the faster I deliver, the better looks on me
 
@roganjosh I heard...
 
which puts pressure ofc
 
11:34 PM
@PawelFlajszer don't let that press you. Better a good job in 6 days than a crappy one at 2.
 
bull, drop the pressure on yourself here
 
if they didn't want you to spend a week on it they should've given a shorter deadline
 
It could well be that they don't expect you to get an answer at all
The points are a) How do you approach the problem and b) How do you deal with pressure.
 
ideally they don't do b) at all, but they often do
I personally wouldn't want to work anywhere where pressure or stress is deliberately involved in the interview
 
I'm probably overreacting, we're speaking through the recruiter, you see
 
11:36 PM
@PawelFlajszer So your first task is to describe the problem clearly & unambiguosly in words, in small bite size pieces, and maybe a sketch or two. You can't create a clear solution if you don't have a clear description of the task. And you need to identify the natural structure of the task so you can break it up into parts, and figure out, in words, what needs to be done to solve each part.
 
so I never dealt with the company
@PM2Ring indeed. that's a great approach. I'll start with that tomorrow morning
I'm just glad you lot didn't say that problem is piss easy
 
@PM2Ring you sound like my twin. I don't know how many times I've posted basically the same thing as a comment to an unclear question.
 
Analytic thinking is the keyphrase
 
Have you done much coding that uses recursion? That's often the best way, when working with trees, since trees naturally have a recursive structure.
 
@PawelFlajszer we don't know the problem ;)
 
11:39 PM
@PawelFlajszer You're not overreacting. The task, at least what I can make of it, is disproportionate to the position. They're just pushing you to this
 
@PM2Ring not really, I had a chance to work with trees in C, but chosen hash tables instead
so not much recursion, not much tree sctructs
 
If you are visiting the tree node in row i and column j in the tree, what do you need to do? (This is the question I would ask myself to try to find a solution.)
 
Once you've done that analysis, don't try to immediately turn it into code. Mull it over a for a while, and let it seep into your brain. Go for a walk, do stuff around the house, and think about other stuff, to give your subconscious a chance to do its magic. ;)
 
@roganjosh my guess is that they want to see what i'm capable of. asking me to write loop to print fibonacci numbers wouldn't tell anything about me except maybe I understand loops or I'm good at googling things
 
FWIW I wouldn't use recursion at all here
But we could all have radically different ideas of what you're trying to do
 
11:45 PM
@Code-Apprentice need to assign node.left value to row[i+1][j] and node.right to row[i+1][j+1] :P
 
and that's not an invitation, at least from me, to post the problem. But I can tell you that submitting broken code will not invalidate your application for a position; I've done it
 
@PawelFlajszer I'm assuming that you have the 2D list that you gave in your original description. There's no need to assign anything to it.
 
Often, with these kinds of structures, once you've got the basic structure in your head, you can get useful insights by looking at it backwards. The task tells you to walk down each path, starting from the top. But there may be useful optimizations that you notice if you trace the paths backwards, starting from the bottom.
 
@PM2Ring I've tried that too, but I'll look into it tomorrow with greater detail. Maybe I've missed something
@Code-Apprentice yeah, I did a little bit earlier
 
But anyway, I'm kinda jumping ahead of the game with that hint. And it might not lead anywhere useful, in this particular problem. ;)
 
11:49 PM
And I would take a totally different approach and get different answers. That gives you some indication about what's expected here :)
 
thanks for your hints guys
I'll have some sleep now and tackle it tomorrow, perhaps with more luck (or thought)
 
@PawelFlajszer One more hint: you say you need to "multiply the whole "path" all together,". Can you write a function which takes a list of numbers and returns the product of all of them? This exercise might help you think about approaches that can work with the more complex pyramid problem.
 
That would be a cost function in my approach
 
@Code-Apprentice thanks.
 
rbrb
 
11:57 PM
rbrb
 
@roganjosh are you familiar with Project Euler? This problem reminds me of a couple of PE problems.
 
Or Advent of Code
 

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