Tuesday, February 9, 2016

I still find airline pricing humorous...

Southwest

Delta
I still find it so funny that airlines like Delta and United try to fool us or blame the government and airports for the cost of airfare going up. They itemize taxes, do not even mention the cost of baggage until later, when you checkin, and so many people still do not look at the details. They see 165 and 175 and head for Delta... "it's cheaper".

Meanwhile, Southwest is totally transparent "this is what we are charging you, for everything."  Why would you ever fly Delta?!? 

Okay, okay... I do fly Delta.  Why? Legacy. We have miles there, we have companion tickets due to our credit cards, and disentangling requires a (I know, little) bit of effort. Sometimes we fly Delta (two people for about $500) RT from ATL-SMF.  Then it is worth it... sort-of... I always have to remind myself that I pay for the credit card... then I remind myself that we don't have to pay for checked bags... and sometimes my wife and I have 2 checked bags!  Also, sometimes when time is tight, it is great to fly direct.
 Cracked me up last time we flew, Delta tried to put both bags under my name and charge me a baggage fee for my second bag. That was at the counter in Sacramento. What!!! Do they think you are so dumb as to NOT know!?!?  Yep, unfortunately, I think that most airlines do thing we are dumb.

One more rant... about our pets... (see my Change org pet petition).  On Southwest, we never worry about the crate not fitting under the seat. It just DOES.  On Delta, lots of different aircraft and seat configurations... always a concern... and they bother you more about the pet.

Done!

Friday, February 5, 2016

Microsoft's underwater datacenters

This is about http://natick.research.microsoft.com/ and a worry about the future.  We already place a large burden on the oceans.  They take our waste products and our effluent.  All of these things raise the temperature of the oceans somewhat. Microsoft's impact might be minimal but I am as concerned about thousands of datacenters off our coasts as I am hundreds of oil wells.

How far away can the noise of the system be heard by whales and dolphins?

We know that pollutants travel differently in air than in water, but one of those pollutants is sound. http://dosits.org/faq/ has some interesting facts about sound in water and the impact on ocean life.

I am not an expert on datacenter noise, the impact of sound on local ocean life (and how far away the sound travels from the datacenter) nor how much heat thousands of such systems could transfer to the gigantic heatsink of the oceans, lakes and rivers that may eventually be used to cool datacenters.  I just have this sense of dread of yet another way to use and abuse our environment to allow, and encourage, data collection about each and everyone of us for the sake of market research, and monitoring our behavior for other reasons.

Just saying...

Wednesday, December 16, 2015

Throwback Thursday inspired python code.

Throwback Thursday inspired code.

For anyone else out there finding this, if you take the code and modify it or put it somewhere else public, let me know. If I do such a thing, I too will let you know.

First off, all I wanted was a way to find images for Throwback Thursday and I have a very messy folder called Pictures and in there my photos go back to 2003, November.

Some are older, but their modification/creation dates on my computer will not reflect their true date/time so this tool will be useless for those. Unless I modify it later, for example, I can think of an improvement. . . if date modified content does not match date in name of file (parse the name of the file) then use the name as the date.

[update] I am not sure how to make this better. It is definitely not 100% accurate. For example, today, some of the 10 images I've pulled up were created on 9/6/2012 (Thursday) BUT they were created for a web-site by a script I used in the past.  By pure coincidence, it also happens to be originally taken on Thursday, July 19, 2012... so, here it is :).

Angel Island, Thursday, July 19, 2012


The code is currently below. I also put it on Siafoo.

================================= usage:

Mac OS X Terminal with python3 and python installed.  This python3 is 3.4.

Show in Mac Preview app 10 files of png or jpg found in /foo/bar directory:

python3 tbt.py /foo/bar/ -n 10 -m

List all files in /foo/bar directory:

python3 tbt.py -l /foo/bar

List all options with -h:

unknown68a86d404130:play michaelcase$ python3 tbt.py -h
usage: tbt.py [-h] [-d D] [-l] [-m] [-mw] [-n N] directory

Program for "Throwback Thursdays" allows users to specify day of week to find,
defaults to Thursday, and provides a list of files of jpg and png within the directory you
specify that occurred on that day of week. However, precedence goes mw, m then
l. In other words, ONLY ONE of those flags will be supported, if you specify
more than one, the precedence is enforced.

positional arguments:
  directory   Required. Directory from which to read files.

