Friday, September 11, 2015

How to Optimize MacOS Yosemite's WindowServer to Reduce CPU Usage

So I'm not going to waste a lot of time explaining the "how come?"'s here. I'm simply going to give you some tips to reduce CPU usage of the WindowServer on MacOS Yosemite.

So here they are:

  1. MacOS, despite what some may tell you, does require the occasional reboot.  So start there, just to clean things up. 
  2. Shutdown apps you don't need to reduce memory usage, thus reducing the likelihood of swapping. 
  3. Disable Transparent Effects as follows:
    1. Apple > System Preferences > Accessibility
    2. Select Display
    3. Check "Reduce Transparency"
  4. Disable "Spaces" if you're using multiple displays as follows:
    1. Apple > System Preferences > Mission Control
    2. Uncheck "Displays Have Separate Spaces"
    3. Uncheck "Automatically rearrange Spaces based on most recent use"
    4. Reboot
That should do it for you.  :)

If you still have problems, download and install MacKeeper or MacBooster, and follow the optimization instructions provided. 

How to Upgrade Windows 8 to 8.1 so you can then upgrade to Windows 10

To say that upgrading from Windows 8 to 8.1 can be a pain is an understatement.  I'm helping out this one person right now who keeps getting stuck at 82% during the upgrade.  So I thought I'd compile some info around the upgrade process.  Hopefully this journey will bear fruit for everyone having these issues.

To upgrade the operating system to Windows 8.1 following these steps exactly:
  1. Disconnect any external devices connected to the computer like printers, cameras, smartphones, scanners, USB drives, etc. that aren't essential to the upgrade. You can always plug them back in and install them AFTER you get the upgrade done. Obviously the mouse and the keyboard will need to remain plugged in. 
  2. Uninstall ALL antivirus or internet security software before you begin, so they don't interfere with the setup program. This is VERY IMPORTANT. And hey, don't worry, the Windows Defender software will still be running on windows, so it'll keep your system safe during the upgrade process. 
  3. Make sure you install any pending Windows upgrades before you start the upgrade to 8.1. 
  4. If your PC comes with custom "help desk" software that helps you install upgrades/device drivers/bios/firmware updates be sure and do that as well. 
  5. Now do a clean boot of your machine by following the steps outlined here:
  6. Start the upgrade to Windows 8.1
