Monday, May 6, 2019

Intellectual Wrestling When Contemplating Leaving a Company



Spending the past decades in a career focused on logic and reason it's disappointing and perhaps eye-opening to observe reasonable people not making reasonable decisions.  As much as I'd like to mount my particularly high horse and proclaim from above how everyone should behave, self-reflection would only exhibit hypocracy as I'm guilty of some of the same short-comings.  I'm still a pup in the study of organizational dynamics so I offer no solutions, only present observations specifically focused on justifying leaving a team which has a corrosive element.  By no means should this be perceived as advocating leaving your team, rather it should be considered reasons you could consider leaving and remedy guilt you may feel in doing so.

Perhaps sadly, long gone are the days of long-term employee/employer relationships.  While more common in past decades, I'm constantly surprised when encountering employee anniversaries on the 15+ year mark.  While admirable, it's far more common for 5-10 year engagements in my observations, but I have no data to back up such a claim.  The point is, company/employee loyalty or long-standing relations are less common than years ago and there is no societal judgement in leaving a job for another position.  In fact, in my opinion, one of the worst things for anyone is to feel or be trapped to an employer/employee.  The employment relationship should be mutually beneficial, if not it's time to consider splitting ties.

I'm getting a bit off-topic so let me reel this in.  Suppose you're currently working on a team that is mostly good, but has some strong elements that makes it frequently suck.  For example, suppose you like your manager, really like most of your team members, but has one (or a few) people make it miserable. Now what?

You're at a cross-roads; stay or leave?

There are strong merits to staying and participating in changing the culture and as admirable this path is, I won't be focusing on it; leaving it to countless other experts.  Stay or go; it's a personal decision, one you need to make for yourself.  Having struggled with this decision numerous times myself and seeing colleagues around me go through it as well it's a pretty common plight.  I thought I'd share some of my thoughts on what may go through your mind and provide some counter-points to common concerns and feelings of guilt.

Feeling of Guilt Leaving the Team

Hopefully, there are team members that you genuinely enjoy working with.  When this is the case I've often struggled with a feeling of abandonment, leaving your good team members to deal with the bad ones.  A feeling that you should remain to assist in changing the team for the better.  Despite the 'fork in the road' analogy the choice to leave can participate in changing the culture.  Pain is a primary motivation, easily observed if you've ever encountered a freak hailstorm on a beautiful sunny day.  Despite your overwhelming desire to stay outdoors, being pelted by hail motivates you to change your current situation.  This goes for you as well as the organization.  Leaving a position, unless it's irrelevant, causes pain to your team, leadership, and organization at many levels.  Project schedules and risk will be impacted which will/should be relayed up the leadership chain.  Time and cost to locate a replacement team member will hit your hiring manager as well as human resources.  Training costs, formal or informal, will impact the organization.  In the case of loss of an employee, rather than a contractor, often a 20% salary finders fee will be accrued, a pretty common fee associated with recruiters.  Loss of a team member is a pretty visible event, while there are plenty of organizations that see this as simply a common thing, you NEVER want to work for a organization that trivializes employees leaving as a non-event.

If you hate the organization you're leaving and everyone associated with it you'll unlikely experience any feelings of remorse, but what if you genuinely like some of the people that will be recipients of the impacts?

What if you like your manager, aren't you hurting them?  In a word, yes; but you may also be helping them.  If a caustic team member is driving away good people it may motivate them to remove the bad element rather than feel everyone will simply deal.  Even the strongest managers struggle with removing an employee for any number of reasons; hoping in time they will improve, a desire to avoid conflict, avoiding the time/cost to locate and train a replacement, a hope in time they'll leave on their own or a desire to avoid the crap-ton of red-tape in documenting and executing an employee dismissal.  Sometimes it's not a shortcoming of your manager, perhaps the caustic employee works for another team.  Like a neighbors dog, often the caustic team member is nice to his/her immediate family but bites everyone else.  The neighbor will strongly desire to keep their family member until it's been demonstrated it bites someone, only then are they sufficiently motivated to address the issue. Leaving an organization is a public event and formally or informally the reason you choose to leave will make it to decision makers capable of addressing the root cause.  If you have a dick working at the company that is driving away talented people it's simply a matter of time before people who can remedy the situation are in the know.  Regardless of how instrumental they may be to the company, a repeated cost of hundreds of thousands of dollars of driving away good people will raise them into a stage they want to avoid.  A company earning a reputation of being a revolving door of hiring is less tangible, but certainly one most companies will avoid.

What About My Team?

