Thursday, July 26, 2012

Faith explained.

This the perfect explanation for my stance on religion.  Keep in mind, however, that my issues with fools that try to shove their religion down your throat is something far more complex!

Note that this image was submitted through Reddit.com (http://www.reddit.com/r/atheism/comments/kvpbc/evidence_vs_belief_a_tale_of_two_bunnies/) and no original author is listed for credit, even via Google image search).  Credit to whoever made it...I am not creative enough to do so ;-)



Wednesday, June 27, 2012

SharePoint 2010 - Workflow Woes

Solution
Disabled all workflow-related Features in the site collection.
Run the Products and Technologies Wizard.
Re-enable all workflow-related Features in the site collection.
Fixed...

Problem
Workflows are showing "Failed on Start" message.

Details:
  • SharePoint Server 2010 Enterprise.  
  • All Site Collections are within the same Web Application (HTTPS, Claims-enabled).
  • Only one Site Collection is affected, and all sub-sites within that collection are affected.
  • All workflows are "out of the box" (not created with SharePoint Designer 2010). 
  • The Workflow History List shows that on Friday, workflows were OK.  On Monday, they failed.
  • No updates/configuration changes were made that Friday - Monday period, and no power/network outages were reported.

Troubleshooting:
I have created 6 document libraries, one for each of the workflow types within this site collection.  Three of them fail, three of them completed successfully.  I am not certain as to the cause (yet), but I'm working on it.  Searching online has not provided any results yet.  In one case, a post said to turn on Content Approval in Site Collection Features if the Approval workflow was used to control content approval...which I did (after deleting the list and workflow and starting "from scratch").

The error says that it was cancelled by the System Account, which isn't supposed to be handling workflows and event receivers, according to TechNet.  I've no idea how to change this functionality, or even where to change it...all other workflows are fine in this site collection, except for these three!



My Docs (Disposition Workflow):  Completed
My Docs (Three-State Workflow):  Completed
My Docs (Signatures Workflow):  Failed on Start
My Docs (Feedback Workflow):  Failed on Start
My Docs (Approval Workflow):  Failed on Start
My Docs (Publishing Approval Workflow): Completed








The Document Library shows this:


The Workflow History List shows this:

Workflow History List Item Details:

Tuesday, June 12, 2012

Why I Hate Polls and Surveys

I wrote this for a class when I was attending the University of Maryland University College - Asia (whew...can it be any longer?!). The assignment was:

  1. Research the results of any poll or survey in which you disagree with the results.
  2. Describe why you disagree with the results.
  3. Offer a brief explanation of how the survey/poll could have been improved (results, survey base, etc).

"A recent Gallup poll in the United States indicated that around 40% of Americans do not believe that humans evolved from less advanced forms of life. That contrasts to 59% acceptance in Canada, and upwards of 80% in some European countries.", taken from here.

Without getting into the Science vs Religion debate, I can accept these statistics. However, I wanted to look at the survey base to find out how accurate it might be, and this is what I found:

"Results are based on telephone interviews with 1,018 national adults, aged 18 and older, conducted Feb. 6-7, 2009, as part of Gallup Poll Daily tracking. For results based on the total sample of national adults, one can say with 95% confidence that the maximum margin of sampling error is ±3 percentage points."

Really?  1,018 adults surveyed over three days can give a confidence rating of 95% that the margin of error is only "'±3 percentage points."?  If I could skew data to show only what I want to show, then I'll just start referring to Gallup for my references from now on!

Here is what I find wrong with this poll:
  1. They don't list what city the poll was taken in, which DOES matter.
We are talking about the opinion of 1,018 individuals being taken as a reflection of the whole of the United States of America. Because of this, the city that was polled is critical to the data represented.  What if the poll was taken in New York, New York? What if it was taken in Montgomery, Alabama? 

If the city lies in the "Bible Belt", the results are skewed in favor of the Biblical representation of the origin and growth of our species.

 If it is taken in a city with a "healthy" amount of non-religious citizens, it may be skewed in favor of the Darwinian representation.

And if the results are taken in cities where the religious community (of mixed religions, not just Christian religions) and the non-religious community are well-balanced, the results are closer to what they SHOULD be, in order to adequately reflect the opinion of an entire nation based on a miniscule percentage of citizens in a specific city.

But it doesn't state this. We don't know if they polled one city, or a number of cities. They don't give us that information, which is ridiculous! "1,018 national adults" surveyed over a period of three days cannot adequately reflect the opinion of the nation as a whole.  How is this small subset of people, each with their own religious or scientific bias, supposed to constitute "40% of Americans"?

According to the Wolfram Alpha Computational Search Engine, the United States population between ages 18-64 in 2009 was 189.3 million people (189,300,000). 1,018 adults out of 189.3 million adults = 0.000537770734284205 % of the 189.3 million adults. Round up a bit to the nearest millionth for an "easy" 0.000538 %.  That is the percentage of the US population that they surveyed. So I think it's safe to say that we can throw their results into the trash.

What should have been included in the survey was the pool of adults in the city that was polled.  1,018 adults out of how many in the city?  This would give a reference for comparison, a ratio, for comparing it to what the average national opinion might be.  Get the ratio of the people who were surveyed (say, 1018 out of 10,180, which is 1/10th), and use that for the basis of stating what the "National Average" is.  1/10th of the adult population in 2009 is 18,930,000.  Grab that percentage and it would result in a more reliable answer.

I may as well survey a married couple, and say that their opinions reflect that of the entire city. If one is religious and one is not, then "50% of the American populace in Okinawa does not believe in evolution". Or take it a step further, and survey ten families (10 men, 10 women). Assume that it comes out 80% in favor of creationism. Can I then go on to say that "80% of the American populace in all of Asia (China, Korea, Japan, Taiwan, etc) does not believe in evolution"? I could, but my statistical results may very well be wrong.

This is the "Age of the Internet". We do everything online: shopping, socializing, and even find entertainment via a staggering amount of venues. Why are polls limited to such a small number of people taken as the opinion for the nation as a whole? Why not put the survey online, and gather data in this way?

There is always a fear of invalid data (the same person taking the survey multiple times, or a person who enters information as a joke), but invalid data can be given in a face-to-face survey and telephone-surveys as well, so there will always be a certain amount of data which is invalid based on those situations. Surveys and polls which are used to define the opinion of a large mass of people are already hard to retrieve data for, and I understand this. But with a survey that included data from such a miniscule subset of the population, with the location of the survey being undisclosed, lends credence to my opinion that the survey itself is nothing more than a joke.

Thursday, May 17, 2012

Astro-Nerdgasm

Drop yer *ocks and grab yer...solar filters ;-)



