Go to advanced search

by jojopi
Wed Jun 23, 2021 6:14 pm
Forum: Troubleshooting
Topic: Forgotten keyboard setup after reboot
Replies: 5
Views: 158

Re: Forgotten keyboard setup after reboot

Even if I connect a second USB keyboard directly for test purposes, the layout of the USB keyboard is always correct, but the wireless keyboard is always incorrect. By default, all keyboards are treated the same. There is one layout, which applies to all. There is one NumLock state, which applies t...
by jojopi
Sun Jun 20, 2021 8:16 pm
Forum: C/C++
Topic: TIL: "==" is not "is equal" for "double"
Replies: 58
Views: 1618

Re: TIL: "==" is not "is equal" for "double"

The digits are not random.

The number was exactly 2^1023.
by jojopi
Sun Jun 20, 2021 7:00 pm
Forum: General discussion
Topic: GPIO-Key to Toggle Desktop Windows
Replies: 2
Views: 212

Re: GPIO-Key to Toggle Desktop Windows

Linux keycodes are listed starting around line 76 of input-event-codes.h . They are normally given in decimal. Your chart appears to relate to Windows. It agrees closely for the first 70 entries (both are originally based on IBM PC scan codes), and then there is a disagreement about whether code 71/...
by jojopi
Sun Jun 20, 2021 1:35 pm
Forum: General
Topic: Incorrect time generation in pi pico.
Replies: 5
Views: 207

Re: Incorrect time generation in pi pico.

Your calculation of year and day seem unlikely to be reliable. You are dividing by 365, but multiplying by 365.25. Anyway, the fact that the first leap day is during year zero, rather than at the end of year three, makes it difficult to get the results you want using truncated linear functions. I su...
by jojopi
Sat Jun 19, 2021 7:25 pm
Forum: Advanced users
Topic: 8-bit character console?
Replies: 6
Views: 293

Re: 8-bit character console?

On x86 hardware there's usually a way to do this, by disabling the framebuffer in the kernel command line. Then the kernel will just interact with the display as if it were a traditional VGA device. It makes no difference. The Linux framebuffer console closely emulates the limitations of VGA text m...
by jojopi
Fri Jun 18, 2021 12:01 pm
Forum: Advanced users
Topic: startx at boot single client and unprivileged user
Replies: 29
Views: 900

Re: startx at boot single client and unprivileged user

rpdom wrote:
Fri Jun 18, 2021 11:48 am
I think that "drtechno" is referring to the /etc/crontab file for some reason. Not the user crontabs.
But /etc/crontab has a user field between the dates and the command, so it is not "always root" either.

"drtechno" is almost always wrong. It is almost scary.
by jojopi
Thu Jun 17, 2021 12:46 pm
Forum: Troubleshooting
Topic: Self Signed Certificate is always expired.
Replies: 1
Views: 79

Re: Self Signed Certificate is always expired.

The expiry date is one year in the future, as is shown in the error message. The problem is that the certificate is not trusted as a root certificate and has no chain of trust back to any trusted root. This is always the case with self-signed certificates. Unless you get them signed by a recognized ...
by jojopi
Thu Jun 17, 2021 12:28 pm
Forum: Java
Topic: Create a program in Java wherein if a year is a leap year will return true otherwise false
Replies: 13
Views: 831

Re: Create a program in Java wherein if a year is a leap year will return true otherwise false

Are we actively trying to be unhelpful? (Especially Heydt.) There should be a specification for how a particular year is requested, what range is expected, and how the result is to be returned. There is no point in us guessing what all that might be. We can all design a program, but OP will only get...
by jojopi
Tue Jun 15, 2021 3:47 pm
Forum: SDK
Topic: [SOLVED] Problem filling my array [BUT WHY?]
Replies: 6
Views: 364

Re: [SOLVED] Problem filling my array [BUT WHY?]

DarkElvenAngel wrote:
Tue Jun 15, 2021 3:26 pm
data <<= 4 * (count % 2);

((data & 0x0f) << ( 4 * count % 2));
* and % have the same precedence and associate from left from right. You need the parentheses around the modulo.

Or (count % 2 * 4), but that may be not the best style.
by jojopi
Tue Jun 15, 2021 2:56 pm
Forum: Advanced users
Topic: How to check the speed of encryption
Replies: 12
Views: 669

Re: How to check the speed of encryption

Thanks all, I was at a loss to explain why rcp was the same as scp, but seems clear if they are now using the same backend. You just have not installed any rlogin packages, so the rcp symlink is pointing to scp ? Installing rsh-client will provide netkit-rcp and should change the symlink via update...
by jojopi
Tue Jun 15, 2021 1:14 pm
Forum: General discussion
Topic: printout from python to txt ?
Replies: 32
Views: 827

Re: printout from python to txt ?

script -c 'yourPythonFile.py YourPythonFIleArg1 YourPythonFileArg2 ...' /home/pi/Logs/TheLogFile.txt Note that you probably want to add -f to the command line Yes. Like anything implemented using the standard C library, script buffers its output to make efficient use of operating system calls. All ...
by jojopi
Tue Jun 15, 2021 11:23 am
Forum: General discussion
Topic: printout from python to txt ?
Replies: 32
Views: 827

Re: printout from python to txt ?

