Read Latex

Tuesday, January 17, 2012

An Unexpected Circuit





Introduction
I am going to write a short paper. It's going to be a fun paper because like you, I don't know how it is going to turn out. That should make it interesting for both of us. Today's topic is a little weird -  it arose in a rather offhanded way. I wanted to write about it because it was like stumbling on buried treasure. I am going to write in the first person because it is easier for me to express myself that way.
The stupefying beauty of this is that if I don't succeed, it is incredibly possible that you may. If I happen to succeed, we both get a useful tool.

Background
The problem is this. I need 50 Volts of Direct Current in a lightweight and portable package. 50 VDC, not 6, 9, 12 or 24. It is okay if I have to use an outlet or extension cord but I need 50 VDC. One more thing - I need 600 Watts of it. Because power is voltage times current there will be 12 Amperes flowing through a wire somewhere. Oh and one last thing -  I need this 50VDC with 600 Watts of power constantly available on the shortest of notice, say 1/20,000th of a second and also in a sustained manner.
Please don't hang up when you read the following statement. Stay with me, it will be worth your while.
An electronic circuit is a mathematical proof.
A circuit is a proof. It is a proof in an ideal sense with idealized components. It is a proof in a real sense with real-world components. If a circuit works, then the system that it represents is true. Many mathematical and mechanical systems have equivalent circuits. We will revisit this powerful idea.

Possible Ingredients
Lead-Acid
50 VDC is a weird number to want. I could use four 12 Volt lead-acid batteries, settling out of court for 48 Volts, knowing full well Lead-acid batteries are not 12 Volts they are 12.63 Volts. I would settle for 50.52 VDC. Lead-acid batteries have two problems though, lead and acid. The first problem, Lead, is toxic, and more seriously, it is heavy. I don't like heavy things. I don't like lugging them around. The second problem, Acid, is also toxic, and more seriously, it burns stuff. I don't like burns and that yucky corrosion that forms on car batteries. So let's just drop lead-acid.
Lithium
I could use thirteen 3.7 Volt lithium-ion polymer batteries, settling for 48.1 Volts. Lithium batteries have two problems, cost and explosion. I don't like things that are too expensive for widespread distribution. Also they explode if they aren't charged carefully. I can handle a small battery exploding. That might even be fun. A battery with nearly a horsepower is not small and neither is its explosion. So strike lithium.
Step Down Transformer
I could use a 120 VAC step-down transformer to transform household current to the lower AC value and then rectify and filter that into 50 VDC.
Two problems emerge. Even ordinary 120 VAC step-down transformers are expensive and they are heavy. I already mentioned my dismay with lugging expensive stuff around. The astute reader will note that this is a lie. I mentioned my dismay with lugging heavy things around and my dismay with things that cost too much, but I did not mention my dismay with lugging expensive stuff around. In that subtle distinction, there is meaning. You might think I don't like lugging expensive stuff around because of theft, and that would be true, but that was not the point. The point was, I never said that, but if one wasn't careful, one might assume I said it, and leave the encounter thinking something was said that wasn't. The structure of this argument is similar to a circuit we will discuss in a moment.
Now since I have ruled out batteries or transformers I need what is called a switching power supply. Switching power supplies are cheap and abundant, but they have a problem that intimately affects their use. They create NOISE. Electrical noise. Electrical noise bothers me more than weight or cost.

MOSFET Modulation: Smooth, Quick, Efficient
What I would like to do is somehow sample 120 VAC in a smooth, quick, and efficient way. Then I can rectify it into 50 VDC and filter it according to standard practice. So now, we have an apparently simpler problem than 600 Watts of 50 VDC. I just need 600 Watts of 50 VAC. Ignore that because of efficiency more than 600 Watts is needed. Ignore that because of voltage regulation, a more than 50 VAC is needed. Settle for 600 Watts of 50 VAC. If it is made from 120 VAC smoothly, quickly and efficiently the rest is cake.
What if instead of brutal switching, which creates far-reaching wideband racket, we gently turn something on and turn something off in a smooth and efficient way?
This circuit does that… partially. The control gate of an N-Channel MOSFET is fed with a version
of the same signal we are trying to clamp to 50 VAC. I say, "clamp" because when the voltage goes over 50 VAC we don't want any part of it. We especially don't want to accept this higher voltage and in turn dissipate the excess energy as noise or heat.


