Search found 4853 matches

by technosaurus
Fri 23 Feb 2018, 05:49
Forum: Programming
Topic: A simple way to detect an odd or even number in bash
Replies: 25
Views: 5668

for a non bashism version (as long as parameters don't contain spaces) isnumber() [[ $(($1+0)) = ${1} ]] AFAIK double brackets are not POSIX compliant though bash supports them also in its "more closely to the POSIX standard" mode. crap, you are right, always get that backwards - it shoul...
by technosaurus
Fri 23 Feb 2018, 03:09
Forum: Programming
Topic: A simple way to detect an odd or even number in bash
Replies: 25
Views: 5668

MochiMoppel wrote:For a bullet proof check this should do:

Code: Select all

[[ $N =~ ^-?[0-9]+$ ]] || exec echo $N is not an integer
for a non bashism version (as long as parameters don't contain spaces)

Code: Select all

isnumber() [[ $(($1+0)) = ${1} ]]
by technosaurus
Fri 23 Feb 2018, 02:44
Forum: Programming
Topic: A simple way to detect an odd or even number in bash
Replies: 25
Views: 5668

Flash wrote:Not to hijack the thread, I'd like to throw in that a prime number cannot be an even number.
2
by technosaurus
Thu 22 Feb 2018, 23:42
Forum: Programming
Topic: A simple way to detect an odd or even number in bash
Replies: 25
Views: 5668

For any language with bitwise operations (like bash), just use &1; however, posix shell lacks bitwise ops, so you need to use the modulus operator % iseven() [[ $(($1%2)) = 0 ]] isodd() [[ $(($1%2)) = 1 ]] Hi technosaurus. Playing with your formula, like a kid with dough! n=33;[ $[$n%2] = 0 ] &...
by technosaurus
Thu 22 Feb 2018, 10:34
Forum: Programming
Topic: A simple way to detect an odd or even number in bash
Replies: 25
Views: 5668

For any language with bitwise operations (like bash), just use &1; however, posix shell lacks bitwise ops, so you need to use the modulus operator %

Code: Select all

iseven() [[ $(($1%2)) = 0 ]]
isodd()  [[ $(($1%2)) = 1 ]]
by technosaurus
Fri 16 Feb 2018, 00:46
Forum: Programming
Topic: Unbloated coding resources
Replies: 56
Views: 81205

Here are github projects to replace larger versions:
pulseaudio
systemd
logind
udev
libevent
alsa
x11
xserver
glibc over musl
by technosaurus
Fri 16 Feb 2018, 00:45
Forum: Programming
Topic: Unbloated coding resources
Replies: 56
Views: 81205

by technosaurus
Thu 01 Feb 2018, 19:42
Forum: Programming
Topic: init from the kernel side -- s243a's legacy bumbling.
Replies: 3
Views: 1708

Yeah, the codebase is admittedly bloated. I usually just Google the function and go to whatever free-electrons page comes up ... they show where each symbol is defined and where it is used.
by technosaurus
Thu 01 Feb 2018, 01:31
Forum: Programming
Topic: init from the kernel side -- s243a's legacy bumbling.
Replies: 3
Views: 1708

The kernel code is actually pretty easy to read, check out kernel_init in https://git.kernel.org/pub/scm/linux/ke ... .c?h=v4.15
by technosaurus
Thu 01 Feb 2018, 01:26
Forum: Programming
Topic: GUI dialog tool and serial IO (Solved)
Replies: 6
Views: 3800

There are plenty of examples in the gtkdialog tips thread as well as the gtkdialog source, but the best way is to look at the script of a program that does something similar to what you want.
by technosaurus
Thu 01 Feb 2018, 01:15
Forum: Truly off-topic conversations
Topic: U.S. tax code
Replies: 18
Views: 453

I have often thought it would be beneficial to have a "simplification movement" where any bill, law or code longer than 100 pages is rewritten to 10% of its original size in plain language. As for the tax code itself, I'm all for a flat "disposable income tax" where only the inco...
by technosaurus
Wed 31 Jan 2018, 23:43
Forum: Programming
Topic: Unbloated coding resources
Replies: 56
Views: 81205

smaller alternative to tinyX http://galos.no-ip.org/siX Good morning ,do you have the file ? I think galos is offline. Sorry for the late reply. The copy of siX that I had, does not include a license, so I can' repost it, but I did find some info here: http://betteros.org/tut/graphics1.php Its actu...
by technosaurus
Fri 22 Dec 2017, 12:14
Forum: Browsers and Internet
Topic: How about Basilisk (experimental) browser?
Replies: 14
Views: 4416

It looks like it may be able to do netflix - I may have a go at it.
by technosaurus
Fri 08 Dec 2017, 03:19
Forum: Puppy Derivatives
Topic: Quirky Pyro64 version 0.6 (alpha) -- and Pyro32 0.5
Replies: 212
Views: 82604

I tried to get the samba server to be recognized by a second computer and it still fails to connect. Has anybody succeeded ? __________________________________________________ It is about time that I actually used samba myself! I am going to install Open Media Vault, have downloaded the iso. This i...
by technosaurus
Wed 06 Dec 2017, 17:55
Forum: Cutting edge
Topic: Linux on Intel Management Engine?
Replies: 3
Views: 2605

At the moment, its possible to reflash the firmware on systems that have it "enabled" for the user (mostly business class machines) but the images have to be signed. From what little I have found out though, it uses a builtin ARC processor (yes ARC, not ARM - not a typo) so it would be a l...
by technosaurus
Tue 05 Dec 2017, 03:54
Forum: Puppy Derivatives
Topic: Quirky Pyro64 version 0.6 (alpha) -- and Pyro32 0.5
Replies: 212
Views: 82604

Yes, I found that source yesterday, waitforX.c: https://sourceforge.net/projects/tinycoremeta4s/files/source/tinycorelinux/3.x/release/src/ Here is a shell function to replace waitforX waitforX(){ while ([ ! -S /tmp/.X11-unix/X0 ]) do sleep .1;done } On second though, if you run multiple Xservers t...
by technosaurus
Tue 05 Dec 2017, 00:55
Forum: Cutting edge
Topic: Linux on Intel Management Engine?
Replies: 3
Views: 2605

Linux on Intel Management Engine?

If you haven't heard about Intel ME, its basically a backdoor built into newer Intel chips with Minix built in to on chip programmable persistent memory (I'm not sure what type) Intel presumably used Minix due to Linux's GPL license and the relative size of Minix vs the various BSDs, but if we were ...
by technosaurus
Mon 04 Dec 2017, 23:54
Forum: Puppy Derivatives
Topic: Quirky Pyro64 version 0.6 (alpha) -- and Pyro32 0.5
Replies: 212
Views: 82604

strange you mention the blank screen with blinking cursor....I am experiencing this with new builds of Xenialpup 32 bit built with woof-CE testing recently. nothing is responsive but when power button is pressed the test sound is played (similar to woof-woof) no noticeable errors and does it also w...
by technosaurus
Mon 04 Dec 2017, 17:55
Forum: Puppy Derivatives
Topic: Quirky Pyro64 version 0.6 (alpha) -- and Pyro32 0.5
Replies: 212
Views: 82604

2. This is an odd one. In Quirky 0.5/06, using jwm 2.3.7, one of the icons does not display in the menu. Everything is setup correctly. the pavrecord.desktop file has "Icon=mini-record.xpm" and the .jwmrc has the path to the icon, but it does not display. (see Multimedia menu in Quirky). ...
by technosaurus
Mon 04 Dec 2017, 03:37
Forum: Puppy Derivatives
Topic: Quirky Pyro64 version 0.6 (alpha) -- and Pyro32 0.5
Replies: 212
Views: 82604

Yeah, that blinking cursor on blank screen is odd, I have sometimes got that too. JWM must be running. I have asked Joe, the author of jwm, for any thoughts on that. I am using jwm 2.3.7, which has at least two bugs, that I have informed Joe about. I wonder if get that blank screen if I roll jwm ba...