Wiggy Thoughts

Tuesday, December 30, 2008

SSH Tunnels and SQUID

I've been using PuTTY for a long time as a way to bypass some corporate web filters. With PuTTY I can create a SSH tunnel and gain access to my home SQUID proxy server, allowing me to use my own home Internet connection.

Now for something that is really new to me, there's no need to use SQUID, yes only PuTTY and SSH are required. This post describes very simple way to use the SSH server as a SOCKS proxy.

My home SQUID is now going on for a long retire. Uninstall is planed for the next weekend. KISS (Keep It Simple, Stupid), one less service running on my home Linux Server.

Labels: ,

Saturday, December 20, 2008

GIS once again

Isn't life a funny thing!

It's now less than a month after a job change witch I though would break my connection with GIS technologies and I'm already posting about the same issue.

Recently i was contacted by one of the DeepEarth project leaders. He asked for my assistance and also for the possibility to reuse some of the Spatial# project code.

Conclusion, I'm now participating in the DeepEarth project. I also invite you all to check the project, it as impressed me a lot.

Labels: , ,

Tuesday, November 11, 2008

Moving

After 6 year's working in the GIS market time to move has arrived.

Since 17-Nov, I'm experimenting new adventures and a new job. I joined the Critical Software team.

I will continue to post in this blog although the main subject will change. As I won't be working in GIS no more, the GIS related posts will start to drop, and eventually disappear.

Nevertheless, the last 6 year were very exciting and challenging, and I will forever be a GIS curious and will always be interested a awaiting for the the new solutions that will arise.

Labels:

Thursday, July 3, 2008

NULLS - Improve the way you handle them in C#

I've recently discovered the Null-Coalescing operator. Didn't knew it exists, and I can't now say that it is a very cool operator.

Several times you like to assign a variable with the value from another variable, but you would like to set a different value if the source is null.

For this situations i would write something like this:


   1:  if(null == source) {
   2:    return "it is null";
   3:  } else {
   4:    return source;
   5:  }


Or this:



   1:  return  (null == source) ? "it is null" : source;


But now I can write this:



   1:  return  source ?? "it is null";


What's the difference ? None! all the three sample produce the same result... personally the last one is the I like the most.

Labels:

Thursday, June 26, 2008

ORA 01460 Passing BLOB parameter

Honestly this has been one of the strangest problems that came across me.

I have code that inserts geometries into oracle tables using stored procedures. Due to legacy reasons I'm still using WKB to get the job done, therefore the procedure parameters are of type BLOB.

Recently when inserting a given polygon, I has blown by the ORA01460 error. Browsing the net just pointed me to the parameter value length.

But, then the byte array length was not that strange. It's an 32646 bytes length array! So why the error ?

Further investigation shows that I was successfully passing larger and smaller array to the stored procedure. Things were getting event stranger...

My first shot was truncating the array, and it worked (got an error due to invalid WKB).

So to solve the problem, I'm now adding extra 0 bytes at the array end.... and guess what... it works!


   1:  IWKs wks = (IWKs)(GeometryAdapter.Convert((IGeometry)value);
   2:  byte[] buffer = wks.ExportToWKB();
   3:  parameter.Value = buffer;
   4:  parameter.Size = buffer.Length;
   5:  if (parameter.Size == 32646) {
   6:    byte[] newBuffer = new byte[50000];
   7:    buffer.CopyTo(newBuffer, 0);
   8:    parameter.Value = newBuffer;
   9:    parameter.Size = 50000;
  10:  }

Labels: , ,

Sunday, February 24, 2008

Subversion Backup Script

In the last days I've been upgrading my backup system. Now I'm using Bacula. Setting up bacula in ubuntu was very simple and straightforward.

I also had to develop a script to backup (dump) my subversion repository to a local folder. Bacula job will later get the subversion dump and place it in the backup storage.

I've decided to publish my script here as it may serve as a  guide and help others with the same requirements.

You can get my subversion backup script here

Labels: ,

Wednesday, January 2, 2008

CodeProject Article

I’ve now concluded one of the oldest todo list items. Publish a CodeProject article. Yes it is true, I’ve published an article and you can check it here.

Labels: ,