The Visual Lounge lets you find out about TechSmith behind-the-scenes. Watch screencasts and videos from other customers, meet up with your fellow TechSmith users and staff, and get more tips and tricks!

RSS iconSubscribe to RSS feed

“Dev Corner” Archives

February 3, 2012

Dev Corner - Decltype Keyword

Posted on Friday February 3, 2012




The keyword decltype is new in Visual Studio 2010 and is available as well in GCC C++.  It is pretty simple you can get a type out of an expression.  I see it used most in cases where you don't want to supply a typedef but would like to use the type of an existing variable; hopefully this example will help illustrate:

struct A
{
   int m_n;
};

int main()
{
   A a = {4};
   decltype(a.m_n) n = 6;   //n in the same as A::m_n which in an int
   a.m_n = n;
   return 0;
}

So with the example if the member variable m_n changes type from an int to anything else the variable n in the main function will be of the same type.  Using a typedef we could have supplied both m_n and n to be a type from the typedef.  Though if we made n an auto (on line 9) then n would be dependent on what got assigned to it (in this case 6 is an int so it would be an int type) instead of what it is assigning to (on line 10).

A large use of this keyword by professionals has to do with return types!  Take a look at the following:

template<typename T, typename U> auto Add(const T& t, const U& u) -> decltype(t+u) { return t+u;}

This templated function can take any type T and U as input and will return the result of a type that makes sense which might not be either type T or type U.  Since the return-type specification comes before the function name and the function arguments; we do not know the names of the variables passed in (the lowercase t & u) in the return-type specification.  So we used the auto keyword and specify the return-type as a late-specified return type which may use the variable names (lowercase t & u).  This is not to say it couldn't have been written without a late-specified return type which is shown in the example below:

template<typename T, typename U> decltype((*(T*)0)+(*(U*)0)) Add(const T& t, const U& u) { return t+u;}

It appears to be a matter of preference whether you think using the decltype as a late-specified return type with auto is cleaner than specifying the return type without the auto keyword.  What do you think?  Do you see a use for the decltype keyword?  Are you understanding late-specified return type?

aj devcorner.jpg

Andrew "A.J." Orians is a developer on the Windows version of Camtasia Studio. Though he enjoys programming he also likes puzzles, running, games, and a whole slew of other activities. He has been at TechSmith for something like five years and looks forward to being here for many more!

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

January 26, 2012

Interview With a Lead Developer: Paul Middlin

Posted on Thursday January 26, 2012

beard_small.png

Who are you, and what do you do?
Paul Middlin, Lead Developer on Camtasia:mac

How did you find out about TechSmith?
Mike Malinak had found the company in 2002, while we were in grad school. Said it was a fantastic place. There were about 40 people here at the time. At first I took his ravings with a grain of salt, but when Tony Lambert was equally impressed, I sought out an interview!

What do you like most about working at TechSmith?
We really do have an entire company focused on building and creating useful things. Everything is pushing towards that goal, so as a developer, I feel fully supported and given the tools needed to make that happen.

What setup (hardware + software) are you using?
Mac Pro, working hard with 8 cores, 12gig ram, and an SSD, displayed on an 27" LED Cinema display. Ready to compile.

What was the most interesting thing you've seen and/or done while at TechSmith?
It's not every day that you write a musical about pair programming.

What is a trick that you do all the time that you think not very many people know about?
Get a hotkey for reformatting your code. It'll save your sanity!

Explain how a feature goes from conception to completion on your team
We rely pretty heavily on Dan Latterner's impressive design and workflow skills, and get a pretty good idea where it needs to end up. But, iteration is your friend, especially after some user testing. Most the team watches these and we brainstorm solutions and tweaks together. We've been using task cards and trying to share each feature as much as we can to spread code knowledge.

Explain how your role as a lead developer differs from a regular developer
More meetings ;) Really though I try to represent the technical side of the product in the business team, or core team. I try to help identify areas of growth for fellow devs and do what I can to open doors. I keep an eye on the whole product in order to connect people and look for patterns in what we're working on, to keep us moving forward as fast and as well as possible!

Is there anything else you think people should know about being a developer at TechSmith?
Read that core traits thing on the wiki. We really mean those things. That really is how you rock it as a developer here.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

December 15, 2011

Interview With a Lead Developer: Jim Dusseau

Posted on Thursday December 15, 2011

jim d dev corner.jpg

Who are you, and what do you do?
Jim Dusseau. I'm a lead developer currently working on Camtasia Relay. I spent the last few months helping out the Coach's Eye team.

How did you find out about TechSmith?
My manager at my previous company knew I really wanted to develop for the Mac platform. He was a Camtasia Studio user, found out about a mac development position with TechSmith, and let me know about it.

What do you like most about working at TechSmith?
I think great companies are made up of great people. This is true of TechSmith. I'm lucky to work with so many people who are dedicated to making quality products.


What setup (hardware + software) are you using?
I have a hi-res 15" MacBook (2.66Ghz, 8 GB ram). I have a cinema display on my desk, and a half terabyte portable hard drive in my bag. I use a lot of software, but here's the main stuff:

  • Xcode, TextMate for Mac development, iOS development, and scripting.
  • Parallels, Visual Studio, and NotePad++ when I need to do Windows development.
  • Campfire, iChat, Communicator, and Mail for communication.
  • DropBox, Evernote, iWork, Alfred, and JumpCut help me stay productive and sane.

What was the most interesting thing you've seen and/or done while at TechSmith?
It's hard to pick out a single thing that was most interesting. If I have to choose just one, I think the Jing 2.0 release was most interesting for me. I was still figuring out how to be a mac developer, we had a tight deadline, and we really struggled with getting MP4 recording working the way we wanted to. It was a release that really opened up the capabilities of Jing, and I'll always be proud of it. Additionally, we were targeting releasing by MacWorld, which happened to be early in January. I have fond memories of developing against a holiday deadline, and the feeling of taking a vacation after being part of a team coming off of a great success.

What is a trick that you do all the time that you think not very many people know about?
Using a clipboard manager has really sped up how I develop. If you're on the mac, I recommend JumpCut. I haven't picked one up for when I'm in Windows yet. If you have ever copied something only to paste it in a text document so that you could copy something else, you could be saving time.

Explain how a feature goes from conception to completion on your team
For Camtasia Relay, everything starts with a problem. It might come from customers at a conference or in from support. It might come from a developer, or someone else within the company. From there, the team investigates a root cause. We then have conversations with our Product Manager, who prioritizes it along with the rest of the work we're undertaking. Once it becomes our top priority, we brainstorm solutions, start with something small, run it by customers, and iterate on the feature until we're satisfied that it solves the root problem in a way that meets our personal standards of quality.

I'm not sure that any feature is ever complete for us. We're always looking for a way that our existing features can be better for our customers.

Explain how your role as a lead developer differs from a regular developer
The primary focus of lead developers is the growth of developers. They're also expected to own the long term health of their product. This means ensuring current development fits in with a vision for the software architecture and being aware of how decisions today will affect our ability to implement the things we want to do in the future. Lead developers also have to have a rough idea of what the other teams are doing to look out for when we can leverage each other's work. This also helps us to share the things the different product teams have learned.

Is there anything else you think people should know about being a developer at TechSmith?
Lead Developer? For me, it's really highlighted how important communication skills are for developers. Being able to express yourself clearly, and having an understanding of where other people are coming from are among the most crucial skills when working on a team.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

December 1, 2011

Interview With a Lead Developer: Justin Welsch

Posted on Thursday December 1, 2011

picture.jpg

Who are you, and what do you do?
Justin Welsch Lead Developer for Shared Code/Recorder SDK/Anti-Piracy

How did you find out about TechSmith?
I saw TechSmith on Monster.com way back in 2001. I called the number listed and spoke to Bill Hamilton himself.

What do you like most about working at TechSmith?
I like that TechSmith is a relatively small company (or has a small company feel) that has many people who are passionate about what they work on. I have also enjoyed watching it grow from a 35 person company to a 200+ person company.

What setup (hardware + software) are you using?
I have a Lenovo ThinkPad running Windows 7. I use Visual Studio 10 for most development work.

What was the most interesting thing you've seen and/or done while at TechSmith?
The most interesting thing I did was develop the .SWF output for Camtasia Studio back in 2002-3. Back then we were one of the first applications that let you output a video to .SWF. Since .SWFs were easy to give to other people to watch it immediately made a splash. The engineering challenge of shoehorning video into essentially an animation container was a real challenge.

What is a trick that you do all the time that you think not very many people know about?
I've seen a lot of developers use "Find All References" in Visual Studio when they are looking for a piece of code like a method or a member variable. I find that it is way faster to use "Find In Files" (Ctrl+Shift+F). I also use Ctrl+Shift+L to delete a line. This is better than Ctrl+X because it doesn't put anything on the clipboard.

Explain how a feature goes from conception to completion on your team
Since I am the only member of my "team", it usually starts with me or my manager identifying a problem. We work together to get it solved.

Explain how your role as a lead developer differs from a regular developer
Lead developers own the code, serve as mentors, act like mini-project managers, and handle communication outside of the developer team. Lead developers do a lot of the overhead that allows "regular" developers to do their job.

Is there anything else you think people should know about being a developer at TechSmith?
Always be on the lookout for how you can make a difference on your team, your product, or the company. Do not rely on other people to give things for you to do. Be proactive and seek out useful projects.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

November 17, 2011

Regular Expressions for Improved Productivity

Posted on Thursday November 17, 2011

If you're a developer, the term "regular expression" should at least sound familiar.  But, if you've never had to write any code that made use of them (i.e. code in a scripting language), you may not know how to write/use regular expressions.  And, if you're like I was, that doesn't bother you.  After all, regular expressions can get confusing and complicated very quickly.  So, it's probably better to just leave them alone until you need them for some code, right?

Sure, maybe.  But consider this:  How many times have you had to do a tedious, repetitive series of find/replace operations with various parameters on a huge block of code with obvious patterns?  Were you aware that Visual Studio supports regular expressions in Find/Replace operations?  In fact, lots of IDEs and beefed-up text editors support regular expressions.  As an example, take a look at the following block of code:

class __declspec(novtable) ITimelineStateAccess
{
public:
/// Create the Timeline state
/// Returns: true if creation succeeded
///          false if the state already exists
virtual bool CreateTimelineState( Timeline* timeline ) = 0;

/// Retireves state of timeline by ptr of timeline
virtual const TimelineState* GetTimelineState( Timeline* timeline ) = 0;

/// Returns true if the start frame was successfully set, false otherwise
virtual bool SetSelectedRangeStartFrame( Timeline* timeline,
                                            CSMediaLib::CSTime frame ) = 0;
/// Returns true if the end frame was successfully set, false otherwise
virtual bool SetSelectedRangeEndFrame( Timeline* timeline,
                                           CSMediaLib::CSTime frame ) = 0;

/// Sets the timeline state observer
virtual bool SetTimelineStateObserver( Timeline* timeline,
                                           IObjectStateObserver* observer ) = 0;

/// Sets a flag telling whether a media is selected or not
virtual void SetIsMediaSelected( ObjectId mediaId, bool selected ) = 0;

/// Clears the currently selected media
virtual void ClearSelectedMedia() = 0;

/// Gets all media ids at a given time from all unlocked tracks
virtual std::list GetMediaIdsAtTime( CSMediaLib::CSTime time ) = 0;
};

Now, let's say I wanted to make all the functions non-virtual.  Well, that's a simple find/replace.  Simply replace "virtual " and " = 0" with "".

Now, what if I wanted to swap the parameters on all the functions with two parameters ( for the sake of emphasis, imagine there are more than a few of said type of function )?  Well if they all take the same parameter types, with the same names, then it's another simple find/replace.  But if they all take different types, with different names, then I've got a separate find/replace for each of them.  At this point, I might as well do it by hand.

Alternatively, I could use a regular expression to match the specific type of text I'm looking for.  The following regular expression will do the trick:

\(.+,\n@.+\)

Since I'm assuming some readers don't know how to use regular expressions, I'll explain what's happening.  Here's a slightly separated view, to give you an idea of what the individual parts are:

\(  .+  ,  \n@  .+  \)

\(  and \)   match the left and right parentheses ( they are operators in regular expressions, so they have to be escaped with a backslash ).

The period (.) matches any character except a line break.  Adding a + sign after it means there must be one or more of them.  Also, the + operator is "maximal", meaning it will try to match as many characters as it can, provided the rest of the regular expression will still match.

The comma is the most literal part of the expression, denoting that we expect exactly one comma at this point in the match.

\n is matching a line break.  The @ operator causes a match if there are zero or more of the preceding item.  So we expect to find zero or more line breaks after the comma.  This helps us match function prototypes that are broken up across two lines for readability.  The @ operator is "minimal", so it will try to match as few line breaks as it can.  This is a good thing because we only want to match one.

If you put all of this together, you can see how that expression will match all of the two-parameter function prototypes in the above code.  Now, how about swapping those parameters?

This is where we get into "tagged expressions".  This is a feature I know is supported by Visual Studio; other editors likely have a similar idea.  A tagged expression sets aside a part of the match for later use.  In Visual Studio, you tag an expression by surrounding it with { }.  Later, you can insert that expression by numerical reference.  Let's tag some things in our first example:

\({.+}{,\n@}{.+}\)

Now we have the following tagged expressions: 1. Whatever was matched by the first .+ 2. The comma and line break (if any) 3. Whatever was matched by the second .+

You can use tagged expressions within the Find and Replace boxes in the Visual Studio Find/Replace dialog by inserting a \#, where # is the number representing which tagged expression you want. In the Replace box, you can also use \0 to insert the entire matched result of the regular expression. So to swap our parameters, we would use the following as our replace expression:

( \3\2\1 )

Notice that we don't have to escape the parentheses in a Replace expression. In fact, most operators don't apply in Replace expressions. So if you try to use them, they will be inserted as-is.  Also, if you're clever, you may have noticed that the second .+ will include all the white space leading up to the second parameter.  So when that gets inserted in place of the first parameter, it will really mess up the formatting.  But that's a trivial detail that could be fixed with a minor change to the expression.  I'll leave that as an exercise.

As you can see, regular expressions can be very powerful and can save you a lot of time. But, there can be downsides.  If it takes you longer to figure out the regular expression for one single find/replace than it does to do the multiple repetitive version, it's obviously not worth it.  They can also be tricky depending on what you are trying to match. Sometimes they may do things you don't expect, like match the whole document because the expression wasn't strict enough. Judicious use of minimal/maximal operators can help out with that. Of course, as with anything, regular expressions get much easier to write with experience. And then there's the fact that different editors will often use different operators, so you may have to relearn little bits and pieces to cope with the fact that they aren't standardized( This page will help with Visual Studio's Find/Replace dialog ).

As a final example, see if you can figure out the Find/Replace expressions to turn the following interface definition into the (mostly done) mock definition listed below it, excluding the class declaration part:

interface __declspec(novtable) IMediaFrame
{
public:
   virtual void Initialize( LONG width, LONG height ) = 0;
   virtual BOOL IsInitialized() = 0;
   virtual void Uninitialize() = 0;

   virtual LONG Width() = 0;
   virtual LONG Height() = 0;
   virtual double Opacity() = 0;
   virtual void SetOpacity( double opacity ) = 0;

   virtual void SetTransform( const CSMediaLib::TransformMatrix t ) = 0;
   virtual void ApplyTransform( const CSMediaLib::TransformMatrix t ) = 0;
   virtual const CSMediaLib::TransformMatrix GetTransform() = 0;

   virtual BOOL IsDirty() = 0;
   virtual void ClearDirty() = 0;
};

class gmock_IMediaFrame : public IMediaFrame
{
public:
   MOCK_METHOD0(  Initialize, void (  LONG width, LONG height  ));
   MOCK_METHOD0(  IsInitialized, BOOL (  ));
   MOCK_METHOD0(  Uninitialize, void (  ));

   MOCK_METHOD0(  Width, LONG (  ));
   MOCK_METHOD0(  Height, LONG (  ));
   MOCK_METHOD0(  Opacity, double (  ));

   MOCK_METHOD0(  SetOpacity, void (  double opacity  ));

   MOCK_METHOD0(  SetTransform, void (  const CSMediaLib::TransformMatrix t  ));
   MOCK_METHOD0(  ApplyTransform, void (  const CSMediaLib::TransformMatrix t  ));
   MOCK_METHOD0(  GetTransform, const CSMediaLib::TransformMatrix (  ));

   MOCK_METHOD0(  IsDirty, BOOL (  ));
   MOCK_METHOD0(  ClearDirty, void ( ));
};

If you don't want to do it, here's the answer.

I know that I've often used Regular Expressions (alright, fine; "regexes") to avoid a bunch of typing and repetition. I hope others will find them useful as well.

R.Schott1.jpg

Randy Schott graduated from Michigan State University in 2007 with a Bachelor's degree in Computer Science and Engineering. Since then, he has been a software engineer at TechSmith, working on the Camtasia Studio team. His development interests center mostly around multimedia, with a soft spot for audio and DSP. Outside of the office, he is an avid musician in multiple genres and occasionally dabbles in gaming.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

November 10, 2011

Dev Corner - Magic Numbers In Designing

Posted on Thursday November 10, 2011




Everyone should know what I mean by Magic Numbers.  Those no named numbers in code that live just to make you scratch your head and scream.  I know I've come to despise seeing numbers without a variable name.

In XAML (and other interface languages) it seems to be easy to forget those simple rules for naming our values and to justify just why you set the margin to 4 vs 7 (Jing's standard margin is 7).  It's this reason that I took some time to see how we could improve the readability of numbers in XAML.

Example XAML:

<Window x:Class="SampleApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow"
        SizeToContent="WidthAndHeight">
   <StackPanel Margin="14"
               Orientation="Vertical">
      <Button Content="Bob" />
      <Button Margin="0,7,0,0"
              Content="Sue" />
      <StackPanel Orientation="Horizontal"
                  Margin="0,7,0,0">
         <JingButton />
         <JingButton Margin="4,0,0,0">
      </StackPanel>
   </StackPanel>
</Window>

In Jing we try to stick with 3 different standard margins: 4, 7, and 14. We tend to use 7 the most and when we want to pack the most in small spaces we will use 4.  Of course though we may want to change these in the future date to 5, 8, 15, and will have to dig through all our XAML and change them manually.  Unfortunately not all of Jing's XAML code has theses standards in place and you can find some elements with 15, 5, and other numbers for margins, because it "looks ok".  But as a WPF developer, stumbling on these numbers just make me think how random they are, and if they were meant to be those strange numbers I would not know and think they were set before the standards.

Alternatively I found we can refactor our XAML in the following way (and yes I said refactor UI)

<Window x:Class="SampleApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mscorlib="clr-namespace:System;assembly=mscorlib"
        Title="MainWindow"
        SizeToContent="WidthAndHeight">
   <Window.Resources>
      <mscorlib:Int32 x:Key="SmallMargin">4</mscorlib:Int32>
      <mscorlib:Int32 x:Key="NormalMargin">7</mscorlib:Int32>
      <mscorlib:Int32 x:Key="DoubleMargin">14</mscorlib:Int32>
   </Window.Resources>
   <StackPanel Orientation="Vertical">
      <StackPanel.Margin>
         <Thickness Left="{StaticResource DoubleMargin}"
                    Top="{StaticResource DoubleMargin}"
                    Right="{StaticResource DoubleMargin}"
                    Bottom="{StaticResource DoubleMargin}" />
      </StackPaen.Margin>
      <Button Content="Bob" />
      <Button Content="Sue">
         <Button.Margin>
            <Thickness Top="{StaticResource NormalMargin}" />
         </Button.Margin>
      </Button>
      <StackPanel Orientation="Horizontal">
         <StackPanel.Margin>
            <Thickness Top="{StaticResource NormalMargin}" />
         </StaticPanel.Margin>
         <JingButton />
         <JingButton>
            <JingButton.Margin>
               <Thickness Left="{StaticResource SmallMargin}" />
            </JingButton.Margin>
         </JingButton>
      </StackPanel>
   </StackPanel>
</Window>

It may be quite a few more lines than before, but I think it is better in two ways.  The first is if we move the resources into App.xaml we can get access to the resources from any control inside the app, this makes it very easy for us to change these numbers at any time.  The second is, in order to use Resources we have to change to the long form of defining margins, adding more lines of code but making it easier to understand.  No longer do you have to remember the format combinations of Margin="Left,Top,Right,Bottom", but define them by name.

So just because it may not seem to be code because you may use the mouse to drag around boxes to make it visual, by using the same standards we hold on our logic code we can make UI easily manageable and understandable.

mark.jpg

Mark Schall started at TechSmith as an intern during his first summer of graduate school and decided to continue working as a full-time employee while he finished his Masters of Computer Science degree at Michigan State University. He originally started out working on Jing and is now contributing to Camtasia Relay. He has been developing with WPF, Cocoa, MFC, and DirectShow at TechSmith. Mark enjoys spending his free time with his wife Julia and two dogs, Bella and Dolly.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

November 3, 2011

Dev Corner - Installing Hubot on Heroku

Posted on Thursday November 3, 2011

hubot.jpg

Here at TechSmith, lots of our teams like to use Campfire to collaborate. We've built a few homegrown bots for things like announcing check ins and daily Dilbert comics, but we never took it to the level that GitHub did. When they released Hubot, we jumped at the chance to start using it ourselves.

The easiest way to get up and running with Hubot is with Heroku, the cloud application platform. First create a Heroku account. Then you'll need to verify the account (which means entering a credit card). Heroku requires users to be verified to add redis to go to your application stack.





First thing you're going to need to do is get a few things installed.

  • Ruby
  • Ruby Gems
  • Heroku Gem
  • Git

I set it up using a Mac but these steps should work fine as long as your platform supports Ruby and Git.

First make sure you have the heroku gam installed.

sudo gem install heroku

Download Hubot by clicking "I would like to obtain my own Hubot".

Extract your download and change to that folder in the terminal.

Setup Git

Create a git repository in that folder by typing

git init
git add .
git commit -m "Initial commit"

Setup Heroku

Now you need to create your Heroku stack.

heroku create --stack cedar

Now push your files to Heroku

git push heroku master

If you get any issues with public keys, check out these two links, which may be able to help.

Next you need to set up the worker

heroku ps:scale app=1

heroku add ons:add redistogo:nano If you haven't verified your account with Heroku this will fail.

Hubot is almost ready to go.

Configure Hubot to work with your Campfire room

First you'll need a user that Hubot will use to talk in the chat room. You can create a new one or use one that already exists. Once you pick a user, you'll need their auth info. This can be found by clicking the "My Info" link in the upper right corner.

  1. myInfoCampfire.pngAuthToken.png
    heroku config:add HUBOT_CAMPFIRE_TOKEN="YOUR_AUTH_TOKEN"
    Replace YOUR_AUTH_TOKEN with the Hubot API token you just found.
  2. heroku config:add HUBOT_CAMPFIRE_ROOMS="999,888"
    Replace the 999 and 888 with your Campfire rooms. To figure out your room number, click on the room you want Hubot to monitor and look for the number at the end of the URL.
  3. heroku config:add HUBOT_CAMPFIRE_ACCOUNT="YOUR_ACCOUNT"
    Replace YOUR_ACCOUNT with your Campire domain. (yourdomain.campfirenow.com)

Now you have your very own Hubot. Hubot comes with a few scripts installed that will do things like search Twitter and Google image search. Read the documentation on how to add your own scripts here.

Pro Tip: If you want to change Hubot's name, open the file in your hubot directory called Procfile. Change "Hubot" to whatever you want to call your Hubot. Save the file, recommit and repush to Heroku.

RandallDevCorner.jpg

Randall Brown started at TechSmith in 2009 after graduating from the University of Michigan with a degree in Computer Science. He is a member of the Coach's Eye team where he is working on the ultimate coaching tool.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

October 28, 2011

Dev Corner - Cast Operator

Posted on Friday October 28, 2011

Today's Dev Corner post is brought to you by AJ Orians.

The cast operator is not well known so I'll explain what it is and how it can be used. To start off POD stands for Plain Old Data in C++ which is things like int, char, double, etc. Unfortunately you cannot inherit off of such datatypes. One advantage of inheriting is you can cast to the base type (assuming public inheritance). With the cast operator you'll be able to specify types that your object can cast to. Below is a simple example showing how the cast operator works:

As you can see I am able to cast the object of type A to an int type. Do you now understand the cast operator? Do you see yourself having a use for it? Let me know what you think!

aj devcorner.jpg

Andrew "A.J." Orians is a developer on the Windows version of Camtasia Studio. Though he enjoys programming he also likes puzzles, running, games, and a whole slew of other activities. He has been at TechSmith for something like five years and looks forward to being here for many more!

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

October 20, 2011

Dev Corner - Viewing a Gdiplus::Bitmap in the VS debugger

Posted on Thursday October 20, 2011

This week's Dev Corner post is from Tom Sirgedas, a developer on the Camtasia Studio team.


I wanted to see a Gdiplus::Bitmap in the debugger, but I wasn't sure how this could be done.

So, I added a function, SaveToDesktop( Gdiplus::Bitmap* )

Now, you can call that function via the debugger



TomDevCorner.jpg

Tom Sirgedas is a Camtasia Studio Software Developer living in Okemos, MI. He's worked for TechSmith since 2004. Tom likes to play volleyball and Scrabble in his spare time.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

October 13, 2011

Dev Corner - HTML 5 Video Player with multiple video streams

Posted on Thursday October 13, 2011

This week's Dev Corner post comes from Mike Luongo and details using HTML5 to create a video player that lets you play multiple video streams at once.

HTML5 video player with PIP that is movable/sizeable/opaciable

I've been playing around with html5 and I have to say it's an exciting new technology! That's right it really deserves a bunch of !!!!! Why is it so cool? With just with a little bit of javascript (yawn) I was able to create a PIP (picture in picture) player with opacity for the web. This example lets you click and drag around the pip (even off the original video). You can click the video and make it large. So you might want to check it out here:

HTML 5 PiP Demo ( Works best in Chrome )

Download the code here

For a long article on how all this works check out this link: Dive into html5

The most important part of the article could probably be found in this single screen capture.

supportedCodecs.png

These are the video types that are supported by browsers. Note that you can give a video tag in html5 multiple source videos and if it is unable to play one of them it will try the next.

HTML5 PIP is something we might be able to use right now but would require more research and testing to figure that out. What we can take from this example is that it is an exciting preview of what is to come. The playback should only get better over time and better supported.

MikeDevCorner.png

Michael Luongo is a software engineer who joined TechSmith in 1999 when the company was about 10 employees. Since joining he has worked on almost every product at TechSmith. He is currently working on the Camtasia Relay team. In his spare time Michael enjoys working on old cars which include a 62 Chevy Corvair, Manx dune buggy, and other vehicles. He also enjoys learning about new technologies. He recently finished a 3D first person shooter in Silverlight and is at work developing his first app for Android.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

October 6, 2011

Dev Corner - Relocating Your TFS Workspace Data

Posted on Thursday October 6, 2011

I recently needed to move my local TFS source tree to a secondary drive, and for the most part, it worked quite well. First, the process I used was:

  1. Copy (do not move) the TFS folder -- or whatever you called it -- to path\to\new\TFS.
  2. In Visual Studio, navigate to your Source Control Explorer view and open the "Manage Workspaces" dialog (via Workspace combo > Workspaces...). Hit Edit next to your primary workspace.
  3. In the working folders treeview, Ctrl+A and Ctrl+C to copy all of the items. Paste this into Notepad and do a find-replace from path\to\old\TFS to path\to\new\TFS. Back in VS, delete the old entries and paste in your edited ones. (Just hitting Ctrl+V will append to the working folders list.)
  4. Click Yes when prompted to update.
  5. Re-open the solution from its new location and build. Check the output window to verify that the build is taking place in path\to\new\TFS. If so, you can delete your old TFS folder.

Tip 1: Deleting a massive folder like TFS is much faster if you hit Shift+Delete to skip the recycle bin.

Tip 2: You can clear out VS's list of recent projects and files, which all still point to the old path, by clearing out HKCU\Software\Microsoft\VisualStudio\10.0\FileMRUList. (Or in previous versions of VS, ProjectMRUList.)

Finally, the only issue that I ran into after migrating my workspace data was that the solution was silently placed into offline mode. (Either that, or perhaps I was already in offline mode and it never prompted me to reconnect.) If auto-checkout seems to be broken after the migration, and/or you get a warning that your source files are write-protected when you try to save them, just reconnect to source control via File > Source Control > Go online.

Don't forget to add the new location to your anti-virus' excluded folders list. Otherwise you'll likely get the elusive "file in use" errors when linking.

cameron flint.png

Cameron is a full time developer on the Camtasia Studio team. He recently graduated from Hope College and was an intern before joining TechSmith full time. You may remember him from his Dev Corner interview.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

September 29, 2011

Dev Corner - What programming languages do we use?

Posted on Thursday September 29, 2011

It's always interesting to find out what technologies developers use to build their software. At TechSmith, we use a broad range of technologies ranging from low level C to high level scripting languages like Ruby and Python.

A discussion of programming languages at TechSmith can be split into two categories. Windows and Mac. You can look at the history of both platforms to get an idea of what technologies our apps use.

Windows

Snagit, Camtasia, and Morae use a lot of C++ and MFC. As Windows evolves, so does our software. These apps all are starting to take advantage of new technologies like C# and WPF in addition to frameworks like Qt.

Our newer products, like Jing, drop some of the legacy C++ code for shiny new C# and .NET.

Our web products run on Microsoft servers using ASP.NET. Camtasia Relay and Screencast.com are built using Web Forms while some new projects, like the Coach's Eye video player, are using ASP.NET MVC. Of course we also use common web technologies like javascript, html, css, and SQL.

All of this code lives in a Team Foundation Server that we use to manage our whole product life-cycle.

Mac

On the Mac, most of our code is written in Objective-C with Cocoa. We also write a lot of C++, so we can share code between platforms. Camtasia:Mac actually started out as a cross platform version of Camtasia Studio so a lot of its back end code is written in C++. Currently all of our mobile apps are written in Objective-C for the iPhone and iPad.

We use Subversion for all of our Mac/mobile code except for Coach's Eye which is experimenting with GitHub.

Cross Platform

At the core of all of our apps is screen recording. The technology to do this is written in C++ so it can be fast and efficient. Actually grabbing the screen on the two platforms is obviously different, but our screen capture codec is shared between the two platforms.

Believe it or not, the languages we use in our products are just a small chunk of the languages the company uses as a whole. Our source repositories contain everything from Bash scripts to Scheme. We use Python for automated testing. We use Ruby for writing tools. Developers write shell scripts to make their lives easier. We have people doing Flash development for Screencast.com. There are plugins for Camtasia written in Java.

We encourage everyone to try out new technologies and get things done the best way possible.

RandallDevCorner.jpg

Randall Brown started at TechSmith in 2009 after graduating from the University of Michigan with a degree in Computer Science. He is a member of the Camtasia Relay team where he works on bringing lecture capture to the masses.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

September 15, 2011

Not All PNG Compressors Are Created Equal

Posted on Thursday September 15, 2011

This week's Dev Corner post is brought to you by Eric Jensen.

Not All PNG Compressors Are Created Equal

Don't believe me? Here's two versions of a Jing logo from one of our press releases.

Jing.pngJing_optimized.png

So what's the difference? The image on the right is less than 1/2 the size of the original image on the left. If the PNG compressor doesn't optimize color depth, or uses non-aggressive DEFLATE compression it can produce PNG's that are up to 90% bloat.

Not just for the web

Optimizing the PNG's in the Camtasia Relay PC recorder resulted in a ~7% (302KB) file-size reduction.
"302KB... big-whoop, people have big hard drives now-a-days"

Touché. But know that file size isn't the only thing affected. With optimized PNG's, the Relay recorder's memory usage decreased ~6.5% (23,736KB vs. 25,268KB) and the start-up time decreased by ~5% (0.774 vs. 0.811 sec avg over 20 iterations). Keep in mind that the Relay recorders are relatively small apps and use a relatively small number of PNG's. Other, larger, applications may see more drastic results.

Producing optimized PNG's

In the case of the Jing logo, it looks like Photoshop is the culprit. When using Photoshop, always use "Save for Web & Devices..." rather than "Save As..." for the final image.

photoshop-save-web-menu.jpg

If you've already got a bunch of un-optimized PNG's, utilities like PNG Gauntlet help batch process them.

The sprite sheet dilemma

Sprites.png

Why did relay.sprite.3.1.png only get a 6% improvement while others got 70-80% improvements? Unfortunately, if even 1 out of 100 images requires 32bit color, the entire sprite sheet is required to use 32bit color. Thus, color depth optimizations are impossible in this case :-( . However, this does not mean that you should immediately slice up all your sprites. Sprites are still awesome at reducing file size and network requests. But, combining all images with varying color depths into a single sprite sheet might not be size-optimal.

Eric_Jensen.jpgEric Jensen has been working at TechSmith since graduating from Michigan State University in 2010. Eric is currently working on the Camtasia Relay team as a software engineer. He enjoys natural fractals, underwater hockey, and contributing to open source projects.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

September 7, 2011

Dev Corner - Building a Mobile App with Adobe Air, Project GoGoCast

Posted on Wednesday September 7, 2011

Today's Dev Corner post is brought to you by Ben Rhodes and Dan Davis, two of our Flash developers. They used some research time to explore the possibilities of using Adobe AIR to build mobile apps.

We wanted to build a video and image uploader to screencast.com for iOS and Android devices.

Technology Approach

We developed our mobile app using Adobe Air 2.7, building with Flash Professional CS 5.5. This platform allows us to target iOS (iPhone 3GS, iPhone 4, iPad, iPad 2, iPod Touch G3, iPod Touch G4) and Android devices running Android OS 2.2, 2.3 and 3.x. The mobile app uses the public screencast.com rest API's to authenticate and upload media with Screencast.com.

Setup Process

iOS

You will need to sign up as an Apple iOS Developer in order to develop with Adobe Air. You will need to get two items setup with Apple to publish your app.

  1. Signing Certificate file (as a p12 Certificate)
  2. Mobile Provision file

Android

You will need to install the Android SDK. Flash Professional CS 5.5 allows you to create a self-signed certificate from within the program. This certificate is used when publishing your Air app to Android.

Plus:

You can build your Adobe Air mobile application on Windows or OSX. Even for iOS!

Development Process

We used Flash Professional CS 5.5 for development. We recommend creating a FLA (Flash AS3) file for each platform you want to target. In our case we created:

  • ios.fla
  • android.fla

Important:

You setup the compile setting within each FLA document.

Shared Code

All the code in Project GoGoCast is identical for the iOS and Android version. This is one of the benefits of coding to the AIR SDK. The Air SDK has several API's to access different features of a device (if device supports it). Here a few of the features we use in our app.

  • Access the native camera / image capture software
  • Save / Read from Image Gallery on Phone (Camera Roll on iOS)
  • Direct Camera access

It is easy to check what device the user is on so you can provide different experiences if needed.

function isIOSDevice():Boolean {

    var os:String = Capabilities.os.toLowerCase();

    if(os.indexOf('iphone') !=-1 || os.indexOf('ipad') !=-1 || os.indexOf('ipod') !=-1) 
    {
        return true;
    } 
    else 
    {
        return false;
    }

}

Some thoughts on Android vs iOS Design

Android devices have physical / soft buttons for navigation unlike iOS devices (minus the home button). You'll want to write special hooks for the Android version of your application that accounts for these buttons. For example, using the 'back' button moves a user to a previous state in the app. However by default hitting the back button within an air app will exit the application. This behavior is probably not desirable. The following code will prevent this from happening and allow you to switch states within your application.

Prevent the App from Closing when "Back" is pressed.

package {

	import flash.display.Sprite;
	import flash.display.StageScaleMode;
	import flash.display.StageAlign;
	import flash.desktop.NativeApplication;
	import flash.events.KeyboardEvent;
	import flash.ui.Keyboard;

	public class Main extends Sprite {

    	private var _mainScreen:Boolean = true;

		function Main() {

			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;

			// add menu button event handlers
			NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_UP, menuHandler);
			NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, menuHandler);

		}

        private function menuHandler(e:KeyboardEvent):void {

             if(e.type == KeyboardEvent.KEY_DOWN) {

				if(e.keyCode == Keyboard.BACK) {

                    // if not on main screen (you'll need to track this yourself) then prevent the app from closing.
					if(!_mainScreen) {
						e.preventDefault();
					}

				}

			} else if(e.type == KeyboardEvent.KEY_UP) {

				if(e.keyCode == Keyboard.BACK) {

            		// if main screen, then exit the app
					if(_mainScreen) {
						NativeApplication.nativeApplication.exit();
					}

				}

			}

		}

	}
}

Getting our App on a Device

We used TestFlight to get the apps on iOS devices and directly handed out the Android version.

Results

Our prototype version of the app does a few things easily:

  • Login to Screencast.com
  • Launch the native video recorder to record some video.
  • Select image from your Camera Roll.
  • Upload that video / image to Screencast.com.
  • Get the tiny URL to the uploaded media.
  • Share media URL to Facebook

Issues We Encountered

Because we were using the native video recording format of the device, Android use became an issue. Android phones running v2.3.2 and lower record in H.263 video in a .3GP file. This video is not playable on screencast.com.

Using the Facebook API was a little flaky in the app. This was due to the fact the API needed to launch the Facebook login within a web view. It worked, but the example we used didn't allow the user to cancel out of the operation. I'm sure with further development, it could have been fixed.

Conclusion

Despite the video format issues, it was very easy to publish working code to both the iOS and Android platforms.

Adobe Air Pros:

  • Cross compile project to Web, Desktop, iOS, Android and Blackberry Playbook.
  • Easy to get graphics and stuff flying on the device.

Adobe Air Cons:

  • Lack of access to a bunch of native features of a platform.
  • Performance for some operations will be slower.
  • No access to native UI (graphics and functionality)
ben_rhodes_pic.jpg

Ben Rhodes is a Rich Internet Application Developer at TechSmith who loves to blend art, design and code. Ben's been working with web technologies including Flash for over 10 years. His new passion is mobile application design and development.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

September 1, 2011

Keyboard Input in MFC/WPF Interoperability

Posted on Thursday September 1, 2011

For this week's Dev Corner, Dave Howell talks about how MFC/WPF interoperability in the next version of Camtasia Studio.

Camtasia Studio has been an MFC-based application since it's origination. For the next version (code named Ocho), a new timeline control was built from scratch using WPF. As a result, communication between the unmanaged and managed code has been through a managed C++ interoperability (interop) layer.

This C++ code snippet roughly illustrates how to host a WPF control in an MFC CWnd:

CWnd containerWnd;
containerWnd.Create(lpszClassName, lpszWindowName, WS_CHILD|WS_VISIBLE, CRect(..), pParentWnd, nID, NULL);

HWND hWnd = containerWnd.GetSafeHwnd();

System::Windows::Interop::HwndSourceParameters sourceParams("HostControl");
sourceParams.ParentWindow = System::IntPtr(hWnd);
sourceParams.WindowStyle = WS_CHILD|WS_VISIBLE;

System::Windows::Interop::HwndSource^ hWndSource;
hWndSource = gcnew HwndSource(sourceParams);

System::Windows::FrameworkElement^ page = gcnew WPFcontrol(); // from XAML
hWndSource->RootVisual = page;

The relationship between the two layers had been relatively peaceful until it became necessary to accept user input through a WPF System.Windows.Controls.TextBox. The purpose of that is to allow the user to change the name of markers (video navigation points) and to let them type in the name right alongside a thumbnail preview.

MarkerEdit.png

Much to our surprise, the keyboard input did not work at all. Focus appeared to be active in the TextBox, but nothing could be typed into it! [expletive deleted!]

The first clue to the problem was revealed when this new functionality was tried in the lightweight WPF application used for testing -- the keyboard input worked just fine. It had to be that the issue was due to the MFC host application.

After a fair amount of research and experimentation, the only solution that would work, admittedly, still leaves me wondering why. The article[1] that gave me the clue that I needed explains that this is "a known unfortunate flaw in WPF's window interop support" and that the solution should be to "use HwndSource in a non-dialog native window" or "handle the WM_GETDLGCODE for the HwndSource and return DLGC_WANTCHARS". Curiously, that explanation only seems apt when the host application is dialog-based. Camtasia Studio is not, the main window is a CFrameWnd, however, it is the latter selection that works.

This code snippet shows what needs to be added to the above code segment:

hWndSource->AddHook(gcnew HwndSourceHook(ChildHwndSourceHook));
where,
System::IntPtr ChildHwndSourceHook(
    System::IntPtr /*hwnd*/, int msg,
    System::IntPtr /*wParam*/, System::IntPtr /*lParam*/, bool% handled)
{
    if (msg == WM_GETDLGCODE)
    {
        handled = true;
        return System::IntPtr(DLGC_WANTCHARS);
    }
    return System::IntPtr(0);
}

A ZIP'd, sample Visual Studio solution can be found here which demonstrates the issue.

If you build the solution and run the MFC application, you'll notice that there is still some trouble. The accelerators defined in the app interfere with the keyboard input in the WPF control too. Curses!

The solution that was used to get around that problem was simply to NULL out the HACCEL so that the ::TranslateAccelerator() call will be blocked while accepting keyboard input. Surely there must be a better way, but I suspect not judging by the number of articles and forum postings on the topic[4][5][6].

Helpful articles:

[1] Keyboard input on a HwndSource-hosted TextBox   {link}
[2] Sharing Message Loops Between Win32 and WPF [MDSN]  {link}
[3] IKeyboardInputSink (IKIS)  {link}

Finding others with the same problem is easy if you use the right search terms:

[4] How to enable the message when embedded the wpf content in a win32 dialog based project ? {link}
[5] WPF-Win32 interop with HwndSource  {link}
[6] WPF TextBox not accepting Input when in ElementHost in Window Forms  {link}

Continue reading "Keyboard Input in MFC/WPF Interoperability " »

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

August 25, 2011

Being a Development Manager at TechSmith

Posted on Thursday August 25, 2011

This weeks DevCorner post comes from David Dooley, one of our development managers.

I was excited when Randall and A.J. asked me to write something about being a Development Manager for TechSmith.

Since everyone is shaped by their experiences, here's a little of my history.

I was about a year and a half out of college and fed up with my job. I was a consultant for a small IT company and I was continuously put in situations where I was over my head. Not from lack of effort. I had just worked through several 12-16 hour days during what was supposed to be my Christmas vacation. Many times I felt like I was compromising my integrity with customers because I wasn't able to deliver what they were promised. I rarely received any help, coaching, or assistance from my boss. His advice was mostly, "Just figure it out." Luckily, it was the late 90's, the Dot Com bubble hadn't burst yet and finding a new job was pretty easy if you had marketable skills. So, I got a great job offer from a larger consulting company and I accepted. I went into my boss's office to give him my notice. It didn't go well. First he offered me a raise to stay and I respectfully declined. He then proceeded to tell me how I didn't have the skills for this job and I would fail in the new job.

I learned a lot from that experience. What still sticks with me today is his lack of interest in my success. He wasn't interested in growing my skills while I was there and he didn't want to see me succeed elsewhere either. That experience has shaped my philosophy as a manager.

The formal responsibility for a Development Manager at TechSmith is to ensure the longer term growth of our Software Engineers.

Putting it in other words, we're here to help people fulfill their career potential. Actually, more than that. On our best days, we help people discover the potential that didn't know they had then help them fulfill it. Unlike the former boss in my story, we want to see our people succeed.

I have a few basic things I do as a Development Manager to help ensure our Developers grow and fulfill their potential:

  • Get to know each person: It's not rocket science. I meet with each Developer every other week and I get to know them as individuals. I ask questions and I listen. What are they passionate about? What are their frustrations? What are their opinions? What are they good at? I invest the time because I can't possibly be a good coach for them if I don't know them as individuals.
  • Develop a growth plan: TechSmith has a process for all its employees called Professional Development Plans (PDP). Let's just call it a growth plan. Once every 3-4 months I sit down with the Developer and their Lead Developer to discuss their completed goals and to reflect on new or continuing growth goals. This process also includes feedback from their peers.
  • Play to Strengths: I'm believer in strengths based coaching. First, Break All the Rules is a great book that advocates this approach. The focus is on helping developers identify their talents, their strengths, and building on them. It still means setting goals that stretch and challenge employee. We should know our areas of weakness and mitigate them to the extent that they don't become an Achilles heel.
  • Have difficult conversations: This is in regards to job performance. If someone is not meeting expectations in terms of job performance, I address it as it occurs. This isn't the attitude of "I tell it like is." That attitude makes you come off as a jerk. This comes from a sense of respect and professionalism. I respect an employee enough to be direct with them when a performance issue comes up and needs to be corrected. Of course, I must first verify that the performance issue isn't just a one-time thing. Everyone has a bad day or even a bad week. I also, need to be able to provide context. So I seek out examples of the performance issue. Not addressing issues in a timely way makes things more difficult for everyone in the long run.
  • Follow through: To the best of my ability, if I make a commitment to team member, I follow through on it. You pretty quickly lose the trust of your team if you get a reputation of over promising and under delivering. That's something I learned the hard way during my years working with customers as a consultant. I do my best not to promise anything I can't deliver. When I do make a commitment, I do my best to follow through.

There's a lot more details to it but that's the basics of how I approach being a Development Manager.

By the way, I'm not the only one that helps people to grow at TechSmith. I brought the first draft of this blog post to my manager, Tricia. To paraphrase her feedback, "This is the safe version of a blog post. It's not you. You can do better." Thanks Tricia! That's why I love working at TechSmith. We hold each other accountable to a higher standard.

ddooley.png

David Dooley joined TechSmith in 2010 as a Development Manager. Before joining TechSmith, David was a consultant and specialist in Customer Relationship Management systems. Prior to that, He served as IT Director, Partner, and Certified Instructor for Dale Carnegie Training in Southern Michigan. David is a graduate of the University of Michigan - Dearborn with a B.S. in Computer & Information Science.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

July 28, 2011

Dev Corner - Customing the Internet with Greasemonkey

Posted on Thursday July 28, 2011

It's time for another Dev Corner update! We recently had an internal conference, DevKhan, at TechSmith for our technical staff. It is a great way for developers, the web team, and others to share their knowledge with each each other. Glen Hoeppner did a session called "Customing the Internet with Greasemonkey" We thought it would be useful for others to watch. It is a longer one that runs about 45 minutes. Enjoy!

