Tuesday, October 30, 2007

.NET - unsigned assemblies

Jyothish did some puzzle sovling - we had a unsigned .NET assembly, that we had to pull into unmanaged JNI code so we could call it from Java.

Problem was - you need signed assemblies to do it. The answer:

>sn -k Key.snk

>ildasm /out:MyHelper.il MyHelper.dll

>ilasm MyHelper.il /KEY=key.snk /DLL /OUTPUT=MyHelper.dll

The output can now be added to the global cache, and you can have a party

Wednesday, September 12, 2007

JAAS

Hard lesson learnt, playing with JAAS & Tomcat.

When using basic authentication:
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
it is NOT possible to log out programatically. You have to close the browser.

session.invalidate() will do NOTHING!!


I'm not missing anything. It's just not possible. The browser keeps the credentials in memory, and keeps re-submitting it. So calling invalidate serves no purpose, as the very next thing you try, will just end up with you being logged in again.

Sunday, September 02, 2007

Oracle - TOP N Queries

If I forget how to do Oracle TopN queries ONE more time - I swear - pig will pay!

"SELECT *
FROM (SELECT * FROM my_table ORDER BY col_name_1 DESC)
WHERE ROWNUM < N - http://orafaq.com/faq/how_does_one_select_the_top_n_rows_from_a_table

Saturday, March 03, 2007

Total Lunar Eclipse

The Event:
From time to time, the Universe puts on an AMAZING show. All one has to do, is pitch up. The 3rd of March, 2007 - was such a day. The event. A total Lunar eclipse.

Preparation:
Preparation for such events is VITAL. I packed my 8 inch Newtonian telescope, I charged and packed my Celestron power pack for the scope. I charged batteries for my Sony DSC-V1, and Canon 300D. I purchased ISO400 and ISO100 film, for my old school SLR. I packed a tripod. I purchased a Logitech Quickcam Pro 5000, and modified it by removing it's lens. I downloaded, installed, and tested remote capture software for the Canon. I experimented with the Quickcam Pro capture software, and made more adjustments to my modified webcam.

Getting there:
I drove to the other side of town, where I could have an unobstructed view of the celestial marvel about to unravel. I started unpacking my equipment, and settled into a good position.

Show time:

As the moon contacted the umbra - it started raining.

The payoff:

Tuesday, February 13, 2007

Saturn @ Opposition / Canon 300D vs. Labtech Webcam vs. JPL Spacecraft

Saturn is glorious.

My skills as astro-photographer, do not do him justice. He's at opposition right now. The Cassini division in the ring jumps out at you. Several bands crossing the surface of the planet can be seen as well.

It's glorious.

From left to right: Webcam (8 inch newtonian, stacked frames), Canon (8 inch newtonian, 2 layered images), JPL (Cassini-Huygens spacecraft, 4.5cm telescope)



In my defense, I might have a bigger aperture than JPL's toy.... but I don't have as good a CCD, and I'm looking from Centurion, whereas they get to go in orbit!!!

Sunday, January 21, 2007

Saturn - I need better equipment


I must be doing something wrong. Naah. I blame the equipment. I thought I was messing up the focus, so I spent a lot of time practicing. In the end, I think the Canon is to blame. I suspect it's the shutter causes everything to vibrate. Can I be sure? Only one way to find out.... a decent CCD camera.... Sigh.... that costs money. Compared to what you see with the naked eye - this picture is up to sh#t.



Caz keeps on asking for a photo of the telescope, so here goes. ;)

Friday, January 19, 2007

Amateur Astronomy in Pretoria

So - as luck would have it - there was no rain! And very few clouds. I got word that the Amateur Astronomy Society of Pretoria would be setting up at CBC.

I got to see the comet a second time. Photo below taken at ISO 100, f9, 10 second exposure. Using CANON EOS 300D.



Too a photo of people standing around their telescopes. ISO 800, f2.8, 30 second exposure. Sony DSC-V1. Wasn't planning it that way - but you can see the Southern Cross rising.

Monday, January 08, 2007

Long exposre - v.s. Layering

So it's not as simple, as just layering a bunch of pictures on top of each other....

On the left - one single long exposure. On the right, a bunch of images layered on top of each other.

Maybe I should ask someone smart if there's a better way?

Saturday, January 06, 2007

Astrophotography - layering

So this weekend, I started getting a feel for my 8" without the moon interfering, and a few kilometers away from the worst city lights.

Equipment again: 8" Newtonian & Canon 300D (you can see from the Tarantula photo - that the Canon introduces a lot of garbage... will have to see what we can do about that)

---
m42
---

I started of with good old Orion again. 10 second exposure at ISO1600. No star trails! Amazing - considering that polar alignment consisted of me guessing the general direction of South!

I've gotten rid of the shakes - Canon has some nice software for taking photos via USB - so you don't have to touch the shutter.

---
ngc2070
---

Went on to something much cooler - the Tarantula Nebula (ngc2070) - which was cool, because as a bonus I got a globular star cluster in as well! (ngc2100)

For Tarantula, I tried out taking multiple exposures, and overlaying them. What you see - are 5 exposures, 4 seconds each, at ISO 1600. I couldn't take longer than that - because my polar alignment was too bad.

Thursday, January 04, 2007

A problem with XSL transformations in Java 1.5

If you are like me, you probably tried to use javax.xml.transform.dom.DOMSource as your XSLT source, and your XML source.

If you are like me - you spent hours and hours, trying to figure out why your XML wasn't being transformed.

I don't know why. But you HAVE to use javax.xml.transform.stream.StreamSource.

Making the code:
// get the files
File xsdFile = new File("xsd/xml.xml");
File xslFile = new File("xsd/xsl.xsl");
// turn them into stream sources
StreamSource xsltSource = new StreamSource(xslFile);
StreamSource xsdSource = new StreamSource(xsdFile);
// get transformation stuff
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer(xsltSource);
// set up for sending the output to screen
StreamResult scrResult = new StreamResult(System.out);
// transform
transformer.transform(xsdSource, scrResult);

Tuesday, January 02, 2007

My first deep space foto


This is my very first (and I mean that literally) photo of a deep space object (something not in our solar system) taken through a telescope.

It's the Orion Nebula (M42/NGC1976). Seeing as my scope isn't aligned at the least - I'm pretty impressed. Just as luck would have it - there's a meteor streaking by as well!

Equipment: Canon 300D, 8 Inch Newtonian
Exposure: 30 seconds, ISO 1600

The picture was actually horribly overexposed (there's a full moon out) so I had to touch it up a bit.

I also finally have a semi decent photo of the moon!