Site Sponsors:
Oracle: Web Access to Java Applets 
There I was - happily updating to the latest version of Java under Windows when - boom - access to my own on-line applets suddenly stopped.

Since the red-faced security flaws of Java 6, it seems that our BROWSER Applets are still well beyond any Oracle developer's ability to protect an OPERATING SYSTEM?

The constructive ideas I have to offer range from shifting the safe-tech responsibility back to Oracle Developers to (1) keep the sandbox safe, or encouraging Oracle to (2) simply craft a safe-and-secure 'Lite Version' of Java for browser use... -Much as Sun did for JME, CLDC, and elsewhere.

Until the inspiration is received however, be aware that there is an alternative to exposing your personal information to yet another public register.

Work Around


Since the policy-prohibitions are coming from Oracle - not your operating system - on Windows all one need do is to search for "Java" under the "Start Program" (Search Programs and Files) tools, then select "Configure Java."



Using the above configuration tool, we can add things like the site URLs for http://www.soft9000.com, http://soft9000.com, or http://TheQuoteForToday.com to Oracles exceptions list:

(Oracle: Tool tip bundles (1.7 u 51) Missing ?)

In a like manner, feel free to take a moment to add your favorite sites to your Java implementation's "exceptional-site list-of-white":



(Both the Yoda-style rhyme, as well as the GUI pun, are indented!)


[ view entry ] ( 1003 views )   |  permalink
Java IPC and Microsoft Windows 
Since the 1970s, folks in the C World have long been enjoying the benefits of "piping" things between processes. Piping is easy, it is fun, and (with a single invocation work-around on Microsoft Windows) piping works pretty much the same everywhere.


While we have been able to start, read, and pass information to other programs on Java for awhile now, everyone knows that - far from "Write Once, Run Anywhere", using Processes under Java can be a very platform – let alone operating system process - specific undertaking.

Process Woes


Interestingly, the first cross-platform IPC problem has very little to do with Java. When working on 'Windows, the most frequent errors encountered often simply have to do with (1) where the program is located / invoked, as well as (2) how we use Java to manage the input and output streams.

Location Matters


For those who are new to programming, the first thing to do is to note that some of the commands we use at a terminal (or "shell") are built-in. Others are external. Hence whenever we type "ls" on Linux, or "DIR" on Microsoft Windows we are not executing an external command. What we are instead doing is executing a built-in ''shell'' feature.

Command-Line Parsing


Unlike our single space-separated string convention on POSIX, Microsoft Windows expects commands to be passed to its command shell via a series of strings. In this way, Java and C/C++ have the same requirement on 'Windows. Both exec() a command shell under the same constraint.



After the obvious however, the second problem begins to bear its teeth: when reading input from a stream on Java, unlike in C/C++ there is no “putc” or “push_bask” capability. Hence, anti-blocking stream pre-read / put_back testing is not possible. We must use .ready(), instead.

What's wrong with using a Reader's “ready()” feature, you might ask?

Well, to begin with, most folks do not use it. --Indeed, whenever ready() is used, rather than simply a “put back” ability, crafting clever “look ahead” and / or time-out checking loops require a block or two more code. (see below)

Reading CMD.EXE Responses under Java


So after the common Windows invocation differences, forever-blocking on any type of buffered / un-buffered read is often the next problem to tackle.


Unlike the former Windows invocation problem however, our second problem is common on POSIX, as well. Our common solution is that in Java, before we read a shared IPC Stream, we had better check to see if it is ready(). Why? Because not only can streams go cross-platform 'zombie on us during even an un-buffered read, but trying to fix the problem – along with dodging common threading problems - might just eat our brain :-)


import java.io.InputStreamReader;

public class ProcOne {

static int BY_LOOP = 7;

public static void main(String[] args) {
try {
String[] data = { "CMD.EXE", "/C", "DIR", ".." };
Process proc1 = Runtime.getRuntime().exec(data);
InputStreamReader is = new InputStreamReader(proc1.getInputStream());
int ch = 0;
do {
int times = 0;
while (is.ready() == false) {
times++;
Thread.sleep(300L);
if (times > BY_LOOP) {
break;
}
}
if(times > BY_LOOP)
break;
ch = is.read();
if(ch != 0)
System.out.print((char)ch);
} while(ch != 0);
is.close();
} catch (Exception e) {
e.printStackTrace();
}
}

}

If you have any doubt, then (2) remove the IO Checking Block then (1) merely change data in the above to a single String: "CMD.EXE /C DIR .." Finally, before debugging (0) pretend you never saw this post & go grab your next-door neighbours shotgun ...

Enjoy the Journey!

(p.s. - Later that evening we encapsulated the above concepts into a simple-to-use Framework. The design allows us to incorporate the events from one - or hundreds - of clustered (cloistered?) IPC Activities into a graphical / textual user interface (GUI/TUI.) See the IpcReader Project on SourceForge for more information.)

[ view entry ] ( 1753 views )   |  permalink  |  related link
Ubuntu 10.04 LTS & LibreOffice 
Collected from various sources, please allow me to consolidate my notes on how to REPLACE the default version of OpenOffice - as included with Ubuntu 10.04 LTS - with LibreOffice.

Removing OpenOffice


In order to avoid crippling programs that require spell-checking (like FireFox), one needs to be very selective in choosing what we remove:

sudo apt-get purge openoffice.org-base-core openoffice.org-common openoffice.org-core openoffice.org-style-human uno-libs3 ure openoffice.org-thesaurus-en-au openoffice.org-thesaurus-en-us openoffice.org-hyphenation openoffice.org-hyphenation-en-us openoffice.org-l10n-common


Installing LibreOffice


In order to install LibreOffice, the default repositories have to be added:

sudo apt-get install python-software-properties
sudo apt-add-repository ppa:libreoffice/libreoffice-4-0
Ignore the "gpg: no ultimately trusted keys found."

Next:

sudo apt-get update
sudo apt-get install libreoffice
sudo apt-get upgrade


BONUS: If yours is a new install and / or you want to install Java (not required), then while working at that command-line terminal here is the best way to install Oracle Java:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer


Next, simply select "Applications | Ubuntu Software Center" to search for & install LibreOffice:


To verify all has worked properly, check to see that the menu shortuts have been created.


OF course the trouble with OpenOffice is that since Oracle has far-outsourced the R&D of the project overseas (just like Microsoft Office - Completely ignored CUA!), it no longer works properly. Unlike OpenOffice, I have yet to crash LibreOffice under Ubuntu when (for example) converting documents between the Open and Microsoft Formats.

See: http://linuxtweaking.blogspot.com/2011/ ... rg-in.html

See: https://wiki.ubuntu.com/LibreOffice


[ view entry ] ( 2387 views )   |  permalink

<<First <Back | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Next> Last>>