Posts Tagged ‘install’

Lucid Ubuntu and GDAL Latest

Tuesday, August 31st, 2010

I’m writing some software that relies on a feature of GDAL (Geospatial Data Abstraction Library) in a more recent version than the one Ubuntu Lucid currently has in their repository. As I write the software on my desktop, I found out pretty quickly that I was using an old version of one of the commands (more specifically ogr2ogr and the clipping functionality).

Thanks to this site for the initial tip, it’s pretty easy to get the latest “unstable” release of GDAL installed without having to manually compile the program from source code yourself.

If you are using Karmic or above, you can run these commands:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable

Or you can opt for the more involved version below:

In your desktop, navigate to here:
System -> Administration -> Software Sources
“Other Software” tab

Add these two items:

deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu  main
deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu  main

Where in my case, would be lucid…

You will also need to run from a terminal:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 314DF160
sudo apt-get update

If you don’t have GDAL installed, you can install it from the terminal by:

sudo apt-get install gdal-bin python-gdal

“python-gdal” being optional…

Otherwise, you can use the standard Ubuntu update program to install the newest version on your computer:
System -> Administration -> Update Manager
Run through that and you should see a new version of GDAL show up to be installed. Install those updates to get the newest version!

Setting Up Netbeans and Ruby

Saturday, November 14th, 2009

I’ve been considering some development with Ruby and Rails. As I’ve used the Netbeans IDE before and liked it, I downloaded the Ruby version to give it a try.

The main benefit here is that you can do a lot of things without the console. I can add models, scaffolds, migrate databases, and such with a few clicks.

The current default install doesn’t have the most current version of “JRuby” (that being ruby created with 100% Java) installed, so I opted to figure out how to update Netbeans with the most current interpreter.

Here is a quick list of things to do:
download the Ruby Netbeans IDE

Download latest version of JRuby

Install the new version to:
C:\Program Files\NetBeans 6.7.1\ruby2\
Depending on your install directory of Netbeans.

A directory will be created: jruby-1.4.0
Depending on the currently available version of JRuby.

In Netbeans, go to the platform manager in the menu “tools >> Ruby Platforms”: Select auto-detect platforms, or add a platform and browse to:
C:\Program Files\NetBeans 6.7.1\ruby2\jruby-1.4.0\bin\jruby.exe
This links the newly installed one with the IDE.

When creating your first project, one of the wizard steps will have a “install rails” button, click that and allow it to download and install rails for the new version of JRuby you just added. Currently that would be version 2.3.4.

Install the “activerecord-jdbcsqlite3-adapter” ruby gem through the menu item “tools >> ruby gems” if you are interested in using the sqlite database engine.
(in your database.yml file make development and test use… adapter: jdbcsqlite3 instead of sqlite3)

Change the server used to Webrick when creating a project, in one of the wizard steps (much much faster than that glassfish one) .

That’s about it to get started. I’ve started playing around with creating models and scaffolding, but I have yet to do anything worth while. I think I need to read up on the Ruby language itself to get the basic syntax down.

Edit:
I started reading and tinkering with some code for a few days.
I’m not too impressed with Ruby/Ruby on rails so far. It doesn’t seem any easier than any other language to use. It seems more like jumping through predefined hoops to get anywhere. It has some great ideas in it like parts of the data model and the ruby syntax itself. I might give it a try again sometime, but for now it is likely I will try a PHP/framework combo instead.

Getting .NET COM Interop DLLs Working

Wednesday, October 1st, 2008

I recently finished working on a macro program where the software’s interface is COM.  Everything worked great until I wanted to transfer the macro over to a test client computer.  The program I was writing the macro for requires some registry entries, so I assumed that was all I needed to do.  After about 2 hours of having issues I figured out how to get the macro working on computers other than the one I developed the macro on.

What happens automatically when developing COM innerop projects in Visual Studio is that the IDE automatically registers the DLL file behind the scenes, so when the program that is going to use the macro starts up, it can find the DLL file (assuming the “register for COM Interop” is checked in project properties).

When transferring over the macro DLL(s), the client computer does not have the correct registry entries, so when the program attempts to load the macro, it will fail because it can’t find the macro DLL(s).

Things I learned:
- regsrv does not work on .NET DLLS, you must use regasm.exe (included in the .NET framework).
- just running regasm.exe with the dll name is not enough (there are two methods to getting the DLL visible to COM)

