Never Argue With Stupid People

Writing to the Output Window VS 2010

by admin on Jun.29, 2010, under config

I have been wondering forever how to write text to the output console in Visual Studio. Apparently I have been using the wrong search terms, because it turns out that it is quite simple.

 

using System.Diagnostics;

 

public static void Main(String[] args)

        {

            Debug.WriteLine(" ------------------> THIS IS SOME OUTPUT TEXT ");

        }

Pretty much as simple as that.

Post to Twitter Tweet This Post

Leave a Comment :, more...

Custom WordPress Theme

by admin on May.01, 2010, under Design, Projects, development

So I have decided to take a crack at creating a WordPress Theme:

wp_theme

Not much to it yet, but I like the look so far.

Post to Twitter Tweet This Post

Leave a Comment : more...

Javascript Image rotator

by admin on Apr.18, 2010, under Javascript, Programming

Javascript Image Rotator

by admin on Apr.18, 2010, under Uncategorized

Wow. Time flies. I wrote a quick and dirty image rotator to help out someone on Bleeping Computer. I could have done it in a single function, but Firefox complained about ‘too much recursion’. Weird.

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 

<head>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

<title>Javascript Image Rotator</title>

 

    <script type="text/javascript">

    

    var images =['img1.jpg',

                 'img2.jpg',

                 'img3.jpg'],

        i=0; 

    

    function chImage(){

        document.getElementById('images').src = images[i];

        i+=1;

        

        if(i === images.length){

           i=0;

        }

        timeOut();

    }

    

    function timeOut(){

        setTimeout('chImage()', 1000);      

    }

    

    </script>

</head>

 

<body onload="chImage()">

    <div>

       <img id="images" src=""/>

    </div>

</body>

 

</html>

Yes, I realize also that I didn’t create a proper img tag.

Post to Twitter Tweet This Post

Leave a Comment :, , more...

Javascript Link Rotator

by admin on Mar.05, 2010, under Javascript, Programming, development

I run across this question quite a bit. people want to rotate links, or images, or colors, etc. on their websites, and they seem to get really confused by all the examples they find. That is sort of a shame because it is really pretty simple. Here is the code for rotating urls:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
   <title>Rotator</title>
      <script type="text/javascript">
        var i=0,
            links = ['http://www.groovicus.com', 'http://www.bing.com', 'http://www.microsoft.com/student/en/us/rally/'],
            seconds = 10;

        function rotator(){
           setTimeout("changeLink()", 1000 * seconds);
        }

        function changeLink(){
           document.getElementById('myDiv').innerHTML = '<a href='+links[i]+'>' + links[i] + '</a>';
           i+=1;            
           if(i===links.length){
              i=0;
           }
           rotator();        }
       </script>
</head>
<body onload="rotator()">
   <div id="myDiv">
      Links will go here
   </div>
</body>
</html>
So by way of an explanation as to how this works. At the top are declared some variables. Ii is the counter we use to traverse the array of links. Links is the array of links, and seconds is the amount of time we want between rotations. I have it set for 10 seconds.
When the page loads, the onload attribute in the body tag tells rotator() to run. Inside the rotator function is a simple setTimeout statement. All this says is that after some amount of time (1000 * seconds), run the changeLink() function. The change link sets the inner content of the div, increments the counter, and calls the rotator function. Before it does, it makes sure that we have not reached the end of the array. If we have, it resets the counter back to zero.
“Well,” you ask, “this works great for links, but what if I want to rotate images?” That is pretty simple too, it just requires some minor modifications of the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
   <title>Rotator</title>
      <script type="text/javascript">
        var i=0,
        links = ['http://www.groovicus.com/wp-content/uploads/2010/03/rally_march_title.png',                      
                 'http://teambeachbody.com/image/image_gallery?uuid=ddad005a-8672-4dba-a446-e44ab34c1a59&groupId=10137&t=1261526318568',
                 'http://i2.cdn.turner.com/nascar/2010/news/headlines/cup/03/05/preview.cup.atlanta/cuppreview.665.jpg'],
        seconds = 5;

        function rotator(){
           setTimeout("changeLink()", 1000 * seconds);
        }

        function changeLink(){
           document.getElementById('myDiv').innerHTML = '<img src='+links[i]+' alt="image_"'+ i +' ></img>';
           i+=1;
           if(i===links.length){
              i=0;
           }
           rotator();
        }
      </script>
</head>
   <body onload="rotator()">
      <div id="myDiv">
         Images go here.
      </div>
   </body>
</html>
That’s pretty much all there is to it.


Post to Twitter Tweet This Post

Leave a Comment : more...

Dress For Success

by admin on Mar.02, 2010, under Microsoft

