Site Sponsors:
New Look for EzLog 
One knows that one needs to make something easier to use when YOU find yourself wishing it were so...



Perhaps that is why we software developers always have the best tools?

After a little thought, it occurred to us that even a time tracking tool might do well to use a "calculator" metaphor. -Once EzLog4J is installed, simply move your cursor over each button to see what each of the above buttons do.

Note that while the new keys do the same as pressing the above key-labelled buttons, that the old keyboard equivalents (INS = new entry, DEL = remove selected entry, etc.) still work as expected.

Hope you find it useful!

[ add comment ] ( 1687 views )   |  permalink  |  related link
Technology Tips for 2013 
I was asked to come up with a handfull of trendy tips for IT Professionals.

Here is the short list.

Enjoy!

-Rn

--- Nagy's Top Tips for 2013 ---

“The realm of continuous integration is putting a great deal of pressure on software developers to do a far better job on real-time testing & diagnostics. Moles, PEX, Delegate, and System-style Integration interfaces & testing strategies must rapidly fill the void between an NUnit Testing mindset, and the creation of a more pluggable, production-quality, stimulation / simulation regression test ability for our applications.”


“MYBATIS and Hibernate are simply must-have technologies for any large corporate undertaking. The ability to quickly represent database schema in source code (Hibernate the choice of many for exact tabular-object CRUD), or efficiently re-factor database schema (MyBATIS is often the choice there) are surely two of the hottest topics in the corporate software-developer world today.”


“The economic realities of our time are clearly favoring software developers who are capable of doing more than writing code. -Becoming familiar with design patterns, UML, as well as tuning our production-quality solutions are the key skills that will help ensure that our resume stands out in a crowd.”


“After reviewing technologies like Hadoop, one will discover many opportunities for performance improvement. While a revolutionary step toward treating massive hardware installations as a single monolithic computing resource, today's software developers should be keeping a closer eye on the more obvious ways to let Big Data task big resources a lot more effectively.”


“Service Orientation is another huge opportunity for software developers. In addition to the technical underpinnings of 'bottom-up' discussions over REST, SOAP, and / or BEST, the real call of duty is to discover why IT is only half of what any good IT Alignment process is all about.”


“With one exception, our modern Enterprise Service Bus is simply a restatement of an old, time-proven, transaction-processing system: Today, often lacking the efficiencies of bit-level encoding, iuo-architecture, and packet-level obfuscation, modern software developers should be paying far more attention to making our data exchanges far more efficient, as well as secure.”


“It is no longer advisable to be selecting technologies simply because they make life easier for developers. In a time when computing power is no longer increasing as fast as we have become accustomed, we may yet have to quickly return to the day when a developer knew enough about microprocessors, operating systems, networking, memory, and bottom-line technology justifications so as to be able to prove that we have selected the right tool, for the right job.”


“When we see Java projects like Hadoop re-writing their own performance-critical routines, we should be interested in discovering how we might do the same. Why? -Because probably sooner - rather than later - we too might reasonably be expected to know how to make our favorite technology natively-faster, resource-smaller, and consequently a better choice for our own projects. Having a common linker, as well as a native-code-creation option would be a good place to start.”


“Just as the loss of traditional occidental values made unlocked car doors and hitchhiking a thing of the past, so too is the rise of digital skulduggery threatening the open and free exchange of standards, ideas, and software. From international copyright & intellectual property issues, to the proper use of asset & license management tools, techniques, and best practices, the software developer of today should be keenly interested in becoming far better versed in the growing legal & regulatory consequences of practicing our trade.”


“Virtualization may be nothing new, but new software developers should be a lot more comfortable with discussing cloud, networking, SAN, and other on-demand software support alternatives, strategies, and concepts. For reason of license validation, if not outright image creation, the ability to deliver and test stand-alone, turn-key applications on-demand is becoming the norm in our modern, corporate elastic-cloud, world.”


[ add comment ] ( 3147 views )   |  permalink  |  related link
Drawing Points On A Line 
Certainly the idea of drawing a simple line is well supported by just about every graphical framework. What is less sure is the ability to enumerate through a set of points so as to choose just which points we are interested in.

LineDDA For Java


While the technique pre-dates Microsoft Windows, the idea of using a Digital Differential Analyzer (DDA) might seem easy enough to write. Once we account for slope management however, the algorithm can get a little more complex:

public static boolean Enumerate(int x1, int y1, int x2, int y2, int step, PointCallback result) {
if (result == null) {
return false;
}
if (step == 0) {
step = 1; // avoid "divide by zero" possibility
}
if ((x1 * y1) > x2 * y2) {
int h = x1;
x1 = x2;
x2 = h;
h = y1;
y1 = y2;
y2 = h;
}
int base = (x2 - x1);
if (base == 0) {
base = 1; // avoid "divide by zero" possibility
}
double m = (double) (y2 - y1) / base;
double y = (double) y1;

if(x1 == x2) {
// No Slope
int iy;
while (y <= y2) {
if (y % step == 0) {
iy = (int) Math.round(y);
result.onPoint(x1, iy);
}
y++;
}
return true;
}

if (x1 > x2) {
// Negative Slope
y = (double) y2;
int iy;
for (int x = x2; x <= x1; x++) {
if (x % step == 0) {
iy = (int) Math.round(y);
result.onPoint(x, iy);
}
y += m;
}
} else {
// Positive & zero Slope
int iy;
for (int x = x1; x <= x2; x++) {
if (x % step == 0) {
iy = (int) Math.round(y);
result.onPoint(x, iy);
}
y += m;
}
}

return true;
}


In the above, we have cobbled together a point enumerator. One that also has a 'step' capability:



Note that testing has verified the support of positive slope, negative slope, zero slope, no slope, as well as the need for point inversion.

Graphics gr = jpDrawing.getGraphics();
gr.drawLine(300, 15, 300, 200);
boolean br = false;

LineDDA.PointPlotter plotter = new PointPlotter(gr, 5, 1);

// Slope Tesitng
gr.setColor(Color.YELLOW);
LineDDA.Enumerate(10, 100, 10, 200, 0, plotter); // No Slope & div by zero
LineDDA.Enumerate(20, 200, 20, 100, 0, plotter); // No Slope & point swap
LineDDA.Enumerate(10, 100, 300, 100, 0, plotter); // Zero Slope & div by zero

gr.setColor(Color.ORANGE);
LineDDA.Enumerate(3, 100, 300, 0, 2, plotter); // Negative Slope

// Positive Slope
gr.setColor(Color.CYAN);
LineDDA.Enumerate(15, 20, 300, 200, 7, plotter); // standard point
LineDDA.Enumerate(300, 200, 0, 0, 3, plotter); // point swap

// Picket Testing
Point p1 = new Point(20, 200);
Point p2 = new Point(300, 20);

plotter.setHeight(9);
gr.setColor(Color.RED);
LineDDA.Enumerate(p1, p2, 20, plotter);

plotter.setWidth(15);
gr.setColor(Color.CYAN);
LineDDA.Enumerate(p2, p1, 40, plotter);


Here is the source code & test. --Hope you will find it useful!





[ add comment ] ( 2431 views )   |  permalink  |  related link

<<First <Back | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Next> Last>>