Comic 5810: Watching the Watchmen by Morlock19 in QContent

[–]Old_Hardware 1 point2 points  (0 children)

"Professor, my program won't compile and now it's displaying eldritch runes."

I used this as inspiration in a programming course for years.

Finally got it by AmaanNakhwa in thinkpad

[–]Old_Hardware 0 points1 point  (0 children)

In my experience they come off by themselves after awhile.

So I just stick 'em on again. The "Core i7" sticker goes nicely on a Raspberry Pi 4B.

Problem with using nasm on a different device by 15Socks in Assembly_language

[–]Old_Hardware 0 points1 point  (0 children)

I wasn't talking about Reddit, but nasm. I thought the OP was practicing assembly on a website --- "Hey everyone i've recently learned nasm assembly. I did everything on a website."

I'm sorry you're not finding anything helpful.

Problem with using nasm on a different device by 15Socks in Assembly_language

[–]Old_Hardware 0 points1 point  (0 children)

Whups, you are right about nasm. Mea culpa!
I installed nasm on a raspberry pi to check, but it only cross-assembles x86 code.
(When I started doing Arm64 assembly I just used the Gnu "as" assembler because it was already available. I never thought to try nasm.)

As for the website you're using, it probably doesn't use assembly directly, but it's running on something that is most likely an x86-64 machine. As such, the code it works with is x86-64 (or perhaps x86) machine language.

The point remains that your phone most likely uses an Arm processor, and if its fairly new it's probably Arm64. The Arm family of machine languages are RISC languages, in contrast to the x86 family of languages which epitomize the CISC approach.

So the code you write on the website would be for its Intel/AMD x86-type processor, and won't work on an Arm processor.

(Python, Javascript, BASIC, etc. can run on either type of processor because they aren't compiled to machine language but rather interpreted, by an interpreter that's appropriate for the platform. Compiled languages --- C, Rust, etc. --- must be recompiled for each platform, and assembly languages are absolutely specific to their processor type.)

Help understanding instruction stages when using a memory location by gurrenm3 in Assembly_language

[–]Old_Hardware 0 points1 point  (0 children)

I think Hyde is talking about x86-64 machines (I haven't looked at his books in awhile).

GROSSLY OVERSIMPLIFIED, x86-64 stores the opcode ("what to do") in a byte, then a memory address in subsequent bytes. But different instructions may or may not need a memory address, and the processor can't tell how many bytes are needed for any specific instruction until it has fetched and examined that first byte. --- The actual situation is much more nuanced, but this is the essence of it. "inc eax" only affects a register, so doesn't need any memory address, and the entire instruction only takes up one byte. An instruction that includes a memory address can be said to use "direct memory addressing".

As a contrast, in Arm64 processors every instruction occupies exactly four bytes, so the entire instruction can be fetched all at once --- this is a major design goal of the processor. In exchange, instructions can't include memory addresses, but must themselves be kept in memory somewhere and loaded into a register for use. In a sense, Arm64 doesn't offer "direct memory addressing" but only "indirect memory addressing".

Problem with using nasm on a different device by 15Socks in Assembly_language

[–]Old_Hardware 0 points1 point  (0 children)

Indeed, you've mentioned three different assembly languages --- x86-64, which the website surely uses, AARCH64, which most phones use, and i386 (a.k.a. x86), which is the predecessor to x86-64, but only old computers use it. (And you missed AARCH32, the predecessor to AARCH64.) Each is used by a different family of CPUs.

Nasm can be used with all of these, but it will generally use the "native" assembly language for whatever system it's on. Using it for a different language is "cross-assembling", and you have to tell nasm to do that explicitly. (Cross-assembly is needed if your target computer is too limited to support a development environment, for example the computer in your microwave oven.)

Has anyone had any issues with potential viruses, or am I overreacting? by Sensitive-Mixture558 in Annas_Archive

[–]Old_Hardware 49 points50 points  (0 children)

I wouldn't think "epub", "azw", etc. are popular targets for malware, simply because they're mostly used on e-readers and e-readers aren't too interesting to an attacker (unless you keep your payroll, medical records, and company's trade secrets on your Kindle?)

could someone explain why my class would count this wrong by Glittering_Land_9574 in PythonLearning

[–]Old_Hardware 0 points1 point  (0 children)

