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
Tinu Awopetu07/27/09
33597 views
3 replies

NetBeans IDE 6.7.1 with JavaFX Now Available for Download!

The NetBeans Team is pleased to announce the release of NetBeans IDE 6.7.1, which supports the latest JavaFX SDK. Download NetBeans 6.7.1 (A JavaFX-only download bundle is also available.) NetBeans IDE 6.7.1 is an update to NetBeans IDE 6.7 and includes the...

Rick Ross02/14/08
13327 views
16 replies

Welcome to DZone's new IndicZone community for Indian IT Pros

Let me welcome all of you to the new DZone community for one of the most important and fastest growing groups in the worldwide IT scene: Indian developers and IT professionals. No matter where you look, if something interesting is happening on the IT and...

Paul Andrews07/23/14
182 views
0 replies

Why Your Staff Should Be Allowed to Work from Home

As a business owner, you probably hear about telecommuting and having employees work from home fairly often. Your initial thought may be that allowing employees to work from home would be counterproductive and nothing but a hassle.

//[C# Code Sample]

Dictionary<string, Symbology> collection = new Dictionary<string, Symbology>();
collection.Add("ONE123", Symbology.Code39Standard);
collection.Add("Process Collection", Symbology.DataMatrix);
collection.Add("Dictionary Collection", Symbology.QR);
collection.Add("X06712AT", Symbology.Code128);
collection.Add("979026000043", Symbology.EAN13);
collection.Add("Aztec BarCode", Symbology.Aztec);

List<Bitmap> images = new List<Bitmap>();

foreach (KeyValuePair<string, Symbology> pair in collection)
using (BarCodeBuilder builder = new BarCodeBuilder())
{
    builder.CodeText = pair.Key;
    builder.SymbologyType = pair.Value;
    images.Add(builder.GenerateBarCodeImage());
}

int maxWidth = int.MinValue;
int sumHeight = 0;
foreach (Bitmap bmp in images)
{
    sumHeight += bmp.Height;
    if (maxWidth < bmp.Width)
        maxWidth = bmp.Width;
}

const int offset = 10;
Bitmap resultBitmap = new Bitmap(maxWidth + offset * 2, sumHeight + offset * images.Count);
using (Graphics g = Graphics.FromImage(resultBitmap))
{
    g.Clear(Color.White);

    int yPosition = offset;
    for (int i = 0; i < images.Count; ++i)
    {
        Bitmap currentBitmap = images[i];
        g.DrawImage(currentBitmap, offset, yPosition);
        yPosition += currentBitmap.Height + offset;
    }
}

resultBitmap.Save("barcode.png", ImageFormat.Png);

//[VB.NET Code Sample]

Dim collection As New Dictionary(Of String, Symbology)()
collection.Add("ONE123", Symbology.Code39Standard)
collection.Add("Process Collection", Symbology.DataMatrix)
collection.Add("Dictionary Collection", Symbology.QR)
collection.Add("X06712AT", Symbology.Code128)
collection.Add("979026000043", Symbology.EAN13)
collection.Add("Aztec BarCode", Symbology.Aztec)

Dim images As New List(Of Bitmap)()

For Each pair As KeyValuePair(Of String, Symbology) In collection
    Using builder As New BarCodeBuilder()
	builder.CodeText = pair.Key
	builder.SymbologyType = pair.Value
	images.Add(builder.GenerateBarCodeImage())
    End Using
Next

Dim maxWidth As Integer = Integer.MinValue
Dim sumHeight As Integer = 0
For Each bmp As Bitmap In images
    sumHeight += bmp.Height
    If maxWidth < bmp.Width Then
	maxWidth = bmp.Width
    End If
Next

Const  offset As Integer = 10
Dim resultBitmap As New Bitmap(maxWidth + offset * 2, sumHeight + offset * images.Count)
Using g As Graphics = Graphics.FromImage(resultBitmap)
    g.Clear(Color.White)

    Dim yPosition As Integer = offset
    For i As Integer = 0 To images.Count - 1
  	Dim currentBitmap As Bitmap = images(i)
	g.DrawImage(currentBitmap, offset, yPosition)
	yPosition += currentBitmap.Height + offset
    Next
End Using

resultBitmap.Save("barcode.png", ImageFormat.Png)

Adi Gaskell07/23/14
458 views
0 replies

Measuring your open innovation