Student Rally Challenge “Dress for Success”

Project Overview:

You’re in school preparing for your career. So show us the job you want by taking a picture of yourself dressed for success in that career. We’re not going to judge you based on which career you choose, but how you capture the spirit of that job and your own enthusiasm towards your future.

Dress for Success

Each month, we’ll host a new Rally challenge. The top five students each month will win a prize.
The top ten each month qualify to compete in the final challenge for the chance to win
$10,000scholarship.

Here is how

http://www.microsoft.com/student/en/us/rally/

Post to Twitter Tweet This Post

Leave a Comment : more...

Students 2 Business

by admin on Feb.01, 2010, under Microsoft

Hi All,

As a Microsoft Student Partner, I have the inside track on the best student resources that Microsoft has to offer. And I want to share them with you.

Today, I urge you to check out Microsoft Students to Business (S2B). Why? Because, like me, you’re probably either looking for a job, or for experience/internship so that you can land a job when you graduate. S2B offers students:
• free training (everyone needs skills in today’s hyper-competitive job market)
• free software (how can you practice those skills without software?)
• experience (projects, internships)
• JOBS!!! (Microsoft’s partners post 1000’s of jobs for entry-level candidates)

Microsoft S2B isn’t just a job site. It’s a launching pad for your career. With free Software, Skills, and Experience up for grabs, you can get everything you need to set yourself apart from the pack. And with plenty of access to jobs and internships, you can take your new arsenal of know-how and land the job of your dreams. Don’t postpone success, register today: http://s2b.experience.com

Joining is easy, just fill out the quick/short registration form. If you have any questions…ask me!

Post to Twitter Tweet This Post

Leave a Comment : more...

Javascript dynamic listeners

by admin on Jan.23, 2010, under Uncategorized

This post is more of a record for me because I have run into the same issue several times. And the title is misleading because it should be more like assigning listeners to dynamically generated buttons of varying quantities. OR something like that. Anyway, for those that use Javascript allot, this is no-brainer territory. For me however….

Anyway, I am parsing datasets from biomart.org, and part of the data set contains a collection of attribute groups. Each attribute group has a button assigned to it that when clicked, displays attributes assigned to that particular group. I know, YAWN!

 

Here is my initial function that I was using to create the buttons and assign the listener:

function buildAttGroups(attData){

        var idLabel = attData[i].displayName.replace(" ", "_") + "_content",            button = new Y.widget.Button({                                id: attData[i].displayName.toUpperCase(),                                label: attData[i].displayName.toUpperCase(),                                container: attButtonGroup                                }                );

        //other irrelevant code

        button.on('click', function (e){ setVisibility(idLabel);});

    }

The problem here is that no matter which button I click, idLabel is always equal to the idLabel created when the last button was created. If you are coming from a java world, that may be a bit surprising because you may expect that each time a new button is created that a new listener is being assigned to it. From my understanding however, there is only one listener created, and it ends up being assigned to each button. Not at all what I want to happen.

The solution is simple. Create the listener in a separate function.

setVisibility(button, idLabel);

......

function setVisibility(button,label){

        button.on('click', function (e){                obj = document.getElementById(label);                obj.style.display = 'block';

             });

    }

Now next time I screw this up, I’ll remember what I need to do.


Post to Twitter Tweet This Post

Leave a Comment more...

I want to build a car. Where do I get started?

by admin on Jan.04, 2010, under Uncategorized

I saw this on Reddit the other day, and it reminded me of the rather unrealistic expectations people have when asking questions.

“I don’t want to build anything too complex. It doesn’t need an automatic transmission or air conditioning. I understand that most of you engineers have a few years of experience and education behind you, but, can you point me in the way of some quick tutorials? It has to be street legal and safe. I know nothing about cars or engineering. I’ve got a month to build it.

I got a steering wheel from a junker so I figure that I am halfway there already.”

Some of the replies were pretty funny also:

“Me 2. Plz send completed car to sunforum99@yahoomail.com.”

“I know where you can get one, but it only drives backwards, simply stops if you put it on an interstate and there are no locks on the doors. You could still fix it yourself, though.”


Post to Twitter Tweet This Post

Leave a Comment more...

User Experience

by admin on Dec.17, 2009, under Design, user experience

Last spring I was fortunate enough to attend MIX09 courtesy of the Microsoft Student Partners program. In addition top being blown away by the lavish surroundings, I also learned about this thing called User Experience. Truth be told, I was a little overwhelmed by my surroundings and all of the activity surrounding the conference that it was difficult to digest all of the information and hype, so it wasn’t until I got back to school that I was able to sort of think about what I had learned. When Bill Buxton unveiled this innovative product called Sketchflow and talked about how it would bring about better user experiences, I could see what an exciting app it was, and that it would clearly be fun to use. The emotional aspect was lost on me.