Phil Plait, from the Bad Astronomy blog, gives the run-down:
On Sunday, May 20, the Moon will pass between the Earth and the Sun, creating a solar eclipse.

However, this isn’t your usual event: because the Moon will be at apogee (the farthest point in its orbit), it won’t completely cover the face of the Sun. Instead of the Sun being totally blocked and the ethereal glow of its corona visible, we’ll see an annular eclipse, also called a "Ring of Fire" eclipse. The picture here from the October 2005 annular eclipse — makes it clear why!

Phil also has a nice map showing where it can be seen. I'm not sure what the view will be like from Sierra Vista, AZ (a few pixels above the US/Mexico border, directly south of Tucson), but I'll have my telescope and solar filter outside and ready to go. I'd think I should at least catch a partial eclipse, just without the "fire and brimstone".

And shortly after...the transit of Venus across the Sun

8086 Assembly (TASM): "Toy" Program

I thought I'd post this here, just in case I end up losing it and needing it later on.  Or whatever...

This was the assignment given:


Write a program to emulate a child's toy which is played by dropping a marble in one of the three holes ( A, B, or C ) at the top of the toy and watching the changes.  As the marble moves past switches, the values of the switch are changed.   The path which the marble will take is dependent upon the current state of the switch.  Your game display should look something like the following: the letters should be displayed, the numbers representing the switch positions, and the value of each switch which is initially a 0:



                   A                           B                           C
                   1                           2                           3
                   0                           0                           0
                                4                           5
                                0                           0
                   6                           7                           8
                   0                           0                           0


          Treat the toy as a multi-switch device with each switch having two states and being independent of each other.   Each switch's input and output are defined as follows:

          INPUT :
                   hole A :  the marble goes to Switch 1
                   hole B :  the marble goes to Switch 2
                   hole C :  the marble goes to Switch 3
          OUTPUT:
                   When Switch 1 is 0, the marble goes to Switch 6
                   When Switch 1 is 1, the marble goes to Switch 4
                   When Switch 2 is 0, the marble goes to Switch 5
                   When Switch 2 is 1, the marble goes to Switch 4
                   When Switch 3 is 0, the marble goes to Switch 5
                   When Switch 3 is 1, the marble goes to Switch 8
                   When Switch 4 is 0, the marble goes to Switch 7
                   When Switch 4 is 1, the marble goes to Switch 6
                   When Switch 5 is 0, the marble goes to Switch 8
                   When Switch 5 is 1, the marble goes to Switch 7
                   When Switch 6 is 0, the marble exits the Toy
                   When Switch 6 is 1, the marble exits the Toy
                   When Switch 7 is 0, the marble exits the Toy
                   When Switch 7 is 1, the marble exits the Toy
                   When Switch 8 is 0, the marble exits the Toy
                   When Switch 8 is 1, the marble exits the Toy

          The Toy starts with a display of the board having all switches set to 0.

          Accept the input from the keyboard (provide an appropriate prompt)  of A, B, or C which is the selection of the hole into which to drop the marble.  Calculate the state changes of the switches, change them, and then re-display the board in its new state. Continue until the proper exit code is provided.  You must idiot proof your program to ignore improper values.  Use of procedures and Macros as appropriate is required.
