Site Sponsors:
New Training from Soft9000.com 

Critical-Path Learning


We are pleased to be offering several new training opportunities:

1.) Training on Testing Topics

2.) Training on PHP for Developers

3.) Training on Microsoft C# for Developers

4.) Training on Microsoft VB.NET for Developers

5.) Training on Hibernate for Developers

I will personally teach each and every one of these topics.

Introductory Rates


Ranging from $800 for the 2-day trains, to $1,500 per student for the 5 day classes, because this training is new we are offering our partner rates to the general public.

I do not believe that anyone will find a better training value anywhere else?

New Topics Soon!


Coming soon: HTML 5 / CSS3 & JavaScript!

From C/C++ & embedded engineering to UML, we can create custom training on just about any technical topic.



[ view entry ] ( 1482 views )   |  permalink  |  related link
Java Clipboard Woes on Ununtu 
Here is a classic tao of software testing - run it once, and the test passes. Right?

Well, by way of a VERY hard to find testing oversight, here is a bug under Java on Ubuntu. -The test works great the first time. Run the EXACT same test again and ... Boom! --Life suddenly gets mysterious:
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.io.StringReader;

/**
* CONCLUSION: CLIPBOARD ON UBUNTU RUNS FINE WHEN JAVA PROGRAM IS RUNNING. ERROR
* AFTER PROGRAM EXITS & CONTENT IS PASTED BACK INTO JAVA. Proof: Run this class
* twice - first time should run okay.The second time will fail. To clear the
* error, merely copy something ELSE to the clipboard.
*
* @author profnagy
*/
public class JaveClipboardWoes {
/*
Exception in thread "main" java.awt.datatransfer.UnsupportedFlavorException: Unicode String
at sun.awt.datatransfer.ClipboardTransferable.getTransferData(ClipboardTransferable.java:160)
at daily.newsletter._ClipboardWoes.main(_ClipboardWoes.java:32)
Java Result: 1
*/
public static void main_string() throws Exception {
Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
DataFlavor[] flavors = cb.getAvailableDataFlavors();
for (DataFlavor flav : flavors) {
System.out.println(flav.getMimeType());
}
// get whatever is on the clipboard
String str = (String) cb.getContents(null).getTransferData(DataFlavor.stringFlavor);
System.out.println(str);
// put a unicode string on the clipboard
StringSelection data = new StringSelection("Testing Is Important");
cb.setContents(data, data);
// get the unicode string okay!
System.out.println(cb.getContents(null).getTransferData(DataFlavor.stringFlavor));
}

/*
Exception in thread "main" java.awt.datatransfer.UnsupportedFlavorException: Plain Text
at sun.awt.datatransfer.ClipboardTransferable.getTransferData(ClipboardTransferable.java:160)
at daily.newsletter._ClipboardWoes.main(_ClipboardWoes.java:48)
Java Result: 1
*/
public static void main_text() throws Exception {
Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
DataFlavor[] flavors = cb.getAvailableDataFlavors();
for (DataFlavor flav : flavors) {
System.out.println(flav.getMimeType());
}
// get whatever is on the clipboard
StringReader str = (StringReader) cb.getContents(null).getTransferData(DataFlavor.plainTextFlavor);
System.out.println(str);
// put a unicode string on the clipboard
StringSelection data = new StringSelection("Important, testing is!");
cb.setContents(data, data);
// get the unicode string okay!
System.out.println(cb.getContents(null).getTransferData(DataFlavor.plainTextFlavor));
}

public static void main(String[] args) throws Exception {
main_text();
main_string();
main_text();
main_string();
}
}

While we are running Sun's JDK on Ubuntu 10.04, the problem has been reported elsewhere.

Software developers everywhere can probably relate to this happen-stance. While vexing, the fact that the problem has yet to be fixed - after 5 or so years of testing - should tell us allot?

Enjoy the Journey!



[ view entry ] ( 1637 views )   |  permalink
Policy Permission: Copy & Paste in Java 
Sure I love C#, C/C++, Delphi, VB.NET, JavaScript, Ruby, and PHP, but in my spare time I write allot of Java.

Why Java? Because when it comes to sharing, be it via applets or applications, Java simply shares allot father.

Yet across the globe, folks who are used to being able to share their clipboard with the Java have been disturbed by what seems to be yet another arbitrary edict: somewhere, someone felt that the world would be safer if clipboard sharing was disabled.



Ignoring the idea that the ability to exchange data is a user-driven operation, the fact that a program can dump huge amount of data to a clipboard is not a problem anyone I know of has ever encountered. Yet, as new-found knowledge has ways that wisdom knows nothing of, the fact remains - by default - that another traditional convenience can be denied.

Well, another nicety lost.... yet (hopefully) merely temporarily interrupted? (Ever wonder if Microsoft hires folks to sabotage open efforts? -I sure do!)

While remediation of the problem promises to allow everything from FireFox to Opera to use JVM plug-ins once again, until we are far, far, past this unfortunate event, folks will want to know how to fix their local policy file.

The 'related link' below has an excellent post. The succinct information will help billions of people enjoy the features of several applets here, as well in the Open Source Projects across the cyberverse.

Linux and Windows user alike might be surprised to discover that a java.policy files might not exist. Not having a java.policy file is not too unusual. For those who would like an example to help them create a java.policy file at the proper location, here is a content cut & (ahem) paste:

grant { 
permission java.awt.AWTPermission "accessClipboard";
};



Enjoy,

-Rn



[ view entry ] ( 2014 views )   |  permalink  |  related link

<<First <Back | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | Next> Last>>