Computing

Information technology.

When you work in coffee shops you get to make friends with the regulars. Note that I said “in coffee shops,” not “for coffee shops.” I spend most of my afternoons working on my laptop, maybe two or three hours a day. I have no other occupation. Actually, I don’t like work that much. If I accepted a $15/Hr job I would need to work all day, five or six days a week; no thanks. I’d rather charge $50 an hour, thank you. How can I do that?

Computers these days come with a flurry of bundled software. It didn’t used to be that way. You bought a computer, turned it on, and all you got was a blinking cursor. The computer out of the box could do nothing, not even an addition. You had to program it, give it a list of instructions in a language it could use. This hasn’t really fundamentally changed. You just get the “free” software included. Same goes for a web site. Old web pages were simple texts with links, sometimes images. Today they do all kinds of things. You still have to tell the server how to do this, by writing a program.

It isn’t as hard as you might imagine. Think of a program as a recipe. You have a list of ingredients and instructions on how to make a cake. Someone needs to follow those instructions in order to make a good cake. Well, that’s programming. You’re the chef, the computer is the cook who follows your instructions. Great thing is, the cook never makes mistakes! On the downside, he speaks a weird language you haven’t heard before..

Could you do it? Most likely. The main issue people have with programming is patience. Imagine a chef developing a new cake… How many cakes will he botch up before finally getting what he wants? Programming is as much about solving glitches than it is about writing code. It can be very frustrating, but you learn to take a deep breath and keep on going. If you can do this, as well as sit down and concentrate on a task for a while, you are very likely to become a decent programmer.

There is a lot of work in web site development, linking sites to databases and getting servers to talk to each other, like when processing a credit card. I am looking at Android application development right now to see if it could be my cup of tea.. I got my first programming gig after reading a Perl language book and studying for a month… The book cost me $50 and I made $2K the following month using what I had learned. I wouldn’t suggest Perl today but you get the picture.

How much is it going to cost you? Nothing! Only time. These days all you need to know is online. You can go to Udemy and get classes for free or for a reasonable fee. It will take you a while if you never wrote code before, but don’t give up. Sweat it now and make a decent living for the rest of your life. Programmers get paid anywhere from $20 to $200 an hour.

So what language to learn? Apple uses Objective-C and Android uses Java. For the web, learn PHP. If you want to work on servers, Python is very useful and a good starter language. C++ is still a very good option which can lead to pretty complicated (and well paid) work. Learn it along Objective C if you want to get into iOS programming. For Window$ applications I’d suggest Delphi, but finding good support for it has never been easy, though it is a great development platform. There are hundreds of programming languages, if not more, but these are the main ones. I’d suggest not getting into obscure or experimental languages unless you’re already fluent in a marketable one. Don’t forget to learn some database management skills for which I suggest MySQL.

If you like computers and can think analytically, why settle for minimum wage? As a programmer, you can work anywhere in the world if you have an Internet connection. You can choose to work two hours a day or sixteen, it’s up to you. I prefer to work less, charge more and enjoy my free time.

I have seen it happen many times. A client asks me to code their latest great idea into a web site, and opening day has arrived. The site goes online, and… Nothing. No orders or signups that day. None that week, and maybe one or two that month. The days when one could launch a site and recline on a Lazy-boy, watching orders pour in are long gone, if they ever truly existed. Design and programming are only the first steps. It takes constant efforts to promote a site, a daily chore site owners often overlook. So, what steps should you take after launching a site? I will try to give you the minimum list of things to do…

I am not associated with any of the sites I mention and link-to below…

Your first step you be making sure that you have the correct meta tags. These tags are embedded in your pages and provide information about them, such as title, content, related keywords, intended distribution, etc. Search engines use them to classify your pages and link them to keywords. They are an important part of your pages, but because they are not mandatory, many designers do not use them.

Use a robot.txt file. This file tells automated web browsing programs how and what to index on your site. You can specify areas of your site not to be indexed. Robots can ignore it, but the legitimate ones will make good use of it.

You can control spiders/robots more efficiently using a .htaccess file, but that topic is beyond the scope of this article.

Allow your users to share your site on social media. A Facebook page can help you make your site more visible. There are tons of sites to submit yours to, like reddit.com. Add share buttons to your pages!

It is unfortunate that Google has become a quasi-monopoly in web services. You really can’t compete these days if you are boycotting Google, or if they are boycotting you! Fortunately what they offer does work.

Your site needs a site map. Search engines need a map of your site to index it. It is an XML formatted file placed in the root of your site, and often named sitemap.xml. Don’t worry about the format, softwares do that for you. Most E-Commerce software packages have built-in sitemaps. You can also use an online service to create it. Now that you have your sitemap, you need to submit it. Open a google webmaster account to do so. You will be asked to place a small file on your site to identify you as the owner, but that is easy to do. Google will now start indexing your pages, and they will be available (although far down the list at this point) in search results.

The most important factor in Google page ranking is how many sites link to yours. You should ask related sites to provide a link and offer them one on yours. One way to rank higher is to sign-up on related forums and regularly post or answer threads on them. You place your link in the signature of your posts, a setting that is usually available in your forum profile.

There are hundreds, if not thousands of search engines out there. You could visit all of them and submit your site manually, but it would take months. I suggest using a program like SubmitWolf. It will automate the task to a great extent. Even if each search engine sends you only one visitor a day, it will be worth it.

Create a QR code for your site, and post it everywhere. iPhone and smart phone users will have a quick way to get your link from print. Make sure you have a way to track visitors using it.

You need to know who visits your site, where they come from, what pages they load, etc. Open a Google Analytics account, place their piece of code in you page’s footer, and find out! Traffic information is also available in your web server log files, which you should be able to download. You can have a neat report generated and printed with a log file analyzer.

