Agile Zone is brought to you in partnership with:
DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
  • submit to reddit
Michael Mainguy10/08/14
4050 views
8 replies

Why OSX sucks and you should use Ubuntu instead

OK, I confess, I use OSX almost exclusively and have for a number of years now. I love the hardware, but the OS and specifically it's lack of a software package management tool has just a level of suckyness that irritates me.

John Cook10/08/14
1682 views
0 replies

The great reformulation of algebraic geometry

At the Heidelberg Laureate Forum I had a chance to interview John Tate. In his remarks below, Tate briefly comments on his early work on number theory and cohomology. Most of the post consists of his comments on the work of Alexander Grothendieck.

Tom Howlett10/07/14
4508 views
0 replies

Could we really be so wrong?

I hear developers talking of Right and Wrong. What would happen if we got better at describing Cost and Value?

Ayende Rahien10/07/14
1839 views
0 replies

Optimizing event processing

There is a migration process that deals with event sourcing system. So we have 10,000,000 commits with 5 – 50 events per commit. Each event result in a property update to an entity.

Alec Noller10/06/14
2138 views
0 replies

TeamForge 7.2: New Tools & Features for Agility (Not Just Agile)

There are a lot of ALM tools out there - so many that it can become a problem to keep it all straight, and it can be difficult to track information between platforms. That's the problem that the newest version of Collabnet's Teamforge, 7.2, aims to address: the interconnection of disparate tools.

<script type="text/javascript">
    window.onload = showTheTime;
    function showTheTime() {
        var now = new Date();
        document.getElementById("showTime").innerHTML = showTheHours(now.getHours()) + showZeroFilled(now.getMinutes()) + showZeroFilled(now.getSeconds()) + showAmPm();
        setTimeout(showTheTime, 1000);
        function showTheHours(theHour) {
            if (show24Hour() || (theHour > 0 && theHour < 13)) {
                return theHour;
            }
            if (theHour == 0) {
                return 12;
            }
            return theHour - 12;
        }
        function showZeroFilled(inValue) {
            if (inValue > 9) {
                return ":" + inValue;
            }
            return ":0" + inValue;
        }
        function show24Hour() {
            return document.getElementById("show24").checked;
        }
        function showAmPm() {
            if (show24Hour()) {
                return "";
            }
            if ((now.getHours() < 12)) {
                return " AM";
            }
            return " PM";
        }
    }
    
    </script>
Vinod Kumaar Ra...10/03/14
1234 views
0 replies

Pair Programming

If you want to walk fast, walk alone; if you want to walk far, walk together

Kevin Rutherford10/02/14
6942 views
0 replies

Where do conditionals come from?

I’ve listed out those origins of conditionals that I could think of. Is this a fool’s errand? Possibly, but let’s give it a try anyway.

Adam Diaz10/02/14
3753 views
0 replies

The Evolution of MapReduce and Hadoop

Recently I authored a section of the DZone Guide for Big Data 2014. I wrote about MapReduce and the evolution of Hadoop.

Steve Francia10/02/14
6247 views
2 replies

Evangelism is NOT Sales

I recently had a discussion with a CFO of a technology company. Ten minutes into our conversation he said, “so evangelism is pretty much rogue sales”. Internally I cringed. I politely corrected him that the two could not be further apart.

Naomi Witter10/01/14
455 views
0 replies

7 Remarkable Ways

This is for website or company who wanted to boost their social media presence.

Mike Cottmeyer10/01/14
3058 views
0 replies

Reframing to Reduce Risk

In my experience some risks for delivering these projects on time and on budget might be identified by a project manager early on in the initial inception phase of the project and might be reviewed at the end of each project, but not much attention is paid to the risks during the life of the project.

//Saving a Raster Image to TIFF with Deflate/Adobe Deflate Compression

// [C# Code Sample]

string sourceFilePath = myDir + "sample.bmp";
string destinationFilePath = myDir + "output.tiff";

//Create an instance of TiffOptions and set its various properties
TiffOptions options = new TiffOptions();
options.BitsPerSample = new ushort[] { 8, 8, 8 };
options.Photometric = TiffPhotometrics.Rgb;
options.Xresolution = new TiffRational(72);
options.Yresolution = new TiffRational(72);
options.ResolutionUnit = TiffResolutionUnits.Inch;
options.PlanarConfiguration = TiffPlanarConfigs.Contiguous;

//Set the Compression to AdobeDeflate
options.Compression = TiffCompressions.AdobeDeflate;
//Or Deflate
//options.Compression = TiffCompressions.Deflate;

//Load an existing image in an instance of RasterImage
using (RasterImage image = (RasterImage)Image.Load(sourceFilePath))
{
    //Create a new TiffImage from the RasterImage
    using (TiffImage tiffImage = new TiffImage(new TiffFrame(image)))
    {
        //Save the resultant image while passing the instance of TiffOptions
        tiffImage.Save(destinationFilePath, options);
    }
}

//[VB.NET Code Sample]

Dim sourceFilePath As String = myDir & "sample.bmp"
Dim destinationFilePath As String = myDir & "output.tiff"

'Create an instance of TiffOptions and set its various properties
Dim options As New TiffOptions()
options.BitsPerSample = New UShort() { 8, 8, 8 }
options.Photometric = TiffPhotometrics.Rgb
options.Xresolution = New TiffRational(72)
options.Yresolution = New TiffRational(72)
options.ResolutionUnit = TiffResolutionUnits.Inch
options.PlanarConfiguration = TiffPlanarConfigs.Contiguous

'Set the Compression to AdobeDeflate
options.Compression = TiffCompressions.AdobeDeflate
'Or Deflate
'options.Compression = TiffCompressions.Deflate;

'Load an existing image in an instance of RasterImage
Using image As RasterImage = CType(Image.Load(sourceFilePath), RasterImage)
	'Create a new TiffImage from the RasterImage
	Using tiffImage As New TiffImage(New TiffFrame(image))
		'Save the resultant image while passing the instance of TiffOptions
		tiffImage.Save(destinationFilePath, options)
	End Using
End Using

//Creating TIFF Image with Deflate/Adobe Deflate Compression

//[C# Code Sample]

string destinationFilePath = myDir + "output.tiff";

//Create an instance of TiffOptions and set its various properties
TiffOptions options = new TiffOptions();
options.BitsPerSample = new ushort[] { 8, 8, 8 };
options.Photometric = TiffPhotometrics.Rgb;
options.Xresolution = new TiffRational(72);
options.Yresolution = new TiffRational(72);
options.ResolutionUnit = TiffResolutionUnits.Inch;
options.PlanarConfiguration = TiffPlanarConfigs.Contiguous;

//Set the Compression to AdobeDeflate
options.Compression = TiffCompressions.AdobeDeflate;
//Or Deflate
//options.Compression = TiffCompressions.Deflate;

//Create a new TiffImage with specific size and TiffOptions settings
using (TiffImage tiffImage = new TiffImage(new TiffFrame(options, 100, 100)))
{
    //Loop over the pixels to set the color to red
    for (int i = 0; i < 100; i++)
    {
        tiffImage.ActiveFrame.SetPixel(i, i, Color.Red);
    }
    //Save resultant image
    tiffImage.Save(destinationFilePath);
}

//[VB.NET Code Sample]

Dim destinationFilePath As String = myDir & "output.tiff"

'Create an instance of TiffOptions and set its various properties
Dim options As New TiffOptions()
options.BitsPerSample = New UShort() { 8, 8, 8 }
options.Photometric = TiffPhotometrics.Rgb
options.Xresolution = New TiffRational(72)
options.Yresolution = New TiffRational(72)
options.ResolutionUnit = TiffResolutionUnits.Inch
options.PlanarConfiguration = TiffPlanarConfigs.Contiguous

'Set the Compression to AdobeDeflate
options.Compression = TiffCompressions.AdobeDeflate
'Or Deflate
'options.Compression = TiffCompressions.Deflate;

'Create a new TiffImage with specific size and TiffOptions settings
Using tiffImage As New TiffImage(New TiffFrame(options, 100, 100))
	'Loop over the pixels to set the color to red
	For i As Integer = 0 To 99
		tiffImage.ActiveFrame.SetPixel(i, i, Color.Red)
	Next i
	'Save resultant image
	tiffImage.Save(destinationFilePath)
End Using

//Loading TIFF with Deflate/Adobe Deflate Compression

//[C# Code Sample]

string filePath = "TIFF-Compression-Deflate.tif";

using (TiffImage tiffImage = (TiffImage)Image.Load(filePath))
{
   // do processing
}

//[VB.NET Code Sample]

Dim filePath As String = "TIFF-Compression-Deflate.tif"

Using tiffImage As TiffImage = CType(Image.Load(filePath), TiffImage)
   ' do processing
End Using
Alec Noller10/01/14
10927 views
0 replies

Dev of the Week: Itamar Haber

Every week here and in our newsletter, we feature a new developer/blogger from the DZone community to catch up and find out what he or she is working on now and what's coming next. This week we're talking to Itamar Haber, Chief Developers Advocate at Redis Labs.

Alec Noller10/01/14
16340 views
0 replies

The Best of DZone: September 23 - 30

If you missed anything on DZone this week, now's your chance to catch up! This week's best include 10 questions to ask in programming interviews, why we need functional programming, the high price of the Internet of Things, how testability does not equal good design, and more.

Johanna Rothman10/01/14
7320 views
2 replies

Change is Learning: No Silver Bullets or Quick Fixes

My professors taught me structured design and design by contract. Those were supposed to be the silver bullets for programming. I thought I was the only idiot that structure and specification didn’t work for. Why did I have to iterate and increment?

Gil Zilberfeld10/01/14
6970 views
0 replies

The Measure Of Success

What makes a successful project? Waterfall project management tells us it’s about meeting scope, time and cost goals. Do these success metrics also hold true to agile projects?

Chris Odell10/01/14
1763 views
0 replies

SOHO Agile – Practices make perfect

Now if you are a SOHO developer then you might think that agile practices are irrelevant to you. I would disagree.

Kevin Rutherford10/01/14
2315 views
0 replies

A problem with Primitive Obsession

A number of the teams I work with have been looking at the Primitive Obsession code smell recently. As we have explored legacy code looking for examples of the smell, I’ve noticed a tendency to enthusiastically label every primitive in any method signature as smelly. I so wish Fowler and Beck hadn’t used this particular name, because it seems to spread as much confusion as enlightenment.

Shelan Perera10/01/14
5206 views
0 replies

Want to learn anything faster?

We are in a world with lot of learning opportunities. But how much stuff do we really learn? What holds us back from learning new things faster?