And here's the garbage that I regurgitated into Notepad!

; Toy.asm
; 
;    What the array looks like when not crammed onto one line.
;    a[0,0] is the array element at position [0,0].  and so on.
;    Essentially, there are 3 rows, just like the assignment description:
;        1st Row has 3 columns.
;        2nd Row has 2 columns.
;        3rd Row has 3 Columns. 
;        +--------+--------+--------+
;        | a[0,0] | a[0,1] | a[0,2] |
;        | OFF 0  | OFF 1  | OFF 2  |
;        +--------+--------+--------+
;          | a[1,0] | a[1,1] | 
;           | OFF 3  | OFF 4  | 
;        +--------+--------+--------+
;        | a[2,0] | a[2,1] | a[2,2] |
;        | OFF 6  | OFF 7  | OFF 8  |
;        +--------+--------+--------+

.MODEL small

.STACK 100h

.DATA
  ; 1FH = ON
  ; 7FH = OFF
  PRMPT1  DB 10, 10, 13, '[q] Or [Q] To Quit'
     DB 10, 10, 13, '[A], [B], [C] To Drop Ball: $'

  HEADER  DB 10, 10, 13, '          ', 41H, '          ', 42H, '          ', 43H, '$'                 ; A  B  C     
  
  LINE1A  DB 10, 10, 13, '          $'
  LINE1B  DB '          $'
  LINE1C  DB '          $'

  LINE2A  DB 10, 10, 13, '               $'
  LINE2B  DB '          $'

  LINE3A  DB 10, 10, 13, '          $'
  LINE3B  DB '          $'
  LINE3C  DB '          $'
  
  SWITCHES DB 1FH, 1FH, 1FH
     DB 1FH, 1FH
     DB 1FH, 1FH, 1FH
  
