About Me

My photo
Santa Clarita, Ca, United States
I work as a Technology Manager in the Entertainment Industry. My first film was Disney's Dinosaur and have been credited on several films since. I love working on old electronics, especially old radios. I am also passionate about technology and education. I have 4 kids and you can read about us on our family blog.
Showing posts with label Software Development. Show all posts
Showing posts with label Software Development. Show all posts

Friday, September 5, 2014

Some Common Programming Languages

People will often ask me questions like like "How is C different from C++?",  "What makes folks use Python instead of Perl?", "Are Java and Javascript the same?", "What is an HTML programmer?"  Of course, these questions could have long, detailed, technical responses. Though, I find usually that's not what folks want. They simply want a one or two sentence simple explanation.   So, I put together this languages matrix to try and answer these simple questions with simple, one or two sentence answers. I hope it helps.



LanguageTypical UsageNotes
General Purpose Compiled Programming Languages
C Low level system programming. Older language used for Linux/Unix kernel.The foundation of UNIX and the the father of Java, C++, ObjectiveC and C#.  Developed in 1969. Used heavily in the 1970's-1990's.  "Procedurual" (Not Object Oriented)
C++Common language for performance centric tasks. Large API / Vendor support.Object oriented additions to C. Very widely used. High learning curve. Lots of features. First standardized in 1989.
Objective CPrimary development language for Mac OSX/iOS development.Another object oriented language based on C. Has a "dynamic runtime" while C++ is static.  Has notably different syntax than C, C++, and Java.
SwiftSupported by Apple for Mac OSX/iOS development.A newer option from Apple for native iPhone and Mac development.
General Purpose Interpreted or Semi-Compiled Languages
JavascriptAny dynamic web page. Not the same as Java! Built into web browsers.  Used for dynamic web pages in HTML5 as well as almost every web site on the internet.
JavaCross platform and enterprise development.  Minecraft!Well known.  Taught in colleges.  Considered "High Ceremony" since lots of code is required even to do small things. Somewhat similar syntax to C/C++.  Generally does not perform as well as "compiled' languages like C, C++, Objective C.
C# (C-Sharp)Java-Like language for Microsoft Windows development
Runs on a VM just like Java.
PythonA great general purpose scripting language.  Capable of a wide variety of tasks such as  web sites,  database communication, games, and image processing. Integrates with many entertainment industry software packages like Maya, Houdini, and Nuke. Scripting language with clean readable code. Easy to learn and maintain.  Surpassed Java as top learning language in schools.
PerlSystems administration.  Text parsing and data manipulation.Powerful scripting language. Can do a lot with small amounts of code. Often referred to as a "write only" language because loose formatting constraints makes it difficult to read others code.
PHP"Back End" web pagesGenerally used as a server-side language for websites. Code is executed on the server per page request and is usually written to output HTML or other browser interpreted data.
Data Description Languages
XMLData description and transfer language for data files and web sites.
HTMLWeb page description language interpreted by web browsers
JSONData description and transfer  language for data files and web sites.Considered by some to be easier to read than XML. Often used when returning data from web sites.
Application Specific Languages
SQLUsed for database queries to relational databasesRuns within many different brands and types of relational database.
Bash/Tcsh/CshQuick utilities.  Systems administration. Unix automation tasks.Scripting language that runs within the specific UNIX shell environment.
MELApplication specific language for Maya. Used for Maya plugins and automation.Scripting language that runs within Maya. Being displaced by Python.
HScriptApplication specific language for Houdini. Used for Houdini plugins and automation.Scripting language that runs within Houdini
CudaNVidia specific graphics processing language. Used to optimize applications to run on the graphics card. (GPU)
GLSLOpen GL Shading Language. Used in real time tools to offload graphics processing to the graphics card (GPU)Replacement for OpenGL

Tuesday, February 21, 2012

The Maker's Schedule Vs. The Manager's Schedule

There is a wonderful article written on Paul Graham's blog  about the different work schedules of Makers and Managers.  Anyone who ever schedules a meeting of any kind should have to read this first.  If you have "Makers" in your organization, you need to understand the price you are paying.  You may be paying for an entire day's worth of work when you only meant to pay for an hour.

Here are a few snippets that I think are especially interesting..
"One reason programmers dislike meetings so much is that they're on a different type of schedule from other people. Meetings cost them more.

There are two types of schedule, which I'll call the manager's schedule and the maker's schedule. The manager's schedule is for bosses. It's embodied in the traditional appointment book, with each day cut into one hour intervals. You can block off several hours for a single task if you need to, but by default you change what you're doing every hour.

When you use time that way, it's merely a practical problem to meet with someone. Find an open slot in your schedule, book them, and you're done.

Most powerful people are on the manager's schedule. It's the schedule of command. But there's another way of using time that's common among people who make things, like programmers and writers. They generally prefer to use time in units of half a day at least. You can't write or program well in units of an hour. That's barely enough time to get started.