Regardless of how good you are, it's incredibly arrogant to ever think your team can't live without you.  Will they be affected?  Absolutely. Short-term they will absolutely encounter pain and likely through no fault of their own.  In my opinion, this will likely be the heaviest burden of guilt you may feel when deciding to leave.  Call it career survivors guilt, understandable but ill-placed.  Long-term, your leaving may contribute more to changing the culture than staying and fighting windmills for years.  It opens a door to find a organization that has a better culture and keeping an eye out for opportunities for your team to join you in the future.

What About My Reputation?

Maybe you're concerned that leaving when 'times got tough' will earn you a quitter scarlet letter.  Having been on both sides of hiring, despite what your high school principle may have informed you....you have no 'permanent record'.  Unless you live in an incredibly small community that is subject to gossip, the reasons you leave an organization are pretty confidential.  The company you left will likely know, and future employment will only know what you share.  Employment references are less common than days of past, and when given are often heavily restricted.  Your past managers sharing the reason you left puts the company in jeopardy of liability.

What If I Can't Find Another Job?

Risk of not being able to find another job may be an issue, but if you're good at what you do and the market is accommodating I've always been confident in finding another position.  You can remedy this concern by finding a position before tenuring your resignation.  Timing of leaving a position for another should be considered, and while likely industry-dependent....avoid leaving near the end of the year when hiring efforts and financials slow.

In Closing

I hope you found some of this useful.  Feel free to share your own questions or opinions on the matter.  Keep in mind, this isn't advocating leaving as the only solution, rather hopefully it provides insight into how leaving a company can long-term benefit a company as well as counter-points to feelings of guilt you may feel when struggling with this decision.  Having worked for a variety of companies these past decades, as an contributor, a technical lead and part of management I feel I have a wide angle lens on employee hiring/leaving practices.

Final note; I've worked for a variety of organizations and have never found one to be inherently evil.  I've never met a Montgomery Burns who treats employees like replaceable cogs and doesn't want to address organizational issues.  Most people want to do the right thing, sometimes it takes a sharp kick in the pants to motivate them to do so.  Reputation and cost are universal motivators to organizations and may provide the tipping point to fix what ails them.

Sunday, April 28, 2019

Just Got Back From Minnebar14

My wife and I just returned from the latest MinneBar tech conference; https://minnestar.org/minnebar/.  I regret not knowing about these local conferences, learned of them only 4 years ago.  Since attending our first, we anticipate and eagerly await the announcement of tickets with the same enthusiasm as a pre-teen looking forward to their current boy band obsession.

They're tagline is 'For Tech. By Tech' organized in the form of typical an 'unconference', informally formatted sessions, a good number of first-timer presenters; nerds presenting nerdy topics to nerds.  In past years, the majority of the sessions were tech-rich offering a variety of interesting topics.  The challenge was always down-selecting from a number of sessions down to just one.  The presenters and audience are tolerant of migrating from one topic to another, encouraging attending a session to give it a chance and leave for another if it wasn't your cup of tea.  Everyone talking passionately about technologies and a fluid audience base flowing in/out with the goal of absorbing as much they can in the time left in the hourglass.

The sessions were primarily about tech, with a smaller fraction focused on the business side with an emphasis on start-ups.  Today, I learned that this start-up/tech pairing was baked into the DNA of Minnebar.

This year, the sessions flipped the script; the large majority of the sessions were about the business side with the minority of the sessions associated with tech.  This was the first year, after returning, that we mutually felt regret in attending.  Before I continue on; this is a zero-cost technical conference, thousands in attendance all organized and executed by an army of volunteers.  One can quickly make a case; 'you have no right to complain' and to that I would absolutely agree.  I suspect however that we aren't alone in our disappointment in this year and MinneBar openly requests feedback.  Additionally, under no illusion was attending a complete waste of time, attending any discussion with an open mind you leave with something.  It's more a matter of; knowing what I know now about this particular Minnebar....would I go again.  To that, I'd unfortunately say no, but I still look forward to next year's conference in hope that it returns to it's origins in tech.  *fingers crossed*  I also am not placing blame on Minnestar, the organizing committee.  I know essentially nothing about how the content of the conference is selected, perhaps the non-tech emphasis is due to lack of tech-rich presenters.  If however the emphasis on non-tech was intentional, perhaps some of my observations could be taken into consideration.

Founders / Technologists -- A Logical Match

From the beginning, the focus of MinneBar was aimed at bringing together start-up folks and technologists, so it's understandable and desired to have non-technical folks attend as well as present so please don't interpret any of my comments as a desire for tech-only content and attendance.  Small businesses don't have deep pockets like larger corporations to locate joint-minded tech heads.  This symbiotic relationship is one of the things that sets MinneBar apart from other conferences.  Finding the right mix of attendees is a complicated problem and I wish MinneStar my best in doing so.  Over-emphasis on one group will drive away the other.  Founders want to meet technologists, technologists wish to meet founders.  I suspect an undesirable affect would be exclusive attendance of techies or founders.  Personally, I fear we are at the cusp of that potential path.
Techies are drawn to tech, and our primary motivation to attend this conference.  We have an opportunity of sampling 8 glorious hours of interesting topics as well as future opportunities to present sessions ourselves.  Personally, we aren't currently seeking out job opportunities or a co-founder, so sessions focused on networking and soft-topics (while appealing to others) aren't worth trading a gorgeous spring day for.  I may not be their intended demographic though.

Minnebar Mission

MinneStar has an executive board so I'm confident that they have a well thought out mission.  It could very well be that the tech-heavy conferences of the past go against their mission.  This year they had a record-breaking attendance so they may very-well be directly on path.  World-wide, the gig economy and entrepreneurial paths are trending so non-tech sessions may very well be the right path for them.
Selfishly, these topics are of less interest to me and I suspect other tech heads.  Contrasting MinneBar with a singles bar, you're trying to bringing pairings together.  If the bar drives away the ladies you're left with a building full of guys.  Likewise, if the bar emphasizes attendance from guys, you drive out the ladies.  Personally, I feel the non-tech emphasis this year will drive away technologists; especially if they feel similarly to us this year.
Equally, the mission of MinneBar may very well be a more diversified attendance.  If so, bulls-eye; there was a more diverse group in terms of occupations, genders, interests and cultural diversity than I've ever witnessed before.  Refreshing for such a conference and perhaps a direct artifact of the non-tech emphasis.

Comments/Suggestions

The mere thought of standing in front of a room of dozens of people I don't know is the formal definition of Hell to me.  Again, having no knowledge of how sessions are selected it could very well be that the platoon of brave souls has simply dried up.  However, if tech-intensive sessions were turned away for a non-tech place at the table I would respectively ask you to 'knock that shit off!'  With decades of feeling out-of-place and hiding our geekhood, these conferences are an opportunity to meet others with similar interests and 'get your geek on'.  This conference is precisely what I thought a good place for doing just that.

Do you know the difference between an introverted nerd and an extroverted nerd? An introverted nerd looks at his/her feet when you talk to them. An extroverted nerd looks at your feet.  Presenters, stop enticing people to mingle as part of your sessions *grown*.  This is an automatic walkout trigger for me, not because I'm afraid to talk to others but rather I don't seek it out without some mutual goal or interest.  Perhaps this makes me an asshole, but given the general responses to these requests I'm far from alone.  I'll gladly talk with a stranger given an opportunity and a common interest; I suspect this to be true for many of my fellow introverts.

Personally, I particularly like first-time presenters, I feel they are particularly brave and enjoy a presentations with some warts over one that's been polished to a mirror finish.

I equally enjoy deep-dive technical topics as well as broad-stroke 'Intro to XYZ' newbie-focused topics.  One hour presentations are only going to go so deep without making presumptions about your audience.  I genuinely miss university colloquiums and the past format of this conference took a similar form.

Minnebar discourages sales presentations and I've never attended any session that violated that principle directly.  In reality, presenters all have motives and a soft-shoe nudge/nudge, wink/wink reference isn't uncommon.  As you move away from true technical presenters I suspect this principle will become harder to enforce.  All but unicorn sales reps are capable of discussing tech in detail, move away from tech flings this door wide open.  Polished presenters will take the stage over flinching introverts.

While I'm an avid drinker, well-acquainted with all the key beer and liquor food groups, I've yet to attend the organized happy hour.  I may very well be missing out on something extraordinary.  As much as I enjoy free drinks and enjoy company during so....introducing myself to strangers without a common interest just isn't something I do.  I trade free drinks with strangers for a bar tab with friends. Perhaps one day I'll attend with colleagues/friends, but honestly....the line length is an equally effective deterant.

This conference encourages stepping in/out of sessions to sample the topic.  If you can do so without disrupting the session I highly encourage you to do so.  In past conferences I migrated in/out of sessions because there were so many interesting topics to choose from.  Get a taste, not to you liking, move to any 6 other tasty topics.  This year, it was difficult to find one highly interesting topic let alone multiples.

Roll The Credits

The annual Minnebar conference has always been one of my favorites and I hope it once again claims that title.  Their demographic and intended audience may honestly not be aimed to those like me and the past years topics may simply have been a good bt of luck on my part.  The complexity of wrestling presenters, topics, volunteers and logistics of such an event is mind-blowing and those that run this ship deserve the highest of praise.