optional arguments:
  -h, --help  show this help message and exit
  -d D        Optional. Day of week. Defaults to Thursday. Can not do multiple
              days.
  -l          Optional. Reply with list of files that can be passed to
              something like xargs.
  -m          Optional. Mac OS open Preview App with resulting list of files.
              If the list of files gets too long, the command may fail.
  -mw         Optional. Mac OS open Preview App with one image per window. Can
              be torture to your screen, be careful.
  -n N        Optional. Number of files to *randomly* retreive from list.

(Revision 1.0 of 2015-12-14 14:15:28)


================================= code, cut here to end. put in file tyt.py


# use os.path.getctime to get creation date/time.
# use date.weekday() to get 0 = Monday to 6 = Sunday.
# then use present Thursdays as tbt files :)

# ctime - the last time the file's inode was changed (e.g. permissions changed, file renamed, etc..)
# mtime - last time the file's CONTENTS were changed
# atime - last time the file was accessed.
# author: Michael E. Case, mec at dcn dot davis dot ca dot us
 
import sys
import os
from datetime import *
import time
from sys import argv
#from subprocess import Popen
import argparse
import random

# 2015-12-14: 
# Given a path, search through it and all it's subdirectories for "throwback thursday" files.

# info to identify program and current revision, and some globals.
global pgm, rev, date
pgm  = (sys.argv[0]).replace('./','')
rev  = '$Revision: 1.0 $'.replace('$','')[9:].strip()
date = '$Date: 2015-12-14 14:15:28 $'.replace('$','')[5:].strip()

def isint( s ):
    try:
        int(s)
    except ValueError:
        return False
    else:
        return True

def tbt_main():

    #read command arguments
    global pgm, rev, date

    ap = argparse.ArgumentParser(prog=pgm, epilog="(Revision "+rev+" of "+date+")", description="""Program for \"Throwback Thursdays\"
allows users to specify day of week to find, defaults to Thursday, and provides a list of files of jpg and png within the directory 
you specify that occurred on that day of week. However, precedence goes mw, m then l. In other words, ONLY ONE of 
those flags will be supported, if you specify more than one, the precedence is enforced.""")    
    ap.add_argument("directory", help="Required. Directory from which to read files.")
    ap.add_argument("-d", help="Optional. Day of week. Defaults to Thursday. Can not do multiple days.", default="3")
    ap.add_argument("-l", help="Optional. Reply with list of files that can be passed to something like xargs.", action="store_true", default=False)
    ap.add_argument("-m", help="Optional. Mac OS open Preview App with resulting list of files. If the list of files gets too long, the command may fail.", action="store_true", default=False)
    ap.add_argument("-mw", help="Optional. Mac OS open Preview App with one image per window. Can be torture to your screen, be careful.", action="store_true", default=False)
    ap.add_argument("-n", help="Optional. Number of files to *randomly* retreive from list.", default=-1, type=int)
    newargs = ap.parse_args() 
    #print(newargs)
    #if ()
    listfiles = newargs.l
    indir = newargs.directory
    nf = newargs.n
    macprev = newargs.m
    macprevwin = newargs.mw
    dow = 3
    if isint(newargs.d) == False:
        lcd = newargs.d.lower()
        if "monday" in lcd:
            dow = 0
        elif "tuesday" in lcd:
            dow = 1
        elif "wednesday" in lcd:
            dow = 2
        elif "thursday" in lcd:
            dow = 3
        elif "friday" in lcd:
            dow = 4
        elif "saturday" in lcd:
            dow = 5
        elif "sunday" in lcd:
            dow = 6
        else:
            print(newargs.d+" not found in day of week. Day of week will default to Thursday (3).")
            dow = 3
    else:
        if dow > 6:
            print(newargs.d+" is greater than 6. Day of week will default to Thursday (3).")
            dow = 3


    if macprev == True and macprevwin == True and listfiles == True:
        macprev = False
        listfiles = False
        print("Found -mw, -w and -l, precedence dictates using mw.")
    if macprev == True and listfiles == True:
        listfiles = False
        print("Found -w and -l, precedence ditates using -m.")
    if macprevwin == True and listfiles == True:
        listfiles = False
        print("Found -mw and -l, precedence dictates using -mw.")

    # print(macprev, str(nf), indir, listfiles)

    # print(indir)
    fs = ""
    fsofar = 0
    randomfs = False
    if nf != -1:
        randomfs = True
    nfilestot = 0
    # probtofind = 0
    rindstosave = []

    # can't figure out how to do this using "probability of this picture being one of the n you requested."
    # or rather, that solution did not always give me n. So the new solution is come up with n integers between
    # one and nfilestot. Those will be the ones we get. No repeats, of course.
    if randomfs == True:
        for root, dirs, files in os.walk(indir, topdown=True):
            #print("in first for")
            for name in files:
                tm = os.path.getmtime(os.path.join(root,name))
                dt = datetime.fromtimestamp(tm)
                if dt.weekday() == dow:
                    if len(name.split(".")) > 1:
                        spl = name.split(".")
                        last = spl[len(spl)-1]
                        if last.lower() == "jpg" or last.lower() == "png":
                            nfilestot +=1
        #print("total number of all jpg and png = "+str(nfilestot))
        if nfilestot > 0:
            nsel = 0
            while nsel < nf and nf > 0:
                rn = random.randint(1, nfilestot) # [1, nfilestot]
                if rn not in rindstosave:
                    rindstosave.append(rn)
                    nsel += 1
                
            # print ("nsel = "+str(nsel))
            # print (rindstosave)
            rindstosave.sort()
            # print (rindstosave)
            # probtofind = nf / nfilestot
    fc = 0
    for root, dirs, files in os.walk(indir, topdown=True):
        #print("in first for")
        for name in files:
            #print("in second for")
            tm = os.path.getmtime(os.path.join(root,name))
            dt = datetime.fromtimestamp(tm)
            if dt.weekday() == dow:
                if len(name.split(".")) > 1:
                    spl = name.split(".")
                    last = spl[len(spl)-1]
                    if last.lower() == "jpg" or last.lower() == "png":
                        fc += 1
                        #print("found jpg")
                        #os.system
                        #Popen
                        if macprev == True:
                            #print (fs)
                            if randomfs == False:
                                fs += "\""+os.path.join(root,name)+"\" "
                            else:
                                if fc in rindstosave:
                                    fs += "\""+os.path.join(root,name)+"\" "
                                    rindstosave = rindstosave[1:]
                        if macprevwin == True:
                            if randomfs == False:
                                os.system("open -a /Applications/Preview.app "+"\""+os.path.join(root,name)+"\"")
                            else:
                                if fc in rindstosave:
                                    os.system("open -a /Applications/Preview.app "+"\""+os.path.join(root,name)+"\"")
                                    rindstosave = rindstosave[1:]
                        if listfiles == True:
                            if randomfs == False:
                                print("\""+os.path.join(root,name)+"\"")
                            else:
                                if fc in rindstosave:
                                    print("\""+os.path.join(root,name)+"\"")
                                    rindstosave = rindstosave[1:]
                        #
