Wednesday, September 9, 2015

Facebook hates Pythagoras: a²+b²=c²

And Wikipedia love/hates "a2+b2=c2" even more! = ☹

Are you a FaceBook user? And have you EVER tried to cut-and-past the Pythagorean-theorem of "a²+b²=c²?" [ I do it EVERY day :-^) ] ... But found your resulting paste gives the grotesque result of "a2+b2=c2?" ...

Now try to cut-and-paste this Facebook/Wikipedia version: "a2+b2=c2?"

Don't believe me? ... then try to cut and paste from either: Facebook: Pythagorean-theorem or Wikipedia: Pythagorean-theorem - Proof by rearrangement.

¢ Kind of typical of the 21ˢᵗ century... after 2½ thousand years of civilisation one cannot simply cut and paste Pythagoras's theorem of a²+b²=c² from wikipedia and share it with a friend on FaceBook! ☹ ¢

Fortunately WolframAlpha has no such problem, eg. click on: a²+b²=c²

Here is a useful table you from where you CAN cut-and-paste ˢᵘᵖᵉʳˢᶜʳᶦᵖᵗˢ and ₛᵤbₛcᵣᵢₚₜ... ¢ oops... Note the b & c, maybe we need to wait until the 22ⁿᵈ century for the entire alphabet to be in all browsers? ¢

Superscript and subscripts cut-and-paste
  0 1 2 3 4 5 6 7 8 9 A B C D E F
U+00Bx                          
U+207x x⁰ xⁱ     x⁴ x⁵ x⁶ x⁷ x⁸ x⁹ x⁺ x⁻ x⁼ x⁽ x⁾ xⁿ
U+208x x₀ x₁ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ x₊ x₋ x₌ x₍ x₎  
U+209x xₐ xₑ xₒ xₓ xₔ xₕ xₖ xₗ xₘ xₙ xₚ xₛ xₜ      

Ironically Wikipedia does detail how to achieve the alphabet in either ₛᵤbₛcᵣᵢₚₜ and ˢᵘᵖᵉʳˢᶜʳᶦᵖᵗˢ... Wikipedia: Unicode subscripts and superscripts.

But you can simply use this page: piliapp.com to: c̶r̶o̶s̶s̶ ̶o̶u̶t̶ ̶m̶i̶s̶t̶a̶k̶e̶s̶ or u͟n͟d͟e͟r͟l͟i͟n͟e͟ ͟i͟m͟p͟o͟r͟t͟a͟n͟t͟ ͟s͟t͟u͟f͟f AND THEN cut and paste it to share on FaceBook. Or use tiny-text to generate ˢᵘᵖᵉʳˢᶜʳᶦᵖᵗˢ.

And for even more find try: ₛᵤbₛcᵣᵢₚₜ @ panix.com

For the technically minded, here is a table of as many of the SI units that I could find, all ready for your cut-and-paste. ¢ Enjoy ¢

Wikipedia: SI Base Units

Named base SI base units.
Name Symbol Unicode Codepoint Quantity Typical Symbol for Variables
metre m

length l (lowercase L)
kilogram kg U+338F mass m
second s

time t
ampere A

electric current I (capital i)
kelvin K

thermodynamic temperature T
candela cd U+33C5 luminous intensity Iv (capital i with lowercase non-italicized v subscript)
mole mol U+33D6 amount of substance n

Wikipedia: Derived Units

Named units derived from SI base units