One often overlooked marketing tool is the RSS feed. It is mostly used for news. Your site probably has news too.. After all, it just opened, and isn’t that a big news? An RSS feed is another way to get the word out about your site. Like a site map, you can create it manually or it can be software generated. You need then to submit your feed to RSS aggregators, which will make it available for search, like a search engine.

If your site is selling products or services, it is a good idea to provide useful material which they might search for. For example, if you sell bathroom fixtures, provide tips on plumbing, soldering pipes, etc. Visitors are then more likely to find your site looking for related subjects.

You need to work on promotion every day, online and off-line. Don’t forget more traditional avenues of marketing, they work too! If you are still not getting enough visitors, try Google Adwords. You will pay for your visitors, but if it generates more profit than you spend, it is a good way to acquire new customers who might become regulars.

It does take a while to build traffic. Keep at it, update your site regularly, and soon or later, they will come!

I answer that question fairly often. There used to be very few choices. When I was about fourteen, my parents bought me a Sinclair ZX81 with a whopping 1kb of memory. After you turned it on, a prompt appeared, then, nothing… Pretty disappointing at first. You had to learn the Basic programming language to get it to do anything. I’ll be forever grateful to them for spending the equivalent of a thousand dollars on technology that at the time, was just a novelty. Today I make a living sitting in coffee shops sipping frappuccinos and writing code; better than digging trenches…

We have many other choices these days, and deciding which language to learn first can be a difficult decision. I will assume here that your goal is to learn skills you can market to hopefully make a decent living. Otherwise, go ahead and learn anything you’d like.

Most current languages are based on C. There is a lot of hoopla about Object Oriented Programming, and you certainly will need to know OOP, but as a first language, C can’t be beaten. C++ and Objective C are both subsets of C, and if you learn both, you can program on any platform there is, Windows, Linux, Mac, and iOS. Java is also based on C, and platform independent. For web programming, PHP uses a lot of C-like syntax. You simply can’t go wrong with C. Sure, it can be a pain in the ass. Pointers and memory management are, at first, rather annoying. It does however ingrain in you good programming practices an you will appreciate the higher level languages when you get to that point.

So, how do you learn C? Sams Publishing has the best programming books in the business. I suggest “Teach Yourself C in 21 Days,” by Jones Aitken. It provides you with a timeline to follow, reading and working on one chapter per day. Sure, you won’t be selling software after 21 days, but you will have a solid base upon which to build.

Where to go from there? It depends on whether you plan on developing for Windows or Apple OSX. For Windows, C++ is the natural progression. Java is also a good choice, and will allow you to code for Android devices. Objective C is used on all Apple products, Macs and the iPhone, iPod and iPad family of devices. If it was only for Macs, I wouldn’t bother. Not that I have anything against Macs. I just bought a Mac Mini, and OSX is superior to both Linux and Windows (which for the later isn’t very hard). Programming for Linux, well, there isn’t much money there, as you would be competing with hordes of programmers working for free.

I would definitely suggest checking out C++, Objective C and Java for your Post-C learning adventure. Sams Publishing has great books in their 21-days or 24-hours series to learn them. For Objective C, see the O’Reilly book: “Programming in Objective-C” by Stephen G. Kochan.

There are three languages I would like to mention on top of these choices. They are, in my opinion, excellent and worth a good look.

The first one is Python, and excellent platform independent scripting language which can be used to write command line tools, and even full fledged graphical applications, if you ever wanted to take it that far. I use Python almost daily to write database management programs. Perl used to be my first choice for such tasks, but Python is more organized, and has many modules available to do practically anything. And excellent book to learn Python is “Learning Python” by Mark Lutz, from O’Reilly.

A note on O’Reilly books. In my opinion they are of two kinds: The first is great books, even for the beginner, with clear explanations and easy to follow. The second is incomprehensible techno babble that is only readable by autistic savants. There is no middle ground. So, when you buy a book from them, make sure it falls in the first category.

The second is Borland (now Embarcadero) Delphi. The second language I learned after Basic was Turbo Pascal. It is a very good, fast and simple compiled language. For some reason I fail to understand, it has fallen out of favor; same goes for Delphi, which uses Pascal at it’s core. However, Embarcadero released Delphi XE2, which allows you to program for Windows, Mac and iOS at the same time. There is no faster Rapid Application Development tool anywhere, to my knowledge. I have a handful of shareware programs written in Delphi, and plan to use it again, when I can afford the $900 Professional version.

At last, for the web, PHP is the right choice. You can use PHP with Ajax, Javascript and of course HTML. PHP is great to connect to databases like MySQL. I use PHP daily for my customers and myself. Note that Ajax and HTML are not programming languages.

I hope you will find my suggestions useful. Have fun coding and don’t overdose on coffee!

Here are a few MySQL date selection queries:

Today:
SELECT * FROM table WHERE adate=CURDATE();

 

Yesterday:
SELECT * FROM table WHERE adate > DATE_ADD(CURDATE(),INTERVAL -2 DAY) AND adate < CURDATE();

 

This week (Sunday-Today):
SELECT * FROM table WHERE YEARWEEK(adate) = YEARWEEK(CURRENT_DATE);

 

Last 7 Days:
SELECT * FROM table WHERE adate > DATE_ADD(CURDATE(),INTERVAL -7 DAY) AND adate < = CURDATE();

 

This Month:
SELECT * FROM table WHERE YEAR(adate) = YEAR(CURDATE()) AND MONTH(adate) = MONTH(CURDATE());

 

Last Month:
SELECT * FROM table WHERE adate BETWEEN date_format(NOW() – INTERVAL 1 MONTH, ‘%Y-%m-01’) AND last_day(NOW() – INTERVAL 1 MONTH);