#                print(os.path.join(root,name)) 
                # call("open -f -a /Applications/Preview.app", os.path.join(root,name))
    if macprev == True:
        #print ("open -a /Applications/Preview.app "+fs)
        os.system("open -a /Applications/Preview.app "+fs)

if __name__ == "__main__":
    tbt_main()

Tuesday, October 20, 2015

unlimited data plans going.. going... gone... and less memory on phones. Result? lots of uploads and data use.

I guess this isn't going to be a long blog entry. I just find it very irritating that I am once again being phased out of an unlimited data plan by the company I currently use (Credo Mobile).  If I upgrade a phone with them, I have to leave the unlimited plan behind.

I also find that when looking for a new and faster phone, that some of the leaders have eliminated my ability to insert a microSD card.  So I can't move my microSD from my Samsung Galaxy S4 to some new devices.

It seems like the whole cloud thing is interfering with common sense... need faster uploads to REALLY make the cloud work... upload speeds from home are slow and data plans on phones/portable hardware no longer have unlimited data upload/download... so we need larger memory on smart phones in order not to pay too much for cloud access and data transport... stupid companies...

I do not believe that ubiquitous data access will ever be truly available in a free-for-all like true capitalism even with government and industry standards trying to keep up with the changes. And also, competition pushes change forward... but some parts of a system always lag behind...

We will always need local storage and in sufficient quantity for the specs of the video and still shots of our smart devices. I personally get sick of carrying my "good" camera around when really my phone is sufficient for "snapshots" which exceed my old 35 mm snapshots (as opposed to "photography").  But I'll carry it with me, or my laptop, if I think the phone's memory will run out on a trip...

Maybe I take and keep too many photos and videos on my phone.

Meanwhile, I have mirrored my backups (2 single terrabyte drives) and they are running out of space... I need to de-duplicate and clean up my backups...

What was I saying? Oh, either give me unlimited data upload capability with a ubiquitous (truly, like in Yellowstone) data access or give me more memory on my phone please!

Tuesday, August 5, 2014

Windows XP, VMware Fusion 4.1.4, Mavericks, Microsoft Security Essentials pain?

I'm currently frustrated with my machine. I've been e-mailing back and forth with VMware.  I know that Windows XP is not supported anymore.  I also know that VMware Fusion has a version 6 but I'm having to move to Parallels for work. 

