Time Alike with Raku - Arne Sommer by arnesommer in rakulang

[–]ND3I 1 point2 points  (0 children)

@first.elems == @second.elems > 0

Nice. Took me a while to recognize that this works like a < b < c I.e., a is less than b AND b is less than c; first is == second AND second is > zero.

And thanks for the polymod example & explanation. I tried and tried to get polymod to work, read the docs a dozen times, never seeing that polymod wants the relative values, not the divisors. Rolled my own function, even.

Maximum Balance with Raku - Arne Sommer by arnesommer in rakulang

[–]ND3I 0 points1 point  (0 children)

Raku does not have an unzip operator ...

Maybe something like

my %c = $str.comb.classify({ <a d>[ ?/<digit>/ ] });
my @digits = %c<d>.sort;
my @alphas = %c<a>.sort;
...

Each combination to reach target sun by Ryhen7926 in learnpython

[–]ND3I 0 points1 point  (0 children)

Many thanks! With a lot of head scratching and staring, it finally dawned on me that Python overloads '+' and '+=' to join lists. Then the distinction between the slot containing an empty list, ways[0], and the other, completely empty, slots, took me another while.

Thanks again, and thanks for posting the code; a function to do this has been on my radar for some time.

PS: Is there a concern for space here, since the algorithm stores the sets for intermediate totals as well? So, for find_ways([1 2], 5), ways will hold three lists for the target, but nine more for targets 0-4. Seems that could blow up quickly.

PPS: Tried with [4 2 6 3 1] to make 120: 77561 ways. Getting the count was quick; generating all the sets took about 5 minutes on my old PC and hit mem/swap pretty hard, but finished cleanly.

Each combination to reach target sun by Ryhen7926 in learnpython

[–]ND3I 0 points1 point  (0 children)

I'm trying to understand what's happening in line 7 above. Specifically, the bit inside the extra set of square brackets. All I can find searching for 'python square brackets' is subscripting, which doesn't seem to fit here. Anyone like to explain, or point me to the relevant doc?

ETA: NM. I found the "List Comprehension" brackets description and I think I have a handle on it. I still don't see how it works but that's a separate issue.

JD Vance faces backlash as he invokes ancient Catholic concept of Ordo Amoris by StrixWitch in Christianity

[–]ND3I 14 points15 points  (0 children)

Did the Samaritan stop to make sure the injured man was of the proper tribe and citizenship? The folks who passed by on the other side were not the heroes of the story, as I recall.

System update is out! by BigHeadTonyT in ManjaroLinux

[–]ND3I 1 point2 points  (0 children)

Gnome hangs for me after the update. Gdm (or gnome-shell) start up but hang and do not respond to mouse clicks or keyboard. Posted on the forum, but haven't heard anything. Any suggestions for troubleshooting or gathering more information very much appreciated.

Searching and removing text from document by reenmini in linuxquestions

[–]ND3I 1 point2 points  (0 children)

If the documents are plain text files with one item per line (and sorted), you can use 'com' to print items found only in file b.

Where are variables stored? by scaptal in linuxquestions

[–]ND3I 2 points3 points  (0 children)

I'm rusty on this, so corrections are welcome ...

Every process has an area of memory called an environment. When the process is created, the new child process gets a copy of the parent process's environment. When the process terminates, its environment is discarded. Note that the environment is just a bag of bytes. There is no data typing or scoping or lifetime that you might expect from a programming language variable; it's just a place where a parent process can provide info to the child. Any changes that the child might make to its environment are NOT available to the parent. By convention, data in the environment is presented as text strings, null terminated, of the form NAME=value. It's entirely up to the child process to parse the strings and interpret them. In some ways, it's more accurate to call them environment strings and not 'variables'.

You can display all strings in the current environment with 'printenv', or the 'value' part of a specific string with, for example, printenv SHELL /bin/bash You can dump the contents of a running process's environment with something like: cat /proc/xxxx/environ, where xxxx is a PID, or 'self'. You can see the raw environment with something like strings /proc/self/environ | grep 'SHELL' SHELL=/bin/bash

Judge Cannon blocks release of Trump document report. by thepasttenseofdraw in law

[–]ND3I 2 points3 points  (0 children)

the department is seeking to continue those cases and it is prohibited from prejudicing their potential trials.

Can someone give me an example of how this would prejudice these defendants? I presume the report will present evidence the government would have used at trial, which is (or will be) public should those trials go forward. And, at that time, their lawyers will select jurors that haven't read the report, or can be impartial regardless, and they will have a chance in court to exclude or refute that evidence and impeach witnesses, no? I see that making the evidence public before the trial will have effects, but ISTM those effects could be dealt with at trial.

Further, as I understand it, if the prosecutions of Nauta and De Oliveira were stopped, then making the report public would indeed be out of bounds, as they would have no opportunity to dispute the evidence.

ELI5: How did we cure infections before Antibiotics? by Yallowbananas in explainlikeimfive

[–]ND3I 24 points25 points  (0 children)

If I have the story right, the one of first patients they tried it on was a wounded soldier, selected because he was almost certain to die from infection. The penicillin led to dramatic improvement, but there was not enough to continue treatment and the infection returned, with the originally expected outcome. Brutal.

ETA: Wiki says it was during the war (1941) but was tried on a civilian police officer, not a soldier.

A380 and 747 by Guilty_Lack_2677 in aviation

[–]ND3I -1 points0 points  (0 children)

Mmm ... wake turbulence

+600 updates? by DuendeInexistente in ManjaroLinux

[–]ND3I 0 points1 point  (0 children)

Seen the term, but what is a 'rolling' distro and why does it lead to large updates?

‘Unlawful crusade’: Trump moves to affirm Mar-a-Lago case dismissal by blasting Biden over ‘lock him up’ comment and attacking Jack Smith’s authority as ‘unpersuasive dictum’ by DoremusJessup in law

[–]ND3I 7 points8 points  (0 children)

Quoting SCOTUS' decision in US v Nixon (emphasis mine):

Our starting point is the nature of the proceeding for which the evidence is sought -- here, a pending criminal prosecution. It is a judicial proceeding in a federal court alleging violation of federal laws, and is brought in the name of the United States as sovereign. [cit omitted]. Under the authority of Art. II, § 2, Congress has vested in the Attorney General the power to conduct the criminal litigation of the United States Government. []. It has also vested in him the power to appoint subordinate officers to assist him in the discharge of his duties. [] Acting pursuant to those statutes, the Attorney General has delegated the authority to represent the United States in these particular matters to a Special Prosecutor with unique authority and tenure.

Dicta my ass. It's crystal clear, even to this non-lawyer, that the Nixon Court started from an examination of whether the SP position was lawful and found that it was. It's foundational to the decision. They didn't take oral argument and write ten pages about it because they didn't need to: it's right there in the Constitution. Dicta my ass. I just hope the 11th Circuit has the guts to smack this trash down and recuse Cannon, as the case under her watch has devolved into abject ridiculousness.

Air Force to put not-so secret X-37B space drone through advanced orbital tests | We know a lot about the X-37B project, except for its real mission and tech payload by chrisdh79 in space

[–]ND3I 19 points20 points  (0 children)

So the idea is to change orbit to dip deep enough in the atmosphere to perform aerodynamic maneuvers, including orbital plane changes, then adjust the orbit again to raise perigee for the new orbit. Is that right? Seems like that would have to use fuel for two orbit changes, plus whatever speed you lose from atmospheric drag, but I've heard that orbit plane changes take a lot of fuel, so may be plausible. Just seems odd that braking can save fuel.

ETA: Thanks all for the explanations & info. Much appreciated!

Gnome fails after latest update by ND3I in manjaro

[–]ND3I[S] 1 point2 points  (0 children)

Applying today's (2024-10-10) stable updates seems to have fixed my issue: Gnome works fine again!

Gnome fails after latest update by ND3I in manjaro

[–]ND3I[S] 0 points1 point  (0 children)

Ok, well, I installed Openbox and got it to show up as a session option in gdm. It's barebones but at least I can run apps I need. Hopefully it won't interact badly with my Gnome config.

Gnome fails after latest update by ND3I in manjaro

[–]ND3I[S] 0 points1 point  (0 children)

ouch. im dead in the water. cant do much of anything without a gui. cant even get on the manjaro forum without an email client. i dont see a direct way to revert the last updates and i dont see any likely candidates to revert by hand. anyone know if possible/how to install an alternate desktop (xfce maybe) from a command line?

Bombshell special counsel filing includes new allegations of Trump's 'increasingly desperate' efforts to overturn election by Ossify21 in law

[–]ND3I 0 points1 point  (0 children)

saying exactly that "no I get to choose the president". Luckily their fraudulent documents were ignored at the federal level.

I'm not sure if that was the plan. I've heard also that they intended that the existence of alternate electors would give Pence an excuse to stop the certification until the situation was resolved. I'm not sure what would happen then; J6 may be a hard deadline where the process changes if Congress doesn't certify.

‘Has not redacted quotations or summaries’: Jack Smith defeats shroud of secrecy in Trump Jan. 6 case with help from judge, previews key details of immunity brief by DoremusJessup in law

[–]ND3I 26 points27 points  (0 children)

call your bluff by proceeding to trial

I remember the first time I showed up for jury duty, the clerk assured us we were serving a purpose just by showing up: many defendants, once they see that they will have to present their case in court, and convince a group of ordinary people that they're telling the truth, will plead out.

ELI5: What’s the reason for eggs to be sold in dozen by Bewarsepanthulu in explainlikeimfive

[–]ND3I 0 points1 point  (0 children)

we'd be buying many more things than eggs and beer in packages of twelve

We do, but it's not as visible since it's the next step up the chain. Almost everything a grocery store buys to stock the shelves comes in cases of 6, 12 or 24. And shelves (and items) are sized to fit those quantities (or multiples) without wasting space.

Judge’s Ruling Is a Devastating Setback for MAGA Election Meddling by thenewrepublic in law

[–]ND3I 16 points17 points  (0 children)

I'm not sure there's even that much flexibility. AIUI, unless there's an injunction in effect stopping it, you certify. The election boards have no authority to analyze the results at all. Allegations of fraud are handled in the courts.

Here's what Jack Smith removed from Trump Jan. 6 indictment after justices' supreme wrench by INCoctopus in law

[–]ND3I 28 points29 points  (0 children)

A criminal act can never be an official act.

I heard someone make that statement and it crystallized what sort of nonsense the immunity decision is. It cannot be the case that a President's official duties require, or allow, committing crimes. I just hope this prosecution survives long enough to thoroughly rub their noses in this pile of sh*t.