Go to advanced search

by jojopi
Thu Jul 11, 2019 6:17 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 726
Views: 27047

Re: A Final Fidonacci Challenge

I have not followed all of the past discussion on this problem, so apologies if this idea has been proposed before. Without mentioning names, I recently became aware of a solution in BBC BASIC V on RISC OS. It does not give a fully correct result do to a slight bug in the carry handling. But what re...
by jojopi
Sat Jun 29, 2019 12:46 pm
Forum: C/C++
Topic: Quick log2????
Replies: 35
Views: 851

Re: Quick log2????

GCC provides __builtin_clz(), et al, which will emit the hardware bit counting instruction when available, or otherwise call a helper function for the architecture. Traditionally you would want to try to avoid these operations in code that needs to be both fast and portable. On platforms without the...
by jojopi
Sat Jun 29, 2019 9:17 am
Forum: Raspbian
Topic: Buster bug report thread
Replies: 106
Views: 7500

Re: Buster bug report thread

The Debian package policykit-1 provides a file /etc/polkit-1/localauthority.conf.d/51-debian-sudo.conf that says: [Configuration] AdminIdentities=unix-group:sudo In the corresponding Raspbian package, this file is missing. The omission means that admin users cannot reboot or install packages, or are...
by jojopi
Fri Jun 28, 2019 7:40 am
Forum: Raspbian
Topic: Buster bug report thread
Replies: 106
Views: 7500

Re: Buster bug report thread

The following additional packages will be installed: libjansson4 libnftables0 nftables The iptables package recommends nftables, but does not require it. Whether recommended packages are included depends on method and options such as --no-install-recommends. This is not a bug, unless you are saying...
by jojopi
Thu Jun 27, 2019 2:27 pm
Forum: Other projects
Topic: Calculating Inductance
Replies: 9
Views: 1286

Re: Calculating Inductance

If you pass a constant 1 Amp through a 1 Henry inductance, the Voltage will increase by 1 Volt per Second. No, if the current in a one henry inductor is changing at a rate of one ampere per second, the emf will be one volt. Your definition is actually a one farad capacitor. Which is going to explode.
by jojopi
Wed Jun 26, 2019 11:14 pm
Forum: Beginners
Topic: cron job not being run
Replies: 7
Views: 700

Re: cron job not being run

I am attempting to learn how to use cron on the raspberry Pi. Are you really attempting to learn about cron, or are you attempting to fix a problem with "mydevices agent" or whatever? 5 * * * * date >> /home/pi/testing_cron which I believe should run the date command every hour at 5 minutes past th...
by jojopi
Wed Jun 26, 2019 7:32 pm
Forum: Raspbian
Topic: Issues changing keyboard in raspi-config
Replies: 8
Views: 765

Re: Issues changing keyboard in raspi-config

I love this bug! There is a typical Debian Perl script, /usr/share/console-setup/kbdnames-maker that is responsible for looking up the translations of every keyboard layout and variant in every language. This script has not changed since stretch, but apparently something has changed in Locale::gette...
by jojopi
Tue Jun 25, 2019 9:43 pm
Forum: General discussion
Topic: Users via ssh can't scan with Raspbian Buster anymore
Replies: 9
Views: 736

Re: Users via ssh can't scan with Raspbian Buster anymore