The application that I mess with for work that runs on Windows XP may be migrated to Windows 7. I've not done much programming on Windows in the past 14 years, so I'm leaving it up to the owner of the application to decide about the upgrade path.

I wish I had the time(to learn), existing expertise, and energy to think of porting this somewhere else but I've not written drivers for cards before, and I'm responsible for other parts of the platform which also need work.

I'm just writing this up because I installed Microsoft Security Essentials sometime just before Windows XP became unsupported.  After that everything seemed fine though I can't recall testing if my network (mac to VMware) was working.

THEN I installed Mavericks, and THEN VMware has not been able to get to the network.

So I reinstalled VMware Fusion and I still couldn't get to the world from VMware Fusion (Windows XP). 

I also could not see a settings screen in VMware Fusion.  When I went to settings, the main window of Windows XP would grey out (suspended or live) and yet no other window would appear.

I reinstalled the VMware Tools.  Still no joy.

Finally I did get through the internet just by using the "quick" buttons for settings to go between NAT and Bridged, which I had been doing before but to no avail. At this point the network was excruciatingly slow. 

I still could not get to a settings screen so I've given up on that.

Ok, long story... Basically now that I've uninstalled Microsoft Security Essentials the network runs much faster.  I'm going to try to get AVG for XP and hope that will be protection enough for long enough that I don't compromise my Windows XP.

For anyone who cares, when I test with this software, I run the user interface side on Mac OS (Java based), similar to as we do with the real hardware, and run the C/C++ part on Windows XP (again, as with the real hardware). 

The GUI commands the C/C++ on some ports and the C/C++ additionally can initiate connections to another system on other ports.  We issue commands to that third system via the C/C++ system.  For pure simulation that 3rd system is s dumb echo on my mac side.  For testing with a more authentic simulator, that 3rd system is remote, so the Windows XP needs to get out to the rest of the world for that kind of testing.




Monday, August 4, 2014

Woke up, saw a bulging iPhone 3GS. Wow!

I hadn't looked at my iPhone 3GS 32G in a while.  I was thinking of updating my music then using it at the gym so there'd be no phone interruptions.  Instead, I found this!



I have other cell phones, much older, that we occasionally power up and try to charge for a visiting friend and get a SIM card for them to use while in the US.  These phones are not kept charged either and they don't do this.

Anyway, here is a long bunch of commentary on the Apple web site.  I'm thinking of walking in to an Apple Store as some people mention, to see if I can at least get them to dispose of the device properly.

If I dispose of it I want to make sure my data is deleted. I can't recall what all I have on it, but I'd just rather not have anything out there.

Friday, August 1, 2014

Post upgrade summary

Work ordered me a new drive (512 GB SSD) and 16 GB RAM kit to upgrade my 13-inch, Late 2011 Macbook Pro from 256 GB/8GB.  I have too much that I keep running at the same time, such as, migrating from VMWare Fusion (Windows XP) to Parallels (Windows 7) on the C/C++ side and  Netbeans 8.1 for the Java development.  When I want to run both applications (which talk to each other and accomplish one task) I'll have a lot of memory in use at one time... although, right now, I'm only running at 4.something GB real memory used.  So here is the upgrade summary. Pretty easy ... after all my worry.

I put the new drive


In a case I got cheap (like $6 for 5) on Amazon ,



and slid it into the Seagate tray.  Actually, I had to trim part of the opening using an box-cutter (do this at your own risk) as I mentioned here before.  I trimmed the top (thicker, nearer the lid of the box) this time.  These trays were meant for a different drive tray but they work, so I'm happy.



Then I used Carbon Copy Cloner to clone the existing 256GB SSD internal to the new drive.  It allowed me to also copy the hidden volume on the original Apple drive, which was important.  I will buy this product although just the try-me version was great, I really liked it, so I'm paying for it.

The clone didn't take that long, then I cracked the case carefully following these instructions at Apple. I also had peeked at these at iFixit earlier so knew about the drive removal and necessary tools.  I put in my 16 GB RAM and the new 512 GB SSD and it worked!

I am happy I also cloned the hidden partition.  Prior to the install, I booted holding down the D key and ran diagnostics on the hardware to find no problems.  This was when trouble-shooting with Apple about why the machine was re-booting for no apparent reason. The current suspected reason is a bad USB cable. More on that later, maybe.

In any case, after the upgrade I again booted holding down the D key and ran diagnostics with the new drive and RAM in and once again, no errors.  So I'm pretty confident right now.

Well, that's it.