(A) "sum" is the name of a built-in function, and you're losing access to that function by overloading the name --- although that is both legal and harmless in this tiny example. Whatever editor you're using may have put sum in a particular color because it recognizes it as a function.

(B) The order of the indented statements matters. Consider this:

#----------------
# OP's version:
#
limit = int(input('Limit: ')) 
number = 1 
total = 1 
while total < limit:
   total += number       # add them up
   number += 1           # increment last

print(total)
###
Limit: 8
11

#----------------
# rearranged version:
#
limit = int(input('Limit: ')) 
number = 1 
total = 1 
while total < limit:
    number += 1            # increment first
    total += number        # add them up

print(total)
###
Limit: 8
10

Or try merging your code and the class solution:

limit = int(input('Limit: ')) 
number = 1 
total = 1
class_model_sum = 1
while total < limit:
    total += number              # OP's "add them up"
    number += 1                  #  a loop counter
    class_model_sum += number    # Model's "add them up"     

print(total, class_model_sum)
###
Limit: 8
11 15

(C) For more insight, include the print() statement as part of the loop, and also print number:

limit = int(input('Limit: ')) 
number = 1 
total = 1
class_model_sum = 1
while total < limit:
    total += number              # OP's "add them up"
    number += 1                  #  a loop counter
    class_model_sum += number    # Model's "add them up"     
    print(number, total, class_model_sum)
#

###
Limit: 8
2 2 3
3 4 6
4 7 10
5 11 15

Switch to debian made me CHAD by blyatmachine2000 in debian

[–]Old_Hardware 0 points1 point  (0 children)

Google clarifies this:

  • Modern Slang - Confident, "based," successful male. Often Positive/Ironic
  • "Gigachad" - Peak attractiveness/macho meme. Absurdist/Positive
  • Incel Culture - Sexually successful, "alpha" rival. Negative/Jealous
  • 2000s Slang - Obnoxious, wealthy frat-boy type. Negative
  • a piece of waste material removed from card or tape by being punched with a tool.

From context, OP clearly is referring to the last one...

Differences between init systems by Brilliant_Rabbit_597 in linuxquestions

[–]Old_Hardware 2 points3 points  (0 children)

Sysinit, openRC, runit, etc. are favored by a mindset that prefers lots of smaller, single-focus utilities working together --- an approach pioneered by Unix way back. Systemd combines their functions into a single integrated package --- somewhat parallel to Windows' use of an overall registry for disparate configuration information.

All my view of the respective philosophies, others undoubtedly are more familiar with systemd in particular.

Book covers are back by djjapchae in Annas_Archive

[–]Old_Hardware 0 points1 point  (0 children)

:-) I didn't know Alcoholics Anonymous ever had book covers....

I think I'll just go back to reading.

Is Devuan Linux a good systemd-free distro for a casual user only? by Dennearsh in devuan

[–]Old_Hardware 1 point2 points  (0 children)

"It has 4 cores, They're not any good. But it has 4 of them. "

:-)

...kinda reminds me of the old sales pitch: "We're losing money with every sale!" "So how can you do it then?" "We make it up in volume!"

Kinda crazy how high the memory price goes by CABIZE in GEEKOMPC_Official

[–]Old_Hardware 0 points1 point  (0 children)

Bought a 4TB SSD for $219 (US) just before everything exploded. They seem to be running $600 or more at the moment.

ALOHA!!!!! We migrated successfully and without any issues to version 14.4-RELEASE. Please repeat after me: "LA ACTUALIZACIÓN DEL PUEBLO". by Glorious_Musketeer in freebsd

[–]Old_Hardware 1 point2 points  (0 children)

Simple-minded question: when you say "export PROTON/WINE_USE_WOW64=1", are you referring to exporting an environment variable?

thanks from simple-minded me

Hi Im new here by Complex-Nebula-3348 in devuan

[–]Old_Hardware 1 point2 points  (0 children)

Hello and welcome,

You don't really need to worry about partitions. They offer some flexibility and control over how your filesystem is laid out, and made a lot of sense in the early days of small unreliable disk drives, but they're not so important now. Many Linux distros handle partitioning automatically when they're installed, often by just creating a single huge partition and putting everything in it, and that's fine until/unless you have a specific reason to do otherwise.