Like anything implemented using the standard C library, CPython buffers its output to make efficient use of operating system calls. When the output is connected to a file, it will be buffered in blocks. This means nothing will be written to the file until there is a full block of output (typically 4...
by jojopi
Mon Jun 14, 2021 5:14 pm
Forum: Advanced users
Topic: differentiate console boot from desktop boot in bash for autostart - using environment variable? or?
Replies: 6
Views: 330

Re: differentiate console boot from desktop boot in bash for autostart - using environment variable? or?

~/.bash_profile Aside, you should not create ~/.bash_profile, because that will take precedence over Debian's existing ~/.profile, and that in turn means that ~/.bashrc will also not be read. A lot of advice on the internet about startup files is accidentally distribution specific. You should alway...
by jojopi
Mon Jun 14, 2021 12:34 pm
Forum: Advanced users
Topic: startx at boot single client and unprivileged user
Replies: 29
Views: 900

Re: startx at boot single client and unprivileged user

Whether from cron, rc.local or systemd trying to run startx /path/to/program as a user other than root always fails with a permission denied error on the tty. I have a few workarounds but none are ideal: Normally the user is granted access to their terminal as part of the login process. If you want...
by jojopi
Fri Jun 04, 2021 5:10 pm
Forum: Beginners
Topic: "find" doesn't find a certain file
Replies: 103
Views: 3088

Re: "find" doesn't find a certain file

Is that a fact (with a reference) or just your opinion? I think it is what I was taught. Holden Caulfield uses contractions in writing. Almost all other authors and narrators do not. Also, if you are a genie, you don't use contractions (in speech). I do not know any genies. The android character Da...
by jojopi
Fri Jun 04, 2021 3:39 pm
Forum: Beginners
Topic: "find" doesn't find a certain file
Replies: 103
Views: 3088

Re: "find" doesn't find a certain file

You do get marks for spelling "you're" correctly. Well done. One should never use contractions in writing, unless quoting speech. I have been thinking about your directory versus folder elitism concerns. Really the problem is that the folder analogy is so bad, not that it is used by the w...
by jojopi
Fri Jun 04, 2021 1:03 pm
Forum: Beginners
Topic: unknown device
Replies: 15
Views: 521

Re: unknown device

A card reader should appear in dmesg and lsusb when inserted. Even if there is no card in it at the time. (Unless someone has invented SD cards that natively support USB protocol, so the reader can be just a passive adapter.) Nothing at all in dmesg suggests that the USB data lines are not connected.
by jojopi
Fri Jun 04, 2021 12:34 pm
Forum: Python
Topic: beginners failure?
Replies: 4
Views: 189

Re: beginners failure?

Presumably the original intention was for the GPIO.cleanup() to be outside (after) the for loop, rather than absent.

It should not be indented, and preferably there should be a blank line before it.
by jojopi
Thu Jun 03, 2021 9:19 pm
Forum: Ubuntu
Topic: ubuntu 21.04 -- keyboard not typing in apps
Replies: 17
Views: 2394

Re: ubuntu 21.04 -- keyboard not typing in apps

"gkr-pam: unable to locate daemon control file" Your distribution has pam_gnome_keyring enabled, but you are not running gnome-keyring? No need to check environment variables unless there is a problem. "pam_unix(lightdm:session): session opened for user pi by (uid=0)" That is no...
by jojopi
Thu Jun 03, 2021 8:57 pm
Forum: Ubuntu
Topic: Ubuntu Server showing multiple IP addresses on the network
Replies: 11
Views: 474

Re: Ubuntu Server showing multiple IP addresses on the network

reset a file,file, structure or key from install script You need to be the user root for file permissions already set in storage. If that explains what that does better than the linux man pages. No, the man page is better. dconf - Simple tool for manipulating a dconf database reset Reset a key or a...
by jojopi
Wed Jun 02, 2021 4:01 pm
Forum: Ubuntu
Topic: ubuntu 21.04 -- keyboard not typing in apps
Replies: 17
Views: 2394

Re: ubuntu 21.04 -- keyboard not typing in apps

drtechno wrote:
Wed Jun 02, 2021 11:34 am
This Pi images return:
0
Which is not a proper nor valid UID for it on any platform.
Zero is the uid of the superuser. Did you use sudo -i again ?
by jojopi
Wed Jun 02, 2021 3:30 pm
Forum: Ubuntu
Topic: Ubuntu Server showing multiple IP addresses on the network
Replies: 11
Views: 474

Re: Ubuntu Server showing multiple IP addresses on the network

Another way they might accomplish this is to reset the entire installation by using: sudo -i dconf reset -f / Does that not just reset the root user's GUI preferences in /root/.config/dconf/user ? I would not have expected the root user to have any personal preferences, or for them to affect system...
by jojopi
Wed Jun 02, 2021 9:38 am
Forum: Beginners
Topic: Automatically modify fstab BEFORE boot
Replies: 35
Views: 1183

Re: Automatically modify fstab BEFORE boot

the result of expanding/moving partitions is that the PARTUUID is changing, so now instead of the original: PARTUUID=system-01, I have something like: PARTUUID=newsys-01 I do not see why. It is certainly possible to repartition a device without completely relabelling it, and that should be the norm...
by jojopi
Mon May 31, 2021 1:29 am
Forum: Troubleshooting
Topic: Official Keyboard Scroll Lock
Replies: 2
Views: 126

Re: Official Keyboard Scroll Lock

Interestingly, the product page for the official keyboard does explain what they think ScrLk should do. But that is not the behaviour I see in Raspberry Pi OS (with a non-Raspberry keyboard), nor is it what I would expect. On the Linux console, Scroll Lock stops output to the terminal until you pres...
by jojopi
Sun May 30, 2021 9:02 pm
Forum: Beginners
Topic: Mac Keyboards for UK AGAIN Locales etc
Replies: 16
Views: 910

Re: Mac Keyboards for UK AGAIN Locales etc

So it seems to me all these keys etc can be referred too in different ways. Linux refers to physical keys using platform-independent keycodes, usually given as decimal. The list starts around line 76 of input-event-codes.h . The names are based on the primary function the key has in a US layout . K...

Go to advanced search