A Windy Dog Mountain

A Windy Dog Mountain

Did an ‘easy’ hike (compared to Hood anyway) up Dog Mountain this weekend, and man was it windy.  Flowers on the upper peak were in bloom and beautiful, but man was it windy!  20-30mph sustained.

Good Hood climbing resources

Good Hood climbing resources

After make a successful climb of Hood, here are some of the helpful websites I used in planning:

Cascade Climbers – message board for folks that just did climbs/etc
http://cascadeclimbers.com/forum/ubbthreads.php/forums/7/1/Oregon_Cascades

Mountain Forcasts.com – Best source of wind/freezing levels/temperatures by elevation for many summits:
http://www.mountain-forecast.com/peaks/Mount-Hood/forecasts/2500

Mt Hood climb!

Mt Hood climb!

Had a GREAT time climbing Mt Hood on Saturday, Jun 11th.  Here is a flickr stream of photos:

   

http://www.flickr.com/photos/18696433@N02/sets/72157626828673343/

We left around midnight and it was a perfect night for climbing.  It was nicely in the mid-20’s (which kept the snow frozen for easier travel) and only 5-10mph winds.  We were about halfway to the crater rim from Palmer as sunlight starting coming out around 4am.  We hit the crater rim around 6am as I recall.  Fantastic views and we got really lucky with the cloud cover.  There was a lot of low-lying clouds around Timberline lodge level, but also a layer of really high clouds which kept the sun off the top of the mountain.  Keeping the sun off the top of the mountain is important later to prevent ice and snow from melting and falling from above.  But we  had a wonderful window between the two layers and enjoyed it.  We did the Old Chute route, and there were easily 50 other people doing climbs as well.  One or two groups did the Pearly Gates, but it was pretty icy and a good number of people switched over to the Old Chute for the way down.  The snow was nicely consolidated all the way up.

I did find out more about the slide that happened on Wednesday.  I took a picture while I was up there since it was the very route we had to take(!), and we think this is where it happened:
http://mattfife.net/special/shuteslide.jpg
The time of the slide was supposedly around 7am – which surprised us at hearing it had being so early.  Usually these sorts of slides happen after the sun has been shining for a few hours (noon/afternoon).  It was apparently a bunch of ice that fell off the wall and then slid down.  The lady who got hit did end up falling a couple hundred feet, sustained ‘a couple fractures’, and went to the hospital but was expect to make a full recovery.  It was small/mid-sized slide by the look of it and you could see where it had left big chunks laying around as we climbed up.  We’d had below freezing temps all night so there was nothing coming down; but the sun was shining directly on the wall section right where it had broken loose by the time we arrived.  Being new to Hood and climbing, I was a (understandably) worried but we got up and down as quickly as we could.  Since we got up there a little later than we wanted, we didn’t run across the summit ridge to get to the true summit.  The sun had been hitting the chute walls for well over an hour by the time we got up there, so we played it safe.  We got to summit ridge, took a good look around to enjoy the view,  and then came down again to be safe.

Most of the folks we ran into up there were really well prepared and safe.  As for poor form awards of the day, we ran into a ski patrol guy on the way down that said a lady had broken her ankle on the way down because she was glissading with her crampons on (a classic, big no-no).  Another guy had done the chute in the simple metal band crampons tied around his hiking shoes (not boots) and a hoodie (no coat, no pack/extra gear/etc).  He got stuck up at the top until someone who had found an extra ice ax (the one that the guy in the slide lost??) lent him it to go down with.

Oh, and a dog made the summit too. 🙂

Nice hike up to the top of Palmer on Mt Hood

Nice hike up to the top of Palmer on Mt Hood

Had a ridiculously sunny and warm day on Saturday.  In preparation for my attempt on Mt Hood this week, I did another hike up the climbers trail from Timberline lodge to the top of the Palmer lift (5,900ft-8,470ft).  Had amazing views and beautiful, sunny weather:

 

It was only about 1/2 the distance to the top (11,240ft), but was a great gear and stamina check.  I considered going higher, but I had started later and the snow was already pretty mushy.  That and I wasn’t going to go higher than the patrolled area alone.  Had to keep putting the SPF 50 on during the few hours I was up there and still got a lot of good sun.  It was so bright that the auto-white balance of the camera turned the blue sky black.

Overall, gorgeous day and great hike.

Gotcha’s of using ID3D11ShaderReflection

Gotcha’s of using ID3D11ShaderReflection

