Search Results

Search: Posts Made By: wisecracker
178
Posted By wisecracker
Hi sea... As with Chubler_XL the more...
Hi sea...

As with Chubler_XL the more verbose the command the better.
The rest is your personal choice except perhaps that echo should be kept in its POSIX simplest form to make it as portable...
Forum: OS X (Apple) 6 Days Ago
386
Posted By wisecracker
Hi MadeInGermany... Although there is a...
Hi MadeInGermany...
Although there is a workaround this is an edge case:
#!/usr/local/bin/dash
# lead_zeros.sh

# This is a gotcha...
# There will always be 6 zeros sooner or later, 000000.
...
Forum: OS X (Apple) 1 Week Ago
386
Posted By wisecracker
Well the C source does not compile on a current...
Well the C source does not compile on a current update, 19-01-2020, Linux Mint 19 using gcc 7.4.0 so here is a completely simplified and modified version for gcc 4.2.1 and 7.4.0...
The printf ...
Forum: OS X (Apple) 1 Week Ago
386
Posted By wisecracker
As the clock is very quickly cycling inside the...
As the clock is very quickly cycling inside the microsecond part there is always a possibility of these values '00000' to '09999' occurring. These are obviously NOT octal but decimal with leading...
Forum: OS X (Apple) 1 Week Ago
386
Posted By wisecracker
Generate a random number in a fully POSIX compliant shell, 'dash'...
Hi all...
Apologies for any typos, etc...
This took a while but it didn't beat me...

Although there are many methods of generating random numbers in a POSIX shell this uses integer maths and a...
Forum: Shell Programming and Scripting 3 Weeks Ago
616
Posted By wisecracker
The perfect example to RudiC's post #6... OSX...
The perfect example to RudiC's post #6...
OSX 10.14.6 default bash terminal...

Last login: Fri Jan 3 13:50:35 on console
AMIGA:amiga~> set
...
IFS=$' \t\n'
...
AMIGA:amiga~> _
863
Posted By wisecracker
Using Python 2.7.x and 3.7.x... ...
Using Python 2.7.x and 3.7.x...


#!/bin/bash
# inline.sh
echo "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness..." > /tmp/text
...
Forum: Shell Programming and Scripting 4 Weeks Ago
841
Posted By wisecracker
Hi Chaos_Lord... Just an observation; you...
Hi Chaos_Lord...

Just an observation; you have shown figures that apparently create a true integer value on integer division...
What happens if the number of seconds is not fully divisible by 60?...
Forum: What is on Your Mind? 4 Weeks Ago
711
Posted By wisecracker
Apologies for any typos. No it doesn't make...
Apologies for any typos.

No it doesn't make you dumb, it means you have not found your niche to create an "_app'_" to take on and maybe even excel at compared to your peers.
It also means that...
Forum: What is on Your Mind? 4 Weeks Ago
711
Posted By wisecracker
A terrific quote:
Food for thought!

"""
Everybody in this country should learn to program a computer...because it teaches you how to think.
"""
Steve Jobs.

So, SO, true!

Merry XMAS all...
Forum: Programming 4 Weeks Ago
1,064
Posted By wisecracker
Hopefully this does NOT attach to the previous...
Hopefully this does NOT attach to the previous post #4...
Hi Neo...

Here is another little snippet aimed at WinUAE, the AMIGA emulator, I created also around 2008-9, if you are interested...
(It...
Forum: Programming 4 Weeks Ago
1,064
Posted By wisecracker
Apologies to everyone... The circuit GIF...
Apologies to everyone...

The circuit GIF image is incorrect this is the correct one:
(I will correct the zipfile and reload...)


EDIT:
This image is now in post #1...

7936
Forum: Programming 4 Weeks Ago
1,064
Posted By wisecracker
More Arduino Stuff...
HI all...
(Apologies for any typos.)

To add to Neo's Arduino subject matter I have decided to upload this in ".zip" format.
Ignore "*.info" files these are AMIGA icons only and also the "HAM"...
Forum: Programming 12-19-2019
1,977
Posted By wisecracker
Hi Neo... Apologies for any typos... ...
Hi Neo...
Apologies for any typos...

Remember to quote your Arduino Programmer version as there have been a great many variations over the years. Mine is Version 0015 and is ancient along with my...
Forum: Programming 12-13-2019
1,491
Posted By wisecracker
E**(i*pi)=-1 or e**(j*pi)=-1, something I found out in Python using part of Eulers Identit equation.
Well guys and gals I have discovered after all these years that Python does complex numbers without the 'complex()' function or 'cmath' import.
It is well known that Euler's Identity E**(i*pi)+1=0...
942
Posted By wisecracker
Hi... It goes without saying: What is/are...
Hi...
It goes without saying:

What is/are your machine[s] and OS[es].
What is your preferred shell and version.
And most importantly what have you attempted yourself and where does it fail?
960
Posted By wisecracker
Hi jejemonx... This is what vbe was referring...
Hi jejemonx...
This is what vbe was referring to assuming you are using 'bash':
Last login: Thu Dec 12 13:15:18 on ttys000
AMIGA:amiga~> bash --version
GNU bash, version 3.2.57(1)-release...
1,226
Posted By wisecracker
You could modify this method to suit your...
You could modify this method to suit your needs...
# get_variable_from_external_command.py

# # with subprocess

# import subprocess
# proc = subprocess.Popen(['ls', '-l'],...
Forum: What is on Your Mind? 12-09-2019
1,010
Posted By wisecracker
The poorest of computer users are programmers...
Hi guys and gals...
A mildly humourous blog from 2013, but I come into this category... ;oDD

Languager: The Poorest Computer Users are Programmers...
Forum: What is on Your Mind? 11-28-2019
1,484
Posted By wisecracker
Hi Chubler_XL... WOW! Terrific stuff....
Hi Chubler_XL...

WOW! Terrific stuff. Congrats, you have earned it...
941
Posted By wisecracker
Hi Chubler_XL... I have never seen that...
Hi Chubler_XL...

I have never seen that before, thanks a lot.
Just shows how much I don't know. Once seen never forgotten...
(But sadly, it won't work in dash.)
941
Posted By wisecracker
Nice and I thanked the post but... Be aware,...
Nice and I thanked the post but...
Be aware, this only works in ksh93 and zsh on Apple gear.
'bash 3.2.x which is all we have with Apple, and POSIX' is a non-starter.
941
Posted By wisecracker
You could use XOR but here is a solution that is...
You could use XOR but here is a solution that is fully POSIX complaint:
#!/usr/local/bin/dash
# decimal2binary.sh <integer_-128_to_127>
#
# USAGE: [/full/path/to/][./]decimal2binary.sh...
982
Posted By wisecracker
A quicky demo for 0 to 127 only using OSX...
A quicky demo for 0 to 127 only using OSX 10.14.6, default 'bash' version 3.2.x...
Called as [./]decimal2binary.sh <integer_from_0_to_127> ...
#!/bin/bash
# decimal2binary.sh <integer_0_to_127>...
Forum: Programming 11-23-2019
2,798
Posted By wisecracker
Hi Neo... Much like my pocket Oscilloscope....
Hi Neo...
Much like my pocket Oscilloscope. That is not backlit either, and has a blue trace that is difficult to see...
That Data Logger idea and Python reminded me of this I tried to upload the...
Showing results 1 to 25 of 500

 

Featured Tech Videos

All times are GMT -4. The time now is 09:01 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy