Rule Number One

Illustration

I got into discussion with friend about best practices when it comes to designing things around PIC micro-controllers. One that we agreed on was to never, absolutely never use ICSP (in-circuit serial programming) pins for anything other than connecting to PIC programmer.

Yes, I know that there are things that you can connect safely to those pins while having them functional as far as programming goes. Yes, I am aware that I am talking about two-and-half perfectly good I/O pins (PGC, PGD and MCLR). Yes, I am probably overreacting. Taking all into account, I still stand by my recommendation.

I know how it goes, first PGC and PGD are left alone. As design develops, we seem to be one pin short. No biggie, we just use PGC for a button. Simple button cannot hurt. Then we need status LED, PGD can do that!

As design develops we move pins back and forth and, sooner or later, we end-up with something like pull-up or diode on ICSP. And that spells trouble. I will not even go into how exactly are we to use ICSP for in-circuit debugging if we have to use it for e.g. input button that triggers action we are trying to debug.

I am not saying it is impossible to use ICSP in your circuit. Those pins can serve as excellent last resort. But most of time it is better to go for a bigger gun PIC.

P.S. Yes, I broke ICSP rule fair number of times.

Pain in the *Ss

Being in USA these days is getting annoying.

I am in EDT time zone for a few days now and rest of world is still on standard (aka winter) time. That means that difference between myself and my home Croatia is one hour less than it normally is. Or is it one hour more? This is getting confusing.

I would understand if US decided to stop using daylight savings (or better, make it permanent). That way I could blame rest of world for being too backward to kill useless tradition. However, some idiots politicians decided that it would be great thing if USA could be out-of-sync with rest of world’s time zones for two weeks.

Thank you.

A Two Weeks With Windows 8

I have forced myself to use Windows 8 at home for previous two weeks. And best way to describe them would be as tablet OS.

Best example of tablet-centric behavior is seen if you search for “Computer”. You will get known “Computer” icon on which you might want to do right-click (in order to get context-menu). If you do this, context menu will appear but at bottom of the screen. So you need to take your cursor all the way down the screen. Pointless. And it is annoying that you cannot use keyboard to do that at all. Pressing context-menu key brings menu for text box and not for currently selected item. You first need to use arrow keys to go up/down and only then you can use keyboard properly. Unpolished to say the least.

Search that worked perfectly in both Windows Vista and Windows 7 is lacking. You cannot search for Printers, Devices, Programs… all those items that resided in start menu are not easily accessible by search. Yes, you can go and CLICK on Settings bellow, but that is solution that is more oriented toward tablets and guys using mouse. If you want keyboard you can get it with Win+W (very logical indeed) but at cost of time for switching. It gets even worse when you are not sure where something is.

Windows SmartScreen technology helps to annoy user further. It checks each file downloaded over Internet and, if not enough users downloaded that application through Internet Explorer, it will force you to jump through hoops to run it.

As network goes, Windows Vista/7 hid everything behind one more click than it is really necessary. However, if you had network connected, that network was shown in notification area (aka tray). In Windows 8 it shows state of whatever adapter it wants. Chance will have it that it is not adapter that you are using currently. So you can have icon with exclamation point while your network works perfectly. To show it you need to click on icon with warning.

Those were the things that I hated the most during regular work but they weren’t only ones. I think that almost every single feature of Windows 8 was unfinished and it was very obvious. I understand that it is not fair to compare beta (or consumer preview) of Windows 8 with finalized product that is Windows 7. However, I remember Windows 7 beta. I had no reservations to start using it immediately. There was virtually no downsides to it. Comparing two betas, it feels like Windows 8 was rushed…

Single excellent thing about Windows 8 is their ability to boot off the USB. And it is fortunate that they do since I am erasing them from my hard drive.

Cheap Bastards

Illustration

It is very sad to see illegal downloads driving Sony Music so poor that they cannot afford to have proper SSL certificate. It is either that or team creating these pages just didn’t give a damn.

Well, at least they do offer SSL…

Force HTTPS for WordPress Login Page

If you do have SSL certificate on your domain it would be shame not to use it for WordPress login. Since WordPress sends passwords as plain-text, it would be great thing if we would be redirected to HTTPS version for every login (even if we forget to specify it).

Solution lies in adding few lines to your .htaccess file:

RewriteCond %{HTTPS} off
RewriteRule ^wordpress/wp-(login.php|admin/)(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

This code checks whether we are going to login or admin pages. If we are and https is not protocol of our choice, it will simply rewrite request.

P.S. This example was taken from my pages where I have WordPress installed in sub-directory named wordpress) If you have it installed in some other directory, adjust accordingly.

P.P.S. Do not forget to set FORCE_SSL_LOGIN and FORCE_SSL_ADMIN also.