We can exactly tailor how much of the positive going side of the 120 VAC makes it to the voltage probe by adjusting the values of R1 and R2. If they are equal, we get 50 VAC on the positive going side of the wave:


So just like that we are halfway done. The signal is about 50 VAC on the top. In the figure above, both the 120 VAC signal and the output signal are drawn.
We would like to do the same thing on the bottom, so let's start simple and build a circuit that just does the opposite of the first one. Maybe then, we can combine them to get what we want. A circuit might do the "opposite" is one that uses a P-Channel MOSFET, the "opposite" of an N-Channel MOSFET:



After trying some different configurations we run it and get what we want –the negative side of the 50 VAC is present:


Now perhaps we can combine the two that will clamp both sides of the waveform to 50 VAC.


Running the simulation, we obtain:


We have achieved our objective. A real circuit might have some additional parts for protection, but this shows that the configuration is valid.

What I did not show you was the search process that a reasonable person might have employed to come up with this configuration.

If you look closely at the schematics, you will notice that MOSFETS are not commutative.
With the gate in the middle, they can be put in forwards or backwards.

This gives rise to four possible circuits, since there are two MOSFETS in use, and only one circuit topology will produce ("prove") the correct waveform.

In addition, the MOSFETS need not live on the positive supply, they could also be placed on the bottom of the load, but because of symmetry, this would still prove the correct waveform:

So now, we have eight possible circuits of which two are equivalent and correct and six are incorrect.
Additionally we can swing one MOSFET around to be on top of the load and one on the bottom:


Which produces the following output:


Swinging the P MOSFET around instead of the N MOSFET produces a similar incorrect outcome. That makes 2 of 10 possible configurations correct.
We can increase that by 4 more configurations by pivoting each MOSFET in the swung around configurations, which also produce incorrect outcomes.
If I have counted correctly, 2 out of 14 configurations are correct. But now we are not doing circuit design. We are searching over a space of possible connection topologies for a topology that proves (produces) the waveform we sought. Each of the topologies proves something, but only two proved what we set out to prove.

