The Rapture of Canaan – Sheri Reynolds

This book was recommended by a friend when we were talking about post-apocalyptic books like Alas, Babylon or The Road.  However, after reading the book I don’t know why he would recommend it as it really didn’t have much to do about the end of the world.  Regardless, it was an excellent read and I recommend everyone read it.

Two quotes that stood out were:

I started to wonder if James was really James or if James was really Jesus answering me with James’ face.  Then I wondered if that’s all God ever is – somebody who loves you enough to come back from the dead to visit every now and again.  Or if that’s all other people ever are – different faces of God walking around.

“Grudges are bad things, Ninah",” she said at last.  “There’s only so much room in one heart.  You can fill it up with love or you can fill it with resentment.  But every bit of resentment you hold takes space away from the love.  And the resentment don’t do no good noway, but look what love can do.”

~david

Android Development: Clickable TextView Relative Layout Using Tables

I’ve been playing around with the Google Android SDK, since there are a couple of mobile application ideas I’ve been tossing around.  However, since it’s been longer than 10 years since I’ve done any real Java development I’m taking it pretty slow and just getting used to the tools available for Android development.

The very first thing is to go through the tutorials that Google has put together, they will give you a very quick understanding on how Android is put together and what all the pieces do in order to construct an application.

Next, appearance is everything, so you need to get familiar with layouts and DroidDraw is the best tool available for understanding how things align.  Use the DroidDraw generated code as a template and play around accordingly.

Finally, play around.

The first application I wanted to create was a gym schedule for my local gym and I will be updating the world as I move along.  The first thing I’ve created is the layout and basic functionality of the application.  This will consist of a couple of rows with the pertinent information as well as a clickable text area which will provide more information about the class.  Notice that all data is static as this is just a framework for what I hope the final application to look like.

Here’s the final product as of this point:

image

The breakdown of the code is as follows:

colors.xml

   1: <;?xml version="1.0" encoding="UTF-8"?>

   2: <;resources>

   3:         <;color name="grey">#C0C0C0</color>

   4:         <;color name="black">#000000</color>

   5:         <;color name="light_grey">#A8A8A8</color>

   6: <;/resources>

main.xml

   1: <;?xml version="1.0" encoding="utf-8"?>

   2: <;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"

   3:     android:layout_width="fill_parent"

   4:     android:layout_height="fill_parent"

   5:     android:stretchColumns="*">;

   6:     <TableRow android:background="@color/grey" >

   7:         <;TextView

   8:             android:textStyle="bold"

   9:             android:text="Monday"

  10:             android:padding="3dip" 

  11:             android:textColor="@color/black"

  12:             android:textSize="18sp"

  13:             />;

  14:     </TableRow>

  15:     <;TableRow android:background="@color/light_grey">

  16:         <;TextView android:text="Time" android:padding="3dip" 

  17:             android:textColor="@color/black" android:textStyle="bold" />;

  18:         <TextView android:text="Class" android:padding="3dip" 

  19:             android:textColor="@color/black" android:textStyle="bold" />;

  20:         <TextView android:text="Studio" android:padding="3dip" 

  21:             android:textColor="@color/black" android:textStyle="bold" />;

  22:         <TextView android:text="Instructor" android:padding="3dip" 

  23:             android:textColor="@color/black" android:textStyle="bold"/>;

  24:     </TableRow>    

  25:     <;TableRow android:background="@color/grey">

  26:         <;TextView android:id="@+id/Time" android:text="6:00 AM" android:padding="3dip" 

  27:             android:textColor="@color/black" />;

  28:         <TextView android:id="@+id/Class" android:text="Cycle" android:padding="3dip" 

  29:             android:textColor="@color/black" />;

  30:         <TextView android:id="@+id/Studio" android:text="C" android:padding="3dip" 

  31:             android:textColor="@color/black" />;

  32:         <TextView android:id="@+id/Instructor" android:text="Jamie" android:padding="3dip" 

  33:             android:textColor="@color/black"/>;

  34:     </TableRow>

  35:     <;TableRow android:background="@color/light_grey" >

  36:         <;TextView />

  37:         <;TextView />

  38:         <;TextView />

  39:         <;TextView android:id="@+id/MoreInfo" android:text="More Info >" android:padding="3dip"

  40:         android:textColor="@color/black" android:onClick="onClick" android:clickable="true"/>; 

  41:     </TableRow>

  42:         <;TableRow android:background="@color/grey">

  43:         <;TextView android:id="@+id/Time" android:text="7:00 PM" android:padding="3dip" 

  44:             android:textColor="@color/black" />;

  45:         <TextView android:id="@+id/Class" android:text="Fundamentals of Yoga" android:padding="3dip" 

  46:             android:textColor="@color/black" />;

  47:         <TextView android:id="@+id/Studio" android:text="GF" android:padding="3dip" 

  48:             android:textColor="@color/black" />;

  49:         <TextView android:id="@+id/Instructor" android:text="Eleanor" android:padding="3dip" 

  50:             android:textColor="@color/black"/>;

  51:     </TableRow>

  52:     <;TableRow android:background="@color/light_grey" >

  53:         <;TextView />

  54:         <;TextView />

  55:         <;TextView />

  56:         <;TextView android:id="@+id/MoreInfo" android:text="More Info >" android:padding="3dip"

  57:         android:textColor="@color/black" android:onClick="onClick" android:clickable="true"/>; 

  58:     </TableRow>

  59: </TableLayout>

