Javascript Plugin Detector code

I spent the day searching for a good solution to detecting plugins such as Shockwave, Flash, Quicktime, etc. The final solution was using http://www.pinlady.net/PluginDetect/. It was as easy as generating the javascript file, adding it to my solution, and adding the following script to my page. <![CDATA[ PluginDetect.getVersion(‘.’); var v = PluginDetect.getVersion(‘Flash’); var isInstalled = (PluginDetect.isMinVersion(‘Flash’, ‘0’) >= 0 ? true : false); if (isInstalled) document.write(“Adobe Flash (” + v + “) is installed.”) else document.write(“Adobe Flash is disabled. Get Adobe Flash.”) ]]>

Custom quote widget for Blogger

On a blog that I have I wanted to have a list of custom quotes that I could have displayed at the top of my blog.  After a bit of searching I came upon this link to a site with a simple widget that did the job.  Here is the code as well.  The only change that I made to it was to add the  to change the color to better match my theme.

http://wishingdoesntmakeitso.blogspot.com/2008/09/quote-widget-for-blogger.html

    
var quotecounter = 0;
var m
/**********************************************************
This code is meant to be installed as an "html/javascript" gadget on a blogger blog.
**********************************************************/
/***************************************************
This code is coprighted by Gove Allen, Ph.D.
Non-comercial use of this code is permiotted provided
that any additions or modifications made are also
made freely available for non-comercial use. For
all use, this comment must remain intact.
For commercial use, contact Gove Allen at
http://gove.net
****************************************************/
var quotes = new Array(); var author = new Array(); var second = new Array()
/*-------------- User Configuration --------------*/
/* the next line allows you to control whether the
link shows to allow the user to pop up a windows
showing all the quotes. Just put the text you want
to show for link in the quotes*/
var labelForAllQuotes = 'View my quotes';

/*-------------- add quotes here --------------*/
/* The first parameter is the number of seconds
the quote should display/ The second is the name
of the person who said the quote. The third is the
quote itself. The second and third are delimited by
either a single quote(') or a double quote ("), you
choose. However, you cannot put the same kind of
delimiter insite the argument that is used to delimit
the argument.*/

q(100, 'Albert Einstein', 'If at first the idea is not absurd, then there is no hope for it.')
q(100, 'Lord Chesterton', 'There are no uninteresting things; there are only uninterested people.')

//-------------- No user-configurable parameters below this line --------------
m = quotecounter;
quotecounter = 0;
function q(secs, auth, quote) {
quotes[quotecounter] = quote
author[quotecounter] = auth
second[quotecounter] = secs
quotecounter = quotecounter + 1
}
function putquote() {
document.getElementById('quotetext').innerHTML = quotes[quotecounter];
document.getElementById('author').innerHTML = author[quotecounter];
document.getElementById('allQuotes').innerHTML = '' + labelForAllQuotes + '';
setTimeout("putquote()", second[quotecounter] * 1000)
quotecounter = quotecounter + 1
if (quotecounter >= m) { quotecounter = 0 }
}
function showQuotes() {
var w = window.open('', 'Quotes', 'toolbar=0,location=0,menubar=0,width=600,height=600,scrollbars=1')
w.document.write('');
w.document.write('Quotes');
w.document.write('');
w.document.write('
');
var o = '"
for (x = 0; x < m; x++) {
w.document.write(o);
w.document.write(quotes[x]);
w.document.write(c);
w.document.write(o2);
w.document.write(author[x]);
w.document.write(c2);
}
//w.document.write(>
"
var c2 = "
';
var o2 = '
';
var c = "
');
w.document.write('');
w.document.close();
}



















putquote()


PRG (Post, Redirect, Get) Pattern

What is the PRG Pattern?

While the PRG pattern isn’t new, there isn’t much out there on it for the .NET community. PRG stands for “Post/Redirect/Get”, I’ll let Wikipedia explain the rest:

instead of returning an HTML page directly, the POST operation returns a redirection command (using the HTTP 303 response code (sometimes 302) together with the HTTP “Location” response header), instructing the browser to load a different page using an HTTP GET request. The result page can then safely be bookmarked or reloaded without unexpected side effects.

While this could be accomplished in webforms, it would be much more difficult since the postback model hangs on pages posting to themselves to implement button clicks and the like. The MVC Framework on the other hand makes the implementation of the PRG pattern extremely easy.
See rest of article written by devlicio.us ….

Questions to get answered when interviewing for a job.

When it comes time to look for a new job here is a few questions that will be good to find out.

Good characteristics in a new company:

  • Ability to offer dependability and stability to an employee looking for a place to stay for the long term.
  • Financially stable.

Development enviroment:

  • SDLC
  • What software and/or tools are used?
  • What version control system is used?
  • What kind of project manangement structure is used and what tools are used to maintain it?
  • How do you ensure the quality of your products?

Development team:

  • How big is the team?
  • What skill levels are people at?
  • Where would you fit into the team?
  • What was the turnover in your team and company in the last year? Why did people leave?
  • How often and for what reasons is a person expected to work overtime?
  • What kind of development environment does the company have? Flexible, ridgid, laid back, etc.
  • Will my personal work practices be acceptable or will I be expected to conform to the rest of the team?
  • What does the team do for learning new skills? Training? Education? Shows? Conferences?
  • What was the last training that the company invested in for their developers?
  • How is conflict between developers handled?
  • How is conflict between developers and business users handled?

Joel test:

  • Ask the questions and find out what they will admit to.
  • If you can find an employee or former employee ask them to take the Joel test for the company.


Video: Design Fundamentals for Developers

This is a video (http://videos.visitmix.com/MIX09/02W) of a presentation by Robby Ingebretsen (http://nerdplusart.com/). The video gave a great overview of the process of design in general. Much of what I saw really resonated with the current way that I do software design as a developer. It is one that will be worth watching again someday.

The biggest takeaways that I got from the video is the series of planning documentation that he recommends for doing design and the breakdown of the types of designers that are involved in the design process.

Of all the design types the ones that resonated with me were the information architect and the user interface designer.

Quotes:
The alternative to good design is bad design, not no design at all.
…design is used to bring order from chaos and randomness…

Books:
Elements of Graphic Design by Alex White
How to think like a great Graphic Designer by Debbie Millman

ToDo:

  • Research Information Architecture
  • Break down his planning documentation and start using what I can
  • Look into training for any tools to use for the documentation

Run command as if from DOS prompt

The following code snippet can be used to run a command as if you are opening a DOS prompt and typing it in.

public static string MyDOSMethod()
        {
            ProcessStartInfo si = new ProcessStartInfo("cmd.exe");
            si.RedirectStandardInput = true;
            si.RedirectStandardOutput = true;
            si.UseShellExecute = false;

            Process p = Process.Start(si);
            p.StandardInput.WriteLine(@"cd \windows\system32");
            p.StandardInput.WriteLine("exit");

            try
            {
                return p.StandardOutput.ReadToEnd();
            }
            catch (Exception e)
            {
                return e.Message;
            }
        }