.CODE

 START PROC
   MOV AX, @DATA   ; Startup code.
   MOV DS, AX

  DRAWGAME:
    CALL CLRSCRN   ; Clear the screen
  
    MOV DX, OFFSET HEADER  ; Display menu
    MOV AH, 09H
    INT 21H

    MOV DX, OFFSET LINE1A  ; Draw Row 1, Col A
    MOV AH, 09H
    INT 21H

      MOV DL, SWITCHES + 0 ; Display switch 1 value.
      MOV AH, 02h             
      INT 21H                     
    
    MOV DX, OFFSET LINE1B  ; Draw Row 1, Col B
    MOV AH, 09H
    INT 21H

      MOV DL, SWITCHES + 1 ; Display switch 2 value.
      MOV AH, 02h             
      INT 21H                   
    
    MOV DX, OFFSET LINE1C  ; Draw Row 1, Col C
    MOV AH, 09H
    INT 21H    
    
      MOV DL, SWITCHES + 2 ; Display switch 3 value.
      MOV AH, 02h         
      INT 21H                 
    
    MOV DX, OFFSET LINE2A  ; Draw Row 2, Col B
    MOV AH, 09H
    INT 21H

      MOV DL, SWITCHES + 3  ; Display switch 4 value.
      MOV AH, 02h             
      INT 21H                 
    
    MOV DX, OFFSET LINE2B  ; Draw Row 2, Col C
    MOV AH, 09H
    INT 21H

      MOV DL, SWITCHES + 4  ; Display switch 5 value.
      MOV AH, 02h             
      INT 21H                 
       
    MOV DX, OFFSET LINE3A  ; Draw Row 3, Col A
    MOV AH, 09H
    INT 21H

      MOV DL, SWITCHES + 5  ; Display switch 6 value.
      MOV AH, 02h             
      INT 21H                 
    
    MOV DX, OFFSET LINE3B  ; Draw Row 3, Col B
    MOV AH, 09H
    INT 21H

      MOV DL, SWITCHES + 6  ; Display switch 7 value.
      MOV AH, 02h             
      INT 21H                 
    
    MOV DX, OFFSET LINE3C  ; Draw Row 3, Col C
    MOV AH, 09H
    INT 21H 

      MOV DL, SWITCHES + 7  ; Display switch 8 value.
      MOV AH, 02h             
      INT 21H                     

    MOV DX, OFFSET PRMPT1  ; Display menu
    MOV AH, 09H
    INT 21H 
   
  GETINPUT:
   MOV AX, 0
   MOV AH, 08H    ; Get user input.
   INT 21H
   
   CMP_bA:
    CMP AL, 41H    ; Is input = "A"?
    JNE CMP_sA    ; If not, check for "a".
    JMP SWITCH1    ;  If it is, Jump to Switch #1.
    
   CMP_sA:      
    CMP AL, 61H    ; Is input = "a"?
    JNE CMP_bB    ; If not, check for "B".
    JMP SWITCH1    ; If it is, jump to Swtich #1.
    
   CMP_bB:
    CMP AL, 42H    ; Is input = "B"?
    JNE CMP_sB    ; If not, check for "b".
    JMP SWITCH2    ; If it is, jump to Switch #2.
    
   CMP_sB:
    CMP AL, 62H    ; Is input = "b"?
    JNE CMP_bC    ; If not, check for "C".
    JMP SWITCH2    ; If it is, jump to Switch #2.
    
   CMP_bC:
    CMP AL, 43H    ; Is input = "C"?
    JNE CMP_sC    ; If not, check for "c".
    JMP SWITCH3    ; If it is, jump to Swtich #3.
    
   CMP_sC:
    CMP AL, 63H    ; Is input = "c"?
    JNE CMP_bQ    ; If not, check for "Q".
    JMP SWITCH3    ; If it is, jump to Switch #3.
    
   CMP_bQ:
    CMP AL, 51H    ; Is input = "Q"?
    JNE CMP_sQ    ; If not, check for "q".
    JMP EXITPROG   ; If it is, jump to EXITPROG.
    
   CMP_sQ:
    CMP AL, 71H    ; Is input = "q"?
    JNE GETINPUT   ; If it is not, then user did not enter any of the above keys.
    JMP EXITPROG   ; If it is, jump to EXITPROG.
   
  SWITCH1:  
   CMP [SWITCHES + 0], 7FH   ; if character in switch 1 is 7FH
   JE SWITCH1A
   
   CMP [SWITCHES + 0], 1FH   ; if character in switch 1 is 1FH.
   JE SWITCH1B   
   
   SWITCH1B:
    MOV [SWITCHES + 0], 7FH     ; switch character to OFF
    JMP SWITCH4

   SWITCH1A:
    MOV [SWITCHES + 0], 1FH    ; switch character to ON
    JMP SWITCH6
    
  SWITCH2:
   CMP [SWITCHES + 1], 7FH   ; if character in switch 2 is 7FH
   JE SWITCH2A
   
   CMP [SWITCHES + 1], 1FH   ; if character in switch 2 is 1FH.
   JE SWITCH2B   
   
   SWITCH2B:
    MOV [SWITCHES + 1], 7FH  ; switch character to OFF
    JMP SWITCH2

   SWITCH2A:
    MOV [SWITCHES + 1], 1FH  ; switch character to ON
    JMP SWITCH5
 
  SWITCH3:
   CMP [SWITCHES + 2], 7FH   ; if character in switch 3 is 7FH
   JE SWITCH3A
   
   CMP [SWITCHES + 2], 1FH   ; if character in switch 3 is 1FH.
   JE SWITCH3B   
   
   SWITCH3B:
    MOV [SWITCHES + 2], 7FH  ; switch character to OFF
    JMP SWITCH8

   SWITCH3A:
    MOV [SWITCHES + 2], 1FH  ; switch character to ON
    JMP SWITCH5
   
  SWITCH4:
   ; Code for Switch #4 goes here.
   CMP [SWITCHES + 3], 7FH   ; if character in switch 4 is 7FH
   JE SWITCH4A
   
   CMP [SWITCHES + 3], 1FH   ; if character in switch 4 is 1FH.
   JE SWITCH4B   
   
   SWITCH4B:
    MOV [SWITCHES + 3], 7FH  ; switch character to OFF
    JMP SWITCH6

   SWITCH4A:
    MOV [SWITCHES + 3], 1FH  ; switch character to ON
    JMP SWITCH7
   
  SWITCH5:
   CMP [SWITCHES + 4], 7FH   ; if character in switch 5 is 7FH
   JE SWITCH5A
   
   CMP [SWITCHES + 4], 1FH   ; if character in switch 5 is 1FH.
   JE SWITCH5B   
   
   SWITCH5B:
    MOV [SWITCHES + 4], 7FH  ; switch character to OFF
    JMP SWITCH7

   SWITCH5A:
    MOV [SWITCHES + 4], 1FH  ; switch character to ON
    JMP SWITCH8
   
  SWITCH6:
   CMP [SWITCHES + 5], 7FH   ; if character in switch 6 is 7FH
   JE SWITCH6A
   
   CMP [SWITCHES + 5], 1FH   ; if character in switch 6 is 1FH.
   JE SWITCH6B   
   
   SWITCH6B:
    MOV [SWITCHES + 5], 7FH  ; switch character to OFF
    JMP DRAWGAME

   SWITCH6A:
    MOV [SWITCHES + 5], 1FH  ; switch character to ON
    JMP DRAWGAME
   
  SWITCH7:
   CMP [SWITCHES + 6], 7FH   ; if character in switch 7 is 7FH
   JE SWITCH7A
   
   CMP [SWITCHES + 6], 1FH   ; if character in switch 7 is 1FH.
   JE SWITCH7B   
   
   SWITCH7B:
    MOV [SWITCHES + 6], 7FH  ; switch character to OFF
    JMP DRAWGAME

   SWITCH7A:
    MOV [SWITCHES + 6], 1FH  ; switch character to ON
    JMP DRAWGAME
   
  SWITCH8:
   CMP [SWITCHES + 7], 7FH   ; if character in switch 8 is 7FH
   JE SWITCH8A
   
   CMP [SWITCHES + 7], 1FH   ; if character in switch 8 is 1FH.
   JE SWITCH8B   
   
   SWITCH8B:
    MOV [SWITCHES + 7], 7FH  ; switch character to OFF
    JMP DRAWGAME

   SWITCH8A:
    MOV [SWITCHES + 7], 1FH  ; switch character to ON
    JMP DRAWGAME
    
  EXITPROG:
   CALL CLRSCRN
   
   MOV AL, 0    ; exit to DOS.
   MOV AH, 04ch
   INT 21h
 START ENDP

 CLRSCRN PROC
   MOV AH, 0fh
   INT 10h
   
   MOV AL, 00h
   MOV AH, 0
   INT 10h 
   
   RET
 CLRSCRN ENDP 