.java file:

   1: package com.example.RelativeLayout;

   2: 

   3: import android.app.Activity;

   4: import android.os.Bundle;

   5: import android.view.View;

   6: import android.widget.Toast;

   7: 

   8: public class RelativeLayout extends Activity {

   9:     /** Called when the activity is first created. */

  10:     @Override

  11:     public void onCreate(Bundle savedInstanceState) {

  12:         super.onCreate(savedInstanceState);

  13:         setContentView(R.layout.main);

  14:     }

  15:     public void onClick(View v){

  16:         Toast toast = Toast.makeText(getApplicationContext(), 

  17: "Cycle/Spinning – Stationary bike cardio workout in a 

  18: group setting. Water bottles and a towel required 

  19: for attendance.", Toast.LENGTH_LONG);

  20:         toast.show();

  21:     }

  22: }

  23:  

~david

Playing around with Twitter API using Tweepy

Yes, this is the kind of stuff I find myself doing when I’m bored.  Just a quick tutorial on using the Twitter python library called Tweepy.  Examples include authentication, print your statuses, and print your mentions.

First, you need to authenticate using OAuth as simple authentication has been disabled by Twitter.  I will not repeat what has already been done, so this is the best way to do it.  If you have no problems with that example, then at the end you will have a simple python script which allows you to update your status via the command line.  However, the most important piece is the authentication:

   1:  #!/usr/bin/env python
   2:   
   3:  import sys
   4:  import tweepy
   5:   
   6:  CONSUMER_KEY = 'Your stuff'
   7:  CONSUMER_SECRET = 'Your stuff'
   8:  ACCESS_KEY = 'Your stuff'
   9:  ACCESS_SECRET = 'Your stuff'
  10:   
  11:  auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
  12:  auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
  13:  api = tweepy.API(auth)

This will allow you to authenticate against Twitter and be able to work with the API.  Now you can add to your python script the code below.

How about printing your status updates?

   1:  statuses = tweepy.Cursor(api.user_timeline).items()
   2:   
   3:  for status in statuses:
   4:          print " "
   5:          print status.text

How about printing your mentions?

   1:  mymentions= tweepy.Cursor(api.mentions).items()
   2:   
   3:  for status in mymentions:
   4:          print " "
   5:          print status.text

 

The Tweepy API reference has a ton of great information.  As well as the Twitter API wiki.

~david

mRemote and Cisco’s AnyConnect Client Issues

I love mRemote.  Makes keeping track of all the different connections (RDP, VNC, SSH, etc.) a breeze.  However, I’ve recently noticed that after I installed Cisco’s AnyConnect client I could no longer open my existing connections or create new connections.  Upon startup I would receive the following window:

mRemoteSecurityPassword

What I ended up having to do is remove AnyConnect and then disable FIPS encryption following this link http://support.microsoft.com/kb/811770.

WindowsPolicy

Works like a charm now.  More than likely you don’t have to remove AnyConnect, however I don’t use it that much and rather just remove it all together.

~david

PS: The mRemote project is dead at version 1.5, there’s a fork out there called mRemoteNG which I’m trying out check it out here http://www.mremoteng.org/.

Create Hyperlinks to Worksheets with Excel VBA

This took me a couple of hours to get working, which means that one of two things happened.  I am very rusty in my VB or nothing I found online made sense.  I’m going with a little bit of the former and a lot of the latter.

The problem I was facing is that I wanted to create an Excel dashboard which linked worksheets in the file.  I wanted to do this dynamically using VBA in order to be able to get a snapshot of the whole workbook without having to go sheet by sheet.

The final code looks like this:

   1:  LinkToSheet = "'" & Sheets(i).Name & "'!A1"
   2:  NewSheet.Hyperlinks.Add Anchor:=NewSheet.Cells(10 + c, 6), Address:="", 
   3:  SubAddress:=LinkToSheet, ScreenTip:="", TextToDisplay:=""
 

Now to break it down a bit for those of us who need a little help with VB.  This part of the code dictates the worksheet where the hyperlink will go, in this case I have a variable called NewSheet:

   1:  NewSheet.Hyperlinks.Add
 

The Anchor property is the location of where to put the hyperlink.  In my case it’s dynamic, but for most people it might be a static location (e.g. F2) like this:

 
   1:  NewSheet.Hyperlinks.Add Anchor:=F2
 

The Address property needs to be blank if you’re linking to other worksheets, you use this if you’re linking to other files or URLs.  The LinkToSheet variable is used because some of the worksheet names I use have spaces, so I need to be able to format my worksheet as ‘WorkSheet Name’!A1.  Finally, the last two properties are more adornments than anything else in case you have to have a hover tip or display different text than the name of the worksheet.

~david

The 2010 Columbus Marathon Experience

This past weekend I ran the 2010 Columbus Marathon.  It was my 2nd marathon ever and while I felt a little more comfortable while running, it was still a grueling task.  Like usual, I really only trained during the weekends and had very little mid week runs.  So, like anything else, you get out what you put in.  One of the main reasons for running this race is the fact that it’s supposed to be a very “friendly” course (e.g. fairly flat and fast).  While I did improve my time by around 15 minutes, my dream of breaking 4 hours will have to be postponed for another race.

A couple of notes about the event itself.  First, the goody bag really didn’t have any goodies.  The Pittsburgh and Akron races had some cool stuff like free food samples, socks, etc.  While Columbus didn’t really have much besides the shirt.  Second, the shirt is nice, but I heard a lot of females complain about the color choices.  All black for both male and female marathoners; pink and blue for female and male half marathoners respectively.  Third, the bands along the way were a great experience.  There drum lines, rock bands, even a guy who played the keyboards while riding his bike… that is talent!  Finally, I felt that the overall runners were not as friendly as in my first marathon, Akron.  Perhaps, it was the fact that a marathon wasn’t new to me.  However, I have a feeling that since the Akron course is so brutal, it forms a much stronger bond among the runners or in other words, misery loves company.  Either way I was full of pithy comments for any runner so unlucky to be around me as I tried to be funny.

Finally, this race did provide some interesting analytics, which I’ve posted below.  It is nice to see a breakdown of your progress, but it is also pretty sad to see how bad my second half was when compared to my first half.

My overtime and splits:

image

 

 

 

 

 

 

 

 

From the start to the 10K mark, I’m kicking ass and taking names.  All 482 of them:

image

I am still feeling pretty good and looking forward to the 2nd half as it’s the easy half:

image

Someone lied to me, this half was not easy:

image

I am struggling, knees feel like Jell-O, legs feel like Swiss cheese, and I want my mommy:

image

Would I do it again?  More than likely, as I think I have a shot of breaking 4 hours on this course.

~david

Cisco UCCE Outbound Option Find Query Rule for Dialed Record

Here’s a simple query using an inner join to find out which query rule added a certain record to the dialer.  This is pretty useful when you’re trying to figure out why a record was dialed which went to the wrong skill group.  The only challenge here is joining two different tables in two different databases, in this case the HDS and AW databases.

 

SELECT [DateTime]
      ,[CustomerTimeZone] AS CustTimeZone
      ,[CampaignID]
      ,[CallResult]
      ,[CallStatusZone1]
      ,[CallStatusZone2]
      ,[asp_awdb].[dbo].[t_Query_Rule].QueryRuleName
      ,[DialingListID]
      ,[Phone]
      ,[SkillGroupSkillTargetID] AS SGID
      ,[AgentPeripheralNumber] AS AgentExt
      ,[PeripheralCallKey]
      ,[CallDuration]
      ,[AccountNumber]
      ,[FirstName]
      ,[LastName]
      ,[CallbackPhone]
      ,[CallbackDateTime]
      ,[DialingMode]
      ,[DialerID]
      ,[ImportRuleDateTime]
  FROM [dam_hds].[dbo].[t_Dialer_Detail]
INNER JOIN [dam_awdb].[dbo].[t_Query_Rule] on [dam_hds].[dbo].[t_Dialer_Detail].QueryRuleID = [dam_awdb].[dbo].[t_Query_Rule].QueryRuleID
WHERE DateTime > ’10/01/2010′
ORDER BY DateTime DESC

Presto!

~david

Sprint’s HTC EVO

I decided to put my Windows HTC Touch Pro 2 out in the pasture and go for the much hyped “first ever 4g phone”, the HTC EVO.  Best decision ever concerning a phone!

First and foremost, this is the best phone I’ve ever had.  The software is great, the responsiveness is amazing, and it has all sorts of randomly cool features.

The Pros:

  • Great screen.
  • Integration with Google products is flawless.
  • Turn by turn navigation with Google maps.
  • FM radio.
  • Sprint TV, great during the world cup.
  • Apps like Swype, NYT, Google Voice, Google Voice Search.

The Cons:

  • Dealing with Exchange invitations, not as clean as with Windows.
  • No unified inbox like WebOS.
  • Battery hog, but all smart phones are, will need to charge it after a few hours of heavy use.
  • Not enough widgets for shortcuts and displaying vital information on the screen.

 

~david

CTIOS Error 10125

PeripheralErrorCode:10125 AgentID:1000 UniqueObjectID:agent.5000.1000
     MessageID:eControlFailureConf MessageType:eSetAgentStateRequest
     ErrorMessage:IPCC Error [10125]You have attempted to log into an invalid
     instrument.  If you think it is correct there could be a configuration error.
      Otherwise, check the number and try again. FilterTarget:agent.5000.1000

I recently ran into this error and for the life of me could not figure out what was wrong.  So, the first thing I did was make sure it was happening on more than one PC, check.  Next, checked if it was happening with more than one phone, check.  Next, check if it happens with both PGs… this is where I noticed that I could login to one PG, but not to the other.  Which then lead me to check the configuration of both PGs and found that the PG configuration for the PG where the login was failing had an agent extension of 7 digits instead of 10 digits.  Thus why CTIOS was rejecting my login to a phone with an extension with 10 digits.

Presto!

~david