Sunday, October 07, 2012

Career bootstrapping for young people: an alternative strategy

At a Satellite coffee shop here in ABQ yesterday, I heard a guy I knew to be a successful local businessman giving a 24 year old fella advice on breaking into business after college.  He focused on how he should look, dress and act.  I kept waiting for him to get past the surficial stuff but, alas, he kept going on about how to shape shift into something acceptable to the corporate stereotype.

So, in a fit of my occassional righteousness, I stood up, looked at the the advice-giving guy and said, "Don't forget to tell him about deed" and walked to the other end of the coffee shop to continue my work.  To his credit, the business guy understood my point and immediately translated my point to the young man.

So, the point of all this is, yes, it's a good idea to start combing your hair, but it's also important to think beyond just "getting" that first job out of college.
  1. Think in terms of "infiltrating" a business.  By that I mean, be determined to learn how the company works, from its ultimate business plan to how it implements that plan in manufacturing, sales and elsewhere.  Position yourself physically -- where you start in the organization.  Believe it or not, the mail room is a great way to achieve that, assuming there are still mail rooms in businesses.  As far as your "insertion point" goes, your ideal vision of that first job may not serve you best.  Ivory tower positions have their consequences.  "Big picture" ignorance is one of them.
  2. Start on the manufacturing side of your ultimate goal.  From that perspective, you'll see the reality of things.  As a wanna-be software developer, I saw how the company hired hordes of young developers from colleges around the Bay Area and those kids never had any idea what happened to their software after it was handed off.
  3. Then, the hard part, which goes hand-in-hand with big pay-offs, is to figure out the weaknesses in the system and find something you think you could improve.  Find a "coach" within the programming group, or general management, and tell them what you're seeing.  See if they'll advise you on a strategy.  For me, it was a fella named Mark Wong who said, "We're drowning in our current workload.  Here's a programming book.  Teach yourself how to program in our language and build a program for that missing process."
So, that's what worked for my career.  By shaving a couple of days off of how things went from design to manufacturing, I got noticed, promoted and even sent to school by the company to become a full engineer.  In today's world, if you're doing the software thing, I highly recommend you pick a company that has truly adopted the Agile methodology.  It's fundamental basis in transparency amongst contributing teams undermines the ivory tower thing.  Just make sure it's a true Agile culture.

So there it is.  I know times have changed.  But my gut tells me that this kind of career strategy is still a valid option.  Just be sure to comb your hair, for goodness sake!

Saturday, July 07, 2012

Key to understanding Higgs Boson... field versus particle

It's a bit of a stretch going from javascript to physics, but why not?  On the web today, "answers" are all around us.  It's fun to find the ones that work for me and, perhaps, you...

I watched the video by John Ellis referenced below.  It was the first explanation by anybody that made the Higgs Boson thing click for me, conceptually speaking.

For of all, composite and elementary particles (electrons, protons, neutrons, photons, neutrinos, quarks, gluons, klingons (just kidding) and leptons) have no mass intrinsically.  From a parental perspective, they're like pre-teens.  Full of nothing but potential... It's through their daily travels that they acquire mass as you would pick up lint when you put on black clothing  and your dog wants some attention).  But some particles, like photons and gluons, never wear lint-attracting clothing...

So here are my video points from Ellis' video:
  • The key is understanding that Higgs Boson introduces both a field and the particles (Higgs Bosons) that reside within that field.
  • It's the particle that CERN detected, not the fieldThe field is implied by the prediction and detection of the particle.
  • It's the journey through the Higgs Field, which is everywhere in our universe, that gives particles their mass, such as electrons.  
  • Certain particles that have no mass, like photons, can traverse the Higgs Field much like the bottom of a skier's ski... No Higgs Boson particles "stick" to the slick surface of that photon and therefore the photon acquires no mass.
  • What did CERN discover?  They discovered the particles, or snow flakes, that reside throughout the Higgs field... namely the Higgs Bosons. So they did not discover the field itself.   They discovered the particles that reside there... the things that latch onto certain particles, giving those particles mass.
  • So, another way of looking at it is that particles with no mass, like the photons that deliver light, are smooth and slick and therefore the Higgs Field that they plow through has little consequence in terms of build up of Higgs Boson particles.  And particles that acquire mass have a rough surface and therefore accumulate Higgs Boson particles along their journey.  The rough and smooth attributes are not necessarily attributes of particles.  I'm just using them as conceptual elements.
So, if you need to see moving pictures, watch the video below.  It's a good one.

If you want to know more about where the sub-particle name Boson came from (since Higgs gets all the press), be sure to read the web page at ibtimes.com.  Just another story from the amazing culture of India... with a great story about the role that Einstein played.

https://www.youtube.com/watch?feature=player_embedded&v=QG8g5JW64BA