Symbol Unicode Expression in terms of other units Expression in terms of SI base units Quantity
hertz Hz ¹⁄s s⁻¹ frequency
radian rad m⁄m dimensionless angle
steradian sr ㎡⁄㎡ dimensionless solid angle
newton N
㎏⋅m⁄s² or ㎏⋅㎨ force, weight
pascal Pa N⁄㎡ ㎏⁄m⁄s² pressure, stress
joule J
N⋅m = C⋅V = W⋅s ㎏⋅㎡⁄s² energy, work, heat
watt W
J⁄s = V⋅A ㎏⋅㎡⁄s³ power, radiant flux
coulomb C
s⋅A s⋅A electric charge or quantity of electricity
volt V
W⁄A = J⁄C ㎏⋅㎡⁄s³⁄A voltage, electrical potential difference, electromotive force
farad F
C⁄V s⁴⋅A²⁄㎏⁄㎡ electric capacitance
ohm Ω
V⁄A ㎏⋅㎡⁄s³⁄A² electric resistance, impedance, reactance
siemens S
℧ = A⁄V s³⋅A²⁄㎏⁄㎡ electrical conductance
weber Wb J⁄A ㎏⋅㎡⁄s²⁄A magnetic flux
tesla T
V⋅s⁄㎡ = ㏝⁄㎡ = N⁄A⁄m ㎏⁄s²⁄A
magnetic field strength, magnetic flux density
henry H
V⋅s⁄A = ㏝⁄A ㎏⋅㎡⁄s²⁄A² inductance
deg Celsius °C K K temperature relative to 273.15 K
lumen lm ㏅⋅㏛ luminous flux
lux lx ㏐⁄㎡ ㏅⁄㎡ illuminance
becquerel Bq ¹⁄s s⁻¹ radioactivity (decays per unit time)
gray Gy J⁄㎏ ㎡⁄s² absorbed dose (of ionizing radiation)
sievert Sv J⁄㎏ ㎡⁄s² equivalent dose (of ionizing radiation)
katal kat
㏖⁄s ㏖⁄s catalytic activity

Wikipedia: The Metric Prefix

Unicode characters of SI derived units and other related non SI units.
Scale femto pico nano micro milli centi deci
hecto kilo Mega Giga Tera Other
Dimensionless

, ㏙, ㏗
Distance



㎞, ㏎
㍳, ㍶, ㏕, ㏌
Area


Volume
㎣, ㎖ ㎤,㏄ ㍹, ㎗ ㎥, ℓ
㎦, ㎘
Mass





㍲, ㍺, 🝲, 🝳, ℥
Pressure


, ㍴
Time

㏂, ㏘, 🝮, 🝱
Frequency


Potential





㍵, ㏞, ㋎
Current





Impedance related





Power





㏋, ㏈
Heat and Energy


, ℉, ㋍
Speed, acceleration and miscellaneous ㎧, ㎨, ㏏,㏚, ㏍
Radio Activity and light , , , , , ㎮, ㎯, , , , ㏆
Note: Struck through units are Unicode SI units already appearing in the first two tables.

Monday, August 10, 2015

Regarding the Colour of the New Zealand Flag...