Conclusion
We have succeeded! It was discovered that we can produce (prove) the desired waveform and discovered two topologies that were satisfactory. The circuits we have produced are equivalent to other systems that have similar algebraic or mechanical characteristics. These equivalent circuits and their topologies not only model the equivalent algebraic and mechanical forms, they model the search process we might employ to discover useful circuits along with its combinatorial growth.
Easter Egg
I mentioned above that "protective circuitry" was needed to take this synthetic design into a practical unit. It turns out that the MOSFET gates need their voltage clamped to around +/- 10 volts. So the  working design looks like this. Twelve parts drawn from 5 types, not counting power cord, fuse and load. An ounce of material you can hide in your hand. Two MOSFETS and power diodes in the top section, all in T-220 cases on a heat sink to handle 12 amps. The “Logic” section on bottom, runs on 6 milliamps that turns on the MOSFETS in 7 microseconds. 576 Watts. $9.15 worth of parts, the front-end of a $600` power supply. Those savvy in the trade will notice that this is a smoother version of an H-Bridge circuit used to control motors, so they don't jerk as much when doing, "the robot".



The file with the component values is available for $9.95 if you send me an email at the address on the left. It uses TINA SPICE from TI.




Acknowledgements
Brian Beckman, private communication.

References
As hyperlinks throughout the text.

Wednesday, November 16, 2011

Scaling Laws for Fractal Antennas



I was doing some simulations of fractal antennas recently and a friend said, "I'm talking about the postage sized antenna for 160 meters."




The statement intrigued me for several reasons:
1) Perhaps fractal antennas scale differently because of fractal dimension?
2) How small would could an antenna for 160 meters (1.9 Mhz) REALLY be?
3) How does fractal dimension affect the performance of the antenna?


Analysis Tools


The questions were answered via extensive analysis. Analysis was performed using 4NEC2 an excellent adaption by Arie Voors of the Numerical Electromagnetics Code by J, Burke and A. Poggio. These links will open in a new window if you would like to check them out. Arie Voors has made his tool freely available to the technical community. The Minkowski Antenna configuration used in this study is described here by Camps-Raga and Islam at the University of Missouri, Columbia. The 'C' program minkowski.c, the bash script, doit.bash, and the parameter file, tail.txt used to generate the antenna examples are included at the bottom of this technical note.


Simulation Results


1) A fractal antenna of a given configuration and dimension scales
    linearly in wavelength just like all antennas do.
2) A Minkowski fractal antenna for 160 meters would be 36 feet wide.
    It would have a gain of -19.3 dB relative to an isotropic radiator.

3) Increasing fractal dimension decreases antenna size with
    gain dropping faster than size.


Discussion


1) A fourfold reduction in antenna size is accompanied by a gain reduction of 21.3 dB so there appears to be is a severe penalty for size reduction. My current hypothesis is that as fractal dimension increases, the antenna starts to look more like a mirror than an absorber of electromagnetic energy.
2) A level 0 Minkowski fractal is a square loop antenna! The makes a nice basis for comparison.




Analysis Details




















'C' Code Used to Generate the Minkowski Fractal Antennas


The 'C' code was written entirely by the author using the principle of segmenting a single line and offsetting the middle segment by a distance h. The code was compiled using the cygwin cc compiler from the fantastic and free cygwin running on top of Windows XP on a dual core Intel processor and ASUS motherboard from newegg.com. If you have never had the pleasure of building your own computer from off the shelf components I urge you to do so. You will save a ton of money and get a computer more suited to your needs. Anyway, here is the 'C' code:


------- cut here -------
// Minkowski fractal antenna generator by van at wdv dot com

#include
#define SOUTH 1
#define EAST 2
#define NORTH 3
#define WEST 4
#define MAX(a,b) ((a)>(b)?a:b)


int maxLevel = 1;


void edge(double xA, double yA, double xF, double yF, int type, int level)
{
    double W = 1.0 / 3.0;
    double H = 1.0 / 3.2;
    double L, w, h;
    double xB, yB;
    double xC, yC;
    double xD, yD;
    double xE, yE;


    if(level >= maxLevel)
    {
        printf("1\t0\t%9.4f\t%9.4f\t0\t%9.4f\t%9.4f\t1.e-4\n",
            xA, yA + 1, xF, yF + 1);
    }
    else
    {
        if(type == SOUTH)
        {
            L = xF - xA; w = L * W; h = L * H;


            xB = xA + w; yB = yA + 0;
            xC = xA + w; yC = yA + h;
            xD = xF - w; yD = yA + h;
            xE = xF - w; yE = yA + 0;


            edge(xA, yA, xB, yB, SOUTH, level + 1);
            edge(xB, yB, xC, yC,  WEST, level + 1);
            edge(xC, yC, xD, yD, SOUTH, level + 1);
            edge(xD, yD, xE, yE,  EAST, level + 1);
            edge(xE, yE, xF, yF, SOUTH, level + 1);
        }
        else if(type == EAST)
        {
            L = yF - yA; w = L * W; h = L * H;


            xB = xA + 0; yB = yA + w;
            xC = xA - h; yC = yA + w;
            xD = xA - h; yD = yF - w;
            xE = xA + 0; yE = yF - w;


            edge(xA, yA, xB, yB,  EAST, level + 1);
            edge(xB, yB, xC, yC, NORTH, level + 1);
            edge(xC, yC, xD, yD,  EAST, level + 1);
            edge(xD, yD, xE, yE, SOUTH, level + 1);
            edge(xE, yE, xF, yF,  EAST, level + 1);
        }
        else if(type == NORTH)
        {
            L = xA - xF; w = L * W; h = L * H;

            xB = xA - w; yB = yA + 0;
            xC = xA - w; yC = yA - h;
            xD = xF + w; yD = yA - h;
            xE = xF + w; yE = yA + 0;

            edge(xA, yA, xB, yB, NORTH, level + 1);
            edge(xB, yB, xC, yC,  EAST, level + 1);
            edge(xC, yC, xD, yD, NORTH, level + 1);
            edge(xD, yD, xE, yE,  WEST, level + 1);
            edge(xE, yE, xF, yF, NORTH, level + 1);
        }
        else if(type == WEST)
        {
            L = yA - yF; w = L * W; h = L * H;

            xB = xA - 0; yB = yA - w;
            xC = xA + h; yC = yA - w;
            xD = xA + h; yD = yF + w;
            xE = xA - 0; yE = yF + w;

            edge(xA, yA, xB, yB,  WEST, level + 1);
            edge(xB, yB, xC, yC, SOUTH, level + 1);
            edge(xC, yC, xD, yD,  WEST, level + 1);
            edge(xD, yD, xE, yE, NORTH, level + 1);
            edge(xE, yE, xF, yF,  WEST, level + 1);
        }
    }
}

main(int argc, char **argv)
{
    if(argc > 1) maxLevel = atoi(argv[1]);

    edge( 0,  0, 16,  0, SOUTH,  0);
    edge(16,  0, 16, 16,  EAST,  0);
    edge(16, 16,  0, 16, NORTH,  0);
    edge( 0, 16,  0,  0,  WEST,  0);
}




Bash Script Used to Generate the Minkowski Fractal Antennas


The 'C' program above, though somewhat minimal, produces extra copies of the segments during the recursion. The output lines are only part of the "card entry" fragments necessary for 4NEC2. To get the output file into a form usable by 4NEC2 the following script was run:


$doit.bash 2


which produces a level 2 Minkowski fractal antenna.


------- cut here --------------


#!/bin/bash
minkowski.exe $1 | sort -u | nl | sed -e 's/ //g' | sed -e 's/^/GW\t/' > head.txt
cat head.txt | wc -l > /tmp/tmp.txt
lineCount=`cat /tmp/tmp.txt`
echo $lineCount
sedCommand="s/NSEG/$lineCount/"
echo $sedCommand
cat tail.txt | sed -e "$sedCommand" > foo.txt
cat head.txt foo.txt > MI3ALVW.nec
u2d MI3ALVW.nec


~                       

The Last File


The last file "tail.txt" is used by the bash script to provide analysis parameters for 4NEC2. It looks like this:


------- cut here ----------


GE  0
EK
LD  5   0   0   0   5.74713e7   0
EX  6   NSEG    1   0   1   0
GN  2   0   0   0   13  0.005
FR  0   1   0   0   1.8 0


Addendum:
"Chip" W1YW owns US patents 6452553 and 7256751 on fractal antennas. He has measured the performance of a configuration similar to the one pictured at 175 MHz and does not report the dip in gain that appears in the 1.9 MHz version above. He states and I quote:


"For example,the MI2 (second iteration)  modeled in NEC4, reveals a 97% efficiency and dipole equivalent gain. Recently an open house with members of the Radio Club of America showed this to: K1VR; WB2MGP; K1BG; WA6RNU; W0BIW; KD0FAA; and several others. In addition, the visitors were treated to actual chamber measurements of a wire-bent MI2 at 175 MHz, Its gain was indisitinguishable (within 0.2dB) from an ETS calibrated dipole of 1.7 dBi. The fractal antenna is thus unity gain to a dipole."


Thus W1YW does not observe the same drop in gain that occur in my simulations. Work is proceeding to rectify this discrepancy.


Sunday, July 31, 2011

Testing a cool posting style excerpted from Matt Might



In his excellent blog on the Y-combinator, Matt Might - a professor at my alma mater, the University of Utah - uses a technique for placing executable Javascript code in the flow of his document.
Right now I am pasting his code into the html editor of my Google blogger to see if I can reproduce the trick he uses. The part that follows is in double quotes, as it is Matt's work:


Open Double Quote


The following example expresses the factorial function without using recursion:
[result1]


Take a close look at the definition of Y. It uses only three kinds of expression: anonymous functions, variable reference and function application.

Close Double Quote


Back to my words: Note that even though this is a blog, the html is still functional and the Javascript program executes when the "Evaluate" button is pressed. So handy for making those subtle programming points!


If you right click this page and choose, "View Source", You can see the embedding of the code between lines 456 and 524. A short preamble and "postamble" are all that are required. Thanks Matt!


Footnotes:
Attempts to paste commented html tags were futile as they were evaluated. Attempts to color the code red didn't work either.

Wednesday, July 20, 2011

Regarding "Informational Derivation of Quantum Theory" by Chiribella, et.al.



Regarding "Informational derivation of quantum theory", "PHYSICAL REVIEW A 84, 012311 (2011)", Chiribella

I was provoked to cast Information Compression as an Iterated Function

So given a string S, of length L, find an iterated function F, that produces a new string S’ of length L’ where L’ < L.
One might also require an iterated function G = F-1 that takes S’ and produces S.
If such a G exists, then F would be called a lossless or invertible iterated compression function.


S = "The rain in Spain stays mainly in the plain."
L = 45

F1 = { s/ain/1/g }

S1 = "The r1 in Sp1 stays m1ly in the pl1."
L1 = 37

F2 = { s/he/2/g }

S2 = "T2 r1 in Sp1 stays m1ly in t2 pl1."
L2 = 35

F()  = F1(F2())
S' = F(S)
L' < L since 35 < 45

G1 = { s/1/ain/g }

G2 = { s/2/he/g }

G = G1(G2())
S = G(S')

F is invertible, iterated and compresses.

Sidebar 1: F can be packaged with S:

Sp = F + S = /ain/1/he/2/"The rain in Spain stays mainly in the plain."

Next Step: Find an Iterated Function that performs Information Expansion

So given a string S, of length L, find an iterated function F, that produces a new string S’ of length L’ where L’ > L.
One might also require an iterated function G = F-1 that takes S’ and produces S.
If such a G exists, then F would be called a lossless or invertible iterated expansion function.

S = "The rain in Spain stays mainly in the plain."
L = 45

F = { s/[a-zA-Z]/[%3d]/ }

S1 = "084he rain in Spain stays mainly in the plain."
L1 = 47

S2 = "084104e rain in Spain stays mainly in the plain.
L2 = 49

S' = "0841041010321140971051100321051100320831120971051100
     3211511609712111503210909710511010812103210511003211
     6104101032112108097105110046010"

L' > L since 135 > 45

G = { s/[%3d]/[a-zA-Z]/ }
S = G(S')

F is invertible, iterated and expands.

Sidebar 1: F can be packaged with S:

Sp = F + S = /[a-zA-Z]/[%3d]/"The rain in Spain stays mainly in the plain."

In this context we call F, the "transcription apparatus".


Next Step: Show that the cost of mutagenesis is higher in the compressed case.


This is trivial and will be left as an exercise to the reader.

Source for F in Expansion Section:

#include

/* convert any number to itself and any letter to a number */
/* hint add a comma to each phrase and watch intronic explosion */
/* hint remove the commas and watch loss of reading frame */
/* hint add triplets and watch need for reading frame */

int isNumber(int c)
{
    return ( ('0' <= c) && (c <= '9') );
}

void echo(int c)
{
    printf("%c", c);
}

void number(int c)
{
    printf("%03d", c);
}

main()
{
    int i;
    int c;

    for(i = 0; (c = getchar()) != EOF; i++ )
    {
        if( isNumber(c) )
        {
            echo(c);
        }
        else
        {
            number(c);
            break;
        }
    }

    for(; (c = getchar()) != EOF;)
    {
            echo(c);
    }
}

Wednesday, June 08, 2011

The Impedance of Free Space



The impedance of free space is ~120Ï€, or about 377 Ohms.

  1. What does that mean?
  2. Does nature oppose the propagation of light? 
  3. If it does, would we even see star light?
  4. Or is this a fee that, once paid, admits to a photon the right to propagate until it collides with something else?



It turns out that the "impedance" of free space is really just a ratio of strengths.


It is the ratio of the electric field strength, to the magnetic field strength.


Its numerical values are just an artifact of the definition of the ampere and the meter.

It might be interesting to work backwards and say that the impedance of free space is one and see how that could lead to a useful set of units for Maxwell's equations.




Tuesday, March 08, 2011

Trustworthy Java Applets Without Costly Certificates


Introduction
When you run a Java applet, the run time system looks for a file called java.policy, on your customer's system. This file specifies what rights Java will be granted at run time. If this file is not configured correctly your Java applet will not function properly and your customer will be frustrated. The only alternative to providing your customer a java.policy file is to buy a certificate that can cost over $500 per year. If your applet does not generate sufficient revenue to cover this, your voice is silenced along with your right to contribute. This also destroys the chance that your applet will be useful to someone a year from now, robbing you of future options as well.

So we would like to get useful applets running without permission problems while respecting the customer's right to security. We will accomplish this by establishing and maintaining a trust relationship with the customer as any supplier must do. In what follows the terms customer and user may be used interchangeably.

Applet Execution
Most applets are executed during development in interactive environments like NetBeans or Eclipse. For simplicity, an applet can be run in a browser, or as a standalone program, by you or your customer. Assuming Java is installed, an applet can be run in a browser simply by visiting a web page that hosts it. It can also be run in standalone mode by typing:


at a command prompt. Getting the right prompt is critical, otherwise hidden errors can disguise what Java is really doing. Getting the right prompt will be covered below. The term right prompt is a useful misnomer. It is really the environment behind the prompt that must be checked, but we want to make a complex thing simple, so we pretend it is a single character, keyword, or phrase, like mathematicians do.

Running appletviewer is useful for testing security fixes. Why? Because you can run it with test java.policy files like so:



Notice there is no space between the -J and the -D in the statement above.

A useful java.policy file for development and testing is:

                     


Blanket permission is not safe for production settings. You can stop here, develop the most sophisticated applet you want, and then resume to deploy your applet. We will now cover four remaining issues to understand and solve Java applet security problems. These issues are:
  1. Getting system properties such as ${user.home}
  2. Getting the right prompt for Windows and Unix systems.
  3. Testing an appropriate java.policy file.
  4. Deploying a java.policy file.
1. Getting System Properties
Some users and most developers have several versions of Java installed. In this situation the value of key system properties can depend on what you are doing. Continuing our java.policy thread, we need to know the exact directory to which ${user.home} refers. To replace complex speculation with simple fact, we run the program PrintUserHome.java:


to produce the output:


Authors note: 
In the text below, please assume that any word that starts with an upper case letter is a trademark held by their respective owners.

Many Java developers use Interactive Development Environments (IDE's) such as Netbeans or Eclipse. Compiling and running tiny programs in these can be a hassle.  This hassle can be eliminated by running programs in Unix environments, like MacOS/Linux, or in  cygwin, a wonderful Unix platform which sits atop Windows. In any of these a tiny Java program can be run without an IDE, without ant or make using the policyInstaller available at the end of this document. In the java.policy file above, we give the Java Runtime Environment (JRE) permission to read files from ${user.home}. This directory becomes the "sandbox" for those activities our grant permission directive allowed. Other key system properties can be listed using similar calls to those above. These are also enumerated in the policyInstaller:




2. Getting 'The Right Prompt'
We can inspect other key system properties by typing:

$ set | grep "JAVA|CLASSPATH"



On the same machine we can open a command "Window" and repeat using a variant of the same command:

$ set | grep "JAVA\|CLASSPATH"



Here we notice an important discrepancy, that the value of JAVA_HOME is different.
It is
...\jdk1.6.0_22 in the first case and ...\jdk1.6.0_10 in the other.

If we were to place an applet policy file in the wrong JAVA_HOME location, it would not work, and we might not know why. If that was done both the customer and the developer would be frustrated. Not good!

This can be fixed by editing the windows environment variables, which require a reboot of the system to take effect. To access these, right-click the mouse and select:
My Computer-->Properties-->Advanced-->Environment Variables.
Then examine the System variables.



In this case we would change the JDK version suffix from 10 to a 22 as shown and reboot.

When these two environments are consistent we have the 'right prompt'. More formal developments can be found at the references provided.

3. Testing an appropriate java.policy File

The blanket permission we granted above for testing and development is not appropriate for applet deployment. Instead we run the applet together with the java.policy file in the local directory granting the most restricted possible permissions until security exceptions no longer occur. As before this is done using appletviewer with the options shown below:


Each a time an exception occurs, we can add a line to the java.policy file that grants permission for that specific exception, using the text of the exception itself as a guide.


The java.policy file above restricts File I/O to the directory Java calls ${user.home}.
The wildcard character '*' says that any file or directory in ${user.home} may be read or written. One could add the keywords write,delete or  execute to this permission directive. Additional keywords are separated by commas, i.e.: "read, write, execute", etc. The references titled "Appendix A..." below provides a complete description of all the possible permission directives. For example, in the applet that motivated this blog entry, the final java.policy file looked like this by the time it ran without exception.


After we have successfully tested the applet using a candidate java.policy file we are ready to deploy both the applet and policy files.


4. Deploying an java.policy File.

Local Deployment
We first deploy the java.policy file locally to the directory in which we were running the applet. . Then we test the applet again using applet viewer.

Now we have a compatible applet.html and java.policy combination. The applet.html can be deployed either as a proprietary custom solution for desktop use, or as a traditional web page for widespread use. We will cover the later case. Since a correct java.policy file is required for execution of many applets, the file itself, properly installed constitutes an informal key enabling the software to function. Note that whenever the user upgrades their version of Java, a new java.policy file must be deployed to the correct location.


There are two ways to deploy the java.policy file. One is to let the user download and install it themselves, but this requires expertise and patience some customers may not have (regrettably). Another way is to bundle the file in the policyInstaller below which the customer downloads and executes to install the java.policy file. It is good practice to inform the customer of the risks that installing the policy file may entail. This can be part of the EULA that the installer requires the customer to agree to, or placed on the web page from which the policy file is downloaded.


Location of the java.policy file.
For an applet to run on a user's machine the java.policy file must be installed in this location:

${user.home}\.java.policy

Policy Installer
A zip file containing the policyInstaller, source code, directory structure, and setup instructions for the IDE-less Java examples is available by sending $19.99 via PayPal to the author's email address. The zip file describes how to quickly and easily make a simple jar file and manifest for testing java.policy  files and IDE-less java execution.

References:
  1. Appendix A: Security and Permissions, Oracle Document
  2. How do I get user home directory name?, Kodejava Example
  3. Hello World without an IDE.


Monday, October 11, 2010

A Short Note On Complexity in Nature


I was thinking about complexity this morning.

- image credit

When we zoom out from a given scene, we embrace more and more complexity. Although we cannot directly perceive this complexity, we can imagine it being there.

- image credit


As we zoom out we embrace more and more collections of matter and interrelationships between them. As we zoom back in, there is less stuff, and presumably fewer relationships.

- image credit
As we keep zooming in we get down to the level of organic molecules, which are made of atoms, which are made of elementary particles, which are perhaps made of strings:

- image credit

I was wondering if the universe was "programmed" like body plan is programmed via our genome. DNA is a base-four digital code that, when evaluated, defines the body plan of most organisms, except for RNA viruses.

These collections of particles were "smart enough" to sweep their orbits clean when they were the size of planets, condensing from accretion disks:

- image credit

So my thought is, "What if complexity increases as we zoom in? That is, the scale we live at is actually one of intermediate (apparent) complexity."

- image credit


If this is true, then the more we search for elementary particles at ever increasing energies, the more we will find.


I am curious about this idea and if there is an encoding of universe body plan at the subatomic level.

- image credit