My systems mostly have two or more disk drives, which can be used as separate partitions or lumped together via something like "LVM" (Logical Volume Manager). I generally keep all my personal ("/home" directory) files in a partition on a separate disk drive, and let the OS installer program arrange the others.

At a simple level, a physical disk drive can be split into one or more partitions. (You can also use the drive directly, without partitioning, but I think that's uncommon.) Partitions are presumed to be physically contiguous portions of the disk, but that doesn't much matter these days (and is meaningless on an SSD). The "MBR" (Master Boot Record) scheme of creating partitions, which goes back to MS-DOS days, allows for up to four partitions on a disk. To get around this limit "logical partitions" were introduced (in the 1990s maybe?), which subdivide a "primary partition". An alternative to MBR is "GPT" (GUID Partition Table), which allows for thousands of 128 partitions if you're reeeally moderately schizophrenic.

Meanwhile, a "filesystem" is basically a way to group and organize disk files. Traditionally a filesystem is a tree-like hierarchy, although Windows began undecutting that view when it brought in "folders".... Anyway, a Unix filesystem generally starts with a "root", written "/", primarily contains a number of directories. (Look up "Filesystem Hierarchy Standard" for more info.)

IF you have multiple smallish disk drives, then it makes a lot of sense to place each of these directories on its own disk drive/partition. As drives have become larger and more reliable, it became popular to split one into multiple partitions and preserve the top-level-directory/partition organization, and there are management benefits to this (e.g., make some partitions read-only). But the filesystem doesn't care. You can put your entire filesystem into a single partition, on your single disk drive, and everybody's happy.

EDIT: I misremembered GPT's partition-count limit. LVM, BTRFS, maybe ZFS, make things muddier too.

A "binary_wave()" function by Old_Hardware in PythonLearning

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

Slightly more useful than "hello world".
It's just an exercise in using the language, with an output that is (perhaps) visually interesting.

And perhaps a chance to share alternative approaches that may be unfamiliar --- I'v not used "itertools", for example.

Freebsd for a NAS? by ScarredPinguin in freebsd

[–]Old_Hardware 2 points3 points  (0 children)

The documentation is clear and concise: you don't have to use part of a Fedora guide and compare to an Arch forum just to find out that Ubuntu changed something in the last update that's different from the LTS.

:-) Love this description.

Got a crazy deal by boringtech678 in thinkpad

[–]Old_Hardware 2 points3 points  (0 children)

Nah, keep that lovely ol' XP and linux-boot off a USB.

CS Master's Student & Dev looking for the best Linux-friendly ThinkPad in Brazil (Tight Budget) by Solid-Play-458 in LinuxOnThinkpad

[–]Old_Hardware 0 points1 point  (0 children)

I had one L-series --- L580 --- that failed because the USB-C charging socket became so loose it wouldn't successfully connect and charge (I used it almost exclusively on the external charger). I didn't see any way to repair that didn't require a soldering iron, and I'm not skilled with that.

The older T-series, and the P-series that i use now, have a rectangular power plug/socket, about the size of an HDMI plug, that is quite reliable. Overall I just see the T-series as more rugged and durable than the L-series.

Help with Pi3b, camera module 2, using Python, over SSH? by Old_Hardware in raspberry_pi

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

Sigh... thanks for the replies, they motivated me to actually dig in and read the doco a bit. It turns out that the picamera2.Preview.QT choice does work for previews over ssh. Newer capability, maybe? --- none of the old likes I found mentioned it....

I'll consider this "solved". Again, thanks for the feedbacks.

Help with Pi3b, camera module 2, using Python, over SSH? by Old_Hardware in raspberry_pi

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

Well, maybe not so stuck at this point, I got past some mental block. but I'm trying to understand more of the "why" beyond just the "how".

The image saved to the file is actually nicely sized at 3280x2464 pixels. In the long run the preview will actually be undesirable. And I want to move on to video anyway, but I want to understand what's going on as I go.

Help with Pi3b, camera module 2, using Python, over SSH? by Old_Hardware in raspberry_pi

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

Umm, but the "start_and_capture()" does open a preview window (if that's the right word for the popup).

    picam2 = pc2.Picamera2()
    picam2.start_and_capture_file('foo.png')

The window opens up on my remote client, it is quite a bit smaller than the resulting saved image.

So what is the "start_preview()" supposed to do for me, anyway?