Thursday, July 11, 2013

Scalzi - the evolution of thoughts harassment

this first article was the START of a series of postings on harassment 
scalzi was replying to THIS event http://blog.bcholmes.org/the-readercon-thing/

It became CLEAR that this is something which scalzi has been thinking about and talking about.

which led to THIS
which if NOTHING ELSE was ever said, is just an AMAZING thing
small, but a start 
but nothing with scalzi ends up that way
the follow up questions and answers are always amazing.
but it isnt over yet.
he is TAKING NAMES !!

Scalzi on SWM = easy mode

SWM = easy mode

http://whatever.scalzi.com/2012/05/15/straight-white-male-the-lowest-difficulty-setting-there-is/



Friday, July 5, 2013

proc summary - BY statement versus CLASS statement

So on the way to writing some impossible code, I ran into the equally strange results using code and false assumptions which I have made for years now.

Mitch and John
As our group works with larger datasets, more and more often, it continues to be important to “worry” about runtimes.
The original problem was intractable. Computing number of trips is non-additive. Computing number of trips for 150 million possible combinations of dimensions, for 100 million trips, is something new.
I tried proc SQL in SAS and failed. Even in a real database, the amount of memory needed is on the order of 5TB! Splitting the input into 100 chunks reduces that requirement to only 50GB of memory, which is tractable.
Mitch, this means that we have reached the edge again. Non-additive measures in this space is right on the edge of possible.


TL;DR (aka short answer)
Using a BY statement does not mean that your code will run faster.
Sometimes a CLASS statement is the only proper answer, esp if it fits in memory.

Long Answer

Version A:

proc summary data=xtrips_01_sort_V     missing  nway  threads ; 
      by n_market  n_products  n_time  n_demos  n_trips    ;
      var  prj_factor dollars_A2  dollars_A4  units_A4  ;
      output  out=perm.xtrips_03_sort_&part.  ( drop=_:   )   n(prj_factor)=trips_A1  sum=trips_A2    dollars_A2  dollars_A4  units_A4  ;
      format _numeric_ comma15. ;
run ;

Version B:

proc summary data=xtrips_01_sort_V     missing  nway  threads ; 
      class n_market  n_products  n_time  n_demos  n_trips    ;
      var  prj_factor dollars_A2  dollars_A4  units_A4  ;
      output  out=perm.xtrips_03_sort_&part.  ( drop=_:   )   n(prj_factor)=trips_A1  sum=trips_A2    dollars_A2  dollars_A4  units_A4  ;
      format _numeric_ comma15. ;
run ;


Facts
input file
270 million records
35gb sas compressed data (which uses more pages than uncompressed? So clearly I should not have compressed on LOL)
Sorted! The dataset was created by a previous proc summary with a CLASS statement, so it is SORTED by the same set of variables (plus a couple of more at the end).

Output file
20 million records
2gb (gah TURN COMPRESSION OFF!!! If you have not character strings, compression isn’t that useful!!)

Assumptions
1)      I have to run this code 100 times. It is critical that it not take an insane amount of time.
2)      Given that the input dataset is sorted, we know that using the by statement will be faster.
3)      We know that using the class statement will use more memory because it will have to store all the results before writing the file out.
4)      So I assumed that Version A would run faster than Version B and probably a LOT faster.

Results and the wakeup call
1)      Version A took from 10-20 hours. I killed it long before it finished.
2)      Version B took 10 minutes. Read that again. 10 minutes.
3)      Yes, version B took 4gbs of memory to run, but so what. We have tons of memory.

Conclusions
1)      Do not assume that you need to sort the data before using proc summary.
2)      If your output dataset from proc summary can “fit” in memory, use a class statement without sorting first

You think I am kidding?
Here is another example:

Input file:            503,012,176 records – (unsorted data – sorting takes about 70 mins on its own!)
Output file:        269,648,824 records – 35gb!
Memory used:  45gb !!!
Time:                    60mins
Here is the insane part, I have to run this process 100 times.
I am looking at 100-150 hours of total running time.

How much time are you wasting in your jobs?
How many times do you run summary in how many jobs over how many days over how many years?
If you do it a lot, maybe you need to invest some time to save some time.
Alas, I am pretty certain the results are the reverse or irrelevant for small/tiny datasets.
Spend an hour testing on your longest running proc sort and proc summary.

Sunday, March 17, 2013

amazon instant video connection speed solution

So, you have amazon prime and you finally realize that you can watch free movies and TV shows on your computer. (Yes, some of us are SLOW with this new tech.) You have been watch Amazon Instant Video (AIV) on your iPad and it has worked great. But now you want to finish the show you started on your iPad on you laptop or desktop. No problem!!