David

Tuesday, April 10, 2012

alpha sorting (filters) with unobtrusive (jQuery) javascript

Often I see code for alpha lists that looks like the following...
<a url="#" onClick="javascript:performFilter('D')" name="D">D</a>
Pretty busy... and that's just the "D" letter...
But there's a much easier way to accomplish the same thing using jQuery (once the dom is instantiated)...
See the complete code below...

BTW, using href="javascript:void(0);" instead of "href="#" will keep the page from scrolling to the top when you click on the associated link.

David

<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript">

var letterElem
$(document).ready(function(){

  letterElem = $('#default') // "ALL" to begin with...

  div#alpha a').click(function() {

    letterElem.removeClass("chosen"); // remove previous node's green background

    letterElem = $(this) // cache the selected element node

    var letter = letterElem.text(); // grab the text node

    $('#answer').text(letter); // display the letter selected

    letterElem.addClass("chosen"); // give the selected letter a green background

    // askServerToFilter(letter); // here's your placeholding call to the server for a filtered query

  });

$('div#alpha a').attr("href",'javascript:void(0);'); // a's have to have href value...
});

</script>
<style type="text/css">
a { margin:0 8px 0 8px; padding: 1px 2px 1px 2px;}
a.chosen { background-color:green;color:#fff; text-decoration:none;}
span#answer { font-size:18px; color: blue; font-weight:bold; }
</style>

</head>
<!-- BEGIN HTML WITH NO JAVASCRIPT ANYWHERE -->
<body>
<p>An example of unobtrusive javascript... used to address alpha lists. </p>

<div id="alpha">
<p><a>A</a>|<a>B</a>|<a>C</a>|<a>D</a> ... <a id="default" class="chosen">ALL</a></p>
</div>

<p>Click on the alpha list above to get the letter selected... ANSWER: <span id="answer">?</span></p>
</html>
</body>

Tuesday, January 24, 2012

MongoDB Tip #2 - updating fields via Java/Groovy (Bicycle Shop Example)


First post of the new year, 2nd MongoDB tip... here we go!

Let's say that you're writing software for a bicycle repair shop. You need to update the "flat tire" status for a handful of customers because those tires were repaired by the repair shop team.

Using native MongoDB Javascript, you might craft the following:

db.bicycleJobs.update({jobId : { $in: [ 110234, 110433, 110511, 110766] }}, 
 {$set : {flatTire:false}}, false, true); 

Yes, we could cruft up a javascript file to do this, but you want to grab the customer job numbers (e.g., 110234 above) from a file or your inventory system.
So you decide it would be much more convenient to do it in Java or Groovy. Interrogating the native mongo statement we used above, you can probably guess what the update method signature looks like according to the Java Driver for MongoDB.

customers.update(document1, document2, flag1, flag2)
document1
This is our "select" that identifies the target rows based on job numbers in the provided list.
document2
This is our "action" document that actually states the operation to take place. Here we "set" the field called "flatTire" to false.
flag1
This is the "multi" flag. It indicates that the set operation should be applied to all rows that match the results of document1, not just the first match, which would be the default behavior. Having been burned in the past, that's what I call a nice default behavior!
flag2
This is an "upsert" indicator, meaning if there's no match to be had according to document1, then create the row, initialized with these two fields: jobId and flatTire. Might look good on the books, but let's keep this behavior turned off since it probably reveals a data entry error (with respect to the correct jobId).

So a more useful description of this Groovy method signature might something like:

bicycleJobs.update(findDoc, operationDoc, multiFlag, upsertFlag)

Now here's some code to tie things together...


def jobList = [] as BasicDBList

jobList << 110234 // until we're reading from a file or other data source...
jobList << 110433
jobList << 110511
jobList << 110766

def findDoc = new BasicDBObject().append('jobId', 
 new BasicDBObject().append('$in', jobList ));

if (verbose) {  // This bit gives us a little debug to see "the before"...
 def cur = leads.find(findDoc)
 while (cur.hasNext()) {
  def customerRow = cur.next()
  println customerRow['jobId'] + ': flatTire: ' + 
   customerRow['flatTire']  + ': customer: ' + 
   customerRow['name']
 }
}

def operationDoc = new BasicDBObject().append('$set', 
 new BasicDBObject().append('flatTire', false));

def multiFlag = true // update all matches
def upsertFlag = false

db.bicycleJobs.update(findDoc, operationsDoc, multiFlag, upsertFlag)

//You could repeat the "verbose" block above to confirm the expected results.

That's it for now. As I build my knowledge with native mongoDB, I'm trying to make sure I know how to do the equivalent in Java/Groovy. Once you understand how to use Hashes and BasicDBOObject operations to build a document, then it appears to be pretty straightforward.