Posts

Share Price Volatility and Swing Trading

Image
Typing "volatility" into Google yields some pretty interesting and, in my opinion, pretty confused results.  The top result from my search was this one from Wikipedia and it says it all.  There seem to be many non-scientists regarding volatility as a financial market rainbow, with a crock of gold at the end of it. Anyone with the most basic grounding in geometrical optics knows that a rain "bow" is really a segment of a rain "ring" and the centre of that ring, and your head, and the sun, all form a straight line, and the angle between that line and the line from your head to the colored rings is a function of the size of the rain droplets. So the rainbow moves with you.  You can never reach out and touch the rings, and you can certainly never navigate to the "base", conceptual or otherwise. I suspect volatility is similar. From much of what is written there seem to be a fair few searching for crocks of gold, without a clear grasp

Windows 8 - my first impression

I was so excited about the first beta release of Vista that I built a computer specially to host it, and I liked enough to run it as my main OS for six months, although not quite enough to buy it. I installed Windows 7 on a spare HD sector of my main computer, but rarely used it. But I was so put off by the Microsoft propaganda with the release of Windows 8 "Customer preview" that I have installed it on a $200 used laptop from eBay. And my first impression is that it will remain there. In fact, as I looked the array of icons on the opening screen, I felt I had been time warped back to the early 1990's, and was looking at Windows 3 not Windows 8. I knew clothing fashions went round in circles, but I didn't realize the designers of computer operating systems were that fickle. Of course people will buy it, because it is built into the purchase of computers from shops. Will the corporate sector be bullied into adopting it? I guess if XP is no longer sup

HTML <div> tag revisited

Image
I was abruptly forced to revisit this topic when I discovered that my <div> tag laid out login page, which seemed to look so great in Windows Internet Explorer (see below), looked absolutely crap in Firefox (see further below). So I did some reading, and the theme seemed to be that tables were never intended to do layout. Well I reckon there should be a counter argument, that the <div> tag was never intended to present data. It seems to me that much of the orthodoxy around HTML is written by graphic artists or publishers, and most of the web sites purported to show the power of <div> tags and CSS, are littered with graphic art and fancy fonts. For anyone used to programming, meshing <div> tags and CSS is not technically difficult, but perhaps it is not second nature to graphic artists and literary publishers. The instructions emphasize the importance of closing tags, and they suggest using borders during the design phase to get a visual aid o

Bringing a Custom Swing Component to Life

Image
I am sometimes down on the Java documentation, but in the sand plains of lugubrious and often confusing material there is the occasional gem. One example is a lesson from The Java Tutorial entitled Performing Custom Painting . I was directed to it by a reply to this thread in the Oracle Java Desktop forum . When I first began my efforts to create a rainbow colored Gaussian distribution curve I began with one of the Tutorial lessons on colors. I have unfortunately lost the URL for the lesson but the code began something like this: import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JFrame; import javax.swing.JPanel; public class Colors extends JPanel { public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; g2d.setColor(new Color(255, 0, 0));//vivid red g2d.fillRect(10, 15, 90, 60); ... } public static void main(String[] args) { JFrame frame = new JFrame("Colors"); frame.s

Creating a Custom Swing Component

Image
I always return to my blog when I'm stuck, and I'm stuck right now. I want to create a custom Swing component. Specifically, I want something like a JProgressBar , with the following changes: In place of a flat Foreground color, I want a rainbow spectrum, showing only the red range for low Values, and the whole spectrum for values close to the Maximum value; Instead of a rectangular box, I want the progress "bar" to take the shape of a normal, or Gaussian, distribution curve; I want progress to be displayed by the area under the curve, rather than by a simple linear scale along the x axis. It's not that there isn't stuff out there. I have five tabs open in my browser, specifically addressing the creation of custom components in Swing, as well as the source code for the JProgressBar . It is that, like everything to do with Java, it is bloody difficult to read. I shall begin from the horse's mouth as it were, with an article on the Java

Mixing and Matching

My unfamiliarity with PHP and JavaScript is illustrated by the fact that it has only just occurred to me that I don't have to choose between one or the other, but can in fact enjoy both. So for example, bringing my Add User screen into the PHP fold was simply a matter of changing the file extension and adding: session_start(); at the top of the file. Everything else remained the same. All the JavaScript remained untouched, all the business rules remained the same, and if the business rules were satisfied, the same PHP file was called to run the data transaction. For display purposes the username was called, and usertype was called to ensure only administrators added to the database. I had also been scratching my head about passing PHP variables back to the Applet to enrich the data stored in my database, but then it finally sunk into my head that they didn't need to be passed backwards and forwards. Variables (such as username, and IP) gathered by PHP, could

Security Points

The first point, about the security of my web site , is that Active Math Java is a test bed for code developed for the Rasch-ItemBank open source project . It is intended as a free resource for use by any child anywhere in the world with access to a computer connected to the Internet and running Java. So the purpose of my login page is not to secure a web resource for which users pay money. Nor is it like a forum, where the login page protects the forum from spammers. It is simply there for the convenience of certain users who have requested the ability to track the performance of their children. The second point, about the security of web sites in general, is that secure pages usually include a server side script, such as PHP, and if security is desired, all the pages have to be in the same or compatible format. Using PHP has some advantages, besides security, such as retaining variables across pages, within sessions. I have enjoyed writing business rules in JavaSc