Fun with JetBrains TeamCity

clock March 9, 2008 16:34 by author csmith12

A friend and I have been working with TeamCity from JetBrains for the past week. I must say that I am impressed with the application so far. I do have a couple of issues I am still working out, but all and all, its a killer continuous integration server for free. Here are just a few of the questions that I have not been able to figure out from reading the documentation so far;

  1. How do I get the build agents to build applications that contain 3rd party project references without installing them on the build server or where the build agent is installed? Am I missing something that is taken for granted here?
  2. Is there any plug-ins/add-on's that will deploy the compiled output (artifacts) to a staging server automatically?

If any experienced TeamCity users read this, please point me in the right direction.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


An Idea For Old Computer Case

clock February 29, 2008 14:04 by author csmith12

I got this in email today and though it was funny. Also went well with the subject matter in the IRC channel I hang out in.

 

clip_image001

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Adding Glass Effect to Images

clock February 28, 2008 11:27 by author csmith12

I found a very nice article on Code Project that shows a simple implementation of a glass effect applied to an image. I thought I would credit the developer and link his code here for my future reference.

        public static Image DrawReflection(Image _Image, Color _BackgroundColor, int _Reflectivity)
        {
            // Calculate the size of the new image
            int height = (int)(_Image.Height + (_Image.Height * ((float)_Reflectivity / 255)));
            Bitmap newImage = new Bitmap(_Image.Width, height, PixelFormat.Format24bppRgb);
            newImage.SetResolution(_Image.HorizontalResolution, _Image.VerticalResolution);

            using (Graphics graphics = Graphics.FromImage(newImage))
            {
                // Initialize main graphics buffer
                graphics.Clear(_BackgroundColor);
                graphics.DrawImage(_Image, new Point(0, 0));
                graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
                Rectangle destinationRectangle = new Rectangle(0, _Image.Size.Height, _Image.Size.Width, _Image.Size.Height);

                // Prepare the reflected image
                int reflectionHeight = (_Image.Height * _Reflectivity) / 255;
                Image reflectedImage = new Bitmap(_Image.Width, reflectionHeight);

                // Draw just the reflection on a second graphics buffer
                using (Graphics gReflection = Graphics.FromImage(reflectedImage))
                {
                    gReflection.DrawImage(_Image, new Rectangle(0, 0, reflectedImage.Width, reflectedImage.Height),
                    0, _Image.Height - reflectedImage.Height, reflectedImage.Width, reflectedImage.Height, GraphicsUnit.Pixel);
                }
                reflectedImage.RotateFlip(RotateFlipType.RotateNoneFlipY);
                Rectangle imageRectangle = new Rectangle(destinationRectangle.X, destinationRectangle.Y,
                    destinationRectangle.Width, (destinationRectangle.Height * _Reflectivity) / 255);

                // Draw the image on the original graphics
                graphics.DrawImage(reflectedImage, imageRectangle);

                // Finish the reflection using a gradiend brush
                LinearGradientBrush brush = new LinearGradientBrush(imageRectangle,
                       Color.FromArgb(255 - _Reflectivity, _BackgroundColor),
                        _BackgroundColor, 90, false);
                graphics.FillRectangle(brush, imageRectangle);
            }

            return newImage;
        }
Link to the original article. http://www.codeproject.com/KB/GDI-plus/Image-Glass-Reflection.aspx

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Explorer Addin for Visual Studio

clock February 8, 2008 13:14 by author csmith12

Just wanted to post a link to a nice addin for visual studio 2005. This little addin will give you some easy browser and explorer tools right from the solution explorer. Check out the tool for yourself (http://www.codeproject.com/KB/cs/Explorer.aspx).

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


My Development Environment

clock January 28, 2008 14:41 by author csmith12

I posted this on my old blog, but it somehow didn't get migrated to this new one. So I am posting again for those who asked.

Machine:
Dell Precision M70
CPU: P4
Mem: 2GB
HD: 100GB (10k RPM)
Dual 21'' LCDs running max resolution (1920x1200)

Software:
Visual Studio 2005
Visual Studio 2008
Jet Brains Reshareper (can't live without)
Reflector
NUnit (download the free jet brains unit test runner)
Explorer In windows Visual Studio Addin

 

I will add more to this list as well as links but, I am out of time.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Basic Thumbnail with Aspect Ratio Preservation

clock January 28, 2008 14:24 by author csmith12

While working different applications, you will need to preserve aspect ratio of images while creating a high quality thumbnail. There are plenty of examples of this on various sites, so I figure one more will not hurt.

[TestFixture]
public class ImageResizingTestFixture
{
    [Test]
    public void TestResizeImageFromMemoryStream()
    {
        Graphics g;

        // create a source bitmap image
        Bitmap source = new Bitmap(500, 500);

        g = Graphics.FromImage(source);

        // draw a background color
        g.FillRectangle(new SolidBrush(Color.Red), 0, 0, 500, 500);
        g.DrawEllipse(new Pen(Color.White), 0, 0, 50, 50);

        // call private thumb
        Bitmap thumbnail = CreateThumbnail(source, 177, 103);

        // save image as stream
        MemoryStream sourceStream = new MemoryStream();
        source.Save(sourceStream, ImageFormat.Jpeg);
        sourceStream.Position = 0;
    }

    private static Bitmap CreateThumbnail(Image source, int width, int height)
    {
        // get the new size
        Size size = GetResizeDimensions(source.Width, source.Height, width, height);

        // create thumbnail holder
        Bitmap thumb = new Bitmap(width, height);
        Graphics g = Graphics.FromImage(thumb);

        // set graphic options
        g.CompositingQuality = CompositingQuality.HighQuality;
        g.SmoothingMode = SmoothingMode.HighQuality;
        g.InterpolationMode = InterpolationMode.HighQualityBicubic;

        // draw the source onto the thumbnail

        g.DrawImage(source, 0, 0, size.Width, size.Height);

        g.Dispose();

        return thumb;
    }

    public static Size GetResizeDimensions(int currentWidth, int currentHeight, int desiredWidth, int desiredHeight)
        {
            double liChange;
            int newHeight;
            int newWidth;

            if (currentHeight == currentWidth)
            {
                // image is square...
                // we can use either height or width to resize....
                // use height
                liChange = 1.0 * desiredHeight / currentHeight;
                newHeight = (int) (currentHeight * liChange);
                newWidth = (int)(currentWidth * liChange);
            }
            else if (currentHeight < currentWidth)
            {
                // image is landscape...use width to resize
                liChange = 1.0 * desiredWidth / currentWidth;
                newHeight = (int) (currentHeight * liChange);
                newWidth = desiredWidth;
            }
            else
            {
                // image is portrait...
                liChange = 1.0 * desiredHeight/currentHeight;
                newHeight = desiredHeight;
                newWidth = (int)(currentWidth * liChange);
            }

            if (currentHeight <= desiredHeight & currentWidth <= desiredWidth)
            {
                newHeight = currentHeight;
                newWidth = currentWidth;
            }

            return new Size(newWidth, newHeight);
        }
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


One step closer to SharePoint Development without SharePoint Designer

clock January 23, 2008 20:50 by author csmith12

I was browsing today and ran across this little nugget http://www.codeplex.com/spdevexplorer. I am still testing and have found it cannot edit all SharePoint types, but hey...

screen2.png

This allows for editing of SharePoint content and structure from within visual studio. Although SharePoint designer is not 100% bad, it leaves a lot to be desired.


Check it out for yourself.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Easy Creme Brulee

clock January 20, 2008 14:22 by author csmith12

I found the recipe on http://www.cdkitchen.com and its pretty simple, and is great.

Ingredients

2 cups heavy cream
5 egg yolks
1/2 cup sugar
1 tablespoon vanilla extract
1/2 cup or so of light brown sugar

How to put it together

Preheat oven to 275 degrees.
Whisk the cream, egg yolks, sugar, and vanilla extract together in a bowl. Mix it all up until it gets nice and creamy.
Pour this mixture into ramekins (those little ceramic dishes). I got it evenly distributed between 4 7-ouncers.
Place the ramekins in a baking pan Fill the baking pan with hot water, about halfway up the sides of the ramekins.
Place the pan with the ramekins in the oven for 45 minutes to an hour or so.
After 45 minutes or so check them every ten minutes. You'll know they're done when you can stick a knife in one and it comes out clean.
Remove the ramekins from the baking pan, set them on the counter, and let them cool for 15 minutes or so.
Then put them in the refrigerator and let them chill overnight.
Sprinkle a thin layer of the light brown sugar on the top of each. Make sure it's a THIN layer, but also make sure it completely covers the custard.
Now torch it! Or, if you don't have a torch, you can supposedly put them under the broiler for a minute or so. The point is, you need to caramelize (melt and let harden) the sugar.

Credit: http://www.cdkitchen.com

Enjoy

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Alt-Tab Replacement for Windows XP

clock January 15, 2008 14:34 by author csmith12

A friend of mine was sitting at my desk while I was working and seen me alt-tab. I have an alt-tab replacement installed from http://www.ntwind.com/taskswitchxp/.

TaskSwitchXP Start Panel style

This is pretty cool for Windows XP. So I thought I would share with everyone else.

 

Enjoy

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


TreeSize - Disk Usage Tool (Free)

clock January 13, 2008 18:16 by author csmith12

A couple of friends of mine have been downloading like mad. And not all of them are very technical pc users, but are downloading some very large files. So in order to help them out, I am linking a great tool to view the disk usage of your hard drive. http://www.jam-software.com/freeware/index.shtml 

TreeSize is an excellent tool for visualizing the usage your hard drive on a directory basis. The provides invaluable to non technical users who don't have all their downloads organized very well.

Special thanks to the guys/gals at Jam Software for making this tool free.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


QOTD

Sometimes... opening a project in visual studio is like opening a jar of farts.

- Reactor

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Sign in