Open innovation has been around for over a decade now, and it’s easy to fall into the trap of believing that the metrics involved in it are rather straight forward. I mean there is often a very clear output that comes from the process, so you can easily subtract the costs from the benefits to get an ROI, right?

Mark Morrell07/23/14
562 views
0 replies

Who has the best intranet team?

What is the purpose of your intranet team? How many people should you have in your intranet team?

Adi Gaskell07/23/14
499 views
0 replies

The importance of breaks to your productivity

Use of social media in the workplace is becoming something of a tired debate, but a post I made recently highlights how it is one that still needs to be had. It highlighted how executives still regarded social media usage at work as something of a time waster, although they themselves tended to use it far more than their employees.

Christopher Taylor07/23/14
424 views
0 replies

How can you be successful without first defining success?

We’re way beyond the point where the world debates whether customer loyalty marketing works, which makes it a good example of a broader theme.

-- Relative time with interval
DATE_SUB(NOW(), INTERVAL 25 HOUR)
 
-- Select all users that were updated in the last 24 hours.
SELECT * FROM users
WHERE users.updated > DATE_SUB(NOW(), INTERVAL 24 HOUR);
 
-- Select all users that were updated in the last 7 days.
SELECT * FROM users
WHERE users.updated > DATE_SUB(NOW(), INTERVAL 7 DAY);
Adi Gaskell07/22/14
195 views
0 replies

How adaptable is your talent?

A number of surveys and studies in recent times have highlighted the importance of managing complexity to success in the modern world, whether as an individual or an organization.

Highq Collaborate07/22/14
153 views
0 replies

Real estate portfolio management

The iSheets real estate portfolio management solution is a platform where you can host all of the information about your properties (or a client’s properties) in one place.

Adi Gaskell07/21/14
273 views
0 replies

How do you spot the trends in your industry?

Back in 2012 the annual IBM survey of CEOs from around the world revealed that managing complexity was the biggest concern executives had. It revealed how CEOs are looking to better connect and collaborate – inside and outside the organization – to meet the staggering complexity of the challenges their organizations are facing.

Interact Intran...07/21/14
114 views
0 replies

Amazing speaker line-up announced for Interaction Intranet Conference 2014

Interaction Intranet Conference #IIC14 is once again shaping up to be the best intranet conference in the UK and something you definitely don’t want to miss out on if your role involves looking after your company’s intranet.

Adi Gaskell07/21/14
125 views
0 replies

When digital tools get in the way of innovation

There is a sense in much of the social business movement that the various digital tools and enterprise social networks that vendors sell are the panacea for great collaboration. Indeed, there is almost a perception that collaboration can’t occur unless you’re using these tools.

Adi Gaskell07/21/14
1814 views
0 replies

Companies still chasing the digital dream

A recent survey published by McKinsey found that companies from around the world are re-investing in digital projects again. What’s more, much of this growth in investment is coming directly from the top, with the report revealing how CEOs are often the ones driving the digitization projects.

Interact Intran...07/21/14
1566 views
0 replies

Animated intranet launch videos to excite and delight

Using video to promote the launch or relaunch of a new intranet is a great way to gain exposure and engage employees.

Adi Gaskell07/21/14
471 views
0 replies

Shuddle aims to crowdsource the school run

That the sharing economy has blossomed in recent years is hard to dispute, with a growing number of industries being disrupted by a sharing economy entrant into a marketplace. The growth in the sharing economy as a whole has encouraged a number of niche players to emerge that are targeting sub-sets of markets that there more established peers have gone after.

Interact Intran...07/21/14
149 views
0 replies

Top 5 intranet features you can't live without

Is your intranet being used frequently amongst your employees? Have you managed to get your least technology savvy employees on board and embracing your intranet in their everyday activity?

Adi Gaskell07/20/14
720 views
0 replies

Amazon enter the collaboration industry

The enterprise social collaboration market has mushroomed in recent years, with estimates that it is already worth several billion dollars a year. Whilst such a bounty has encouraged a wide range of entrants into the field, one that has stayed out, perhaps understandably, has been Amazon.

Christopher Taylor07/20/14
222 views
0 replies

As a golfer once told me — “Never over, never in”

Back when I lived in Spain, I never completely grasped the value when my friend Valentín used to say, “Never over, never in.” This is a golf mantra…a warning that if you don’t putt to a point just past the hole, you’re not always going to putt hard enough to get to the hole. The best golfers rarely ever miss by falling short.