Bio:

Glenn Hoeppner has been a Software Engineer at TechSmith since 2006. Glenn has mostly worked on Screencast.com, but has lately been working on multi-user account management and credit card payment systems for the TechSmith store. Glenn has over 1,100 (non-digital) comic books in his collection and has a passion for vintage video games. He also enjoys amazing interns with the IBM Correcting Selectric II typewriter on his desk.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

July 7, 2011

Dev Corner - Roles and Authorization

Posted on Thursday July 7, 2011

This week's Dev Corner blog post comes from Dan Fiedler is a Security Engineer at TechSmith. What would you like to see future Dev Corner blog posts about?

I've recently been working on making authorization in Camtasia Relay more flexible. Camtasia Relay has always had a notion of role-based access control (RBAC) but depending on how RBAC is implemented in your application you can run into problems extending your security-related business logic in the future.

In this post I'll talk about different ways you might implement RBAC in a .NET web application and potential problems with each approach.

Approach One: Access Level

In Camtasia Relay, users are either Presenters or Administrators. This is represented as a column in the Users table that is tied to a UserAccessLevel enum. A lot of decisions revolved around the user's Access Level: what menu the user saw, what MasterPage (page template) was used, what pages the user has access to, showing/hiding various UI elements, and for many shared pages what LINQ query was executed to retrieve the objects displayed by the page. For example, displaying all presentations for administrators or displaying only the user's presentations for presenters.

This model is difficult to extend. If we want to add another access level to the system, we need to add another value to the UserAccessLevel enum and then find every place (over 200) where we use access level and update those decisions to make sure we take into account the permissions of the new access level.

One feature request is for a more limited administrator access level: a user that can manage profiles and presentations but not all system options. You can imagine how difficult it might be to correctly update every place where access level is used, especially as more and more access levels are added (going from two to three may not be terrible but what about three to four or four to five?). For example:

fieldler2.jpg

Another problem with this approach is that users can only have one access level: what about users that want to both administer a system and upload presentations? They need two user accounts under the access level scheme.

Sidebar: ASP.NET Roles

It is useful to understand how ASP.NET supports RBAC before moving on to approach two. ASP.NET provides a set of classes, sometimes collectively called membership providers, to support authentication and authorization. Included in these classes are Role Providers. In general the behavior of these classes is configured via web.config and there is little code to write. For example, here's a configuration of the SqlRoleProvider:

RoleProviderConfig.png

Which can then be used to lock down a directory to specific roles (only users in the user or admin role can access the directory where web.config is located)

RoleDirAznConfig.png

We can also make exceptions for specific files (anyone can access rest.ashx)

FileAznConfig.png

With this configuration in place, a few things happen during the ASP.NET pipe line. Here's the pipeline in case you aren't familiar:

ASPNETLifeCycle.png

During the authentication phase, ASP.NET sets up Thread.CurrentPrincipal and HttpContext.Current.User with a GenericPrincipal with the user's roles. During the authorization phase, the user's request is either allowed or denied based on the permissions declared in web.config.

The ASP.NET approach has a couple of benefits and drawbacks. Benefits include:

  • Support for RBAC is already built and you don't have to implement yourself
  • Authorization is applied early in the pipeline so you can focus on business logic in your page or service (the Execute Handler phase)

Drawbacks include:

  • A strict table structure. If your application doesn't follow their table structure you can't use the built in providers (you have to implement the interface yourself.)
  • Strict API usage. To use the various ASP.NET Membership providers you have to use the Membership classes which tend to be static method calls and this can be problematic for unit testing.
  • Authorization lives (mostly) in web.config and is limited to URL-based authorization. (But we can ask questions like Thread.CurrentPrincipal.IsInRole("Admin")) in our code.)

Approach Two: User.IsInRole

One way to allow a user to belong to multiple roles is to follow the example of ASP.NET's SqlRoleProvider and represent role membership with another table that relates Users to Roles. One problem with this is that to make authorization decisions we need to make a trip to the database to retrieve the user's roles. We can avoid this when the user logs in, we can retrieve the user's roles once and then cache them in the session or in an encrypted cookie (like ASP.NET's forms authentication ticket.)

To further follow ASP.NET's example, I implemented an HTTP module that hooks to the AcquireRequestState that populates Thread.CurrentPrincipal and Context.User with a Generic Principal based on a forms authentication cookie (created when the user first authenticates.) Here's the code for that creates the cookie (which is then added using httpContext.Response.Cookies.Add( authCookie )):

2011-07-08_03-47-19.jpg

And then the code to populate Thread.CurrentPrincipal / Context.User with a Principal object:

2011-07-08_03-43-54.jpg

Remember that if we used the .NET provider classes then all of this would be done for us but doing it ourselves lets us customize and use our existing database schema... We could also do this by writing our own implementation of the <a href="MembershipProvider and RoleProvider classes, changing our code to use the membership interface, and hooking the providers up in web.config. The Provider pattern has a few drawbacks though such as being difficult to test and it would also require a lot of code changes to move from the current way Camtasia Relay performs CRUD operations for Users and the way MembershipProviders work.

With all of that setup out of the way, we are free to ask (anywhere in the website) role-based authorization questions without a trip to the database. For example:

RBAC.jpg

So now users can be in multiple roles but our business logic is tightly coupled to the authorization check and if the security requirements ever change then our code will also need to change.

Approach Three: AuthorizationManager

What if instead we asked:

if( AuthorizationManager.IsAuthorized( Thread.CurrentPrincipal, "AddCustomer" )
{
// add customer
}

Our code is no longer tied to one role but instead asks a central AuthorizationManager class whether or not the current principal (user) has permission to perform the specified task.

Here are the bones of the AuthorizationManager class:

05.16.2011-16.31.41.png

The _rolePermissions dictionary links an action to a list of roles permitted to perform that task/action. This dictionary is initialized once based on stored permissions (which could be stored in a config file or database table.) Then if a role gains or loses permissions or we wish to add a role then we just have to change the stored permissions rather than change the code.

I laid out a couple of different ways an ASP.NET web application might implement role-based access control; there are probably a few others. I think that the AuthorizationManager approach will prove to be flexible and extendable but I can't claim that the code in this post is perfect -- let me know if you spot a potential problem.

dan fieldler.jpg

Dan Fiedler is a Security Engineer at TechSmith who likes breaking things but loves building secure software even more. Since joining TechSmith in 2008, Dan has worked with several teams to help the teams avoid vulnerabilities and implement security features. Dan received his master's degree in computer science from Michigan State University and a bachelor's degree in computer science from Allegheny College.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

June 30, 2011

Dev Corner - Cheevos

Posted on Thursday June 30, 2011

This week's Dev Corner column comes from one of our lead developers at TechSmith, Jim Dusseau! He'll give you an insiders look at one of our experiments at TechSmith. Enjoy!

cheevo.jpg

Randall and AJ asked me to write up a post to talk about Cheevos, one of our internal experiments. Experimentation is a big part of our culture at TechSmith. We know the best way to stay competitive is to never settle for the status quo, so we never stop trying new things. Many of them never see the light of day. However, more than one of our products have started off as a rough idea translated to code, and then painstakingly refined into a product that's worthy of release.

When Alan from our User Experience department got to talking about achievements in software, I was quick to ask how I could help explore the concept. He did some research with Mike and Scott, and we sat down to flush the experiment out a bit more. Scott was quick to use a shorthand to dub the project "Cheevos."

Achievements can be powerful in terms of motivating users. Our main goal was to see if Achievements could increase usage of our internal experimental versions of our software products.1 We were also hoping to learn a lot of about what kinds of achievements are effective and the best ways to implement a system to support achievements.

After a lot of discussion, we decided to build Cheevos into Jing. It's a product that almost everyone at the company already uses for their day-to-day work, and most of Team Cheevos had worked in the Jing code before. Over the course of a few lunch hours, Mike had built out a rough server, Alan and Scott had made updates to the Windows version of Jing, and I had added code to the Mac Version of Jing.

We released it to TechSmith's entire staff on a Friday. Within a few hours our security expert Dan had hacked it, earning all of the achievements and reminding us that security is important. We made some of the changes he suggested, and redeployed.

From there, we had a lot of conversations, making improvements and smoothing out rough features as we went as we found spare time. We added a system to see who was sharing screen captures throughout the day, gathered stats, and eventually added a way to follow your friends, so you could check out what achievements they were getting. We learned a lot about how discoverable to make an achievement, and whether or not it's disruptive to your workflow. We learned that some achievements have to be mysterious and easy to stumble upon, rather than driven by progress.

Though we had some mixed results, I consider the experiment a success overall. We learned a bit, and had fun doing it. Our biggest lesson is that an Achievement system takes constant care to keep things from becoming stale.

1. We call these versions "Hawt 'n' Busted" because they have hot new features, and haven't been thoroughly vetted by our quality assurance department yet. We have a phenomenal staff, so the software is almost always great, but not quite great enough for our equally phenomenal customers.

jim d dev corner.jpg

Jim Dusseau is a lead developer at TechSmith. Since joining TechSmith in 2008, Jim has helped out a variety of TechSmith teams, primarily Jing and Camtasia Relay. A Computer Science graduate of Bowling Green State University, Jim has a passion for the way technology continues to change the way people communicate.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

June 23, 2011

Dev Corner - Programming for Fun

Posted on Thursday June 23, 2011

Last month, TechSmith Developers organized their own internal 2-day conference, DevKhan. At TechSmith, we are always striving to learn and DevKhan is a way for our developers to share their expertise with each other. They spoke on a wide variety of topics. This week's Dev Corner is a presentation from DevKhan where Chris Bowron spoke about his personal homebrew project, "Chess Programming For Fun and Zero Profit".

The video runs about 25 minutes. Enjoy!

What would you like to know from our developers for future Dev Corner posts?

chris_bowron.jpg

Chris Bowron is a developer in the future products and research group at TechSmith. He has worked at TechSmith for over 5 years, during which time he has also worked on Camtasia Studio and Morae. In college, he became interested in artificial intelligence and chess programming, which lead to his development of "Boo's Chess Engine," and later, pspChess for the PlayStation Portable. He lives in East Lansing, MI with his wife and their wall of candy and is on a perpetual quest to find another bottle of Uncle Oscar's Popcorn Schnapps.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

May 27, 2011

Dev Corner - Interview with Tony Lambert

Posted on Friday May 27, 2011

It's time for another Dev Corner from Randall Brown and Jared Wein. Take a sneak peek into our development department with an interview of Tony Lambert, the lead developer on Camtasia Relay. It's a short video that runs just over 8 minutes.

What questions do you have for our developers? I'd love some ideas for future Dev Corner blog posts!

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

May 19, 2011

Dev Corner - Camtasia Studio and Cursor Effects

Posted on Thursday May 19, 2011

aj devcorner.jpg

It's Thursday and that means it's time for Dev Corner! This week, Randall Brown and Jared Wein chat with A.J. Orians about Camtasia Studio. Any suggestions for next week's Dev Corner topic? What do you want to know from our Developers?

Andrew "A.J." Orians is a developer on the Windows version of Camtasia Studio. Though he enjoys programming he also likes puzzles, running, games, and a whole slew of other activities. He has been at TechSmith for something like five years and looks forward to being here for many more!

There are some really cool features in Camtasia Studio 7; my personal favorite is Cursor Effects. The spotlight effect and the ability to change the highlight effect post-recording is very cool! For these features to work you need your recording to be a Camrec (Camtasia Studio Recording document) from Camtasia Studio 7 or later:

rec screen aj.jpg

For all the AVI files recorded over the years and all the Camrec files from earlier versions of Camtasia Studio they do not have cursor information attached and so Cursor Effects cannot be used with these files. So I worked on a program which goes through each frame of a video and tries to locate the cursor and so this program will create cursor information such that you could use the spotlight effect or add a highlight effect! The program takes as input either a Camrec or an AVI and produces a Camrec with cursor data.

The program basically starts at the beginning of the video and goes through each frame to the end and tries to locate one of the cursor images somewhere in the frame. To speed up the process I break up the frame into a grid and so I locate the cursor in one frame then in the next frame I first search for a cursor in a subsection of the whole frame, the same grid location. If I do not find it within that grid location I try the search in the surrounding grid areas before finally searching across the whole frame.

In source code, this process looks like the following:

            public IEnumerable NextRectangleOfInterest(Point ptPosition)
            {
                //First look at the rectangle which has the point
                int nRow = -1;
                int nCol = -1;
                if (ptPosition != Point.Empty)
                {
                    GetSectionWithPoint(ptPosition, ref nRow, ref nCol);
                    yield return GetRectangleAt(nRow, nCol);
 
                    //Next look at surrounding rows/columns
                    if (nRow > 0)
                        yield return GetRectangleAt(nRow - 1, nCol);
 
                    if (nCol > 0)
                        yield return GetRectangleAt(nRow, nCol-1);
 
                    if (nRow < m_Sections.Count - 1)
                        yield return GetRectangleAt(nRow + 1, nCol);
 
                    if (nCol < m_Sections[0].Count-1)
                        yield return GetRectangleAt(nRow, nCol+1);
 
                    //Upper left
                    if (nRow > 0 && nCol > 0)
                        yield return GetRectangleAt(nRow-1, nCol - 1);
 
                    //Upper right
                    if (nRow > 0 && nCol < m_Sections[0].Count - 1)
                        yield return GetRectangleAt(nRow - 1, nCol + 1);
 
                    //lower left
                    if (nRow < m_Sections.Count - 1 && nCol > 0)
                        yield return GetRectangleAt(nRow + 1, nCol - 1);
 
                    //lower right
                    if (nRow < m_Sections.Count - 1 && nCol < m_Sections[0].Count - 1)
                        yield return GetRectangleAt(nRow + 1, nCol + 1);
                }
 
                for (int Row = 0; Row < m_Sections.Count; Row++)
                {
                    for (int Col = 0; Col < m_Sections[Row].Count; Col++)
                    {
                        if (ptPosition != Point.Empty)
                        {
                            if (Math.Abs(nRow - Row) <= 1 || Math.Abs(nCol - Col) <= 1)
                                continue;
                        }
 
                        yield return GetRectangleAt(Row, Col);
                    }
                }
 
                yield break;
            }

Since the cursor is visible in the video; having the Cursor Effects option "Mouse cursor visible" checked will have two cursors displayed (hopefully directly on top of each other). Also this program doesn't work with animated cursors or the I-beam cursor. Nonetheless if you use the Recorder in Camtasia Studio 7 you will not hit any of these issues! The preferred route is to use Recorder in Camtasia Studio 7; this program was meant both for learning as well as creating something that might be useful.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

April 28, 2011

Dev Corner - Interview with Larry LaHaie

Posted on Thursday April 28, 2011

larry lahaie.png

Here's a peek behind the scenes at TechSmith... For this week's Dev Corner post, Jared Wein and Randall Brown interviewed Software Engineer, Larry LaHaie (LH). Enjoy!

Who are you, and what do you do?

(LH): Hi! My name is Larry LaHaie, and I'm a software engineer who works on the Windows side of Snagit. I've also worked on the Windows side of Camtasia Studio and the web presence team in my 4.5 years at TechSmith.

How did you find out about TechSmith?

(LH): I went to MSU for my undergraduate studies in Computer Science (I phrase it this way because I think it makes it sound like I have continued studying and working toward degrees since then, although I really haven't), and had a classmate who mentioned that he had submitted a resume here. Then I came across TechSmith again at a Career Fair in the Engineering Department, and that was it. I had to court them.

What do you like most about working at TechSmith?

(LH): I enjoy the heck out of the programming, and the company treats its employees extremely well, but my favorite thing is definitely my fellow humans. It's a splendid array of personalities. Many of us are pretty unique and/or eccentric, but that just makes it more interesting; egos are checked at the door. We've bonded over the common goals of making software that people want and use and love, but the relationships often become about much more than that; it's tough to walk more than a few feet without running into someone I'd consider a friend. Heck, I like the people here so much, I even married one of them!

What setup (hardware + software) are you using?

(LH): I've got a laptop and a desktop. Both are currently running 64-bit Windows 7 (I probably could use more diversity, but they were both wiped late last year, and having Windows 7 and 64-bit made a lot of sense in terms of my team at the time). My most commonly-used apps are Visual Studio (right now 2010, but I've also got 2008 and 2005 installed for rainy days), Outlook, and Office Communicator. Oh, and some apps called "Jing" and "Snagit". They're real handy. :D

What was the most interesting thing you've seen and/or done while at TechSmith?

(LH): Several things come to mind, actually.

The first is volume leveling on the timeline in Camtasia Studio. We added it for CS 7.1, and it was neat to work on and help transition from drawings to functionality in the application. It wasn't something that I was entirely clear on conceptually when we began talking about it, but now it just feels so right. It was very cool to develop, in terms of how we implemented it and getting a little bit of time with the code that rendered out the timeline.

The second is some new code on Snagit. I don't believe I can talk about the end result at this time, but we're basically starting from scratch in this functionality, and that's fun, because you have an opportunity to take a more grand swipe at the architecture, which isn't always the case when you're working with existing code that is already tied into the software.

Third and finally are just my various experiences working across products at TechSmith. I've worked on the Web Presence team working with products and marketing, and with Camtasia Studio while working with Screencast.com, Camtasia Relay, and the Mac side of Camtasia Studio. We have teams of developers (among many other parts), and that coordination is a lot trickier than working within a product team, because there's so much to communicate among so many parties. There's coordinating development efforts, testing efforts, making sure expectations are understood and fair for all parties involved, making sure we have the necessary hardware for the job, and communicating to everyone when things change (because they inevitably do). In the end though, if/when everything comes together, it's a heck of a feeling. And I like the challenge of trying to improve the processes involved.

What can you tell us about the relationship between TechSmith and the Detroit Tigers?

(LH): Well, it's a very special one. The Tigers are our hometown/state team, and we have a quite a few diehard fans here. The diehards, in turn, have rubbed off on others too, I think.

Once a year, many of us even make a pilgrimage down to the beautiful and spacious Comerica Park (home of our beloved baseball team) together to take in a ball game in the summer, and I'm not going to lie - it might be the most fun thing ever.

All in all, I think most of the company is pretty informed about the Tigers. Either because they eat, sleep, and breathe them by nature, or because Detroit Tigers-goings on are crammed down their throat whether they like it or lump it.

I've heard that you have an interesting nickname. Can you share some background?

(LH): Sure! My nickname is "Pieboy", which is short for "Pieboy McGillicuddy" (also my nickname). The reason for "Pieboy" is short and sweet (pun intended, because pie is sweet, too! Ha!): I LOVE pie.

Now, you might be asking yourself, "How did this clown get the 'Pieboy' nickname? I love pie, too! Why not me? Sham! SHAM!". First of all, please calm down. There's no reason to call me a sham! That's just mean. Second, I've always wanted a nickname, and I actually successfully made claim to and applied this one for myself (I feel like it's a tricky move to nickname yourself and get others to follow that, so I pride myself on this), so I guess I just got there first. J Don't despair if you wish you had my delectable handle, though: 'Pieperson', 'Piefellow', 'Pielady', 'Piechap', and 'Piehuman' are still up for grabs! Have at it!

Oh, and "McGillicuddy" just seemed like a fun last name, and I needed one when I was testing a UI many moons ago, so I applied it to the "Pieboy" name, and it also took.