Thank you to the presenters as well as the battalion of volunteers planning and executing the conference.

Monday, April 22, 2019

FFMpeg Blending










FFMpeg can blend two input files which allows for a gradual transition from one to the other.  This post will demonstrate how this can be done with two image files or video files.  Let's get started.

Blending Images

Let's snag a couple images to show how blending can be used in transitioning from one to the other.  More specifically, we're grabbing one image and cropping them to form two images.


$ wget https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Bush-Arnie-morph.jpg/300px-Bush-Arnie-morph.jpg -O src.jpg
$ convert -crop 100x300+0+0 src.jpg s1.jpg
$ convert -crop 100x300+200+0 src.jpg s2.jpg




Next, let's generate a 5 second video using the two source images.  Notice the A/B coefficients are relative to time finally capping at 1 when there remains 1 second of video left.  The blending coefficients define how much of one or the other video frame is blended.



$ ffmpeg -loop 1 -i s1.jpg -loop 1 -i s2.jpg -filter_complex "[1:v][0:v]blend=all_expr='A*(if(gte(T,$((5-1))),1,T/$((5-1))))+B*(1-(if(gte(T,$((5-1))),1,T/$((5-1)))))'" -t 5 foo.mp4



The result;

Blending Videos

We can provide a similar effect on videos.  Let's grab a source video and split it into two videos that we'll blend between.


$ youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -o src.mp4 https://www.youtube.com/watch?v=-sUXMzkh-jI
$ ffmpeg -i src.mp4 -ss 10 -t 5 -an vid1.mp4
$ ffmpeg -i src.mp4 -ss 60 -t 5 -an vid2.mp4



Let's blend the videos in the same manner as our images;


$ ffmpeg -i vid1.mp4 -i vid2.mp4 -filter_complex "[1:v][0:v]blend=all_expr='A*(if(gte(T,$((5-1))),1,T/$((5-1))))+B*(1-(if(gte(T,$((5-1))),1,T/$((5-1)))))'" foo00.mp4





There you are, the most fun you can have while blending short of making margaritas.

Cheers.

Sunday, April 14, 2019

Remodeling Software Engineering Practices


I overheard a clever engineering nugget at work today.  I'd attribute authorship to the speaker but I'm unsure he would care about this wee little blog or want his name associated with the quip.  I'll refer to the author as DP.

I'll be phrasing it as I heard it, paraphrasing given my limited short-term memory.

"I remodeled my kitchen some time ago.  The designer was armed with a extensive list of questions.  After answering what seemed an endless number of questions,  I noticed the designer hadn't asked where I wanted the dishwasher located, to which she responded 'the dishwasher always goes to the right of the sink'."  DP, a diligent engineer, extracted a design philosophy from this simple event.  When best practice principles are known it's best to not ask the customer less they answer wrong.

Finding the right balance is always a challenge, it's easily to over-correct.  While the customer has expertise in the problem domain, you have expertise in much of the solution domain.  It's your responsibility to bring your expertise in as applicable, that's specifically why they brought you in.  For example, best-practices in UX design is likely outside your customer's expertise and rather than asking specific layout input from your customer it's better practice to base a layout on best practices and acquire feedback.  Both you and your customers bring the right stuff to the table is a recipe for a successful meal.

Good dining.

Monday, April 8, 2019

Ffmpeg Reverse Video - If I Could Turn Back Time


Staying on the time/ffmpeg topic, this blog will demonstrate how to reverse a video, essentially stepping backwards in time.

Since FFMpeg functionality is fluid with new features, and sometimes command-line arguments, changing along the way I've primarily stuck with a known version in my posts; namely FFMpeg v2.7.2.  This is relevant because in this particular post there are two ways to reverse a video; 1) deconstruction frame-by-frame followed by reassembly, 2) a video filter available in newer versions of Ffmpeg.

Source Video

Let's start by grabbing an interesting video to work from.  Calvin and Hobbes certainly will fit the bill.


$ youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -o input.mp4 https://www.youtube.com/watch?v=KckYcuiKAN8



Snag a Clip

Let's snag the clip when Hobbes tackles Calvin, a solid segment that could benefit from a reversal.


$ ffmpeg -ss 20.0 -i input.mp4 -t 4 -strict -2 clip.mp4



Reverse the Clip

For newer versions of FFMpeg, this is simply a matter of applying the 'reverse' video filter, like so:


$ ffmpeg -i clip.mp4 -vf reverse reverse.mp4



