PORTCOMMODORE.COM / LARRYMADE.COM BLOG

Happy Birthday To Me!

From what all the 'old fogeys' I talk to said to me - I'm still young at 45.

What did I do for my birthday? Go to the dentist! (no, really - I picked that day). My philosophy on that is it is celebrating a a step in personal progress, something I should do more often and having something like that to checkoff on my to-do list on my birthday, is a good feeling.

Eventually I'll get to more technical discussion, hang in there. 8-) This Blog enabled Dokuwiki is soo much more comfortable to work with, of course I like the Wiki format text editing. ^_^

~~LINKBACK~~ ~~DISCUSSION~~

2011/04/17 16:50

Some of My Favorite Software Tools

Here are some of the Software/Development tools I like, many of which BTW are Open Source and/or free.

Inkscape - Great Vector art program. While Photoshop is something a lot of people live by, I prefer to deal with lines and graphs and repositionable objects, for the longest time it was Appleworks Draw then a while with Adobe Illustrator, but given im not rich and I like to share I pick Inkscape for its portability and its price. Check out the screen shots to knock your socks off on what it can do!

GIMP - Not terribly pleased with some of the features or lack thereof (i,e, you need a tutorial to learn to draw a simple box - really!) but it does great stuff and it has promise. I mainly use it to adjust levels, crop, and convert image formats. Like most highly developed open source applications, it supports just about anything.

Quanta Plus - This is the odd case of a superior web development environment languishing while waiting for a version upgrade. Regardless of the pace of KDE4 tools development, Quanta 3.5 is an excellent web tool, it integrates the excellent KATE editor as well as many HTML tools, and finished it all with a great site development manager. Despite being more unwildy in Ubuntu it is still worth a serious look.

Meld Diff Viewer - While KDE's quantum plus is the bees knees for coding Gnome's Meld's diff utility is a great tool for directory/file comparison. Diff utilities will scan two files - or directory trees too as in Meld's case and highligh the differences. Meld offers great side-by side screens, with easy to follow comparison and click or edit ease of editing either source or target panes.

Gnome/Gedit - Wile I like KATE, Gnomes file manger along with GEDIT make life so much easier. I can do quick fixes on remote FTPs as if I were working on the file locally, that is slick.

IDLE - I haven't done much with Python yet but I like the Python Interpreter IDLE, lets me do on the fly calculations in the interpreter terminal, much more usable then a calculator widget.

OpenOffice.org - Replaces thos commercial Office programs for me, adds excellent drawing tools, can create PDFs on the fly (including fillable forms), and is rightly cross-platform and I can share it with my friends - bliss.

Scribus - High End DTP in open source. Has had a slow start but with 1.3.5 alot of the rough spots have been smoothed out, if you use the like of PageMaker, InDesign or Quark, take a look at Scribus.

Team Viewer - One of the few commercial tools - a remote desktop support that does not require complicated setup to connect. Has offered a free for non-commercial use and just recently a Linux version to go along with the Mac and Windows versions. My work bought a corporate license, probably one of the best purchases we have made.

PHPMyAdmin - Doing MYSql work with PHP or on a webhost and never heard of PHPMyAdmin? Drop what you are doing and check it out. While you should know the MySQL nuts and bolts PHPMyAdmin gives you the power tools to make life less tedious. There is also PHPPGAdmin for PostgreSQL, though somewhat different it looks just as invaluable.

Firebug on Mozilla Firefox - Im just getting into this with CSS, it is excellent for debugging webdesign.

Screen Grab for FireFox - Ever wanted to get an image of a web page as it looks on the browser, not what the printer makes of it? Screengrab is the answer even captures flash.

~~LINKBACK~~ ~~DISCUSSION~~

2011/04/17 16:50

My Table Field Naming Tips