So, I am working on something that requires I programmatically know what’s in a DX11 shader file.  One of the cool things you can use to figure out how many constant buffers, get string names from position streams, etc – is the DirectX Shader Reflection system.  It gives you the ability to query a loaded shader blob for names/types/etc.  However, it’s not quite as straightforward as one might expect to use.  The docs were pretty incomplete up until the DX11 version.  But here’s the basics of the ID3D11ShaderReflection system:

  1. Load your vertex/pixel shaders.  Get the actual shader blob – or extract it from the FX system if you used that.
  2. Bind it to a shader reflection object using D3DReflect:
    pd3dDevice->CreatePixelShader( pPixelShaderBuffer->GetBufferPointer(), pPixelShaderBuffer->GetBufferSize(), g_pPSClassLinkage, &g_pPixelShader );
    ID3D11ShaderReflection* pReflector = NULL;
    D3DReflect( pPixelShaderBuffer->GetBufferPointer(), pPixelShaderBuffer->GetBufferSize(), IID_ID3D11ShaderReflection, (void**) &pReflector);
  3. Query the reflection object for whatever constant buffer, input/output stream, or other info you want using the many methods available.  It’s a GREAT way to test your shaders at load time so you don’t get cryptic runtime errors later when you try to actually draw objects.

Now, the gotcha’s:

  1. You must also include this:
    #include <D3DCompiler.h>
    Or you’ll get a compile error with D3DReflect() – despite the fact the official Microsoft docs seem to say you should (only) include:
    #include <D3DShader.h>
  2. Finally, you MUST have the DirectX SDK include directory listed before the windows include directory in the Visual Studio compiler include directory list or you’ll get compile errors in D3DShader.h. This is apparently because the windows headers that come with Visual Studio actually have a few DX definitions in them that conflict with the DX SDK header definitions.  
    In Visual Studio, check: Tools/Options -> Project and Solutions -> VC++ Directories and make sure Windows SDK include & library paths appear AFTER DirectX include & library paths.  See here for the thread.
iPhone programming – Learnings

iPhone programming – Learnings

From the wayback machine…

I found a half-completed post on when I was first learning to program on the iPhone.  I think these things are all still valid…
So, I’ve embarked on an ambitious programming project.  One that is now 1/3 of the way complete (first third was the ‘heaviest lifting’ part of the project – took about a month of outsourced grunt work).  The next 1/3 involves programming an app on the iPhone/iTouch.  I thought that would be the easy part, but as it turns out – there is a substantial learning curve that one should be aware of before starting this endeavor.  Here are some of the learnings I’ve found so far after having just got the bare bones of my own app up and running.

  1. Apple’s documentation is very robust – but frustratingly ‘useless’ at times.  They provide many very detailed and excellent vertical stacks of information.  Want to learn about pooled allocators?  They have a document that gives you all the information you could ever want.  But not in the context of how you’d actually use them – or why you hit various problems you hit.   You’ll find yourself sifting around from document to document trying to find out why your NSString object is throwing an exception when returning from a function – only to find the real reason is buried in the memory management section of the Cocoa programming guide – not anywhere near the NSString documentation or their samples. 
  2. You need to learn Objective C and Cocoa. – and learn them in THAT order.  It’s annoying, but try to find a good Objective C book first.  There aren’t many of them.  There are lots of bad ones though.  Learn how to write a class, add functions with multiple calling parameters, how to make calls to classes, and how allocation works.  That last one is key.  Really spend time learning why:
    [[NSString alloc] init]
    is the right way to allocate and initialize an object and then learn why:
    NSString *s = [[NSString alloc] initFromString:@”hello”];
    [s appendString:@”this string now leaks”];
    leaks memory.  And how the autoAllocator pools work/don’t work.  This is all huge and the first biggest gotcha’s your get hit with right off the bat.
  3. You’ll struggle to get even a 5 line program working at first.  Your first Objective C/Cocoa programs will be very painful.  The simplest things will feel like fighting a brick wall.  I tried to do a simple enum, and kept getting burned by an invalid class definition.  Wha?  The objective C compiler on the iPhone requires you typedef your enums and structs:
    enum newEnum { a, b, c, d }; (NOPE – will cause a compiler error in whatever line follows this definition)
    typedef enum { a, b, c, d } newEnum; (yes – works)
    Just millions of little things like that.  Again, logical if you put your old C/gcc hat on, but it’s been a bit since I last had that hat on and it had some dust on it…
  4. The GUI IDE is great – if you do things they way THEY want them and only for straight-forward designs.  The interfaces for GUI controls holds very much like Win32/X programming philosophies, albeit the syntax is very different.  X Code comes with it’s own WYSIWYG GUI editor, but I found it very limited if you’re going to come up with any kind of innovative interface.  If you just want some standard buttons/etc – you’re probably fine.  But if you want to have some interesting scrolling effects/etc – you best be ready to spend another few days learning how the UI control systems work underneath and experimenting.  The built-in GUI editor reminds me of the old VS2005 GUI editor that you could drag-n-drop controls, compile, and you’d see the results.  If you want any dynamic elements – I haven’t found a way to do that using their gui editor.  And if you want to embed controls on scrolling panels and some other more modern effects – you’ll be tossing the GUI editor altogether.  Trouble is, you spend a good bit of time learning how the built-in GUI system works, find out it won’t do the thing you need without tons of digging through forums and ‘tricking’ the thing to do what you want, then give up and have to learn a bunch of NEW stuff when you give up and decide to just dynamically/hand-generate the controls yourself.  Frustrating.



							