Finally, please note that National Pie Day is January 23rd (I'm not sure why, but I speculate that it inspired by the combination of the phrases 'Easy as 1-2-3' and 'Easy as pie!', and the fact that the date is 1/23). Every year, hundreds of people don't eat pie on National Pie Day. Please do your part to promote National Pie Day awareness.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

April 14, 2011

Dev Corner - Interview with Ben Pedersen

Posted on Thursday April 14, 2011

ben pedersen.png

Here's a peek behind the scenes at TechSmith... For this week's Dev Corner post, Jared Wein and Randall Brown interviewed a Software Test Engineer at TechSmith, Ben Pedersen (BP). Enjoy!

Who are you, and what do you do?

BP: Ben Pedersen - Software Test Engineer for our desktop products unit, currently working with Snagit Windows.

How did you find out about TechSmith?

BP: I believe I first met TechSmith at one of MSU's Career Gallery events in 2008.

What do you like most about working at TechSmith?

BP: The work environment/people I work with. My job entails switching teams regularly; I continue to be impressed with the knowledge and helpful attitude of all the Software Developers/Engineers I've interacted with so far.

What setup (hardware + software) are you using?

BP: What a loaded question :P. I'm running Windows 7 on a MacBook Pro currently, with 1 extra monitor and an external keyboard. When I was working with C:Mac I used OS X.

What was the most interesting thing you've seen and/or done while at TechSmith?

BP: The TechSmith birthday party is strong in my mind at the moment - seeing everyone "let down their hair" and have a blast was a lot of fun. But in terms of things I've worked on, what comes to mind is the Redirects Initiative Technical Team. The Redirects team was a small group of 2 developers, myself, and one QA that were brought together to come up with a plan for a better way to create and manage redirects with seamless communication between product teams and Web Dev. I found it interesting because it was a significant departure from my typical heads-down solo work, and gave me some insight into how planning work is done (at least by some people on some teams).

Can you compare and contrast your work with the work of the software engineers on your team?

BP: I think the primary similarity between my work and that of the software engineers on the team is that we attend the same scrums J. What I'm doing is generally about as separate, from what I can tell, as a designer; more in some ways, because what I'm working on is not specifically related to a release. There have been some exceptions like the in-product AppleScript hooks or the COM tester, but in general I'm not looking at the same code and tasks tend to be more long-term with status updates versus the smaller one-week-or-less sized chunks that developers on both teams I've worked with have typically pursued.

How close do you work with the software engineers on the team?

BP: With both teams so far, I've had a primary contact person that I have used frequently for questions about how the product is set up/where to look for X/what compile flag am I missing for your product?! The other developers on both teams have been very helpful as well when I had questions about areas they were working on, or when my primary contact was unavailable and I had more general questions. But in general, the work I'm doing is not closely related to the primary development work on these projects so there hasn't been a lot of need for communication outside of those questions.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

April 7, 2011

Dev Corner - Software Development Methodology

Posted on Thursday April 7, 2011

For this week's Dev Corner, Randall Brown and Jared Wein caught up with Tricia Broderick, TechSmith's Director of Development. Tricia shares what she has learned about working with a variety of different software development methodologies. Enjoy!

As a developer, lead developer, project manager and now the director of development, I've been in the business of building software for a number of years. As such, I've worked within a number of different known methodologies: Waterfall, Rapid Application Development (RAD), Rational Unified Process (RUP), Extreme Programming (XP), Scrum and now entering the world of Kanban. In appreciation of these teams and projects, I wanted to share some of the key truths I learned as it relates to methodologies.

quote tricia.png

Perception: If you don't agree/like a methodology, just wait for the next one.

Truth: Methodologies are not constantly changing for the sake of changing. The reality is that they are constantly evolving due to learning from going too far to one extreme back to the next until we balance. An oversimplified version of some of the evolution in the industry:

text pane.png

Over the years, I've had successes with each of these methodologies. Ultimately though, I've become a strong supporter of Agile. Not a specific implementation of Agile but the principal behind the word. Agile is a group of various methodologies based on iterative and incremental development, where requirements and solutions evolve through collaboration between self-organizing and cross-functional teams. I personally look forward to the software development community evolving the software development lifecycle methodology because it means we're reflecting and growing. Given the innovative nature of TechSmith; hopefully, we can help contribute to the methodology evolution.

Perception: If you are struggling with building software, the fault rests solely on the methodology.

Truth: Software development is not just a science but also an art. Our binary minds want an exact repeatable formula to ensure success. The reality is the formula is not the methodology itself but the principles behind the methodology. As a result, the best software methodology for a project is the one that fits!

select evolve.png

A few years ago, I heard about Shu Ha Ri from Alistair Cockburn at an Agile Conference.

I find this applicable to finding the best methodology. The goal is not to copy or choose a single methodology but to transcend to one that meets the exact situation you are facing.

Similar to how we, as individuals, should work to consistently improve and evolve, so too should our processes for developing the best software possible in the most efficient manner possible.

Instead of getting frustrated by attempting to conform and implement a specific perfect methodology, we should instead embrace the challenge of evolution. However, be careful to not go to the other extreme of abandoning all existing processes. This would likely result in a team investing energy in re-creating the lessons learned that others have endured. Personally, in order to focus on becoming a leaner team, I would rather invest that energy in leveraging the results from an established process.

Is your team ready to invest energy in evolving?

TriciaBroderick.png

Tricia Broderick joined TechSmith in 2008 and is the Director of Development for the web and enterprise services product family, which includes, Jing, Screencast.com, Camtasia Relay and Web Presence. In this role, Tricia manages the engineering team and helps them deliver high quality products on time that meet customer demand and market needs. She has always been a firm believer in mentoring, training and coaching as key skill sets to becoming a great leader.

Tricia has over 14 years of software development and management experience. Prior to joining TechSmith, she managed large development teams through a variety of software methodologies, implemented process improvement plans and successfully launched multiple million-dollar software platforms.

Tricia received her bachelor's degree in computer science from Michigan State University and is a certified Project Management Professional (PMP).

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

March 31, 2011

Dev Corner - Coding for Charity at GiveCamp

Posted on Thursday March 31, 2011

ray givecamp.png

What's more fun than being locked in a science center all weekend long? The answer? Not much! Several TechSmithies did just that last weekend at Impression 5 Science Center for Lansing GiveCamp. We even had matching bedazzled TechSmith Slankets! You can see pics of our weekend fun here.

Randall Brown and Jared Wein share their experience donating their time and developer skills at Lansing GiveCamp for this week's Dev Corner! Enjoy!


This past weekend was the third annual Lansing Give Camp. What is Give Camp? It is a weekend-long event where software developers, designers, and database administrators donate their time to create custom software for non-profit organizations. Since TechSmith is a software company in the Lansing area, we had lots of employees donate their time to help out the non-profits. Of the over 100 developers that donated their time, at least 13 of them were from TechSmith.

The event started with introductions to the non-profits and the rest of the team members. After that, dinner followed and the teams got down to work. Projects ranged from simply renovating existing websites to complicated location aware web applications. After about 36 more hours of nonstop hacking and cupcake eating, thirteen non-profit organizations came away with brand new websites.

On the last day, following the website demos, the event sponsors showed their appreciation for the estimated $100,000 worth of work, by having a drawing for numerous prizes from t-shirts to the Master Collection of Adobe CS5.

Since this is DevCorner, we thought we'd talk a little bit about the technologies used. Most of the teams used content management systems so that once they handed off the project to the non-profits, the sites could still be easily updated. DotNetNuke and Drupal were the most commonly used systems. One group used Weebly and another group used jQuery Mobile to make a mobile web app that would work on multiple phone platforms. What technology would you use if you had a weekend to build a website?

Here is a screencast folder with all of the before and after images.

randall jared devcorner.png

Randall Brown started at TechSmith in 2009 after graduating from the University of Michigan with a degree in Computer Science. He is a member of the Camtasia Relay team where he works on bringing lecture capture to the masses.

Jared Wein started at TechSmith in 2007 as a Software Engineer Intern. In 2008, he graduated from Michigan State University with a degree in Computer Science. He is currently finishing up his Masters in Computer Science while working full-time as a Software Engineer on the Camtasia Relay development teams.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

March 24, 2011

Dev Corner - Interview with Jeffrey Morgan

Posted on Thursday March 24, 2011

jeff morgan.png

Here's a glimpse inside of TechSmith... For this week's Dev Corner post, Jared Wein and Randall Brown interviewed a Software Install Engineer at TechSmith, Jeffrey Morgan (JM). Enjoy!

Who are you, and what do you do?

JM: My name is Jeffrey R. E. Morgan and I am a Software Install Engineer currently working closely with the Snagit Team.

How did you find out about TechSmith?

JM: I found out about TechSmith through http://www.indeed.com. I was out of work and needed a job, and indeed led me to TechSmith.

What do you like most about working at TechSmith?

JM: The cool technology I get to work with on a daily basis.

What setup (hardware + software) are you using?

JM: I am using an Intel 64-bit Core Duo 2 3.16Ghz machine with 4GB of RAM, Dual Samsung SyncMaster 22" displays, Visual Studio 2010 Team Edition, Snagit 10, Camtasia Studio 7, WiX 3.5, and Google Chrome.

What was the most interesting thing you've seen and/or done while at TechSmith?

JM: One of the most interesting things I have seen is a co-worker dressed as Buzz Lightyear and his wife (who also works here) as Jessie from Toy Story 3. One of the interesting things I worked on was the major releases of Snagit 10 in French, German, and Japanese. It was interesting to see the sort of work that went into a product release in a language I don't understand.

How long have you worked at the company?

JM: I have worked for TechSmith for 8 months.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

March 18, 2011

Dev Corner - Brian Dishaw

Posted on Friday March 18, 2011

For this week's Dev Corner post, Jared Wein and Randall Brown interviewed the lead developer of Camtasia Relay, Brian Dishaw. Enjoy!

So it's research time again and I decided I wanted to get better with MVVM and TDD. I have an idea for a simple data mashup application for a Windows Phone 7 that will allow me to scan RSS feeds for mentions of fantasy football players. Easy right?

Since others on the team were starting with the frontend work on phone applications, I decided to start on the back end.

I fired up Visual Studio 2010 and created my Silverlight Class Library Project. I then went to create a Test Project. Well, anybody that's done some Silverlight development knows that the Silverlight class libraries don't mix with normal libraries. This really sucks since it doesn't matter what functionality my unit test project has that's above my Silverlight library! My only other option is to use the Silverlight tests that run in a browser. Well this isn't very convenient for developing a class library. So I decided to see if I could hack a Silverlight Class Library Project to act like a normal Unit Test project that uses MSTest.

I'll spare you the discovery phase. Just picture an eighties montage with me in front of a computer programming to Dancing Queen... Yea, it's not pretty.

So the short of it is I figured it out and the changes were pretty simple once I got it all up and running. It required me creating a new Silverlight Class Library Project and editing the csproj file by hand.

I changed the ProjectTypeGuids element from:

1  <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

to

1 <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

I also needed to add a reference to the MSTest framework.

1  <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework">

2 <HintPath>$(DevEnvDir)PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</HintPath>

3  </Reference>

I then built an extension installer to aid in installing the project template. I used this tutorial to help me since it was something I've never done before.

Anyway, I've uploaded the installer to the Visual Studio Gallery. You can download it here.


brian dishaw vl.png

Brian Dishaw is a lead developer at TechSmith. He is currently working on Camtasia Relay and has contributed to many other products since joining the company in 2005. Prior to joining TechSmith, he graduated from Michigan State University with a degree from the Lyman Briggs college with a focus in microbiology and computer science.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

March 3, 2011

Dev Corner - Interview with Dennis Cornwell

Posted on Thursday March 3, 2011

dennis cornwell.png

Here's a glimpse inside of TechSmith... For this week's Dev Corner post, Jared Wein and Randall Brown interviewed one of our software engineering interns at TechSmith, Dennis Cornwell (DC). Enjoy!

Who are you, and what do you do?

DC: My name is Dennis Cornwell, and I'm a Software Engineering Intern on Jing Team for the Windows platform. I am also the internal security liaison for Jing.

How did you find out about TechSmith?

DC: Mark Schall, a fellow Jing developer and MSU graduate, told me about who we are and how awesome TechSmith is.

How do you feel about the work-school balance?

DC: If there are any pressures from holding an internship here and having a heavy class load, they're mostly self-imposed. I could work many less hours than I do without complaint from my team or managers, I generally choose not to though.

What do you like most about working at TechSmith?

DC: As for being an intern here, I love the way that I am treated as though I were a senior employee of the company. I have the ability to question my team's decisions and form valuable opinions of my own. I significantly impact real public facing production code and have the ability of taking on important roles for my team (like security liaison).

What setup (hardware + software) are you using?

DC:

  • Two 1680×1050 monitors (21" monitors? )
  • HP Desktop 4GB RAM, 4 Core 2.4GHz processor w/ Windows 7 64-bit
  • Macbook Pro 4GB RAM, 2 Core 2.33 GHz processor w/ Mac OS 10.6
  • Visual Studio 2008/2010 and Office 2010

What was the most interesting thing you've seen and/or done while at TechSmith?

DC:

  • Seen: The success of the organization change when we were being split into desktop and internet/service-based divisions
  • Done: Presenting about how UX fits into the agile process model at TechSmith

bill janged.png

Have you ever been 'Janged'? (Note: A Jang is the unintentional sending of a Jing that was not the Jing you meant to send.)

DC: The back story is basically that we were acceptance testing with our personas and Bill happened to be playing the role of "Team Player Penny" a little bit too well. The only problem was his girl voice in all his Jings sounded like a 90 year old British lady, so I stitched that image together and posted it in Campfire. I don't remember who I was talking to after that, but I ended up sending that image along instead of a UI mock up I meant to send.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

February 24, 2011

Dev Corner - Prototyping Apologies

Posted on Thursday February 24, 2011

It's Thursday and that means it's time for another Dev Corner blog post. This week's post is from Matt Mercieca. Enjoy!

The start of a new year is a good time for confession and apologies. I have wronged prototypes. Sometimes negligent, sometimes well intentioned, and other times not, I have found several creative ways to misuse this tool. I'd like to correct that now.

The first of my wrongs is using something that I call a prototype to increase a feature's priority. The conversation goes like this:

ME: Hey, product manager, here's a feature I prototyped. Isn't it cool?

PRODUCT MANAGER: Yes. When can we get it in the product?

ME: Oh, it shouldn't take long. About a week, I'd guess.

It sounds harmless enough. Those using Captain Subtext's Truth Seeking Helmet would have heard this, however:

ME: Hey, product manager. Here's a feature I couldn't work in to your process or wasn't a priority. Instead of waiting I just wrote it in some spare time. Isn't it cool?

PRODUCT MANAGER: Yes. When can we get it in the product?

ME: It's ready for a code review and QA now. I won't admit that though. Instead I'll say a week.

It doesn't matter if the work was done in spare time. If code is ready for release then it is not a prototype. It was production code developed in spare time. Prototypes are useful experiments: they allow developers to cheaply explore alternatives or devise a plan. If quality practices are rigorously used then the development isn't cheap and a prototype isn't the result. Further if prototyping is a problem solving strategy used later, then the product manager and other developers are set up to be disappointed with the results, the process, or both.

The second offence is using prototype as a weasel word. That conversation goes something like this:

ME: I've been working on that feature and I think I have a prototype.

OTHER DEVELOPER: It seems to work. But I noticed this over here...

ME: Well, it's just a prototype.

OTHER DEVELOPER: Oh, right. We'll fix that before it goes in to production.

As deadlines approach the conversation is forgotten--- or worse, ignored--- and the prototype is released in to production. There the price of cheap development is paid in maintenance: when a bug shows up; when the feature needs to be extended; or when the original developer is transferred to another team. The suffering usually outweighs the pain of doing it right the first time. That is clear in hindsight but difficult to recognize that in the moment.

My last transgression is the easiest to hide: "Maybe we should spend some time prototyping that," I'll say. I might even be using prototype correctly here--- one of the few times that I do.

More likely I was hiding something. "That's a really big, important feature and I have no idea how to start," I could have said. That is so easily covered by the keyword prototype. Covering leads to time wasted which could have been dedicated to working with my team to break down the problem into manageable increments.

Prototypes don't deserve the bad reputation I am helping to create. They are core agile tools: low cost experiments that can be used to quickly add value to the end product. The software industry is one of the few places where significant value can be added in the design phase. We don't have to use cheap parts to bring the end cost down. Instead we can conduct cheap experiments and deliver a higher quality product at the end.

From now on I will use prototypes to answer a specific question like:

  • What are the risks of this approach?
  • How will this approach perform with live data?
  • Can different technologies do this better?
  • How will this fit in with the rest of the system?

This is not an exhaustive list. Most questions, like these, are similar to the ones I use when planning research. That's a fair guide as prototypes are a great research tools.

I will not:

  • Write prototypes in the production codebase. I will use a local branch or create a new project.
  • Prototype a large unknown. I will break the problem down into small units which may then be prototyped.

If I follow those two rules then I won't commit any of the above sins. I hope prototypes will one day forgive me for the damage I caused.

mattmerceica.png

Matt Mercieca started at TechSmith as an intern in 2002. After graduating from nearby Michigan State University with degrees in Computer Science and English, he started working full time as a software engineer. He has contributed to: UserVue.com, Screencast.com, and is currently working on supporting TechSmith's growing ecommerce needs.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

February 17, 2011

Dev Corner - Interview with Cameron Flint

Posted on Thursday February 17, 2011

For this week's Dev Corner post, Jared Wein and Randall Brown interviewed one of our intern's at TechSmith, Cameron Flint (CF). They asked him about what it's like to be an intern at TechSmith. Enjoy!

cameron flint.png

Who are you, and what do you do?

CF: I work alongside the Camtasia Studio team, specifically to facilitate tight integration between Camtasia and various third-party products.

How did you find out about TechSmith?

CF: Believe it or not, by taking Calculus. My first mathematics professor, Maria Andersen, uses Camtasia Studio to record her lectures live - sometimes even incorporating students as "guests" - making it possible for students to later reference the class material at their convenience, and so that her online sections can have access to the same dynamic that in-class students experience. She also encourages the use of Jing to collaborate on homework, so her students are pretty thoroughly introduced to TechSmith products.

I was immediately intrigued by the utility and effectiveness of both applications, but what really put it over the edge was when Troy Stein (at that time the product manager for Camtasia Studio) visited our classroom one day to gather feedback and suggestions. I thought, "If this company is passionate enough about the quality of its software to send someone to sit through a lecture in Calculus, then this is a company I want to be a part of!"

How do you feel about the work-school balance?

CF: I'll be honest; majoring in Computer Science and working in the industry at the same time amounts to a lot of programming, and it can be challenging to keep the end goal in sight. Two things that have been helpful to me in this respect are 1) making sure to keep work and school on separate days of the week, so that I can give each proper focus; and 2) having experienced two awesome summers working on-site in Okemos, which keeps me motivated and looking forward to the next summer.

What do you like most about working at TechSmith?

CF: I love working with driven, talented, bright yet down-to-earth colleagues whom I can learn from and have a laugh with at the same time. I like the trust and transparency that is exhibited between team members and across all levels of the company.

What setup (hardware + software) are you using?

CF: I work on a Thinkpad T410: Core i7, 8GB of RAM, and 120GB SSD, coupled with a pair of monitors when I'm on-site. I spend time in both Visual Studio 2008 and Eclipse, though my primary development environment is heavily biased towards the latter (and my fingers are trained to Eclipse's keyboard shortcuts). Grindstone 2, which I use for organizing my tasks and keeping track of time spent on each, is also an indispensible part of my workflow.

What was the most interesting thing you've seen and/or done while at TechSmith?

CF: I once had the opportunity to work directly with a client in Chicago. Besides the novelty of the trip, it was truly exciting - and also intimidating! - to see the product that I had worked on even as an intern being put to use right in front of me.

Other than that, the games of lunch soccer are pretty intense!

What is it like being the only Java developer in the company?

CF: Well, considering the number of developers at TechSmith, I'm almost certainly not the only one in the company who is a Java developer; maybe just the official one for the moment... or maybe no one else is willing to come out of hiding yet!

Whatever the case, I actually enjoy the variance. Using diverse programming languages and technologies lends itself to a broader perspective on what tools are more aptly suited for a given task... and, of course, to occasional good-natured debate over lunch.

Do you incorporate TechSmith products in your school-work?

CF: Absolutely. SnagIt or Jing - sometimes both - are almost always running in my system tray at any given time. I've used Camtasia Studio for at least one class assignment, and more than a few side projects.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

February 10, 2011

Dev Corner - Sketch Motion Callouts

Posted on Thursday February 10, 2011

It's Thursday and that means it's time for another Dev Corner post. This week one of our Camtasia Studio software engineers, Kevin Mojek, shares a couple ideas he experimented with for Camtasia Studio 7's sketch motion callouts. Enjoy!

With Camtasia Studio 7, we introduced sketch motion callouts and updated most of the others to use path-based shapes. For the sketch motion callouts, the path is the callout... it's gradually drawn in by default to mimic the way a person might draw the shape. For the other callouts, the use of paths is not as obvious. As a result of the switch, we were able to make the default shading look nicer and allow some limited adjustment of the shapes; but other than that, it's not immediately obvious that the image-based callouts have been replaced by shapes. I spent a little time looking into how else we could use the path data for non-sketch motion callouts. I came up with a couple of ideas.

The first thing I tried out was animating the border-drawing and then fading in the fill. This was simple to implement and doesn't seem to slow things down too much. But unlike the sketch motion callouts, there's not really an obvious way a person might 'draw' a non-sketch motion callout, so it's debatable whether this adds visual interest or is just annoying:

Another possibility might be blending from one shape to another. When one callout is immediately followed by another, it might be nice to transition between the two, or it might be nice to have a callout that slowly cycles between two shapes. This is easy to do if we temporarily switch from the 'real' shapes to a less accurate piecewise-linear representation. With this code, things started to slow down. Calculating the intermediate shapes on-the-fly was too slow, so I pre-calculated and cached them... 100 intermediate shapes is likely excessive for a short animation though. To do this, I used Qt's QPointF class with linear interpolation between the points.

 for ( int i = 0; i < 100; ++i )
{
  qreal t   = 0.01 * i;
  qreal t_1 = 1 - t;
  for ( int ii = 0; ii <= 400; ++ii )
  {
    qreal step = 0.0025 * ii;
    QPointF p1( m_p1.pointAtPercent( step ) );
    QPointF p2( m_p2.pointAtPercent( step ) );
    QPointF p( t * p1 + t_1 * p2 );
    if ( ii )
      m_paths[i].lineTo( p );
    else
      m_paths[i].moveTo( p );
  }
}
 

Finally, since path data for fonts is readily available, I tried doing the same thing for a few of those shapes.

Kevin Mojek.png

Kevin Mojek has worked for TechSmith since 2008 as a software engineer on Camtasia Studio. Prior to joining TechSmith, he graduated from Michigan State University with a degree in electrical engineering and worked in the auto industry developing customizations and extensions to computer-aided-design software.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

February 3, 2011

Dev Corner - Comments: A Dissenting Opinion

Posted on Thursday February 3, 2011

It's Thursday and that means it's time for this week's Dev Corner! Software Engineer, Matt Mercieca, shares his insight about comments and our code. Enjoy!

"Comments: A Dissenting Opinion"

Many--- actually most--- of the questions I'm asked at work start with the phrase, "Do you know why?" That's not surprising. "Why questions" about our code can't be answered by Google, Ctrl + F, or file history. Why we implement features a certain way is usually the result of more than one discussion which we distill into objects and functions which perfectly capture how. We miss "why".

The majority opinion at TechSmith seems to be: comments are evil. I don't believe that. Because comments can aid in the maintainability of our code, it is worth examining some of the criticism around them.

"Comments lie!" or "Comments get outdated."

Sadly both of these are often true. This usually happens when comments are included to explain what the code is trying to accomplish. Nothing conveys that better than clear naming and design. Also clearly named functions and variables stay up to date.

That does not stop developer time from being saved when a comment is included to explain why a particular method was chosen.

Obligatory example: years ago, one of the tasks I worked on when I was on the web staff was writing the pack list printer. This is the program which pulls orders from the database and prints those which need to be shipped. Finding those orders was a straightforward SQL query. The program worked fine on our test system, but when deployed to live nothing printed.

Debugging with live data showed why. For the only time in my experience, the SQL Server Query Optimizer chose the wrong execution plan. Going against my developer soul I rewrote the query incorrectly so that it would run. Life went on. I couldn't check in code that looked that bad, however, so I included a comment saying why I wrote it that way.

The next time I looked at the pack list printer my bad SQL and comment were still there. I didn't waste any time figuring out why the query was written that way or waste any time trying to fix it. Other developers also knew that when a new version of SQL Server came out they could address that bad code and test appropriately.

"Comments clutter the code."

Again there is some truth here. However, I find that this critique most often applies to comments which violate the above rule and describe what the code is doing instead of capturing why.

"OK, if it's that important it should be in a README.TXT or included in other documentation."

I don't think I'm alone in that I read documentation as a last resort. I'll look for code examples, search the web, and ask coworkers before I check to see if someone took that time to write a README--- even if I'm the someone that wrote it. The documentation that gets read is the documentation in the code.

Like every tool, comments can be used poorly. I'll admit that a lot of why strange things happen is to get around a bug, framework quirk, strange hardware, or other abnormality. These are not reasons to brand comments as evil. One of our top goals is clarity and maintainability of code. In some cases, comments help with both.

--- Matthew Mercieca, Dissenting Commenter

mattmerceica.png

Matt Mercieca started at TechSmith as an intern in 2002. After graduating from nearby Michigan State University with degrees in Computer Science and English, he started working full time as a software engineer. He has contributed to: UserVue.com, Screencast.com, and is currently working on supporting TechSmith's growing ecommerce needs.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

January 27, 2011

Dev Corner - Meet Randall and Jared

Posted on Thursday January 27, 2011

Ever wonder what it's like behind the scenes at TechSmith? What's a typical day like for a software engineer at TechSmith? Every Thursday over the next several weeks, two of our Software Engineers, Randall Brown and Jared Wein, will share with you what happens in our development department. Welcome to the new 'Dev Corner'!

Randall and Jared stopped by the TechSmith studio to share a little bit about themselves. The video runs 4:37.

A little more about Randall and Jared...

Randall Brown started at TechSmith in 2009 after graduating from the University of Michigan with a degree in Computer Science. He is a member of the Camtasia Relay team where he works on bringing lecture capture to the masses.

Jared Wein started at TechSmith in 2007 as a Software Engineer Intern. In 2008, he graduated from Michigan State University with a degree in Computer Science. He is currently finishing up his Masters in Computer Science while working full-time as a Software Engineer on the Screencast.com and Camtasia Relay development teams.

What would you like to know from our developers? How do they come up with new feature ideas? What books do they read? Mountain Dew or Coca-Cola? They'd love to hear your questions.

Share Submit link to Del.icio.us | Submit to Digg Digg This | Submit to Reddit Reddit

Dev Corner Posts

This page contains an archive of all entries posted to The Visual Lounge in the “Dev Corner” category. The blog entries are listed from oldest to newest.


Previous category:
Customer Videos

Next category:
EDU

All recent entries can be found on the main page or by looking through the archives.