The Windows 7 Taskbar

by James Archuleta

September/27/2009 22:10

The new Windows 7 taskbar is great. It's chock full new effects and goodies. If you've used windows 7 at all, then you're already aware of many of these features. What I'm going to show you is how you can add these same features to your programs and applications. Giving them a professional up-to-date feel. I'm not going to get too involved with demos since there are a ton of them on the web as well as demos. I’ll focus more so on the setup.

More...

Thumbnails in Blogengine.NET

by James Archuleta

August/12/2009 23:36

After searching the web and being unable to find one that works. I hacked up my own.

I had to change the Add Entry pages, as I was unable to make this happen using the extensions to blogengine.net, ideally there should be a better way to do this, but I was unable to find one.

Here's how I did it.

Add_entry.aspx (7.31 kb)


<asp:CheckBox ID="CheckBoxThumb" runat="server" Text="Generate Thumbnail" Checked="true" />

 

 

Add_entry.aspx.cs (14.10 kb)

if (CheckBoxThumb.Checked)
{
    string thumbPath = Server.MapPath(folder + relativeFolder);
    int width = 250; // you can change the size here
    GenerateThumbnail(thumbPath, fileName, width);
    img = string.Format("<a class="\"lightbox\"" 
        href="\"{0}image.axd?picture={1}\""> 
        <img src="\"{0}image.axd?picture={2}\"" alt="\"\" />", path, 
        Server.UrlEncode(relativeFolder.Replace("\\", "/"") + fileName),    
        Server.UrlEncode(relativeFolder.Replace("\\", "/"") + "thumb_"  
        + fileName));

    txtContent.Text += img;
    txtRawContent.Text += img;
}
else
{
    img = string.Format("&ltimg src="\"{0}image.axd?picture={1}\""
       alt="\"\"" />",
path, Server.UrlEncode(relativeFolder.Replace("
\\", "/") + fileName)); txtContent.Text += img; txtRawContent.Text += img; }
private void GenerateThumbnail(string path, string filename, int width)
{
    using (Image orig = Image.FromFile(path + filename))
    {
        this.GenerateThumbnail(orig, new Size(width, 
               CalculateHeight(orig, width)), 
               GetFormat(filename), path + "thumb_" + filename);            
    }
}

private void GenerateThumbnail( System.Drawing.Image orig, 
                Size size,ImageFormat format, 
                String location)
{
        System.Drawing.Image.GetThumbnailImageAbort callback = new 
System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback); System.Drawing.Image img = orig.GetThumbnailImage(size.Width, size.Height, callback, IntPtr.Zero); img.Save(location, format); } private static ImageFormat GetFormat(string filename) { if (filename.EndsWith("jpg") || filename.EndsWith("jpeg") || filename.EndsWith("tiff")) return ImageFormat.Jpeg; return ImageFormat.Png; } private static int CalculateHeight( System.Drawing.Image img, double desiredWidth) { double power = img.Width / desiredWidth; return (int)(img.Height / power); } private bool ThumbnailCallback() { return false; }

The whole thing came out really nice. I also added the Jquery Lightbox plugin. for the images.

Trying out flock

by James Archuleta

August/12/2009 02:38

I decided to try out a new web browser.  Although my trusty Firefox has never given me any problems. I like to see what else is out there. What I like about it is that it seems to work with my Firefox extensions.  I don't know what I'd do without my StumbleUpon Flock is aimed at social networking, and I must admit it definitely makes want to check my social networks, namely Facebook and twitter. It also has a built in Blog Editor so I can blog right from my browser.

http://www.flock.com/images/template/logo.gif

Blogged with the Flock Browser

Conversion To BlogEngine.Net

by James Archuleta

August/2/2009 19:14

So I've finally moved away from Drupal. It was much nicer in a Linux environment, but now that move to a new host for .Net stuff. It makes sense that I should switch to new CMS system. Also I love working .NET as opposed to PHP.

I've still got a lot go as far as restoring my old Post and getting everything configured correctly.

I think my first project is to make my own theme, something that I never quite got around to doing before.

Keeping the Peace

by James Archuleta

May/4/2009 22:21

I tend to be a very argumentative person. But lately I've noticed that this has a negative affect on those around me.

Luckily I've stumbled upon this article called 10 things to say to keep the peace. Its a great way to stop the fight before it happens, whether it be your parents, friends, or co-workers.

Let me summarize the key phrases that will help you keep the peace.

1. "Thank you for your opinion. I'll think about it." When people give you unsolicited advice.

2. "Is this a good time for you?" This one is great for talking to people who are really busy or have a tendency to ignore you.

3. "Would you like my thoughts?"
Offering constructive criticism is much easier to deal when its up to the person to decide.

4. "Why don't we get the facts?"
Stop an argument before it happens. Get the facts.

5. "I need your help. Can you please...?"
Just a friendly reminder for people who arn't pulling their weight.

6. "Let's wait on this until we have more information."
Before having an argument, make sure you have the information. otherwise you may find yourself arguing just to argue.

7. "What did you mean by that?"
It's so easy to jump to conclusions, but you know what they say about assuming. Next time try to understand the message the other person is sending.

8. "I don't like that, so why don't we do this instead?"
Rather than complaining or straight-up disagreeing with someone's idea, offer an alternative.

9. "I'm sorry you're upset."
Instead of saying "I told you so" try to sympathize with your partner.

10. "Let me get back to you."
When your put on the spot, its okay to take some time to think about it.

Ultimately, whats more important then the words is how you say them and the meaning behind them. Try to consider the other person, and take the focus off yourself.

 

Catch a Fly - Game

by James Archuleta

April/21/2009 00:02

This is the final project I did for a flash class. Everyone focues on animations and Web pages. I wanted to make a game.  And Sure, it's not that involved of a game. But its a cool project none the less. This is my first flash game.

Try Clicking on the outlets or the cat.

Hold down the 'W' key if you have problems.

More...

Mortgage Calculator

by James Archuleta

January/7/2009 22:03

This is a projects that I originally did in October of 2008 for a Visual Basic class. It turned out really nice so i'm posting it up here.

You can see the working demo here.

Or download the source MortCalc.zip (1.05 mb)