Advice from a manager

Advice from a manager

Interesting article in Fortune from someone who appears to be a good manager and author of the book “You Can’t Fire Everyone” by Hank Gilman.   I particularly liked him because he seemed like a ‘good’ manager.  i.e. he had the notion of treating his people with respect, and handling his job with class, professionalism, and style.  One of his un-stated guidelines he seems to have is that if you build a great work environment, then it will sell itself.  Keep that point in mind while reading the rest of this. Some of his points:

  1. The day your star employee decides to leave is the day you start woo-ing your player back again – it’s not a time to act like child, hold a grudge, or try to sabotage them.  New opportunities and a chance to grow/try something different come along for everyone.  It’s your job as a manager to get them to want to come back. Doing any of the aforementioned childish behaviors only sabotages your own reputation, future hiring, and long-term career.
  2. Try to keep them – if what they want is something you can give.  Know when it’s right to bend over to keep someone.  If it’s about money, get them some more. If it’s about title, do something about that (titles are only words anyway). But if they really want a new job – or need a change – let them take it.  People who think a good career move is a new title will likely be back in six months anyway.  Conversely, all the money in the world won’t keep someone who really wants or needs a change.
  3. Don’t bad-mouth their direction/new employer.  Even if you know the other company is bad or people there are cut-throat back-stabbers, don’t get involved in a petty squabble or words that might get back to the people you gab about.  Show your integrity at those moments.  If you’ve build a great work environment, then you can honestly say “Go off and have a great time. I think you have a great opportunity.  However, I’ve had enough of them and I believe you’re not going to get much better than what we offer.  You’re always welcome here.”  The grass isn’t always greener, but sometimes you just have to let them find that out on their own and welcome them back when they’re ready.
  4. Keep in touch – Make it a point to have lunch or dinner and remain friendly.  You have a scout in a new place if you want to recruit one of their colleagues. You also have a damn good reference in case you need to look for work!

He had other suggestions, but you get the idea of his style.  He shows how an other-directed focus gives your actions class and doing things with a style that makes people want to come back to him.  His advice is to not pout around like a child that didn’t get their way, burn up potential partners and bridges, and generally strangle your own career over the long haul because you’re too ego-centric.  If all managers worked in a similar way, then I think far more people would be happier in their work lives.

Windows 7 blue-screens due to stdriver64.sys

Windows 7 blue-screens due to stdriver64.sys

I recently started getting blue-screens with stdriver64.sys. In doing my blue-screen debug, very little useful information was given:


SYSTEM_THREAD_EXCEPTION_NOT_HANDLED (7e)
This is a very common bugcheck.  Usually the exception address pinpoints
the driver/function that caused the problem.  Always note this address
as well as the link date of the driver/image that contains this address.
Arguments:
Arg1: ffffffffc0000005, The exception code that was not handled
Arg2: fffff8800970bbe8, The address that the exception occurred at
Arg3: fffff8800676d7f8, Exception Record Address
Arg4: fffff8800676d050, Context Record Address

Debugging Details:
------------------

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.