The upgrade will take some time but you should be able to get through it without issue.  If you do have issues, such as getting stuck at 82% for a long time here are some things you can try:
  • Wait for at least an hour before trying anything else.  Many people have reported 45-60m or more wait times and then all of a sudden it continues on.  Knowing what I know about how things are done, this is likely because any devices the setup has trouble with will eventually TIMEOUT.  No idea how long the time out is, or how many times it RETRIES before giving up.  Just be patient, it may work itself out.
  • If things still don't clear up, it's likely that setup is getting stuck on a device driver setup of some sort.  So here are a few things to try, and yes some of them may seem crazy but I'm just compiling a list of things folks have reported seems to work for them:
    • A number of users have reported that unplugging their power from their laptop for a few moments allowed them to get past this point.  It's worth a try, don't ask me why.  Thanks Microsoft!
    • Go to the device manager and uninstalling all NON-ESSENTIAL devices such as (don't worry, you can reinstall this stuff AFTER the upgrade):
      • bluetooth devices
      • printers/all-in-one devices
      • webcams
      • camera/smartphone drivers
      • scanners
      • any older devices you may have had for a while that could hang things up
  • I'll add more trouble shooting tips here as I come across them.
Once you manage to get your PC updated to Windows 8.1 you can move onto Windows 10. Use the following link to do the upgrade:
Here are a couple other useful links from Microsoft on this topic:

Thursday, September 10, 2015

How to Fix Issue Where Windows 10 won't Wake Up From Sleep Mode

Here are the steps to fix the issue where windows 10 won't wake up from sleep mode:

  1. Settings > System > "Power and Sleep"
  2. Select "Additional Power Settings"
  3. Change the settings for the currently selected plan (i.e. "Balanced")
  4. Now select "Change Advanced Power Settings"
  5. Select "Hard Disk" and set the value to a higher value than the default 20 minutes.

Using Lawnchair in Angular

In case you're looking for a way to call lawnchair from angularJS, here's a handy service factory:

  .factory("LawnchairFactory", function($window, $log, $parse) {
    return function(name, config) {
      var collection = {};
      var array = [];
      var isArray = config && config.isArray;
      var idGetter = $parse((config && config.entryKey) ? config.entryKey : "id");
      var transformSave = (config && config.transformSave) ? config.transformSave : angular.identity;
      var transformLoad = (config && config.transformLoad) ? config.transformLoad : angular.identity;
  
      function getEntryId(entry){
        try {
          return idGetter(entry);
        } catch(e) {
          return null;
        }
      }
  
      function lawnchairBucket(callback) { return new Lawnchair({name:name}, callback); }
  
      function saveEntry(data,key) {
        key = key.toString();
        if(angular.isObject(data) && data !== collection[key]){
          collection[key] = collection[key] || {};
          angular.extend(collection[key], data);
        } else {
          collection[key] = data;
        }
        var update = {key:key, value:transformSave(collection[key])};
  
        try {
          lawnchairBucket(function() { this.save(update); });
        } catch(e) {
          if (e.name === "QUOTA_EXCEEDED_ERR" || e.name === "NS_ERROR_DOM_QUOTA_REACHED") {
            $window.localStorage.clear();
          }
          $log.info("LocalStorage Exception ==> " + e.message);
        }
      }
  
      function updateArray(data){
        array.length = 0;
        _.each(data,  function(o) { array.push(o); });
        return array;
      }
  
      function updateCache(obj,key) {
        if(obj && angular.isObject(obj) && collection[key] && collection[key] !== obj){
          angular.extend(collection[key], obj);
        } else {
          collection[key] = obj;
        }
      }
  
      function updateCacheFromStorage(cache, storage) {
        if(storage){
          if(angular.isObject(storage.value) && angular.isObject(cache)) {
            angular.extend(cache, transformLoad(storage.value));
          } else {
            cache = transformLoad(storage.value);
          }
          updateCache(cache, storage.key);
        }
        return cache;
      }
  
      function allAsCollection(callback){
        lawnchairBucket(function() {
          this.all(function(result) {
            angular.forEach(result, function(o) { updateCache(o.value, o.key); });
            if(callback){
              callback(collection);
            }
          });
        });
        return collection;
      }
  
      function allAsArray(callback){
        return updateArray(allAsCollection(function(data){
          updateArray(data);
          if(callback){
            callback(array);
          }
        }));
      }
  
      function removeEntry(key) {
        delete collection[key];
        lawnchairBucket(function() { this.remove(key); });
      }
  
      function getDefault(key) {
        if(collection[key]) {
          return collection[key];
        } else {
          var  d = {};
          idGetter.assign(d,key);
          return d;
        }
      }
  
      var lawnchair = {
        collection: collection,
        save: function(data, key, clear) {
          if(!data){
            data = collection; // if nothing is set save the current cache
            key = null;
          }
  
          if (angular.isArray(data)) {
            angular.forEach(data, function(e, index) { saveEntry(e, getEntryId(e) || index); }); // Save a Array
          } else if(key || (data && getEntryId(data))) {
            saveEntry(data, key || getEntryId(data)); // save one entry
          } else {
            angular.forEach(data, saveEntry); // save a collection
          }
  
          if(clear) {
            var newIds = angular.isArray(data) ? _.chain(data).map(getEntryId).map(String).value() : _.keys(data);
            _.chain(collection).keys().difference(newIds).each(removeEntry);
            // remove entries wihtout ids
            _.chain(collection).filter(function(entry){ return !getEntryId(entry); }).keys().each(removeEntry);
          }
  
          if(isArray){
            updateArray(collection);
          }
        },
        batch: function(keys, target, callback) {
          var cache = _.chain(keys).map(function(k){ return getDefault(k);}).value();
          if(target && angular.isArray(target)){
            target.length = 0;
            _.each(cache,  function(o) { target.push(o); });
          } else {
            target = cache;
          }
  
          lawnchairBucket(function() {
            this.get(keys, function(result) {
              if(result){
                for(var i = result.length - 1; i >= 0; i--){
                  target[i] = updateCacheFromStorage(target[i], result[i]);
                }
              }
              if(callback){
                callback(target);
              }
            });
          });
          return target;
        },
        get: function(key, callback) {
          var value = getDefault(key);
          lawnchairBucket(function() {
            this.get(key, function(result) {
              if(result){
                value = updateCacheFromStorage(value, result);
              }
              if(callback){
                callback(value);
              }
            });
          });
          return value;
        },
        all: isArray ? allAsArray : allAsCollection,
        remove: removeEntry,
        nuke: function() {
          lawnchairBucket(function() { this.nuke(); });
        },
        destroy: function() {
          for (var key in collection){
            delete collection[key];
          }
          lawnchairBucket(function() { this.nuke(); });
        }
      };
      return lawnchair;
    };
  })

Ask me anything computer related, really.

Last year I was the head coach of my son's hockey team and volunteered a great deal of my time to minor hockey.  The year started out great, and I really enjoyed things, until toward the end of the season.  After that, well, let's just say volunteering just isn't worth the grief we take sometimes.

This year, instead, I'm going to focus on what I do best. All things computer wise.

So, ask me anything.
  • Got a problem with your Mac or PC?  
  • Is your Windows box giving you grief?  
  • Has your PC slowed down to the point where you want to throw it against the wall?  
  • Need some advice on what antivirus and/or internet security tools to buy?
  • Having trouble getting onto your wireless network?
  • Trying to understand how Netflix works?
  • Wondering how to use your iPhone or Android device?
Honestly, if it's computer related, and you need some help, I'm here for you.

Best way to reach me, is by clicking the button below and sending me a tweet, as I check my twitter account regularly.  From there we can converse and I'll see if I can't help you figure things out.



Oh, and don't forget to follow me on twitter as well, cuz sometimes I tweet out stuff that you might find helpful, other times I just aims to amuse.  :)