The method I used:
This method is good if you only want one program to see your DLLs, this does not register it with the GAC.
In your project properties inside Visual Studio 2005:
- Select the “Signing” tab, check the “Sign the assembly” checkbox.
- From the drop-down box, select <new>, fill out the fields in the pop-up (eg. key name and password).
- Creating a key for your DLL means that it will disallow people to create a DLL with the same name as yours and so the .NET framework can properly manage dependencies.  If you don’t do this step you will get a warning when you try to run the regasm step below.

- Figure out where the regasm file is so we can use it.  This step isn’t necessary if you use a console window inside Visual Studio. (for .net 2.0 it is in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe), regasm can’t be called with “regasm …” inside a normal console window, unless you added your own dos “shortcut” to the exe.
- Copy all of your output files to where you want them to be.  So for my macro, I had a directory inside the application’s add-on folder.
- Create a  text/BAT file  in the same directory
- include this command in the BAT file:  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm macroname.dll /codebase /regfile:install.reg
- run the bat file in a console window, it will generate a reg file that you can use to install the necessary registry entries to make the DLL visible to your selected DLL file.  Remember that the BAT file needs to be executed in the directory that you intend to run the macro from.  When the REG file is created, it adds various direct paths to the directory, so we need the regasm utility to use the correct path.

Now you can merge the REG file from anywhere in the user’s computer.  It will register the DLL file so that your specified program will find it.  When we write the regasm command line, take note of a few things.  The codebase switch is the directory where the DLLs are located.  the regfile switch is the filename you want the registry install file.  You can run regasm without the regfile switch, but it will install the registry keys directly into the registry.  This is fine, but for me having a reg file is more convenient.

Site Revamp Details

Tuesday, August 19th, 2008

Here is a screen shot of the old site.  It served me well for the two years or so that I had it running on blogger.com.  The great thing about blogging is that I can save bits of important information in one place that I can later come back and utilize. The secondary benefit is that other people can also gain something from my writings as well.

Now that I’ve taken the plunge to into the world of incorporation, I have had a strong desire to improve my web presence.  My first project being this website revamp.

Here is a list of the steps necessary to get from blogger to a custom wordpress blog:
- Install wordpress on my computer’s local server (WAMP).  This is quite easy if you have messed around with developing websites before.  The major steps to that are 1. create a database (wamp has phpMyAdmin preinstalled, so doing SQL stuff is easy) 2. create a new SQL user that has permissions on the new database.  Once the database is setup, extract the wordpress install files to the WWW directory of your server (or wwwroot for IIS).
- Once the wordpress files are in there, I decided to do a special step.  Open my Windows HOSTS file and add two lines:

127.0.0.1       thewayofcoding.com
127.0.0.1       www.thewayofcoding.com

What this does is make my computer think that localhost (127.0.0.1) is actually the IP address of thewayofcoding.com.  This allows me to leave my current blog alone while I work on the new one, setup all aspects of the new site as it will exactly be (any full path links can be tested locally), and just generally makes things a lot simpler.  One thing I noticed is that I had to open a console window and type ipconfig/flushdns to get the changes to register.  The other option would be to restart the computer, but the command is much faster/easier.

Ok, so now at that point I pointed Firefox to “thewayofcoding.com” and went through the directions available to install wordpress, it said to create a configuration file before it could continue.  So you need to create/edit one code file wp-config.php by adding the database information and change a few other lines.

After that, it is a simple install.

Then I spend a few weeks modifying the wordpress code as I needed.  The primary amount of work was in creating my own visual look for the site.  Seeing as I wanted to really improve the layout of the site, I did quite a bit of research on CSS layout methods.  Matthew James Taylor had some of the best layouts I could find with clean code, so I based this layout off of two of them.  As you can notice, the two side panels of this site are fixed to the window size.  The middle panels will scale with the computer’s screen resolution.  So at resolutions around 1600+ width, the site looks pretty nice by using that added space.

From there I searched out a number of interesting plugins and set them up.  I didn’t find anything too exciting, but a few like the poll system are useful.

Lastly I setup and installed some forum software in a sub directory of the site.

All that being said, it took quite a bit of time to setup.  Of course to actually write something from scratch of this quality level would take me a long time.  I’m pretty happy with the result so far.  I still have quite a few more things I want to do with it, so look for updates in the near future!

Here is a picture of the current site for history’s sake:




The Way Of Coding



 
Scott J. Waldron Photography
Stock Photo Website
Tech Learning Site
Follow me on Twitter

Popular Article Tags

Archives

Pages