FAULTING_IP:
stdriver64+1be8
fffff880`0970bbe8 49              dec     ecx

EXCEPTION_RECORD:  fffff8800676d7f8 -- (.exr 0xfffff8800676d7f8)
ExceptionAddress: 0000000000000000
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 158383080
Parameter[0]: fffffffffffff880
Parameter[1]: 0000000000000002
Parameter[2]: 0000000000000000
Parameter[3]: 0000000000000000
Parameter[4]: 0000000000000000
Parameter[5]: 000000000022dba8
Parameter[6]: 0000000000000000
Parameter[7]: 0000000000000000
Parameter[8]: 0000000000000000
Parameter[9]: 0000000000000018
Parameter[10]: 0000000000000000
Parameter[11]: ffffffffffffffff
Parameter[12]: 000000000000007f
Parameter[13]: 0000000000000000
Parameter[14]: 0000000000000000
Attempt to execute non-executable address 0000000000000002

CONTEXT:  fffff8800676d050 -- (.cxr 0xfffff8800676d050)
Unable to read context, NTSTATUS 0xC0000147

DEFAULT_BUCKET_ID:  VISTA_DRIVER_FAULT

BUGCHECK_STR:  0x7E

CURRENT_IRQL:  0

LAST_CONTROL_TRANSFER:  from 0000000000000000 to 0000000000000000

STACK_TEXT:
00000000 00000000 00000000 00000000 00000000 0x0

STACK_COMMAND:  .bugcheck ; kb

FOLLOWUP_IP:
stdriver64+1be8
fffff880`0970bbe8 49              dec     ecx

SYMBOL_NAME:  stdriver64+1be8
FOLLOWUP_NAME:  MachineOwner
MODULE_NAME: Unknown_Module
IMAGE_NAME:  Unknown_Image
DEBUG_FLR_IMAGE_TIMESTAMP:  0

BUCKET_ID:  INVALID_KERNEL_CONTEXT

I dug around on my support forums, and exception 7E has been related to loads of different problems: bad logitech mice drivers, cardbus adapters, audio drivers, failed USB drivers when it happens on awake from hibernate, etc.  Basically, any and all services seem to be known to cause it.  Also, having the module and image names completely unknown wasn’t very hopeful either.  I considered the idea of stepping into the memory location specificed until I found this write-up.  It mentions the program SoundTap as a very common source.  I had recently got Soundtap as part of a kit including the excellent Switch sound converter.  I uninstalled Sound Tap and sure enough – bluescreens went away.  Soundtap installs an audio driver to divert playback so you can do raw rips of anything you play on your pc (think sound ripper for youtube/shoutcast streams/shockwave players/etc).

So, it’s always a good idea to keep track of what you’ve changed on your pc and suspect even the unlikely things such as a simple software install.  That and googling for others with the same problems. 🙂

Is there really a shortage of scientists, engineers, and computer scientists?

Is there really a shortage of scientists, engineers, and computer scientists?

You hear it in the news – the US has a shortage of people going into engineering, science, and high-end technical degrees.  We’re being trounced by the extrodinary graduation rates in developing contries and China/India.  Even Obama introduced his STEM education support program to encourage students into Science, Technology, Engineering, and Math (which he touted on his trip to our Intel site a few months back).

I was recently elected to Purdue’s Alumni Board for the school of Sciences.   During the last bi-annual meeting, we have a dean of one of the science schools come in.  This time it was the dean of the Geology dept.  He gave a great presentation on the interesting things they’re doing, but one of the most interesting points about his presentation was this: he gets calls all day long from companies and government agencies looking for geologists, but he has none to give them.  Currently the enrollment in geology at Purdue is around 150 students.  For ALL undergraduate levels.  Purdue has just under 30,000 total students, and only 150 are enrolled in undergrad geology.  He says he has jobs to give away, but nobody to fill them.  And they’re not all just for oil companies – government needs lots of surveyors, building ground inspections, erosion and terrain evaluation/etc.  Companies have all kinds of jobs too.

Surprised by this information, I went over afterwards to my haunt – the Computer Science department.  In talking to one of my old professor acquaintances over there,  I was surprised to find they were *just* reaching 200 undergraduates.  When I was in computer science in the last 90’s, there were 250 students and rising every year.  it turns out that enrollment plummeted right after the dot-com bust and has only recently started recovering.   Both of Dean of Geology and the CS professor independently cited 2 major reasons:  high-school curriculum focus and perception of job market.