When you're operating on the maker's schedule, meetings are a disaster. A single meeting can blow a whole afternoon, by breaking it into two pieces each too small to do anything hard in. Plus you have to remember to go to the meeting. That's no problem for someone on the manager's schedule. There's always something coming on the next hour; the only question is what. But when someone on the maker's schedule has a meeting, they have to think about it.

For someone on the maker's schedule, having a meeting is like throwing an exception. It doesn't merely cause you to switch from one task to another; it changes the mode in which you work.

I find one meeting can sometimes affect a whole day. A meeting commonly blows at least half a day, by breaking up a morning or afternoon. But in addition there's sometimes a cascading effect. If I know the afternoon is going to be broken up, I'm slightly less likely to start something ambitious in the morning. I know this may sound oversensitive, but if you're a maker, think of your own case. Don't your spirits rise at the thought of having an entire day free to work, with no appointments at all? Well, that means your spirits are correspondingly depressed when you don't. And ambitious projects are by definition close to the limits of your capacity. A small decrease in morale is enough to kill them off.

Each type of schedule works fine by itself. Problems arise when they meet. Since most powerful people operate on the manager's schedule, they're in a position to make everyone resonate at their frequency if they want to. But the smarter ones restrain themselves, if they know that some of the people working for them need long chunks of time to work in."



"When you're operating on the manager's schedule you can do something you'd never want to do on the maker's: you can have speculative meetings. You can meet someone just to get to know one another. If you have an empty slot in your schedule, why not? Maybe it will turn out you can help one another in some way.

Business people in Silicon Valley (and the whole world, for that matter) have speculative meetings all the time. They're effectively free if you're on the manager's schedule. They're so common that there's distinctive language for proposing them: saying that you want to "grab coffee," for example.

Speculative meetings are terribly costly if you're on the maker's schedule, though. Which puts us in something of a bind. Everyone assumes that, like other investors, we run on the manager's schedule. So they introduce us to someone they think we ought to meet, or send us an email proposing we grab coffee. At this point we have two options, neither of them good: we can meet with them, and lose half a day's work; or we can try to avoid meeting them, and probably offend them. "

"Those of us on the maker's schedule are willing to compromise. We know we have to have some number of meetings. All we ask from those on the manager's schedule is that they understand the cost."




Monday, February 6, 2012

Understanding Force Quit On The Mac

How many times have you had an application go haywire and then needed to "Force Quit".  Ever wondered what that means and why it is necessary?  You probably thought,  "why can't I just close the app and let it die?"   For those folks with a deep need to tinker and understand, this blog post is for you.

One of the greatest things Apple ever did was to decide to bring OSX to the macintosh.  OSX is based on the Unix operating system. Specifically, it's based on the NeXTSTEP OS which was a very special version of Unix tailored by Steve Job's NeXT corporation.

All versions of Unix allow "Pre-Emptive MultiTasking" which means many different processes can by many different users at the same time.  Apple OS X,  Linux, Sun Solaris, Cray Unicos, IBM AIX, HP uX, and any other version of Unix will support this feature.  The wonderful thing about this is that you can have one user running one process and another user running another process and they won't normally interfere with each other.

You actually can see this if you open a Terminal.  On your Mac, open Terminal and type "ps".  The "ps" command will show you all the processes that are running.

Every process has a "Process ID" that is given to it.  It also will have a parent process and the process ID of the parent is shown as well.

Though, sometimes, things go wrong. Sometimes a process will find a way to hog system resources or behave erratically. Sometimes, a process would go so wrong, that you had to force it to die.  For this reason, Unix needed a command to talk to send messages to the process, and, if necessary, shut the process down. So, the "kill" command was created.


Kill takes a "signal" which is sent to the process. If you just type "kill" and your process ID, that signal will be "SIGTERM" which tells the process to terminate. Though, if the process is really wedged tight, that won't be enough. So, there is a more lethal and powerful signal, "SIGKILL" which can not be ignored.  In unix, each signal has a number. For "SIGKILL" the number is 9 so a SIGKILL is usually referred to as a "kill -9".


When you are doing a "Force Quit" on the Mac, this is exactly what you are doing.  It's a "kill -9" wrapped in a nice user interface.  Though, if you wanted to play Unix Nerd, you could do the same thing from a shell.

The Kill Command

The Kill Command used to send a signal to a process. The signal sent might not necessarily be to terminate execution. The following table is a list of some of the signals supported.
SIGNAL NUMBER DEFAULT EVENT Explanation
HUP 1 Exit Hangup Tells the program to reread all of its configuration files.
INT 2 Exit Interrupt
QUIT 3 Core Quit Terminates Program and leaves a core file.
ILL 4 Core Illegal Instruction
TRAP 5 Core Trace/Breakpoint Trap
ABRT 6 Core Abort
EMT 7 Core Emulation Trap
FPE 8 Core Arithmetic Exception
KILL 9 Exit Killed Cannot be caught or ignored.
BUS 10 Core Bus Error When used with Celpaint, will cause it to save out the planes.
SEGV 11 Core Segmentation Fault Will cause Softimage, Maya and Photoshop to save out and then exit.
SYS 12 Core Bad System Call
PIPE 13 Exit Broken Pipe
ALRM 14 Exit Alarm Clock
TERM 15 Exit Terminated Terminates, but is more gentle. It gives the process a chance to clean up. This is the default.
USR1 16 Exit User Signal 1 Causes the font server to re read the configuration file.
USR2 17 Exit User Signal 2 Causes the font server to fluch the font cache.
CHLD 18 Ignore Child Status Changed
PWR 19 Ignore Power Fail/Restart
WINCH 20 Ignore Window Size Change
URG 21 Ignore Ugrent Socket Condition
POLL 22 Exit Pollable Event
IO 22 Exit input/output possible signal
STOP 23 Stop Stopped (Signal)
TSTP 24 Stop Stopped (User)
CONT 25 Ignore Continued
TTIN 26 Stop Stopped (tty input)
TTOU 27 Stop Stopped (tty output)
VTALRM 28 Exit

