Welcome to Deadbeef.com
Articles and tips on software from authored by Jeremy Bettis.

Search

XML Feed RSS

What is RSS?

Who's Online?

  • Guest Users: 7

Archives for: June 2008

06/24/08

Permalink 11:50:56 am, by Jeremy Email , 62 words, 543 views   English (US)
Categories: General, Personal

Thank goodness for WiFi

It seems like wireless networking has been around forever, but it was not so long ago really. I had a laptop with no wireless:

Working on the couch with wired network

Now, what is that strange posture, and why am I holding the Ethernet cable with my foot?

Oh yes, here is the reason:

Brianna playing with the Ethernet cable

Now, she doesn't do that anymore, but there aren't wires stretched across the room either.

06/05/08

Permalink 04:22:50 pm, by Jeremy Email , 143 words, 743 views   English (US)
Categories: Money

One year of debt freedom

So it has now been one year since we became debt free!

How has life changed? I must say as good as it felt to be debt free, it felt much better when we had 3 months of expenses saved as an emergency fund.

In the last year we have:

  • Saved $16,000 as an emergency fund
  • Saved $3000 for new furniture (and spent it on the new furniture.)
  • Bought a cheap car and gave it away as a gift
  • Saved $3300 for our vacation fund.
  • Paid down the mortgage by $2311.24
  • I was laid off from my job, and had enough money saved for 7 months
  • Started a new job, just two weeks later, making slightly more than the old job.
  • Opened a Roth IRA: $3935.35 contributed so far.
  • Starting funding College Funds: $2576.82 so far.
  • Our net worth has increased by $29,046.38 (despite the stock market doing so badly)

Thanks Dave

Permalink 04:04:02 pm, by Jeremy Email , 139 words, 3306 views   English (US)
Categories: Programming, C++

Converting RGB to HSV in C++

I don't know why this is so hard to find, but it is. I ended up following the suggestion of a google answers question and converting the javascript formula at http://www.csgnetwork.com/csgcolorsel4.html to C++. (Ok, it is just plain C).

// RGB are from 0..1, H is from 0..360, SV from 0..1
double maxC = b;
if (maxC < g) maxC = g;
if (maxC < r) maxC = r;
double minC = b;
if (minC > g) minC = g;
if (minC > r) minC = r;

double delta = maxC - minC;

double V = maxC;
double S = 0;
double H = 0;

if (delta == 0)
{
	H = 0;
	S = 0;
}
else
{
	S = delta / maxC;
	double dR = 60*(maxC - r)/delta + 180;
	double dG = 60*(maxC - g)/delta + 180;
	double dB = 60*(maxC - b)/delta + 180;
	if (r == maxC)
		H = dB - dG;
	else if (g == maxC)
		H = 120 + dR - dB;
	else
		H = 240 + dG - dR;
}

if (H<0)
	H+=360;
if (H>=360)
	H-=360;

June 2008
Sun Mon Tue Wed Thu Fri Sat
 << < Current> >>
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          

Categories

powered by
b2evolution