Friday, September 13, 2013

#fast IEEE 754 double to int32 @ music-dsp

at the music-dsp mailing list there was a short discussion about a "double -> int" rounding hack present in the JUCE library. i've posted an alternative solution that does the same without IEE 754 arithmetic. i'm sure similar solutions can be found in libraries and for CPU's that don't have a floating point co-processor unit. code is for c99.

http://music.columbia.edu/pipermail/music-dsp/2013-September/071572.html

can be summarized into:
1) separate double into mantissa, exponent, sign bit
2) depending on exponent value shift the mantissa left or right by the difference of the exponent and the amount of bits in the mantissa
3) truncate and receive a 32bit integer, while applying the original double's sign

--

Tuesday, September 10, 2013

#flash cs6 compiler bug

i have to work with tools like the one mentioned in the title. here is a bug that only happens if you assign code to a frame in the (main) timeline. target version is 12.0.0.481 and could be fixed in later interations.

you can try the following:
// Array can be used here instead, for 'list'
var list:Vector.<String> = Vector.<String>(["hello", "world"]);
trace(list); // hello,world
var vlen:uint = list.length;
trace(vlen); // 2
const clen:uint = vlen; // this works but 'vlen' is zero at this point
trace(clen); // 0
const len:uint = list.length; // list is a null object reference

results in:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Untitled_fla::MainTimeline()

what happens here is that the as3 compiler tries to play smart and traverses for 'const' declarations, and once it finds 'len' it decided to assign a value to the address where it will be stored in the 'constant pool' and then to be referenced by bytecode. but since 'list' is not a 'const' declaration itself the object is simply not constructed yet and 'list' is a null reference.


same does not happen if:

- 'const list:...' is used, but one may not want that
- if the same code is written in an external document class instead on the timeline

if this is by design it may cause compatibility issues with class written code and simply confuse developers. after all, constant declarations after variable declarations should make perfect sense. in general, i wouldn't recommend writing anything more important on timeline frames, but use classes with ENTER_FRAME listeners or attempt to use addFrameScript() on MovieClip instances instead.
--

Monday, May 6, 2013

#robotic arm flashbacks

i remember programming this machine with an apple 2 clone, when i was quite young. it was a educational robotic arm i had access to in a laboratory in the early/mid 80's.

 

it had pretty good mobility, small error margin and it could lift up a kilo or so. here is a sheet photo where you can see some Tesla ICs and a voltage regulator:
image

--

Thursday, February 21, 2013

#android 4.2.2 and RSA encryption

i was doing some testing recently with the "Android Debug Bridge" ADB, but the device was refusing APK upload. it appears that the recent JB 4.2.2 has a security update:
http://android-developers.blogspot.com/2013/02/security-enhancements-in-jelly-bean.html

which means that you will need to update your Android SDK and copy / use the adb.exe (and all dependencies from "/platform-tools"), which should be version >= 1.0.31 as of this point.

--

Friday, February 8, 2013

#bulls and cows: open source game in ANSI C

here is an open source "bulls and cows" game written in ANSI C:
download

pre-compiled win32 executable included.

i wrote that after a simple challenge proposed by some of my friends, and now apparently they even play it from time to time.

if you are a C programmer, try guessing out why the 0xDA special case happens and how volatile it is.
--

Monday, January 28, 2013

#starling framework video tutorials

here are a nice set of video tutorials by +Hemanth Sharma to get you started with the starling framework:
http://youtu.be/RTvhZ8wbJaQ

if you don't use proprietary software like "flex builder", mind that you can set everything on the command line using the flex tools "mxmlc", "adl", "adb". i'm sure there are examples on how to do that online. flex is open source as is now maintained by the "apache software foundation".

--

Tuesday, January 22, 2013

#CFG2 - an INI-like parser

i wrote a simple INI-like parser some time ago called CFG2.
it's released in the "public domain" with source code at http://github.com/neolit123/cfg2.

--

Thursday, December 13, 2012

#clipboard managers

i've been using ClipX on windows for quite some time, but it seems the latest version (which haven't been updated for quite some time) has some bugs, or perhaps it's windows 7 with something installed or used at the moment.

from time to time it did not catch all the "ctrl + c" events from text editors, so a couple of months ago i've moved to Ditto, which has much more features, yet at the same time can remain quite simple when in action. it can store a very large number of entries in a database that can be cleared any time and is still quite responsive when retrieving something (perhaps slightly slower that ClipX).

on the linux side of things, the only one i've tried is parcellite, which apparently to a majority of users is the best one out there.

perhaps future OS's will have native implementations of clipboard (history) managers pre-bundled.
--

Friday, October 26, 2012

#windows 8 micro rant

i haven't seen or tried it yet, but i've seen some posts that people do not like the windows 8 new looks and mobile-like utilities. this new version seems like windows 7 with some mobile + touch screen extras, people say. what i'm sure however is that some of that can be disabled. here is an example for disabling the metro-ui:
http://techmell.com/how-to/disable-metro-ui-windows-8/

so things like metro-ui should not be the only reason not to get a certain peace of software, because there may be an option to disabled such. perhaps the price itself can be a reason - which is around 30euros.

i cannot say more about the OS itself as i haven't read something drastically negative yet...
if you a are a windows "fan" and simply don't like the number 8, stick to 7.
but if you are concerned about the price or anything else certainly try linux instead

--

Saturday, October 20, 2012

#RIP Nilz

i'm almost one year late, but RIP Nilz.

http://www.discogs.com/artist/Nilesh+Patel?anv=Nilesh+'Nilz'+Patel
"He was a highly-regarded mastering engineer at The Exchange, London."

you have probably heard music mastered by him!

--