Archive

Posts Tagged ‘Programming’

WPF 4.0 Text Stack Improvements

Декабрь 3rd, 2010

Sourse

Please note that the screenshots in this post are not displaying correctly. To view them in their full fidelity, right click on them and save them as a .PNGs.  Then use your image viewing program of choice.

Text Formatting API

The attached property TextOptions.TextFormattingMode has been introduced to switch the text metrics used by WPF while formatting text. There are two settings for this property, and the value of this property is inherited by an element’s children.

Read more...

, , , , , , , , , ,

Java Concurrency Guidelines

Ноябрь 29th, 2010

Java Concurrency Guidelines

, , , ,

Rotate Labels JFreeChart

Ноябрь 24th, 2010

When creating a chart that has rather long labels for the x-axis it is sometimes desirable to rotate them a bit so they fit on the plot. The method to use is setCategoryLabelPositions(...) on the CategoryAxis class. Here’s a quick example:


And the code...

Read more...

, , , , ,

Introduction to Interprocess Communication Using Named Pipes

Ноябрь 14th, 2010

Source

Contents:

  • Creating a Named Pipe
    • From the Command Line
    • Within a Program
  • Opening a Named Pipe
  • Reading From and Writing to a Named Pipe
  • Full-Duplex Communication Using Named Pipes
  • Benefits of Named Pipes
  • Limitations of Named Pipes
  • Code Samples
    • Example of Half-Duplex Communication
    • Example of Full-Duplex Communication

Named pipes allow two unrelated processes to communicate with each other. They are also known as FIFOs (first-in, first-out) and can be used to establish a one-way (half-duplex) flow of data.

Named pipes are identified by their access point, which is basically in a file kept on the file system. Because named pipes have the pathname of a file associated with them, it is possible for unrelated processes to communicate with each other; in other words, two unrelated processes can open the file associated with the named pipe and begin communication. Unlike anonymous pipes, which are process-persistent objects, named pipes are file system-persistent objects, that is, they exist beyond the life of the process. They have to be explicitly deleted by one of the processes by calling "unlink" or else deleted from the file system via the command line.

Read more...

, , , , , ,

5 things you didn’t know about java.util.concurrent, Part 1

Ноябрь 14th, 2010

Source

Concurrent Collections were a huge addition to Java™ 5, but many Java developers lost sight of them in all the hoopla about annotations and generics. Additionally (and perhaps more truthfully), many developers avoid this package because they assume that it, like the problems it seeks to solve, must be complicated.

In fact, java.util.concurrent contains many classes that effectively resolve common concurrency problems, without requiring you to break a sweat. Read on to learn howjava.util.concurrent classes like CopyOnWriteArrayList and BlockingQueue help you solve the pernicious challenges of multithreaded programming.

Read more...

, , , , , , , , ,