/lib/udev/rules.d/* have changed between stretch and buster. In stretch, 60-libsane.rules identified any device supported by SANE, gave it ENV{libsane_matched}="yes", and then because of that applied a fACL granting rw access to group "scanner". In buster, 60-libsane.rules still identifies supported...
by jojopi
Tue Jun 25, 2019 7:48 pm
Forum: General discussion
Topic: Upgrading from Stretch to Buster: Any experiences?
Replies: 2
Views: 308

Re: Upgrading from Stretch to Buster: Any experiences?

I have done it. It is the kind of thing that will only ever cause problems if you do not know how to fix them—but then you could lose all your data. However, I would not really recommend version upgrading on an SD card even if you are confident of fixing any issues. For one thing, updating a hundred...
by jojopi
Thu Jun 20, 2019 1:26 pm
Forum: Beginners
Topic: Error using SSH for raspberry pi - Permission denied (public key password)
Replies: 8
Views: 387

Re: Error using SSH for raspberry pi - Permission denied (public key password)

I am using a raspberry with Ubuntu MATE OS whenever I used the default password "raspberry" If you got the image from https://ubuntu-mate.org/raspberry-pi/, then according to that page: There are no predefined user accounts. The first time you boot the Ubuntu MATE image it will run through a setup ...
by jojopi
Mon Jun 17, 2019 1:53 pm
Forum: Off topic discussion
Topic: how heavy is raspbian ?
Replies: 30
Views: 3615

Re: how heavy is raspbian ?

Given that the Pi and it's SD card will be electrically neutral no matter if the SD is programmed on blank, it will always have the same mass. The charges on those gates are balanced elsewhere. Certainly in a regular capacitor we would expect the electrons added to the negative plate to be closely ...
by jojopi
Fri Jun 14, 2019 1:49 am
Forum: Beginners
Topic: USB Numeric Keypad with RPI3
Replies: 4
Views: 220

Re: USB Numeric Keypad with RPI3

Note, a regular keyboard will control the PDF document as inteneded with the stand alone directional arrows but now with arrows on keypad, something we failed to note during first attempts. So, the unspecified application you are running treats the keypad arrows differently than the dedicated arrow...
by jojopi
Sat May 25, 2019 6:18 am
Forum: General discussion
Topic: Incorrect mapping of the 79 keys official keyboard
Replies: 8
Views: 694

Re: Incorrect mapping of the 79 keys official keyboard

It does seem strange to go with a hybrid layout that is not completely supported in the recommended operating system. However, the initial announcement last month said that these keyboards can report their country to the host, so maybe RPF/T plan to add software to configure them at some point. Out ...
by jojopi
Wed May 22, 2019 7:01 pm
Forum: Networking and servers
Topic: UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 532: invalid start byte
Replies: 5
Views: 488

Re: UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 532: invalid start byte

The error corresponds to the fancy apostrophe (right single quotation mark) in "the system’s owner". That would be 0x92 in legacy single-byte Windows encodings, such as CP1252. In UTF-8 it should be the three byte sequence e2-80-99. Alternatively it could be replaced with a non-fancy ASCII apostroph...
by jojopi
Wed Apr 17, 2019 1:57 pm
Forum: Troubleshooting
Topic: Environment variables vs. bash and lxterminal
Replies: 2
Views: 186

Re: Environment variables vs. bash and lxterminal

(Weirdly, I did `ls -lut ~/.bash*` and none of them seemed to have been accessed recently!) You cannot rely on access times. Many distros and images mount filesystems with the "noatime" or "relatime" options by default. Especially on an SD card, where small writes are costly, frequent access time u...
by jojopi
Tue Apr 02, 2019 12:13 am
Forum: C/C++
Topic: ATEXIT behavior
Replies: 17
Views: 2308

Re: ATEXIT behavior

dlclose returns and atexit calls function. By that time linux has not yet removed library. No, the function registered via atexit is called during the dlclose, before dlclose returns. By the time dlclose returns, the library and function have been removed from the address space. (POSIX does not gua...
by jojopi
Mon Apr 01, 2019 11:42 pm
Forum: Python
Topic: For Loop
Replies: 1
Views: 210

Re: For Loop

Simpler examples: for i in "abc": print(i) for i in [1,2,3]: print(i) for i in "abc", [1,2,3]: print(i) In the first case there is a string, and for iterates over the characters in the string. In the second case there is a list, and for iterates over the objects in the list. In the third case there ...
by jojopi
Mon Apr 01, 2019 10:46 pm
Forum: Advanced users
Topic: crontab and DST issue
Replies: 4
Views: 371

Re: crontab and DST issue

The job ran at the correct time, and cron jobs by default use the same timezone as cron itself. The date argument "last month" means the same as "1 month ago", or "now -1 month". The month is subtracted without changing timezone/dst values. (I am not sure if that is really as intended, and the docum...
by jojopi
Sat Mar 30, 2019 9:09 am
Forum: C/C++
Topic: ATEXIT behavior
Replies: 17
Views: 2308

Re: ATEXIT behavior

"man atexit" says that since glibc 2.2.3, functions registered from within a shared library will be called when the library is unloaded. This resolves the potential crash of trying to call them after they have been unmapped. Putting a sleep() between dlclose() and exit(), this is indeed what is happ...
by jojopi
Mon Feb 11, 2019 5:32 am
Forum: Debian
Topic: Porting Debian ARM to the Raspberry Pi
Replies: 8
Views: 2168

Re: Porting Debian ARM to the Raspberry Pi

This thread is about porting vanilla Debian (not Raspbian) to the Raspberry Pi. My goal is to provide an armel image that boots on all Pi models, an armhf image that boots on the Pi 2 and 3, and an arm64 image that boots on the Pi 3. I would not call that porting Debian to the Raspberry Pi. I would...
by jojopi
Fri Feb 08, 2019 5:32 pm
Forum: Advanced users
Topic: Device Names of USB Serial ports
Replies: 4
Views: 394

Re: Device Names of USB Serial ports

There are standard udev rules that create predictably-named symlinks under /dev/serial/by-id/, based on the USB descriptors, and /dev/serial/by-path/, based on the physical port numbering. You will need to use by-path if the two devices are otherwise identical. The predictable names are a bit cumber...
by jojopi
Fri Feb 08, 2019 11:20 am
Forum: Beginners
Topic: how to delete accidently named files?
Replies: 5
Views: 336

Re: how to delete accidently named files?

Also: rm udo, then press [Tab⭾].

Tab completion is something you always want to be using for long file names, independent of whether they contain odd characters.

rm "udo or rm 'udo before pressing Tab will try to complete using quotes, instead of backslash escapes.
by jojopi
Fri Feb 08, 2019 8:36 am
Forum: Beginners
Topic: Remotely Changing Website Passwords
Replies: 2
Views: 169

Re: Remotely Changing Website Passwords

The key fob you are referring to would be something like RSA SecurID . That is a form of two-factor authentication, where to log in you need to both know the user's password and be in possession of their physical token. The token is designed so that it is impractical to extract the internal secret k...
by jojopi
Thu Feb 07, 2019 5:34 pm
Forum: Python
Topic: Deleting directory created by other user
Replies: 5
Views: 332

Re: Deleting directory created by other user

Write permission on a file allows you to modify the file. To remove or rename the file, you need write access to the containing directory. Similarly, write permission on a directory allows you to create and remove files inside it. To remove the directory itself you need write access to its parent. N...
by jojopi
Mon Feb 04, 2019 5:43 am
Forum: Python
Topic: Keyboard input
Replies: 13
Views: 1136

Re: Keyboard input

Installation should be basically: sudo apt update sudo apt install python3-pip sudo pip3 install evdev The type field tells you if it is a key event or something else. The value field indicates whether a key event is up (0), down (1), or hold (2). I do not think there exist symbolic names for those ...

Go to advanced search