Projects

Salary Calculation Based on 401K Contribution Plus Taxes – April 05, 2024

I was faced with an interesting problem yesterday of trying to calculate the optimal salary for someone who wants to contribute all of their income to their 401K.  And "optimal" is defined as "near as possible to the deductible maximum and not have any half penny or rounding issues per month or for the quarterly social security and medicare reports".  In previous years (especially last year) it was trivial to get the right number, and I didn't have to think too much.  I poked around guessing some numbers but kept getting fractional payments when multiplying the tax rates, so ended up writing a script to do it, and got an excuse to do it in Python, since I've been trying to learn it, but often don't have reasons to use it. (not that this script is all that interesting from a Python perspective).  As my first Java instructor said, "it looks like you took a C program and then renamed it .java and modified it until the compiler didn't complain."  And I had to admit that he was right...

#!/bin/python3
MAX_401K=23000
SOCIAL_SECURITY_RATE=0.062
MEDICARE_RATE=0.0145
TEST_RANGE=200
MONTHLY_NET=int(MAX_401K/12)
MONTHLY_GROSS = int(MONTHLY_NET / (1 - SOCIAL_SECURITY_RATE - MEDICARE_RATE))

for gross in range(MONTHLY_GROSS,MONTHLY_GROSS-TEST_RANGE, -1):
  social=gross*SOCIAL_SECURITY_RATE
  if(social*100 == int(social*100)):
    medicare=gross*MEDICARE_RATE
    if(medicare*100 == int(medicare*100)):
      net=gross-medicare-social
      print("gross:",gross,"net:",net," social:",social,"  medicare:",medicare)
      break

Hope this helps someone else, and maybe I'll even remember I wrote this next year and not calculate it manually...

 

Importing Data From Ning – July 26, 2013 (read more)

I have a customer who is trying to move their website from ning.com to a new web hosting provider, and ning supposedly provides a method for exporting the data, but they acknowledge that their data format is broken, and so requires manually editing to make it readable by other parsers.  They bug they know about is that the ning files start and end with extraneous parentheses, and so those have to be removed prior to reading by any JSON parser.  You'd think that Ning could remove those parentheses, but perhaps this is their goal - to not let people leave their service after starting with them.  If that is the case, then I'm sorry to say that I'll be wrecking their business model by showing you how to get your data out of Ning...

HTML Obfuscation – February 19, 2010 (read more)

I just finished a fun project today for a customer that involves trying to prevent HTML from being easily copied.  It isn't possible to prevent someone like myself from getting the content, but you can go pretty far in preventing an average user from getting the content.

There are a couple commercial solutions available, but they fail in different ways, mostly notably not working in some browsers (I still need to test mine with Safari and Opera), but even in Internet Explorer, all of the solutions I saw let you "save as text" and you get the entire text content of the page.  My customer is particularly interested in protecting the text content, so those options weren't acceptable.

Most of the project wasn't interesting, just fighting with javascript and encoding and quotes, etc. but the last part: obfuscating the text, was pretty neat.

Welcome Circuit Cellar Readers – April 08, 2009

A hearty welcome goes out to those engineers and hobbyists who have found us via the recent Circuit Cellar article about our DOS USB project last year. 

We hope to post more articles about past projects soon.  The articles will be back-posted (with timestamps to match the dates the projects were completed), so be sure to check the projects page again later.

If you are interested in hiring Lime Daley for embedded software and/or hardware, we'd be happy to hear from you.

IRS Recovery Rebate Credit Calculator – February 17, 2009

The IRS is supposed to be working on an online calculator to help everyone figure out how much of a rebate (if any) they are due this year.  I was confused about my own taxes, and so once I figured it out, thought I would write an online calculator to help the rest of you.  Try it out here.

USB Flash Disk on DOS – July 01, 2008 (read more)

No, you aren't reading the Internet Wayback Machine - this is 2008, and the National Institute of Mental Health still uses DOS for testing subjects.  (If it isn't broken, don't fix it...  And they can be much closer to real-time accuracy with DOS rather than Windows.)  However, as the data sets get larger, and floppy drives become increasingly less common, it is harder and harder to get the data off of their testing machines back to the experimenters' desktops to analyze the data.

Networked Industrial Thickness Measuring System – May 01, 2004 (read more)

Lime Daley's (even before the name "Lime Daley" existed) first project was to create a device that could measure the spacing between two giant rollers (40 feet long, 6 feet in diameter) in a paper mill.  Measuring the thickness of deformation of the rollers against each other (with the sensing device in between) we were able to accurately display how far apart the rollers were from each other. The idea is to make sure that the rollers are aligned properly to produce paper of an even thickness.

The existing system did the job, but could only measure at 16 points across the 40 foot span, and the customer desired more data points, but without all of the extra wires.

Real-Time Data Collection Inside a MRI Scanner – February 10, 1999 (read more)

One project that Jon did while working at Carnegie Mellon University was to create a "button box" that collected data from a subject inside an MRI scanner as well as data from the scanner itself.  The project was "real-time" in the sense that we needed the hardware and software to be accurate within 20 or 30 milliseconds (which depending on what field you are in, you might laugh at that number being "real-time").