Saturday, February 4, 2012

Uploading To YouTube From The iPhone

While working on an iPhone application, I wanted to add the ability to share videos on YouTube.  Since the iPhone comes with a YouTube application, I expected this to be pretty easy. What I found was that, although not terrible, there were more options for doing this than I expected. The choices you make depend on the amount of integration you want with your application.  If you are looking at a similar scenario, here are some options to consider.

1) Have Users Upload From A Photo Album
By far, the simplest way to upload a video to YouTube from your iPhone is to make use of the built-in "Send To YouTube" button in the photo albums. You can have your application save the movie to the phone, and then have the user share it from there.  Making your application save a movie to the phone is pretty easy and can be done with the following line of code.

if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (pathToMovieFile))
{
    UISaveVideoAtPathToSavedPhotosAlbum (pathToMovieFile, nil, nil, nil);
}

Once the movie is saved, the user needs to share it from their album.   To do this, they click on the "Pictures" icon on the phone and go to "Camera Roll"





You can then browse to the video you want to upload.  When you find it, click on the "Send To YouTube Button". Your phone will guide you through uploading the video.


First, it asks you to log in to your YouTube account. Generally, this is a GMail account.


Once you enter your credentials, you are taken to a very nice page to enter information about your video and upload it. 


Once it is done, you'll get a confirmation that the movie uploaded. The nicest thing about all this is that you don't have to write any more code than what it took to create and save the movie file. The YouTube login dialog and details page all are handled by the phone.

2) EMail The Video To YouTube Mobile
YouTube has a nice feature that allows you to get an e-mail address that will publish videos for you. You simply send e-mail to this address, and it appears on your YouTube channel.  To do this, you need to be able to send your movie as an e-mail.  You could use the above example and simply use the "EMail Video" button. Though, if you wan to be a bit more deluxe, you could have your application spawn the e-mail message with the address already filled out.  Sending an e-mail from the phone is pretty straight forward using the MFMailComposeViewController class.  Rather than put all the code here, there is a great Apple Example you can reference.

Of course, you'll need to know the YouTube address for your user.  You get it from the YouTube web site under "Mobile Setup" in your account settings.  I could walk you through this, but it's easier to let YouTube explain in the following video.



3) Full You Tube Integration With Your Application
The most deluxe, and also the most difficult you can choose is to write code to  integrate YouTube into your application. For instance, you could have a "Share On YouTube" button in your application that walks the user through uploading their video.  This would provide the same experience as the first option, but do it entirely from within your application.  Essentially, you will need to implement all the code from Step #1 yourself in your application. This is considerably more work than the above options, but also provides the nicest experience for your user. 

Here is an example screen from our application.  We wanted the e-mail button to share the movie on e-mail, which also would provide YouTube sharing through the above options. We also added  a YouTube button which we wanted to give the same experience as option #1 above.  In this particular version, YouTube and Facebook were not complete yet, so they are marked as "Coming Soon".


If you want to go to this level of integration, you will need to download the Google Data API for Objective C. There is an SVN Command that will download the API code so you can use it from your project. Once you download the code, there is a YouTubeSample.xcodeproj that will help you get started.  There's a couple things you'll notice right away.

1) You'll need a Google Client ID for your application.  This can be obtained by going to the Google API's Dashboard.
2) You'll need a YouTube Developer Key for your application. This can be obtained from the YouTube Dashboard.

Once you have the above two things, you'll be able to run the Google/YouTube Sample that comes with the sample code. You can upload videos using multiple different YouTube/Google accounts. You can also view information about them.

The GDataAPI is going to give you some options on how you post your video and you are going to need to decide if you want to request these from your interface, or if you want to decide for the user.  Here is some Google example code that shows some of these options.

GDataYouTubeMediaGroup *mediaGroup = [GDataYouTubeMediaGroup mediaGroup];
[mediaGroup setMediaTitle:title];
[mediaGroup setMediaDescription:desc];
[mediaGroup addMediaCategory:category];
[mediaGroup setMediaKeywords:keywords];
[mediaGroup setIsPrivate:isPrivate];

In our case, we wanted to control these things so we didnt' ask the user. Though, they have the ability to change these things later by logging in to YouTube.

[Posting Not Yet Complete - This project is still in progress.   I'll post more as I work this out]