Archive for the ‘Programming’ Category

C and C++ are NOT losing ground!

Friday, April 25th, 2008

The TIOBE index managing directory, Paul Jensen, was recently interviewed by Dr. Jobbs.  The question posed was regarding C and C++ losing ground in the top programming languages being used, in which he claimed they were simply because they did not have better memory management and automatic garbage collection like C# and Java.  

Just because C and C++ do not have such memory management does not mean that will no longer have a place in the industry.  C has been around for ages and is still being used to write new code.  Have you heard of LINUX?   The Linux kernel is written in C.  Does this mean Linux is losing ground also, because it will eventually lack developers that know C?   C++ code is found everywhere, including most of the computer games that are being enjoyed today.  Does this mean those games are losing ground as well and should be rewritten in Java or C#?    You also mentioned that Python replaced Perl on the index because Python was object oriented.  Your group needs to research that a bit more as Perl also has an object oriented structure now.

 While I like coding in C# and Java, I seriously doubt they will dominate the market completely.   Not only due to maintenance of legacy applications, but also because speed and overall performance is superior to automated memory management, especially when such memory management is still available in C and C++, if the programmer is able to implement it correctly.  You will need a bigger bullet than garbage collection to kill off these languages.  

 On a side note, are you sure that the level of web presence a programming language has on the web is truly indicative of its actual usage or value to the industry?   I wonder if I were to post thousands of videos on YouTube  showing how to write code in C++, if it would “regain” its position on your index?  Bah.

Switcing to ASP.Net for web development…

Thursday, March 20th, 2008

After reading a few industry reviews, I quickly realized that ASP.Net was the language of choice for most web applications.   For years, I have been favoring PHP due to its close similarities to C++.  However, outside of a few open source projects, PHP is not in very high demand, at least in my region.   I will still maintain my existing PHP applications, write the occasional PHP script to administer a few web sites, and of use it for a few projects at work (seeming as how we are a Solaris shop).   However, most of my web development effort will be migrated over to ASP.Net in order to user C#. 

 The first thing to resolve was the fact that my home web servers are running Apache over Linux.  Obviously ASP.Net favors IIS over Windows for the web server.  Being that I have had experience in writing portable applications between Windows and Linux via Mono… I decided to take a look at Mono to handle running ASP.Net over Linux.

 The solution was mod_mono available and documented here:  http://www.mono-project.com/Mod_mono.   Mod_Mono is an Apache 1.3/2.0/2.2 module that provides ASP.NET support for the Apache web server.  Stay tuned for a few web apps I have coming down the pipes…

Apple iPhone SDK released…

Monday, March 10th, 2008

The Apple iPhone Software Development Kit has been released!    I may switch gears a bit from mobile development on Palm TX over to the iPhone.  The SDK and related documents can be found here:  http://developer.apple.com/iphone/.   I’ll post my first iPhone program as soon as I get a chance to test it out.  

There is also a $100 million iFund for startups developing applications for the iPhone.

The new C++ standard… C++0x

Thursday, November 8th, 2007

“C++0x is the planned new standard for the C++ programming language. It is intended to replace the existing C++ standard, ISO/IEC 14882, which was published in 1998 and updated in 2003. These predecessors are informally known as C++98 and C++03. The new standard will include several additions to the core language and will extend the C++ standard library, incorporating most of the C++ Technical Report 1 libraries - most likely with the exception of numerical libraries.”

http://en.wikipedia.org/wiki/C%2B%2B0x

Python to grab zip codes.

Friday, January 19th, 2007

I had a need for a list of zip codes and some other relavant information and a need to tinker with Python… So here is a small script that will go to a few zip code sites and save the codes and other info to individual text files for later parsing. I must say this was relatively quick and easy compared to what I would have had to write in C++ to do the same thing.

*NOTE: Don’t use this code to plague the sites, they normally shut you down around 130 hits any way. Although, I programmed a way around that, but due to those interested in DoS attacks, I will not post that here. If you have a need for the zip codes, I can make my zipcode database available to you.

import urllib2

zip=10000
while zip < 99999:
#address = “http://www.zip-codes.com/zip-code/” + str(zip) + “/zip-code-” + str(zip) + “.asp”
address = “http://zipinfo.com/cgi-local/zipsrch.exe?cnty=cnty&ac=ac&tz=tz&ll=ll&msa=msa&zip=” + str(zip) + “&Go=Go”;
website = urllib2.urlopen(address)
website_html = website.read()

print “Processing zipcode: ” + str(zip)

filename=”data/” + str(zip) + “.html”
myfile = open(filename,’w')
myfile.write(website_html)
myfile.close()
zip = zip + 1;

Code Archive Status

Friday, November 17th, 2006

For about a year now, I have been wanting to make a source code archive in order to facilitate code reuse, etc.

After taking an inventory of all of the code that I was going to put in an archive, I came up with 166,838 source code files… totaling 4.7GB. These figures are for code that I wrote between 1992 and 2006, and the numbers do not include special projects or five languages that I started with in the late 80s early 90s. So the actual figures could be closer to 500,000 and 5GB.

I have decided that all of this code will not make it to my code archive. In fact most of it will end up deleted or as code snippets from which a library will be built, for each language.

I have laid the ground work for the code archive, which will function much like my existing knowledge base. All I have left to do is sift through the mounds of source code… and being that I’m not one for data entry, this could take a very long time. :)

-Jason

JP_FishString: Modification to the Blowfish Cipher

Wednesday, June 7th, 2006

I started looking into the Blowfish encryption/decryption algorithm for a few projects that I have started working on. I quickly realized that the algorithm, as-is, had a painful way of handling strings for standard text:salt pairs. So I created a shared library to extend the Blowfish algorithm that contains wrapper functions to allow strings to be passed into the base Blowfish_encipher and Blowfish_decipher functions. For a few laughs� I named it FishString. Since it is used for some secure applications I am working on, I am not able to release the source; however, I will submit the *.o file and the binary created during testing (which can be used as a command line based encryption / decryption tool). Available by request only.

Perl script to generate MD5 hashes

Tuesday, May 16th, 2006

#!/usr/bin/env perl

# This perl script generates MD5 Checksums
# Jason Powers
# 16 MAY 2006

use 5.8.6;
use strict;
use IO::File;
use Getopt::Long;
use Digest::MD5;

my $myFile = $ARGV[0];
my $md5 = Digest::MD5->new;
my $check = 1;

open(FILE, $myFile) or die �Couldn�t open $myFile for md5 checksum generation.�;
binmode(FILE);
my $sum = $md5->addfile(*FILE)->hexdigest;
close FILE;

print “\n—————————- \n”;
print “MD5 Checksum of $myFile:\n”;
print “$sum\n”;
print “\n—————————- \n”;