Skip to main content

Posts

Yet more ABAP fails

Recent posts

Fixing Bluetooth headset audio quality issues on Mac.

The issue is that, although a headset might have implemented the AptX codec with great quality sound otherwise, because it is a headset, and it needs to be able to work with A2DP for the Microphone to work with all phones etc. The moment it does this, the sound output quality drops as well. The easy way to fix this is to switch your Input from Bluetooth to Internal Microphone. To do this, Hold in Option, and click on the Sound icon in the menu bar (or go to the Sound Preferences). But it is annoying to do this every time... To fix this some people have devised scripts to detect this, and switch it back, but this would require automation software and some fiddling. Which you either may not want to do, or are unable to do. I may have found another way to fix this without using scripts or apps. Open the standard "Audio MIDI Setup.app" utility, and click the + at the bottom to create an "Aggregate Device". Then select the Internal Microphone as the only com

Compacting internal memory of SAP tables in ABAP.

How to force-free memory from deleted entries in internal tables in SAP ABAP, since the garbage collector won't touch these. This is only needed in rare occasions and/or when memory fragmentation needs to be avoided. This method will do it fast, and correctly: CLASS cl_demo DEFINITION . PUBLIC SECTION . CLASS - METHODS compact CHANGING ct_tab TYPE ANY TABLE . ENDCLASS . CLASS cl_demo IMPLEMENTATION . METHOD compact . FIELD-SYMBOLS : <lt_buffer> TYPE ANY TABLE , <lt_buffer_std> TYPE STANDARD TABLE , <ls_buffer> TYPE any , <ls_buffer_prev> TYPE any . DATA : ltr_buffer TYPE REF TO data , lsr_buffer TYPE REF TO data , l_kind TYPE c LENGTH 1 . " simple case: IF ct_tab IS INITIAL . FREE ct_tab . RETURN . ENDIF . CREATE DATA ltr_buffer LIKE ct_tab . DESCRIBE TABLE

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

Yet another ABAP packed/literal bug: CLASS cl_test DEFINITION . PUBLIC SECTION . CLASS - METHODS test IMPORTING i_num TYPE numeric . ENDCLASS . CLASS cl_test IMPLEMENTATION . METHOD test . WRITE : / i_num . ENDMETHOD . ENDCLASS . START-OF-SELECTION . DATA : l_f TYPE decfloat34 . " This works correctly: l_f = '10.1231231233' . l_f = '10.12312312334234234' . l_f = '10.12312312334234234345345' . " This has some kind of MOD overflow error on packed's maximum decimals of 16: cl_test => test ( '10.1231231233' ). " OK: "10.1231231233" P(16) DECIMALS 10 cl_test => test ( '10.12312312334234234' ). " FAIL: "10.1" P(16) DECIMALS 1 cl_test => test ( '10.12312312334234234345345' ). " FAIL: "10.1231231" P(16) DECIMALS 7

My Custom Mechanical 60% Keyboard Build

My Custom Mechanical 60% Keyboard Build 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 GMK Carbon Cherry-profile keycaps):
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

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 stabl