END START   

PowerShell: Searching For Installed Patches/Updates

I had the need to search for the installation of specific patches on one of my servers recently. This isn't really a big deal...just type "appwiz.cpl" into the Run window and click "View Installed Updates" or take the dangerous journey through the control panel to find the same thing)...

However, even in Windows Server 2008, there is no option to sort this list by KB article (patch name). So what to do?

Hello, PowerShell! Nice to meet you again!



$KB = Read-Host "Enter KB Number (EX: KB2604094, with or without KB): "

 If ($KB.StartsWith("KB", "CurrentCultureIgnoreCase"))
  { $KB = $KB.Substring(2) }
 
 $Result = Get-HotFix | Where {$_.HotFixID -like "*$KB*"} | Select Description, HotFixID, InstalledBy, InstalledOn | Format-List
 
 If ($Result.Count -gt 0) { $Result }
 Else { Write-Host "KB Not Found!" }


Just enter any part of the HotFix ID that want. Here is the output. It's messy, but it gets the job done.


Sunday, May 6, 2012

Final Exam Finished

Well, I paid the price for watching a movie, chatting with the kids, playing a video game (Mass Effect 3, heh), and eating dinner....

all while taking my final exam for CIS 217.

So, I made a few mistakes, mostly not noticing when a question says "Show me which of these is incorrect", and I pick the "correct" answer, thus getting the question wrong. I do it all the time...and it's too late to stop doing it now, I guess!

Anyway, I wanted to let everyone know that there ARE errors in the Final Exam. I've sent Grace a list of the ones that I got wrong that I KNOW to be correct (which I verified with code shortly after submitting the exam). I would have sent the list to everyone, but I'm not going to get hammered for giving out exam answers ;-)

But if you got something wrong and got a bad grade, don't stress over it if you know the answer was right. She'll update it if you let her know.

Cheers!