plonq: (Twilight Meh)
[personal profile] plonq
When half the company goes on strike and your operations roll to a stop, you find ways to occupy your time.

Usually I am pushing out tables and graphs in this application, but today I put it to a slightly better use.
Twilight Calculation

I did most of the coding for this at work while I was languishing on a conference call, but I was running into a puzzling error. It was a pretty short bit of programming, so I recreated it when I got home and finally worked out the bug.

This is quite possible one of the most useless things I have done in awhile, but I am quite pleased with the results.

Date: 2012-05-24 04:53 am (UTC)
From: [identity profile] furahi.livejournal.com
Last time (I remember) there was a strike, didn't they send you out somewhere to do the work of the people who were on strike?

You mean to tell me those are all individual cells? Holly cow =O
I assume your script read a bitmap and shaded the cells automagically?

Date: 2012-05-24 11:23 am (UTC)
From: [identity profile] plonq.livejournal.com
I nearly got sent out again about a year and a half ago when our locomotive maintainers where threatening a strike. Fortunately they signed without striking, which saved me the job of cleaning chemical toilets in -35 weather.

Yes, those are individually shaded cells, and I did it just like you said. I wrote a little job (18 lines of code) in Visual Studio to read the RGB values of a bitmap and then set the background shading in the corresponding cells in Excel.

I originally did it in colour, but the limited colour space in Excel made for rather interesting results.

Image (http://www.flickr.com/photos/plonq/7258914902/)

Date: 2012-05-24 11:24 pm (UTC)
From: [identity profile] furahi.livejournal.com
That's awesome!
I'd love to share that with someone in the Excel team, if you'd let me :)

Date: 2012-05-25 12:48 am (UTC)
From: [identity profile] plonq.livejournal.com
The picture or the source code? You are welcome to share either one.

I exported one to Google Docs as well (https://docs.google.com/spreadsheet/pub?key=0Aq0RvWRrcEZLdFBNNW9ZS0hUbVlqcU5RZDlsTS0zY1E&output=html)

Date: 2012-05-24 11:16 am (UTC)
From: [identity profile] ducktapeddonkey.livejournal.com
Did you do this in a macro or something?

Date: 2012-05-24 11:30 am (UTC)
From: [identity profile] plonq.livejournal.com
Yes - well, more specifically in Visual Studio. I had Excel open while I was sitting on a conference call where I was on the line as a SME. Since they were only asking me every ten minutes, my mind busied itself with other things.

Other things such as, "In theory, it should be possible to graph a pony if I read the RGB values of a bitmap and set the cell colours to the same..."

Date: 2012-05-25 02:46 am (UTC)
From: [identity profile] kfops.livejournal.com
You sir are mad!

But that good mad, y'know. The kind that I look up to... Nay, idolize!

August 2025

S M T W T F S
     12
3456789
10111213141516
171819202122 23
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 5th, 2026 07:59 pm
Powered by Dreamwidth Studios