Skip to main content

Posts

ABAP fails again, on literal/packed to numeric parameters.

Recent posts

My Custom DIY 60% Keyboard

My Custom DIY 60% Keyboard
All the parts

1x GH60 (Satan) board - $35 61x Cherry Clear switches - $35 2x Cherry Blue switches - $3 10x Cherry Red switches - $10 1x PCB Stabilizer set (6.25 space) - $6 1x Royal Oak Glam 60% case (Black Walnut) - $78 1x Aluminium 60% plate - $19 1x SA profile Choclatier keycaps - $102 (base, modifiers, and novelties)
1x Braided Nylon USB cable - $15 Solder, Tools, Risers, Labor, etc.
Total: ± $300
(Other single switch types added as needed)
Testing the board I had my helper do the work here. We needed to test the board before applying any solder.
Assembling Add the stabilizers first Add the plate (using a few switches as spacers) Then add the rest
Solder solder solder...

And test again:


The casing The casing I received did to have built-in risers:

So I added my own:



Then Assemble (using temporary spare DSA Carbon Cherry profile keycaps):


Hmm... pretty.

And finally received my Chocolatier SA-profile keycap set!


Programming the GH60 The board is controlle…
ABAP Bugs and peculiarities
Some of the design decisions in the ABAP language are a leap backwards when the intention was to leap at best sideways to thrust us into the meaningless paradigm of the now-defunct world of 4GL languages.

ABAP is a horrible language on all counts. Syntax-wise and how it is implemented, but here are just some of the succinct little tidbits I have found and ways to try and circumvent them.

1. Divide by zero is OK! sometimes... So X / 0 in my opinion is never OK. When X != 0, the result is +-Infinity and for X = 0 the result is undefined. Both should result in an error. Well, for some reason ABAP decided 0 / 0 = 0. Without blinking an eyelid. Well done.

To fix this, and create an exception in all cases of X and Y in expression X / Y, re-write it as:

X / Y -> ( X * ( 1 / Y ) )

The same problem happens with modulus, however the solution is not as elegant:

X mod Y -> ( ( 1 mod Y ) * 0 + X / Y ) )

2. float parsing on older system fail when assigned to a non-…

Retina Macbook Pro Bluetooth woes [partial fix]

Ever since I bought a pair of Bluetooth 4 headphones (with AptX) I've been noticing sporadic issues connecting with my Retina Macbook Pro. I've also seen posts of countless other people having the same issues. Needless to say an Apple Genius was unable to help me, but I was eventually able to get a solution thanks to the internets!
My problem being, that after a while (or after being put to sleep), my Bluetooth would not reconnect to my headphones, nor would it even see any other devices nearby. I've tried repairing and switching Bluetooth off and on again, but nothing helps. The only thing that helps is to reboot my Mac. This is kind of troublesome since I may be busy with a VMWare session debugging code in a session etc. This problem has persisted since Mavericks up to El Capitan so far.
Anyway, a solution someone proposed was to switch the WiFi off and back on again... and this solved my issue. For me this is cool, since VMWare seems to keep my network stable enough th…

How to OTA update your rooted Nexus. (quickly unroot)

Quite a few posts out there seem to think the only way to accomplish this is to do a factory reset and/or wipe all user data. As Android is moving to a faster release cycle, combined with the new measures to ensure an unaltered installation, this procedure is going to become more used. It might also be possible to flash the latest factory images non-destructively to emulate a OTA, but I'm not 100% sure of this (yet).

That is not true, all you will need to do is to revert certain partitions on your phone to stock (boot, recovery and system), and you can do this without wiping apps or user data.

This is because of new restrictions in Android Lollipop (for whatever reason)

I had to flash a custom boot when 5.0 was released to be able to root my Nexus 5 using SuperSU. And this combined with the modifications this did to my system partition prevented the OTA update from working, resulting in an 'Error!' message during update.

All you need to do is to download the original post…

Garage door opener using Arduino + SmartThings

I wired up and controlled my garage (two main doors controlling and one side door sensor only) with the following customizable source code running on an Arduino and the SmartThings platform (via a Z Wave shield. (The .groovy file you load on the web, and the .ino file you compile for the Arduino)

These are the materials I used:

$35 Smarthings Arduino Z Wave shield
$25 Arduino Uno
$10 Power supply for Arduino
$10 Wire
$20 Magnetic switches
$8   Relay

It was pretty easy, I developed all the source and did the installation in a single day (tweaked it a little the rest of the weekend) and it has been running stable for about 2 years now.

The garage doors are toggles that I wired into my garage controller button wires, and they only show if the garage doors are ajar. (It does not indicate whether they are closing or opening... that was troublesome to detect with just a magnetic switch and the way garage doors open and close.)

No express or implied warranty are attached to this guide... yo…
I've customized my default key bindings on Mac to try and get some conformity amongst my many platforms. I tend to get confused, and these make it easier for me each time I switch around.
For one thing, this fixed the Home and End keys' default behavior. Also tweaked PgUp and PgDown slightly. Then also added shortcuts for the most commonly-used CTRL-<key> variants (like copy and paste).
I've added/created the following file: (also creating the directory) ~/Library/KeyBindings/DefaultKeyBinding.dict
With the text content:

/* ~/Library/KeyBindings/DefaultKeyBinding.dict */

{
      /* Remap Home / End to be correct :-) */
      "\UF729"  = "moveToBeginningOfLine:";                   /* Home         */
      "\UF72B"  = "moveToEndOfLine:";                         /* End          */
      "$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
      "$\UF72B" = "moveToEndOfLineAndModifySele…