http://www.amazon.com/gp/product/B0088W6DPI/?forceBR=5

replace B0088W6DPI with whatever the AIN is for your movie or show!
(for slower connections, try 4 or 3)

Sunday, March 3, 2013

killing my home land line


OK ---- so this is directed to people who have DONE this, are thinking of DOING this, or have read about a solution for this. (NO, I am not getting rid of my old phones, a cell phone meets NONE of my actual home requirements)

I am trying to replace my land line with my cellular-based solution.  BUT, I work from home, on the PHONE A LOT and a cell phone is NOT the solution, no matter what headset is used.  I crack up when people suggest something that works for them. I have tried everything. NONE of them come even close to working.

A short list of a couple of the infinite number of reasons why I can not use my cell phone:

  • battery life is infinitely too short - I am on the phone for hours, few batteries last for hours and hours.(my fully charged phone claims that it would last 5 hours ...)
  • well just plug it in - UM NO ... if I wanted to have a corded phone, why would we even be talking here?
  • well use a headset!! - hahah ahahahha hahahahaha - while I am certain that whatever you use is perfect for you, I already have 4 headsets which I use with my cordless home phones. They are perfect. I tried them and other headsets for my cell phone and stopped after 3 seconds. They met zero of my needs, biggest one being actually working at least as good as my current set up.
  • One phone number - Less subtle but just as important, people always seem to call the wrong phone number. They call my cell when it is on the couch in the other room. No, I am NOT carrying it everywhere, nor can I hear it everywhere in the house. DUH. They call my home phone on the 4 times I actually leave the house each week. And it is always important when they do. HAHAHAHAH
    (Having one number makes most of these problems go away!)

Minimal list of requirements:
  • works with my current cordless headsets
  • uses my existing phone number - one number to rule them all, and in the darkness bind them
  • let me cancel my current land-line service


There are different approaches and I have just begun looking and not every solution fits everyone's needs.

AT&T Wireless Home Phone - free with 2 year contract - http://tinyurl.com/c8cfgw8
It is a cell phone for your house.  This type solution is a possibility for some people. It replaces your physical phone service, with a cell based service. Basically converting your existing home phone into "cell" phone.

PROS
This would allow you to use your existing home cordless phones.
Use your existing home phone number.

CONS
monthly service with the provider.


Phonelabs - 100-200ish - http://tinyurl.com/6ppr6 - uses your actual cell phone - but you can use your regular cordless home phones

PROS
This would allow you to use your existing home cordless phones.

CONS
Would require that you transfer your home phone number to your cell phone. This isnt really a con. Except for people who only know my cell number needing to learn my new number. Not really a problem at all.
(Why not keep my cell number and dump my old number? I LOVE MY OLD NUMBER!! I have had it for 30+ years. It is like a child to me!!)


xtreme xlink - http://tinyurl.com/bjtyfn5 - 

cheap ...
looks like I might buy one just to do a test run ... LOL





Now to find out if either doesnt completely suck.

Thursday, January 31, 2013

Starship Troopers and Voting


I find Starship Troopers (ST) to still be thought provoking. The question of who should get "the vote" is quite interesting to continue thinking about.

Who should vote:
Felons after they are released having served their time?
Felons serving their time?
Felons on parole?
People committed to a mental institute?
Very low IQ people? Lower than 50? Lower than 75?
Very uneducated people? Unable to add, read or write?
What about brain-damaged? To what level?
Very old people who are losing their faculties? 

What about special classes?
Everyone gets 1 vote.
People paying less than 20k in taxes (including sales, local, state, federal) get 2 votes.
People paying 20k-100k get 3 votes.
People paying more than 100k get 4 votes.

so yah, I use ST as a starting point to thinking about the consequences and unintended consequences of different voting schemes. The consequences of a tax paying weighted system can be interesting. 
The group paying the most into the social tax fund would have the most impact on who gets elected.
The group paying the least would still get some say, but not enough to pull things to one extreme or another.
The group paying the most per person would get a bigger say, but they are such a small number of people that they would not be an issue.
The people avoiding paying taxes would have less say than if they had paid their fair share.

/as I said, thinking can be fun. yes I know all about the down sides, but the thinking alone can be useful.

Wednesday, January 16, 2013

debt ceiling increases by president

Reagan:  17 increases, 300% increase, 0.9 to 2.8
Bush 1.0:  6 increase, 150% increase, 2.8 to 4.1
Clinton:  4 increases, 150% increase, 4.1 to 5.95
Bush 2.0:  7 debt increases, 190% increase, 5.95 to 11.3
Obama:  3 debt increases, 126% increase, 11.3 to 14.3

http://www.foxnews.com/politics/2011/07/26/raw-data-past-debt-ceiling-increases/