One of my professors teaches Human Factors, and I talked to him about what I had learned and seen, and we discussed this idea of user experience, and how important (as I had been told) that designers be brought in early into a project in order to provide a good user experience. We agreed at the time that this term, User Experience was just a new buzzword for human factors.

My last few blog posts were about a mobile application that I developed as part of an independent study that allowed me to study some of the special ‘problems’ associated with mobile application development. One of my main resources was Mobile Design and Development by Brian Fling, and in it he talked about the design process. I do recommend the book.

There were two concepts that struck me. The first was when he talked about not considering the inherent constraints of designing an application for a mobile device. At the time, it made no sense because I thought “why try to do something if I know the hardware can’t handle it.” The second concept was this idea of context. During this design phase, I need to consider how the app is going to be used, as well as where, when, and by who.

As I started thinking about my app, it became clear to me that I need to design it to be used in short bursts because a student would potentially be using it on the way to class, or during a walk in the park, for example. this meant that the system needed to do frequent saves the state of the application, and be easy to resume. Simple enough to do. I also want to make using the app a social event, so I want my user to be able to share data.

As I was considering all of these ideas, what I was really doing was systematically working through ideas that would make the application fun to use. It is sort of a no-brainer that regardless of the functionality an application provides, if it is painful to use, then nobody will want to use it. So what I was trying to do was make my application fun to use. It was at that point that I suddenly had a couple of revelations about software design.

First, while I was working through what I wanted the app to do, at no time did I consider whether or not the hardware could handle it. The first time that sketched out the design for my app, I spent too much time thinking about things like screen size, and navigation, etc., and I think that by considering the limitations of the hardware, I automatically limited how I thought about the functionality of the application. Clearly the time to worry about hardware limitations is during the development/implementation phase.

Finally, while HCI considers things like the physical and psychological capabilities of people when designing systems, user experience is much more encompassing because it considers the impact of emotion and context. As I said before, an application can have all of the functionality in the world, but if it isn’t any fun to use, then nobody will use it. If you can make an application fun, functional, and ‘sexy’, then you have a home run. Anyway, it changed how I view the design process.


Post to Twitter Tweet This Post

Leave a Comment :, , more...

Add Cards To Set

by admin on Nov.28, 2009, under Design, Mobile, development

GENERAL DESCRIPTION:
  • This is the screen where an actor can add cards to a set.
ACTOR:
  • The actor is a student.
GOAL:
  • The goal is to allow the actor to create a card set.
PRECONDITIONS:
  • The application must be running.
POST CONDITION:
  • The actor has successfully created a card and added it to a set.
SCREENSHOT:

image

OBSERVATIONS:

This iteration is terrible. There is too much happening on the screen, and there is no room for labels, so it is unclear what the user is supposed to do. There is a box for a save name, but I think the better idea would be to move that functionality to a different page. Some may expect that there would be the need for a ‘save’ button, or that it may be hidden under the menu button, but that is not the case. Since I expect the application to be used only for short bursts of time, every time a card is created, it is automatically saved, thus there is no need for a save button.

The second thing is that the edit card set screen and the create card set are nearly identical. By moving some of the functionality, I only need to create this form once.

REFINED SCREENSHOTS:

image                     image

This is better, but I just noticed that I forgot some functionality. There is no way to navigate to the next card in the set. Now I have to take an inventory of necessary functionality.

  • Back and Forward buttons: necessary because the user needs to be able to navigate back and forth in a card set.
  • Text Block for the question
  • Text Block for the answer

The only thing probably not needed is the breadcrumbs. I could place a button in between and drop the breadcrumbs, like so:

image

This is better, but I don’t like having the ‘Next’ button at the top because it breaks the flow. Order of operation should flow from top to bottom. However, moving all of the buttons to the bottom does not seem like a good idea either because then the navigation buttons are down by the function buttons; it seems that the potential for hitting the ‘Exit’ button instead of the back button is too great.

I looked back through some flash cards that I created using Index cards, and I noticed that generally, the answers were very short, and that the questions were not too terribly long either. This suggests a bit different layout that might be acceptable:

image

This layout works a bit better because now the ‘Next’ button is at the bottom where it makes sense, and it is also along the side so that it is easily operated with a thumb. There is also little danger of missing the button, and even if the user does, all they will do is hit the ‘Menu’ button. It also suggests some ideas for graphical design that may be interesting. So now the complete flow for the user is like this:

FINALIZED SCREENSHOTS:

image                          image


Post to Twitter Tweet This Post

Leave a Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!