First they both talked about the need for outreach programs.  The dean of Geology and the CS department appear to desperately want to get kids in High School interested in CS or Geology (I’d say most of the schools of sciences would also agree).  We all know that high school programs across most states have been getting chopped for years.  Their evaluation is that the constant budget chopping has seriously cut back on all their curriculum; but in science/math it’s had a particularly chilling effect.  Why?  Because schools under budget constraints tend to focus only on core-courses that are required for state accreditation, and cut everything else.  Computer programs are nice, but are expensive investments from a per-student basis.  My own high school only had a programming course because one math teacher wanted to teach it pretty much pro-bono and the machines were the ones use to teach typing/word processing classes.   Many science programs have cut back to just basic chemistry and biology.  So it’s no wonder that students that have had lack-luster, or simply no, high school experiences with sciences like geology or computer science.  Even fewer are inspired to look into or consider them as possible career choices.  In recounting my own experience of being a rural Indiana student of a high school with only 500 students; my professor friend said I was most certainly a huge exception.  Most rural students never see the insides of a Purdue science lecture hall, let alone even apply.

If anecdotal evidence isn’t enough, the Dean of Geology said that many states and oil/geology companies are becoming so desperate for geologists that they are starting to create their own high-school curricula for geology programs and giving them to high-schools for free; if only they agree to teach it.  Some of these companies have even considered also sending along someone to teach it – for free.

Secondly, there is a perception that the job market isn’t good for sciences.  For CS, there is apparently still a lot of stigma from the dot-com explosion.  During a lot of the later 2000’s there were tons of out of work programmers, and even though the tide is completely turned around, the perception is that there is still a glut of programmers and/or that it’s a difficult job market.  In Geology, there is a perception that one will have to work for an ‘evil’ oil company; not knowing there are tons of fascinating other job opportunities doing surveying, soil research, water erosion, earthquake prediction/prevention, etc, etc, etc.

These two points were big factors in their take on the situation.   So as a member of this board, what should one advise?  I did some of my own research, and will write about THAT next time. 🙂

Successful iPhone 3GS battery replacement

Successful iPhone 3GS battery replacement

Well, just shy of 2 years, the battery in my iPhone 3GS had gotten pretty sad.  While it would charge up to 100%, it would run down really fast.  I wasn’t able to get more than half a day of good use out of it before it needed recharging.  Even sitting on my desk at work doing nothing it would lose 20% in an 8 hour stretch and seem to be getting worse every day.

Call up an Apple store, and ask them.  Battery replacement on a iPhone 3GS?  $199.  Really?  $199 sir.  Hangup.  I look around on the internet.  Lots of folks selling iPhone batteries, and most for $5-$15.  I start looking around for the most reputable guys, and find iFixIt.com.  They have lots of great step-by-step diagrams, descriptions, videos, and pictures.   Even better, they have a comments section that has literally hundreds of folks who put tips/gotchas/etc. This is looking good.

They sell a 3GS battery kit with all the tools you need for $15 – which includes a tiny screwdriver and a small plastic pry tool that they claim is the same one made for Apple.  You can also buy other helpful tools like a suction cup for removing the 3GS screen.  I decide to take the risk and have it all shipped – $25 total.

Kit comes in the mail and looks pretty well packaged and has all the tools I need.  I open it up and go to the website for instructions.

I follow the instructions pretty closely.  This isn’t like swapping the battery in your remote.  Mine has 16 different steps with no less than the removal of 10 different tiny screws and 7 different tiny ribbon cables.  You need to remove the screen, logic board, camera, and …well… basically everything because the battery is on the very bottom *glued* to the back plastic panel.  I remove it all, install the new battery, and reverse the 16 steps.

I flip it on, *blip!* it makes the normal startup sound – the screen backlights – but NO image/icons/etc.  🙁 I plug it into my computer and it syncs and sees the phone just fine.  I can even see my pictures and music on it – but no image.  I take it apart 2 more times and try re-seating the 3 display cables.  Same result.  Ugh.  I go to check iFixIt.com’s forums, but the site is now down for maintenance – right in the middle!  I remember from a previous look on the forum where one guy had to restore the factory defaults to fix a problem with his phone not charging properly.  I figured what the heck and tell iTunes to restore to factory defaults.   Turns out there was an update due, so it took 30 minutes to download the patch and another 15-20 to restore the defaults.  Shesh.  But right after the restore of factory defaults – I get my display back!  WOOT!  I restore everything, then make a phone call – works like a champ!

I make a phone call, test the buttons, test the camera/screen/music/etc, and everything seems to work great.  Why a software reset is needed to have your display come back after a simple battery replacement is beyond me – but there it is.

So, I don’t recommend the procedure to everyone.  It took about 30 minutes of steady concentration and a equally steady hands – but it seems to be working like a total champ.  It just finished charging to 100%, so we’ll see how well this battery lasts, but it already seems much better.