Alas, with older versions of FFMpeg this can be also done, just a little more heavy lifting involved.  In general, we'll deconstruct the video into a series of frames, then re-encode by supplying the frames in reverse order.



$ ffmpeg -i clip.mp4 frame%06d.png

$ ls -t *.png | awk '{print "file \x27" $$1 "\x27"}' > fileList.txt

$ ffmpeg -f concat -r 30 -i fileList.txt reversed.mp4



Resulting in our reversed clip;

Gotta love that tiger!!

Monday, April 1, 2019

Linux Find -- Your Tool To Searching For Dinosaur Bones


Imagine that you have a Swiss Army knife, but you only use the file on it.  Punch a hole in a leather belt, smooth out a broken nail, opening a can of beans, or filleting a trout….chances are you can get the job done with it, but you’re certainly making your job harder than it needs to be.

That’s a pretty fair analogy to how I’ve used the ‘find’ command for the majority of my life.  ‘Shoulder surfing’ of colleagues and I feel that’s the norm.  I’ve only recently (say over the past couple years) began using some of the other find ‘blades’ which can really make your job easier.

Searching for files satisfying a file (or directory) name and finding files of a particular type (e.g. file, directory) are certainly the most common uses for using find.

$ find . –name “*.cpp”
$ find . –iname “*main*.cpp”
$ find . –type f

Often, you want to act on the file list, like grepping for a specific string in each of the files.  For yeeeeeeeeeears I did that by passing the results of the find command to a new command line.  For example, if I was interested in locating the main function declarations in any C++ files found from the current directory I’d do it by either:


$ grep –l “main“ `find . –name “*.cpp”`
$ grep –l “main” $(find . –name “*.cpp”)

*shrug*; so….what’s wrong with that?  Whelp…a couple things: 1) its more complex than it needs to be and 2) it’s not uncommon for the results of find to exceed the command line length limits.  So, why in the world did I do that for literally DECADES?  Simple…I didn’t know any better and frankly the ‘-exec’ option confused my little ‘ol knowledge nugget. 
Understanding the ‘-exec’ subcommand will pay dividends almost immediately, once you get over the confusing syntax.  The subcommand takes the form ‘-exec somecommand {} \;’, the results of the find command will be substituted for the brackets.  The following ‘\;’ indicates the end of the command chain….just get in the habit of slapping it on the end for now.
So, the equivalent of the previous commands would take the form:


$ find . –name “*.cpp” –exec grep –l “main” {} \;

Suppose you have 2 files that satisfy this find: file1.cpp & file2.cpp, notionally this would result in the equivalent of ‘grep –l “main” file1.cpp file2.cpp’.
Well, that doesn’t seem much simpler….why bother?  Let’s say you’re interested in searching for header and implementation files (e.g. *.h & *.cpp).  You could certainly accomplish this without the exec subcommand:


$ grep –l “main“ `find . –name “*.cpp”` `find . –name “*.h”`
$ grep –l “main” $(find . –name “*.cpp”) $(find . –name “*.h”)

The equivalent using the exec subcommand would be:


$ find . \( -name "*.cpp" -o -name "*.h" \) -exec grep -l "main" {} \;

The first half specifies a search criteria of all files satisfying “*.h” OR “*.cpp”.

Last bit, consider how you’d find all files that reference ‘main’ but aren’t headers or implementation files?  Extremely simple change for the exec subcommand example, consider the complexity of not using exec.



$ find . –not \( -name "*.cpp" -o -name "*.h" \) -exec grep -l "main" {} \;

If you haven’t already done so, start using the special blades of your find command.

Sunday, March 24, 2019

Executing Commands Repeatedly



While I've been using Linux pretty regularly since '98, I only recently became acquainted with the 'watch' command.  The primary purpose of this utility is to repeatedly run a command, at a specified frequency, and display the results.

Suppose you're writing to a file and wish to monitor the file size as it goes along.  Whelp, you could issue 'ls -l somefile' repeatedly, write a simple script or make use of the watch command.

If you wish to issue an 'ls -l somefile' every 5 seconds, the syntax is:


$ watch -n 5 'ls -l somefile'



If find this particularly of use if I am monitoring the disk usage of a file or file system.


$ watch -n 5 'du -sh .'

$ watch -n 5 'df -h /'



I find this quite useful on any number of occasions, especially when you wish the output displayed.


If the output isn't particularly interesting, perhaps you only need to run an identical command X times to perform run-time comparisons then in-line bash scripting is your friend;



$ for i in $(seq 1 5); do ls -l somefile; done



Anything worth doing once is worth doing N times.