There are lots of guidelines for naming functions, objects and variables in PHP and other languages but when I started with MySQL I didnt find one that applied to databases. Fortunately I did one I saw once in an example (I don't remember where) and have added to it.

So here it is:

tablename_fieldname[type]

So, for a simple mailing address list I would create these fields:

table name: addresslist

Fields:
  addresslist_id  ((all my tables have an 'id' field*))
  addresslist_firstname
  addresslist_lastname
  addresslist_mailaddr1
  addresslist_mailaddr2
  addresslist_mailcity
  addresslist_mailst
  addresslist_mailzip
  addresslist_taglist ((the 'list' at the end indicates an imploded list))
  addresslist_update  (('date' at the end indicates a date field))

Then say I had another table subscription, that relates to current subscriptions of folk in the address list

table name: subscription

Fields:
  subscription_id
  addresslist_id
  subscription_publication
  subscription_startdate
  subscription_enddate

As you can see, it's pretty apparent what fields are related to what tables.

With these guidelines I can do some really cool stuff without having to hard code tons of specific field/table logic in my scripts, (which again, is another post.)

Think about it - it is a bit more typing, but besides the benefits in scripting it also adds much more readability into your code such as this query:

SELECT
    *
FROM
    addresslist a
    LEFT JOIN subscriptions s
        ON s.addresslist_id = a.addresslist_id
WHERE
    subscription_startdate <= 20100501
    AND subscription_enddate >= 20100501
    AND subscription_publication = 'News About Me'

Historical tables

Now I have an alternative table style for data that gets updated but never gets deleted… the records are datestamped (could be timestamped but I felt date was fine grained enough for my purposes) So those tables have more common fields:

Table: addresslist

Fields:
  addresslist_rid
  addressllist_id
  addresslist_begin
  addresslist_end
  .... rest of field set
  

Each change would be a new record with a new record id (rid) but the same general data id (id). On the old record, the “end” date to be made to be the day before the change. On the current record, the begin date to be the date of the change. And for “current” data records I put a max value in the end column.

Example: (for external compatibility I record my dates in a YYYYMMDD format, though the MySQL date format is good too) Here is one historic record, created 9/23/2008, and then updated 7/13/2010:

addresslist_ridaddresslist_idaddresslist_beginaddresslist_endother fileds…
565 123 20080923 20100712
1022 123 20100713 99999999

If you are willing to take the time this could be optimized, where all you need is a begin field, and that could be the rid, but partly for time and also readability sake, I chose to leave my structure a bit more verbose.

(Note I don't normally use numeric ids, but currently a 15 byte varbinary fields… and that is a great subject for another post ;-) )

Thats it for now, hope that gives you some guidance and/or inspiration.

~~LINKBACK~~ ~~DISCUSSION~~

2011/04/17 16:50

Necessity is the Mother of Invention

Most inventions are made because people develop an answer to a need. Regardless of the education or skills of the creator, invention still happens. When I read about how you need this degree or that education to be a productive member of modern society I recall newsreels Ive seen from the 1920s and 1930s of lots of ordinary Joes' working on new inventions… Many of what I remember of those are the humorous flops, but amongst all those there were many successes.

The only difference nowadays is there is quite an industry setup to try to snatch up these personal innovations and market and exploit them to the fullest return on profit. So most of the time you don't see that individuals are still are the key to progress. And when you try to succeed you are met with many nay sayers saying “you can't do that, it's impossible.” That is because to them, they don't see the possibility. Find out for yourself, even if you don't succeed you learned more than it's just plain impossible.

~~LINKBACK~~ ~~DISCUSSION~~

2011/04/17 16:50

LAMP Rocks!

A few years ago I had to revamp our database (written in FoxBase), after frustration with Microsoft's FoxPRO (don't trust MS for supporting thier Applications) much research I chose (without knowing it) the LAMP stack, which consists of:

  • Linux OS
  • Apache Webserver
  • MySQL database
  • PHP programming language

Also along with those, you have to throw in a few more skills such as HTML web page markup, and now CSS for styling. But the efforts are worth it, all the tools are logical and though at times tough to absorb, make sense and provide opportunity for unimagined success.

The Stack

Linux itself has more use beyond serving web pages and being a server, it also is my primary work and home platform. So many good tools to help one out. But back to serving, Linux and other Unix and POSIX compliant OSs run most of the Internet servers, with Linux hosting the majority of the Web, due to its reliability and free/open-source software appeal.

Apache is probably one of the most alien bits you will learn if you haven't done Internet services, but once you get that (and there are many guides on-line to help) it's practically worry free.

MySQL - Wow, compared to the old FoxBase it is something else; I can write a couple K long query and it grinds through it in half a second, I'm regularly amazed at how wicked it can relate things together. And I have yet to try scalability (not a bit issue presently), but from what ive seen/read it is pretty painless to implement. Though in an earlier blog post I mentioned the potential in PostgreSQL, which I see the eventual transition not too siginificant (mainly tightening up the loose MySQL Syntax to be more SQL standard, which PostgreSQL leans toward).

PHP - Syntax is easy to read and follow, if you use high level languages like Pascal or xBase you will pick it up really quick. Implementation of a web app is a new experience as each time you do a new page you are technically starting from scratch so inter-page data management is a new skill to learn. Two things that make it exciting is loosely typed variable, you can use a numeric value as a sting and a number without conversion, if you need more strict typing there are provisions to ensure this. Second are the arrays, which can be referenced by numbers or text, and can contain any other variable type including arrays themselves. (some will warn that these features can be dangerous in the wrong hands, you need to know security and add some failsafes, but there are many good guides on handling those things and the effort is worth the outcome.)

Pulling It All Together

For Linux there are many distributions what will get you going with LAMP on a server or on your desktop for internal development, for the Mac and Windows there are a couple freat tools, WAMP and MAMP which in the Macs case makes setting up the M(ac)AMP stack way easier (but then you won't have the easy access to some excellent Linux tools)

If you are looking to try web development then check out LAMP, also go to your local bookstore and peruse the PHP and MySQL books, as those are the core of LAMP web development - you won't be disappointed.

Of course I'll be writing more about it as I get going on this blog, so stay tuned.

~~LINKBACK~~ ~~DISCUSSION~~

2011/04/17 16:50
Last modified:: 2020/11/22 08:33
   
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International