(Alternative title: The ex-Empiree's New Clothes) #nzflag

Ironically the post WWII British Gov was only too happy (and in a big rush) to "grant" all "their" colonies "independence" cf. http://www.vice.com/en_uk/read/the-uk-government-are-opening-thousands-of-secret-files-to-the-public...

To achieve this the British Gov even had a special mobile hit squad of diplomats to speed up the "transition" and the British exit. Did you ever notice that when the "sun set" on the British Empire, it set WITHOUT the British Marines EVER loosing a single battle? Figure that one out! How is that a retreat?

It all culminated around 1970 when NZ (and others) became victim of combined effect of the Secret UK/US "Atlantic Charter" AND the UK/US manipulation of the Goldstandard... the net effect was the virtual crash of the NZ economy...

Meantime my grandparents quietly had their Irish/Scottish rights of descent "squished" by over eager "ex-colonies" asserting their newly found "sovereignty".

[ The ex-colonies "officials" were (in most cases) re-engineering the British "empire's" original bureaucracy to suit the pro-independence family dynasties that emerged ]

The end of the "British Empire", meant the end of the common currency, the end of border-less global travel, the imposition of ID numbers/travel-documents, the end of free trade, the increase in the ACTUAL income tax rate, and economies becoming centric on super-cities.

[ Ironically the common currency with free internal trade & travel of the US, EU & China (and even Australia) is what powers these economies. ]

If the ex-British colonies were truly smart, then they would have evicted England from the Empire and but kept the Empire. We then would have been had a chance to stand up against the emerging economic super powers and been be in a much better position to augment (and develop) the more vulnerable smaller economies.

So... just maybe... the colour of the flag is not the issue? Maybe the flag's colour is just another cleverly engineered distraction. Maybe the real question is... Who engineered this distraction? (And why?)

Wednesday, May 27, 2015

The meaning of adb

From: Drew Sullivan 
Newsgroups: comp.unix.misc
"If you are going to get your history correct, then you have to know why Bourne was at Bell Labs. He was trying to build an algol-68 compiler. The project didn't complete in the sence that there is no algol compiler but the tools that he built live on. That is why the Bourne shell has case ... esac, if ... fi, do ... done, These are all from algol-68."
Lastly the the adb was the algol debuger.  The 'a' is for algol!!!! 
I extract the following screen shot from:  Bryan Cantrill's - The Observation Deck
"Views on software from Bryan Cantrill's deck chair"
* https://blogs.oracle.com/bmc/entry/unix_circa_1984 
 
Basically the "adb" command has built into it the command "$a" for debugging Algol68 stack structures and scopes.

c.f. "abd manual page extract" & "Algol68C and Unix"
After Cambridge, Bourne spent nine years at Bell Labs with the Seventh Edition Unix team. As well as developing the Bourne shell, he ported ALGOL 68C to Unix on the DEC PDP-11-45 and included a special option in his Unix debugger "adb" to obtain a stack backtrace for programs written in ALGOL68C. Here is an extract from the Unix 7th edition adb manual pages:
NAME
      adb - debugger
SYNOPSIS
      adb [-w] [ objfil [ corfil ] ]
[...]
COMMANDS
[...]
       $modifier
             Miscellaneous  commands.   The  available modifiers
             are:
             [...]
             a      ALGOL 68 stack  backtrace.   If  address  is
                    given  then it is taken to be the address of
                    the current frame (instead of r4).  If count
                    is  given  then  only the first count frames
                    are printed.
 

Friday, January 30, 2015

Dual booting Centos: /boot/boot/grub.conf kernel root=/dev/sda0 VS root=UUID=X-X-X-X-X VS root=/dev/mapper/luks-X-X-X-X-X

I'm adding this to my blog because I'm not sure where else to post technote ...

From: kernel-2.6.32-504.3.1 To kernel-2.6.32-504.3.3

The nearest I report I found to my problem was:
[SOLVED] LVM on Luks cannot find device

I dual boot linux/Centos.  x86_64 on one partition, and i686
Basically back in Dec 2014 I upgraded my kernel on one of my partition

However "something" then cleaned up all my  "x86_64" kernels and modules...
It was manifested with the message "cannot load module.dep"

FATAL: Could not load /lib/modules/2.6.32.431.23.3.el6.x86_64/modules: No such file or directory.

The fix is to reinstall the missing kernel... IF you can boot.

This is made a little tricky when one partition is strictly i686 and the other is x86_64... I ended up booting into single user, doing a rpm install --ignorearch on i686, then manually mounting the x86_64 copying all the x86_64 kernel files (rpm -ql kernel)  from the i686 partition...

Interestingly this whole process is a bit of a time bomb, because the problem only manifested itself 6 weeks after previous kernel upgrade.  So I am not sure what "update" cleaning out all the previous kernel and modules...

Alternatively you may be abel to an easier solution by running the "recovery shell" or booting from a recovery disk/USBDrive.

Goodluck
N

ps.  If you know what is "cleaning up" the old kernels (esp. kernels on that partitions RPM database, then let me know)  Cheers.








Saturday, December 27, 2014

A bit of fun with Jabberwocky, classes, mixins, python and method resolution order (MRO)

I was trying to figure out and demonstrate python's Member Resolution Order... In particular, pay attention to the output from __str__...

#!/usr/bin/env python
# -*- coding: utf-8 -*-

class BeastBase(dict):
  def __init__(self, **characteristics):
    super(BeastBase, self).__init__(**characteristics)

  def __str__(self):
    return "; ".join(["%s=%r"%item for item in super(BeastBase, self).iteritems()])

class Mixin(object): pass

class BitingMixin(Mixin):
  def __init__(self, jaws=2, teeth_per_mouth=32, **characteristics):
    self.jaws=jaws
    self.teeth_per_mouth=teeth_per_mouth
    super(BitingMixin, self).__init__(**characteristics)

  def bite(self):
    print "Bite: jaws=%s, teeth=%s"%(self.jaws, self.teeth_per_mouth*self.jaws/2)

  def __str__(self):
    return "Jawed: %s; %s"%(self.jaws, super(BitingMixin, self).__str__())

class JawedBeast(BeastBase, BitingMixin): pass

class ClawingMixin(Mixin):
  def __init__(self, feet=4, toes_per_foot=3, **characteristics):
    self.feet=feet
    self.toes_per_foot=toes_per_foot
    super(ClawingMixin, self).__init__(**characteristics)

  def catch(self):
    print "Catch: feet=%s, toes=%s"%(self.feet, self.toes_per_foot*self.feet)

  def __str__(self):
    return "Claws: %s; %s"%(self.toes_per_foot*self.feet, super(ClawingMixin, self).__str__())

class ClawedBeast(BeastBase, ClawingMixin): pass

class FlamingMixin(Mixin):
  def __init__(self, eyes=6, flames_per_eye=1, **characteristics):
    self.eyes=eyes
    self.flames_per_eye=flames_per_eye
    super(FlamingMixin, self).__init__(**characteristics)

  def flame(self):
    print "Flames:", self.eyes*self.flames_per_eye

  def __str__(self):
    return "Eyes: %s, Flames: %s; %s"%(self.eyes, self.eyes*self.flames_per_eye, super(FlamingMixin, self).__str__())

class FlamedBeast(FlamingMixin, BeastBase): pass

class WhifflingMixin(Mixin):
  def whiffle(self): print "Whiffle...."
  def __str__(self): return "Whiffling... "+super(WhifflingMixin, self).__str__()

class WhifflingBeast(WhifflingMixin, BeastBase): pass

class BurblingMixin(Mixin):
  def burble(self): print "Burble...."
  def __str__(self): return "Burbling... "+super(BurblingMixin, self).__str__()

class BurblingBeast(BurblingMixin, BeastBase): pass

class Jabberwocky(BitingMixin, ClawingMixin, FlamingMixin, WhifflingMixin, BurblingMixin, BeastBase):
  def __init__(self, **characteristics):
    super(Jabberwocky, self).__init__(**characteristics)

  def __str__(self):
    return "JabberWocky: "+super(Jabberwocky, self).__str__()+" ... Beware! "

if __name__ == "__main__":

# Beware the Jabberwock, my son!
  jabberwocky1=Jabberwocky(personality="Friendly", consideration="Temperamental", eyes=5, flames_per_eye=3)
  print jabberwocky1

# Beware the Jubjub bird, and shun
# The frumious Bandersnatch!

# The jaws that bite, the claws that catch!
  jabberwocky1.bite()
  jabberwocky1.catch()

# And as in uffish thought he stood,
# The Jabberwock, with eyes of flame,
  jabberwocky1.flame()

# Came whiffling through the tulgey wood,
  jabberwocky1.whiffle()
# And burbled as it came!
  jabberwocky1.burble()  

Output:
JabberWocky: Jawed: 2; Claws: 12; Eyes: 5, Flames: 15; Whiffling... Burbling... consideration='Temperamental'; personality='Friendly' ... Beware!
Bite: jaws=2, teeth=32
Catch: feet=4, toes=12
Flames: 15
Whiffle....
Burble....
 

Saturday, March 8, 2014

A brief history of Air Traffic Control and on-line Aircraft Tracking Systems...

Today's loss of flight MH370 got me wꜵndering the internet briefly investigating how Aircraft Tracking/Control systems have changed over the years.
  • 1958 - Semi-Automatic Ground Environment - The prototype was an IBM 4020 Military Computer
    "SAGE—Air Force project 416L—became the pattern for at least twenty-five other major military command-control systems… These were the so-called “Big L” systems [and] included 425L, the NORAD system; 438L, the Air Force Intelligence Data Handling System; and 474L, the Ballistic Missile Early Warning System (BMEWS). … Project 465L, the SAC Control System (SACCS) [with] over a million lines, reached four times the size of the SAGE code and consumed 1,400 man-years of programming; SDC invented a major computer language, JOVIAL, specifically for this project." 
    • http://www.computermuseum.li/Testpage/IBM-SAGE-computer.htm
  • 1958 - Algol58/JOVIAL created.
  • 1961- AN/FSQ-31V- SAGE Solid State Computer was a planned military computer central for deployment to Super Combat Centers in nuclear bunkers
  • 1968 - ALGOL 68 Final Reportr0 Presented at Munich Meeting
  • 1980 - re: 1968 ... The best we could do was to send with it a minority report, stating our considered view that, "... as a tool for the reliable creation of sophisticated programs, the language [ALGOL 68] was a failure." [...] - C. A. R. Hoare  Oct 1980

¢ My commentary: Algol68 should have been adopted and replaced Algol60, but [IMHO] instead Algol68 was shot down by a vocal minority.  Sure, I would love to own and drive a 1961 E-type Jaguar, but it would be better with airbags and a GPS.  So the 1968 Security, Efficiency, Type-safety, Standardization and Internationalization offered by Algol68 (which predates C11 well by over 40 years!) should have been leveraged in 1968! Algol68 is kind of like a 1961 E-type Jaguar, but with seat-belts, air-bags, a roll-bar, traction-control and modern tyres! ¢

BTW:  As a wonderful example of today's "crowd-sourcing": Do you regularly have aircraft pass (or cross paths) over your home/community? but you live in the "middle-of-every-where"... How about becoming part of "flight-aware" and to help track aircraft?  If your location is "desirable", then you may get a free [ADS-B] to put on your roof... Here is the current coverage map: http://flightaware.com/adsb/coverage.

Click MH370 for an example of this flightaware's tracking of MH370.

Update: My best guess as to where MH370 is... On a "great circle" west of Kuda Huvadhoo (in the Maldives).

Friday, March 7, 2014

Was Algol ever used for “mainstream” programming?

¢ I rather liked this answer on Stackoverflow, so I am reproducing it here ¢
 
Algol58 seems to have been the most successful in terms of important applications.

From Wikipedia:
JOVIAL is an acronym for “Jules Own Version of the International Algorithmic Language.” The “International Algorithmic Language” was a name originally proposed for ALGOL 58. It was developed to compose software for the electronics of military aircraft by Jules Schwartz in 1959.
Then:
Notable systems using JOVIAL include the Milstar Communications Satellite, Advanced Cruise Missile, B-52, B-1B, B-2 bombers, C-130, C-141, and C-17 transport aircraft, F-111, F-15, F-16 (prior to Block 50), and F-117 fighter aircraft, LANTIRN, U-2 aircraft, E-3 Sentry AWACS aircraft, Navy Aegis cruisers, Army Multiple Launch Rocket System (MLRS), Army UH-60 Black Hawk helicopters, F100, F117, and F119 jet engines, the NORAD air defense & control system (Hughes HME-5118ME system) and RL-10 rocket engines. Airborne radar systems with embedded JOVIAL software include the APG-70, APG-71 and APG-73
ALGOL 68 was used in part of DRA for the same purpose. cf. Wikipedia:
The ”’Defence Research Agency”’ (normally known as ”’DRA”’), was an executive agency of the UK Ministry of Defence (MOD) from April 1991 until April 1995. At the time the DRA was Britain’s largest science and technology organisation.
DRA’s Algol68 compiler was finally open-sourced in April 1999 and is now available for linux for download from sourceforge. (However an interpreter for “Algol68g” is easier to use).

ICL’s Algol68 was/is S3 – It was developed by the UK company International Computers Limited (ICL) for its 2900 Series mainframes. It is a system programming language based on ALGOL 68 but with data types and operators aligned to those offered by the 2900 Series. It was the implementation language of the operating system VME.

There are (at least) two other British operating systems – Flex and Cambridge_CAP_computer – written in Algol68 variants. And also 1 Soviet OS: Эльбрус-1 (Elbrus-1), but I have yet to find any of their source code. (If anyone can find and distribute to this source code please let me know)

BTW: I believe that VME is still running – in production – as a Linux/Unixware guest VM. Mostly at Commonwealth of Nations Custom/Immigration services.
Also over the same period the USSR was using Algol68, c.f. history link. Algol68 is used in Russian telephone exchanges. And Algol58 was used in the Russian “Buran/Буран” Space Shuttle landing system.

ALGOL68 was internationalized in 1968. I suspect there are other Algol projects in other countries. esp in German, in Dutch Japanese and Chinese but I have no details.

If you want to actually tryout Algol68 and/or contribute your code, check out Rosettacode’s ALGOL 68 repository, then as a class project try one of the “Tasks not implemented“.

enjoy!