text
stringlengths 454
608k
| url
stringlengths 17
896
| dump
stringlengths 9
15
⌀ | source
stringclasses 1
value | word_count
int64 101
114k
| flesch_reading_ease
float64 50
104
|
---|---|---|---|---|---|
Create Managed Extensibility Framework Plug-Ins
The Managed Extensibility Framework (MEF) is a library for creating lightweight, extensible applications.
For up-to-date information regarding MEF, refer to the MSDN article “Managed Extensibility Framework.”
Prerequisites
Before running this example, keep the following in mind:
You must be running at least Microsoft® Visual Studio® 2010 to create MEF applications. If you can't use Microsoft Visual Studio 2010, you can't run this example code, or any other program that uses MEF. End users do not need Microsoft Visual Studio 2010 to run applications using MEF.
You must be running at least Microsoft .NET Framework 4.0 to use the MEF feature.
The easiest way to use MEF is through the type-safe API.
Addition and Multiplication Applications with MEF
This MEF example application consists of an MEF host and two parts. The parts
implement a very simple interface (
ICompute) which defines three
overloads of a single function (
compute).
Each part performs simple arithmetic. In one part, the compute function adds one (1) to its input. In the other part, compute multiplies its input by two (2). The MEF host loads both parts and calls their compute functions twice.
To run this example, you’ll create a new solution containing three projects:
MEF host
Contract interface assembly
Strongly-typed metadata attribute assembly
Where To Find Example Code for MEF
Create an MEFHost Assembly
Start Microsoft Visual Studio 2010.
Click File > New > Project.
In the Installed Templates pane, click Visual C# to filter the list of available templates.
Select the Console Application template from the list.
In the Name field, enter
MEFHost.
Click OK. Your project is created.
Replace the contents of the default
Program.cswith the
MEFHost.cscode. For information about locating example code, see “Where to Find Example Code,” above.
In the Solution Explorer pane, select the project MEFHost and right-click. Select Add Reference.
Click Assemblies > Framework and add a reference to
System.ComponentModel.Composition.
To prevent security errors, particularly if you have a non-local installation of MATLAB®, add an application configuration file to the project. This XML file instructs the MEF host to trust assemblies loaded from the network. If your project does not include this configuration file, your application fails at run time.
Select the MEFHost project in the Solution Explorer pane and right-click.
Click Add > New Item.
From the list of available items, select Application Configuration File.
Name the configuration file
App.configand click Add.
Replace the automatically-generated contents of
App.configwith this configuration:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <runtime> <loadFromRemoteSources enabled="true" /> </runtime> </configuration>
You have finished building the first project, which builds the MEF host.
Next, you add a C# class library project for the MEF contract interface assembly.
Create a Contract Interface Assembly
in Visual Studio, click File > New > Project.
In the Installed Templates pane, click Visual C# to filter the list of available templates.
Select the Class Library template from the list.
In the Name field, enter
Contract.
Note
Ensure
Add to solutionis selected in the Solution drop-down box.
Click OK. Your project is created.
Replace the contents of the default
Class1.cswith the following
IComputeinterface code:
namespace Contract { public interface ICompute { double compute(double y); double[] compute(double[] y); double[,] compute(double[,] y); } }
You have finished building the second project, which builds the Contract Interface Assembly.
Since strongly-typed metadata requires that you decorate MEF parts with a custom
metadata attribute, in the next step you add a C# class library project. This project
builds an attribute assembly to your
MEFHost solution.
Create a Metadata Attribute Assembly
in Visual Studio, click File > New > Project.
In the Installed Templates pane, click Visual C# to filter the list of available templates.
Select the Class Library template from the list.
In the Name field, enter
Attribute.
Note
Ensure
Add to solutionis selected in the Solution drop-down box.
Click OK. Your project is created.
In the generated assembly code, change the namespace from
Attributeto
MEFHost. Your namespace code should now look like the following:
In the MEFHost namespace, replace the contents of the default class
Class1.cswith the following code for the
ComputationTypeAttributeclass:
using System.ComponentModel.Composition; [MetadataAttribute] [AttributeUsage(AttributeTargets.Class, AllowMultiple=false)] public class ComputationTypeAttribute: ExportAttribute { public ComputationTypeAttribute() : base(typeof(Contract.ICompute)) { } public Operation FunctionType{ get; set; } public double Operand { get; set; } } public enum Operation { Plus, Times }
Navigate to the .NET tab and add a reference to
System.ComponentModel.Composition.dll.
Add Contract and Attributes References to MEFHost
Before compiling your code in Microsoft Visual Studio:
In your MEFHost project, add references to the Contract and Attribute projects.
In your Attribute project, add a reference to the Contract project.
Compile Your Code in Microsoft Visual Studio
Build all your code by selecting the solution name MEFHost in the Solution Explorer pane, right-clicking, and selecting Build Solution.
In doing so, you create the following binaries in
MEFHost/bin/Debug:
Attribute.dll
Contract.dll
MEFHost.exe
Write MATLAB Functions for MEF Parts
Create two MATLAB functions. Each must be named
compute and stored in
separate folders, within your Microsoft
Visual Studio project:
MEFHost/Multiply/compute.m
Create Metadata Files
Create a metadata file for each MATLAB function.
For
MEFHost/Add/compute.m:
Name the metadata file
MEFHost/Add/Add.metadata.
In this file, enter the following metadata on one line:
[MEFHost.ComputationType(FunctionType=MEFHost.Operation.Plus, Operand=1)]
For
MEFHost/Multiply/compute.m:
Name the metadata file
MEFHost/Multiply/Multiply.metadata.
In this file, enter the following metadata on one line:
[MEFHost.ComputationType(FunctionType=MEFHost.Operation.Times, Operand=2)]
Build .NET Components from MATLAB Functions and Metadata
In this step, use the Library Compiler app to create .NET components from the MATLAB functions and associated metadata.
Use the information in these tables to create both
Addition and
Multiplication projects.
Note
Since you are deploying two functions, you need to run the Library
Compiler app twice, once using the
Addition.prj information and once using the
Multiplication.prj information.
Addition.prj
Multiplication.prj
Create your component, following the instructions in Generate .NET Assembly and Build .NET Application.
Modify project settings (
> Settings) on the Type Safe API tab, for whatever project you are building (
Additionor
Multiplication).
Click the Package button.
Install MEF Parts
The two components you have built are MEF parts. You now need to move the generated parts into the catalog directory so your application can find them:
Create a parts folder named
MEFHost/Parts.
If necessary, modify the path argument that is passed to the
DirectoryCatalogconstructor in your MEF host program. It must match the full path to the
Partsfolder that you just created.
Note
If you change the path after building the MEF host a first time, you must rebuild the MEF host again to pick up the new
Partspath.
Copy the two
s (
componentNative.dll
Additionand
Multiplication) and
AddICompute.dlland
MultiplyICompute.dllassemblies from your into
MEFHost/Parts.
Note
You do not need to reference any of your MEF part assemblies in the MEF host program. The host program uses a
DirectoryCatalog, which means it automatically searches for (and loads) parts that it finds in the specified folder. You can add parts at any time, without having to recompile or relink the MEF host application. You do not need to copy
Addition.dllor
Multiplication.dllto the
Partsdirectory.
Run the MEF Host Program
MATLAB-based MEF parts require MATLAB Runtime, like all deployed MATLAB code.
Before you run your MEF host, ensure that the correct version of MATLAB Runtime is available and that
is on your path.
matlabroot/runtime/
arch
From a command window, run the following. This example assumes you are running from
c:\Work.
c:\Work> MEFHost\bin\Debug\MEFHost.exe
Verify you receive the following output:
8 Plus 1 = 9 9 Times 2 = 18 16 Plus 1 = 17 1.5707963267949 Times 2 = 3.14159265358979
Note
If you receive an exception indicating that a type initializer failed, ensure that you have .NET security permissions set to allow applications to load assemblies from a network. | https://in.mathworks.com/help/compiler_sdk/dotnet/managed-extensibility-framework-mef-plug-ins.html | CC-MAIN-2022-05 | refinedweb | 1,340 | 51.04 |
Technical Articles
Fundamental Library NGX towards Day.js
Moment.js has officially been deprecated as of September 2020. The Moment.js team has announced the end of the active development and they no longer update or add new features. The reasons for such a decision are explained on the Moment.js website.
But how does the deprecation of Moment.js affect Fundamental Library NGX?
One of the Fundamental Library NGX adapters, MomentDateTimeAdapter was using the Moment.js library. Considering that Moment.js objects are mutable. This was a common source of complaints about Moment and this bug was also reflected in the Fundamental Library NGX adapter. The latest version update on the 22nd of March, 2022 reflects this bug. In order to fix this bug, we incorporated Day.js library.
Advantages of using Day.js.
- Day.js is actually built in the way it mimics MomentJS’s APIs
- Day.js variables are immutable.
- Day.js minified file is only 2Kb
Example
We are going throught an example for a quick comparison between Moment.js and Day.js in Fundamental Library NGX.
Moment.js
Firstly you need to import the moment library. If you are already using Fundamental Library NGX you don’t need to install the library. It will be automatically installed.
import moment, { Moment } from 'moment';
The code below, returns the formatted date string in the given format.
moment().format('dddd, MMMM Do YYYY, h:mm:ss A'); // output => "Friday, October 4th 2019, 7:12:49 PM" moment().format('ddd, hA'); // output => "Fri, 7PM"
Day.js
The Fundamental Library NGX is currently working to merget the latest changes and incorporate Day.js as an option for the developers to use.
Similarly to Moment.js, you will need to import the Day.js library.
import dayjs, { Dayjs } from 'dayjs';
Additionally, if you would like to used Advance format for the date and time, you will need to add the code snippet below.
import advancedFormat from 'dayjs/plugin/customParseFormat'; dayjs.extend(advancedFormat);
The code below, returns the formatted date string in the given format.
dayjs().format('dddd, MMMM D YYYY, h:mm:ss A'); // output => "Friday, October 4th 2019, 7:12:49 PM" dayjs().format('ddd, hA'); // output => "Fri, 7PM" // dayjs requires advancedFormat plugin to support more format tokens dayjs().format('dddd, MMMM Do YYYY, h:mm:ss A'); // output => "Friday, October 4th 2019, 7:12:49 PM
Fundamental Library NGX is providing the developers with both options. Developers who use Moment.js in their existing applications can use MomentDateTimeAdapter since the migration to DayDateTimeAdapter can cause issues. Although, we do not recommend picking MomentDateTimeAdapter for the new projects. We also recommend developers to switch to DayDateTimeAdapter if they are not using Moment.js in their existing application.
Follow the Fundamental Library Styles Community to stay tuned for the updates. If you have any questions feel free to post them in the comment section below or in SAP Community Q&A. | https://blogs.sap.com/2022/05/02/fundamental-library-ngx-towards-day.js/ | CC-MAIN-2022-21 | refinedweb | 490 | 52.15 |
Hi David, are you working on this test at the moment? We are trying to get Robocop tests done for the basic smoke tests and I could work on this if you are not currently working on it. Thanks
Created attachment 687716 [details] [diff] [review] Tab History test v1 This is a robocop test that covers the use of the Forward, Back and Reload buttons to navigate the current tab history. By testing the reload button it also covers the test for bug 747837. The test starts by determining the device OS (pre or post Honeycomb) and then the device size in order to run the test depending on the different UIs. I am assuming in the test that a device with a both the width and height larger then 480 pixels is a tablet. During the testing of the bug I have noticed the fails covered in bug 798816 on low end devices and this is why I also made changes to the VerifyPageTitle method. The title of the page may not be updated in time when checked and the URL is found instead causing the VerifyPageTitle test to fail. The change in this patch introduces a delay that allows for the title to be updated.
Created attachment 687718 [details] [diff] [review] Tab History test v1.1 Cleaned up some extra spaces
Comment on attachment 687718 [details] [diff] [review] Tab History test v1.1 Review of attachment 687718 [details] [diff] [review]: ----------------------------------------------------------------- overall this is a good start. A lot of little details I would like to see fixed before r+. This also makes me wonder if we should abstract our menus a bit more. Also there is a lot of checking for tablet vs phone, if this was abstracted out, we could create a menu or navigation class and instantiate it with phone or tablet. This would Allow us to call navigation.back(), etc... This entire concept isn't required for a r+, it just seems like a nice to have or a followup bug. ::: mobile/android/base/tests/testTabHistory.java.in @@ +11,5 @@ > + > +public class testTabHistory extends PixelTest { > + > + > + private Boolean tablet; maybe icsTablet to be complete. @@ +12,5 @@ > +public class testTabHistory extends PixelTest { > + > + > + private Boolean tablet; > + private Boolean icsOSphone; can we call this 'icsPhone' instead? @@ +29,5 @@ > + > + public void testTabHistory() { > + blockForGeckoReady(); > + > + // Get the screen size - used to determin if tablet or phone s/determin/determine/ @@ +42,5 @@ > + > + // Get the buttons from the tablet UI - will be null if the UI is not tablet > + Element fwdBtn = mDriver.findElement(getActivity(), "forward"); > + Element backBtn = mDriver.findElement(getActivity(), "back"); > + Element reloadBtn = mDriver.findElement(getActivity(), "reload"); we shouldn't get these unless we know we have a tablet. @@ +49,5 @@ > + mActions.sendSpecialKey(Actions.SpecialKey.MENU); > + if (mSolo.waitForText("More")){ > + icsOSphone = false; > + tablet = false; > + } I don't like making this decision based on the 'More' key, can we just use the resolution mentioned below? Maybe other factors? @@ +80,5 @@ > + mSolo.waitForText("Browser Blank Page 02"); > + } > + > + // Go to the first page > + mActions.sendSpecialKey(Actions.SpecialKey.BACK); why not use the backBtn for the tablet? @@ +94,5 @@ > + mActions.sendSpecialKey(Actions.SpecialKey.MENU); > + mSolo.waitForText("^Share$"); > + if (icsOSphone) { > + fwdMenuBtn.click(); > + mSolo.waitForText("Browser Blank Page 02"); please indent here @@ +98,5 @@ > + mSolo.waitForText("Browser Blank Page 02"); > + } > + else { > + mSolo.clickOnText("^Forward$"); > + mSolo.waitForText("Browser Blank Page 02"); please indent here.
(In reply to Joel Maher (:jmaher) from comment #4) > @@ +49,5 @@ > > + mActions.sendSpecialKey(Actions.SpecialKey.MENU); > > + if (mSolo.waitForText("More")){ > > + icsOSphone = false; > > + tablet = false; > > + } > > I don't like making this decision based on the 'More' key, can we just use > the resolution mentioned below? Maybe other factors? I can look forward into this but I am not sure there is another way to check for this. The resolution would not be very accurate I think because for instance a Samsung Galaxy S2 can run both Gingerbread (Factory default) or ICS (System update build offered for the device). I can try and look forward into this but at this point this is the only way I could think of to make a difference between the menus for ICS and Gingerbead devices.()
(In reply to Joel Maher (:jmaher) from comment #6) >() Created the follow-up bug 818390 for this
Created attachment 691265 [details] [diff] [review] Tab History test v2 Kept the changes to fix bug 798816. Added the Device and Navigation classes in BaseTest to make it available in other tests. Remade the patch for back, forward (bug 747835) and reload (bug 747837) to use the new classes.
Comment on attachment 691265 [details] [diff] [review] Tab History test v2 Review of attachment 691265 [details] [diff] [review]: ----------------------------------------------------------------- this is looking really good. Some whitespace nits here. Does this run for you? ::: mobile/android/base/tests/BaseTest.java.in @@ +390,5 @@ > + public String version; // 2.x or 3.x or 4.x > + public String type; // tablet or phone > + public int width; > + public int height; > + can we have a constructor which does a detectDevice()? @@ +422,5 @@ > + type = "phone"; > + } > + } > + > + public void rotate(){ nit: space between () and { @@ +436,5 @@ > + class Navigation { > + private String devType; > + private String osVersion; > + > + public Navigation(Device mDevice){ nit: space between () and { @@ +442,5 @@ > + osVersion = mDevice.version; > + } > + > + public void back(){ > + if (devType == "tablet"){ nit: space between () and { @@ +452,5 @@ > + } > + } > + > + public void forward(){ > + if (devType == "tablet"){ nit: space between () and { @@ +470,5 @@ > + } > + } > + > + public void reload(){ > + if (devType == "tablet"){ nit: space between () and { ::: mobile/android/base/tests/testTabHistory.java.in @@ +4,5 @@ > +import @ANDROID_PACKAGE_NAME@.*; > +import android.app.Activity; > +import android.util.Log; > +import android.widget.ImageButton; > +import android.widget.ListView; do we need ImageButton and ListView?
I originally tested this on an HTC Desire(Android 2.2), a Samsung Galaxy S2 (4.0.4) and a Samsung Galaxy Tab 2 7.0 (Android 4.0.4). This worked on each of the devices and they were correctly identified in each case. I will make the necessary changes to the patch and update it shortly
Created attachment 692230 [details] [diff] [review] Tab History test v2.1 Added the detctDevice method to the Device constructor, added the necessary spaces and cleared the unused imports/variables from testTabHistory.java.in. Retested everything against the 3 devices (HTC Desire, Samsung Galaxy S2 and Samsung Galaxy Tab 2 7.0)
Comment on attachment 692230 [details] [diff] [review] Tab History test v2.1 Review of attachment 692230 [details] [diff] [review]: ----------------------------------------------------------------- thanks!
Comment on attachment 692230 [details] [diff] [review] Tab History test v2.1 Review of attachment 692230 [details] [diff] [review]: ----------------------------------------------------------------- I just ran into some of this code while looking into bug 814282 and there are some additional things that should be fixed. Please file a new bug for these issues. ::: mobile/android/base/tests/BaseTest.java.in @@ +18,5 @@ > import java.io.IOException; > import java.lang.reflect.Method; > import java.util.HashMap; > +import android.os.Build; > +import android.util.DisplayMetrics; The imports should be ordered as described at @@ +389,5 @@ > + Build.VERSION mBuildVersion; > + public String version; // 2.x or 3.x or 4.x > + public String type; // tablet or phone > + public int width; > + public int height; The version, type, width, and height variables should be made final, and the detectDevice() code should be inlined into the constructor. @@ +399,5 @@ > + private void detectDevice() { > + // Determine device version > + mBuildVersion = new Build.VERSION(); > + int mSDK = mBuildVersion.SDK_INT; > + if (mSDK < Build.VERSION_CODES.HONEYCOMB) { The "m" prefix on variables should only be used on class variables. mSDK is a local variable and shouldn't have that prefix. mBuildVersion is a class variable but it is never used anywhere other than these two lines, and should become a local variable. Also you don't need to create a new Build.VERSION object, you should just use Build.VERSION.SDK_INT.
Thanks for the observation on the code. Actually the code in this patch has been changed since it was landed. I'll look over the existing code in the latest versions of the sources and see what changes are needed.
New bug to cover the code cleanup filed and patch added - bug 864280 | https://bugzilla.mozilla.org/show_bug.cgi?id=747835 | CC-MAIN-2017-13 | refinedweb | 1,327 | 58.28 |
I was working with some InfoPath 2007 + MOSS 2007 + BizTalk Server 2006 R2 scenarios, and accidentally came across a possible problem with how InfoPath is managing namespaces for promoted columns.
Now I suspect the problem is actually “me”, since the scenario I’m outlining below seems to be too big of a problem otherwise. Let’s assume I have a very simple XSD schema which I will use to build an InfoPath form which in turn, is published to SharePoint. My schema looks like this …
Given that schema (notice ElementFormDefault is set to Qualified) the following two instances are considered equivalent.
…
Whether there’s a namespace prefix on the element or not doesn’t matter. And as with any BizTalk-developed schema, there is no default namespace prefix set on this XSD. Next, I went to my InfoPath 2003 + SharePoint 2003 + BizTalk Server 2006 environment to build an InfoPath form based on this schema.
During the publication of this form to SharePoint, I specified two elements from my XSD that I wish to display as columns in the SharePoint document library.
Just to peek at how these elements are promoted, I decided to “unpack” the InfoPath form and look at the source files.
If you look inside the manifest.xsf file, you’d fine a node where the promoted columns are referenced.
<xsf:listProperties> <xsf:fields> <xsf:field </xsf:field> <xsf:field </xsf:field> </xsf:fields> </xsf:listProperties>
A namespace prefix (defined at the top of the manifest file) is used here (ns1). If I upload the two XML files I showed above (one with a namespace prefix for the elements, the other without), I still get the promoted values I was seeking since a particular namespace prefix should be irrelevant.
That’s the behavior that I’m used to, and have developed around. When BizTalk publishes these documents to this library, the same result (promoted columns) occurs.
Now let’s switch to the InfoPath 2007 + MOSS 2007 environment and build the same solution. Taking the exact same XSD schema and XML instances, I went ahead and built an InfoPath 2007 form and selected to publish it to the MOSS server.
While I have InfoPath Forms Server configured, this particular form was not set up to use it. Like my InfoPath 2003 form, this form has the same columns promoted.
However, after publishing to MOSS, and uploading my two XML instance files, I have NO promoted values!
Just in case “ns0” is already used, I created two more instance files, one with a namespace prefix of “foo” and one with a namespace prefix of “ns1.” Only using a namespace prefix of ns1 results in the XML elements getting promoted.
If I unpack the InfoPath 2007 form, the node in the manifest representing the promoted columns has identical syntax to the InfoPath 2003 form. If I fill out the InfoPath form from the MOSS document library directly, the columns ARE promoted, but peeking at the underlying XML shows that a default namespace of ns1 is used.
So what’s going on here? I can’t buy that you HAVE to use “ns1” as the namespace prefix in order to promote columns in InfoPath 2007 + MOSS when InfoPath 2003 + SharePoint doesn’t require this (arbitrary) behavior. The prefix should be irrelevant.
Did I miss a (new) step in the MOSS environment? Does my schema require something different? Does this appear to be an InfoPath thing or SharePoint thing? Am I just a monkey?
I noticed this when publishing messages from BizTalk Server 2006 R2 to SharePoint and being unable to get the promoted values to show up. I really find it silly to have to worry about setting up explicit namespace prefixes. Any thoughts are appreciated.
Technorati Tags: InfoPath, SharePoint
Categories: InfoPath, SharePoint
Its a bug in WSS/MOSS. The two solutions are:
a) make a custom XSLT that uses the right namespace URI prefixes.
b) write a custom WSS adapter.
Wow, that’s quite a bug. I’m glad that I’m less crazy than previously thought.
Thanks Jon.
Hey All. I am encountering the same problem from a different angle. When I programatically create an InfoPath form instance and save it to a document library, the form exhibits strange behavior. If you look at the xml that’s serialized, the default namespace (which should be “my”) is blank and all elements are not prefixed.
Bugger!
Wow, I’ve run into exactly the same scenario. Please keep up us posted if you find a better workaround that writing a custom xslt or wss adapter. One would think that MS would issue a bug fix ASAP!
Thanks
This bug seems to happen with WSS3 regardless of wether or not you are using InfoPath 2003 or 2007. I think I found another work around. After creating the Form in InfoPath extract the files. Open the mainfest in notepad and do a find-replace on NS1 changing it to NS0. Save the file and then click on it and open in InfoPath. It should open the form – then publish to your library and give it a try. It seems to work…somebody else try to make sure I am not crazy.
You can create a simple BizTalk project and Orchestration must be AUTOMIC. Then add Recei shape, Construct Shape, Message assignment,Send Shape.
Code in the Message Assignment Shape.
WSSout=NewForm;
NodeList=WSSout.GetElementsByTagName(“ns0:Form”);
Node1=NodeList.Item(0);
Node1.Prefix=”ns1″;
WSSInput=WSSout;
NewForm is the message generated by BizTalk with ns0:Form.
WSSout is a variable of type System.Xml.XmlDocument
NodeList is a variable of type System.Xml.XmlNodeList
Node1 is a variable of type System.Xml.XmlNode
WSSInput is a message type of System.Xml.XmlDocument
The input will be ns0:Form na doutput will be ns1:Form .
You can create this as a Convertion project and deploy so the flow will be Input to BizTalk –> output from BizTalk is Input to the project we created –> Output from Our project is the Input to MOSS
:). Hope this help.
If anyone has any other ideas please post.
Regards,
Daniel.
i’m having the same problem too..don’t know how to configure this. it seems like the infopath 2007 really mess up my working life..
Well, I think that I’m seeing it in BizTalk Server 2009.
I’ll keep trying and report back.
This is still a problem in bts 2009 – unfortunatly.
But @Dave’s method of modifying the manifest file works for me as well. Strange…
We have resolved this issue for about 46 different InfoPath templates and multiple levels of nesting. Please let me know if anyone is intrested in solution.
Yes please post the solution
Hi can you please post the solution?
Hemendra Patel, yes please post your solutions | https://seroter.wordpress.com/2007/10/25/problem-with-infopath-2007-and-sharepoint-namespace-handling/ | CC-MAIN-2017-39 | refinedweb | 1,133 | 65.42 |
A First Look at MassTransit
A First Look at MassTransit
Join the DZone community and get the full member experience.Join For Free
Get the code for this post here.
I’ve recently been trying out MassTransit as a possible replacement for our current JBOWS architecture. MassTransit is a “lean service bus implementation for building loosely coupled applications using the .NET framework.” It’s a simple service bus based around the idea of asynchronous publish and subscribe. It’s written by Dru Sellers and Chris Patterson, both good guys who have been very quick to respond on both twitter and the MassTransit google group.
To start with I wanted to try out the simplest thing possible, a single publisher and a single subscriber. I wanted to be able to publish a message and have the subscriber pick it up.
The first thing to do is get the latest source from the MassTransit google code repository and build it.
The core Mass Transit infrastructure is provided by a service called MassTransit.RuntimeServices.exe this is a windows service built on Top Shelf (be careful what you click on at work when Googling for this J). I plan to blog about Top Shelf in the future, but in short it’s a very nice fluent API for building windows services. One of the nicest things about it is that you can run the service as a console app during development but easily install it as a windows service in production.
Before running RuntimeServices you have to provide it with a SQL database. I wanted to use my local SQL Server instance so I opened up the MassTransit.RuntimeServices.exe.config file, commented out the SQL CE NHibernate configuration and uncommented the SQL Server stuff. I also changed the connection string to point to a test database I’d created. I then ran the SetupSQLServer.sql script (under the PreBuiltServices\MassTransit.RuntimeServices folder) into my database to create the required tables.
So let’s start up RuntimeServices by double clicking the MassTransit.RuntimeServices.exe in the bin directory.
A whole load of debug messages are spat out. Also we can see that some new private MSMQs have been automatically created:
We can also launch MassTransit.SystemView.exe (also in the bin folder) which gives us a nice GUI view of our services:
I think it shows a list of subscriber queues on the left. If you expand the nodes you can see the types that are subscribed to. I guess the reason that the mt_subscriptions and mt_health_control queues are not shown is that they don’t have any subscriptions associated with them.
Now let’s create the simplest possible subscriber and publisher. First I’ll create a message structure. I want my message class to be shared by my publisher and subscriber, so I’ll create it in its own assembly and then reference that assembly in the publisher and subscriber projects. My message is very simple, just a regular POCO:
namespace MassTransit.Play.Messages
{
public class NewCustomerMessage
{
public string Name { get; set; }
}
}
Now for the publisher. MassTransit uses the Castle Windsor IoC container by default and log4net so we need to add the following references:
The MassTransit API is configured as a Windsor facility. I’m a big fan of Windsor, so this all makes sense to me. Here’s the Windsor config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<facilities>
<facility id="masstransit">
<bus id="main" endpoint="msmq://localhost/mt_mike_publisher">
<subscriptionService endpoint="msmq://localhost/mt_subscriptions" />
<managementService heartbeatInterval="3" />
</bus>
<transports>
<transport>MassTransit.Transports.Msmq.MsmqEndpoint, MassTransit.Transports.Msmq</transport>
</transports>
</facility>
</facilities>
</configuration>
As you can see we reference the ‘masstransit’ facility and configure it with two main nodes, bus and transports. Transports is pretty straightforward, we simply specify the MsmqEndpoint. The bus node specifies an id and an endpoint. As far as I understand it, if your service only publishes, then the queue is never used. But MassTransit throws, if you don’t specify it. I’m probably missing something here, any clarification will be warmly received J
Continuing with the configuration; under bus are two child nodes, subscriptionService and management service. The subscriptionService endpoint specifies the location of the subscription queue which RuntimeServices uses to keep track of subscriptions, this should be the location of the queue created when RuntimeServices starts up for the first time, on my machine it was mt_subscriptions. I’m unsure what the managementService specifies exactly, but I think it’s the subsystem that allows RuntimeServices to monitor the health of the service. I’m assuming that the heartbeatInterval is the number of seconds between each notification.
Next, let’s code our publisher. I’m going to create a simple console application, I would host a service with Top Shelf in production, but right now I want to do the simplest thing possible, so I’m going to keep any other infrastructure out of the equation for the time being. Here’s the publisher code:
using System;
using MassTransit.Play.Messages;
using MassTransit.Transports.Msmq;
using MassTransit.WindsorIntegration;
namespace MassTransit.Play.Publisher
{
public class Program
{
static void Main()
{
Console.WriteLine("Starting Publisher");
MsmqEndpointConfigurator.Defaults(config =>
{
config.CreateMissingQueues = true;
});
var container = new DefaultMassTransitContainer("windsor.xml");
var bus = container.Resolve<IServiceBus>();
string name;
while((name = GetName()) != "q")
{
var message = new NewCustomerMessage {Name = name};
bus.Publish(message);
Console.WriteLine("Published NewCustomerMessage with name {0}", message.Name);
}
Console.WriteLine("Stopping Publisher");
container.Release(bus);
container.Dispose();
}
private static string GetName()
{
Console.WriteLine("Enter a name to publish (q to quit)");
return Console.ReadLine();
}
}
}
The first statement instructs the MassTransit MsmqEndpointConfigurator to create any missing queues so that we don’t have to manually create the mt_mike_publisher queue. The pattern used here is very common in the MassTransit code, where a static method takes an Action<TConfig> of some configuration class.
The next line creates the DefaultMassTransitContainer. This is a WindsorContainer with the MassTransitFacility registered and all the components needed for MassTransit to run. For us the most important service is the IServiceBus which encapsulates most of the client API. The next line gets the bus from the container.
We then set up a loop getting input from the user, creating a NewCustomerMessage and calling bus.Publish(message). It really is as simple as that.
Let’s look at the subscriber next. The references and Windsor.xml config are almost identical to the publisher, the only thing that’s different is that the bus endpoint should point to a different msmq; mt_mike_subscriber in my case.
In order to subscribe to a message type we first have to create a consumer. The consumer ‘consumes’ the message when it arrives at the bus.
using System;
using MassTransit.Internal;
using MassTransit.Play.Messages;
namespace MassTransit.Play.Subscriber.Consumers
{
public class NewCustomerMessageConsumer : Consumes<NewCustomerMessage>.All, IBusService
{
private IServiceBus bus;
private UnsubscribeAction unsubscribeAction;
public void Consume(NewCustomerMessage message)
{
Console.WriteLine(string.Format("Received a NewCustomerMessage with Name : '{0}'", message.Name));
}
public void Dispose()
{
bus.Dispose();
}
public void Start(IServiceBus bus)
{
this.bus = bus;
unsubscribeAction = bus.Subscribe(this);
}
public void Stop()
{
unsubscribeAction();
}
}
}
You create a consumer by implementing the Consumes<TMessage>.All interface and, as Ayende says, it’s a very clever, fluent way of specifying both what needs to be consumed and how it should be consumed. The ‘All’ interface has a single method that needs to be implemented, Consume, and we simply write to the console that the message has arrived. Our consumer also implements IBusService, that gives us places to start and stop the service bus and do the actual subscription.
Here’s the Main method of the subscription console application:
using System;
using Castle.MicroKernel.Registration;
using MassTransit.Play.Subscriber.Consumers;
using MassTransit.Transports.Msmq;
using MassTransit.WindsorIntegration;
namespace MassTransit.Play.Subscriber
{
class Program
{
static void Main()
{
Console.WriteLine("Starting Subscriber, hit return to quit");
MsmqEndpointConfigurator.Defaults(config =>
{
config.CreateMissingQueues = true;
});
var container = new DefaultMassTransitContainer("windsor.xml")
Component.For<NewCustomerMessageConsumer>().LifeStyle.Transient
);
var bus = container.Resolve<IServiceBus>();
var consumer = container.Resolve<NewCustomerMessageConsumer>();
consumer.Start(bus);
Console.ReadLine();
Console.WriteLine("Stopping Subscriber");
consumer.Stop();
container.Dispose();
}
}
}
Once again we specify that we want MassTransit to create our queues automatically and create a DefaultMassTransitContainer. The only addition we have to make for our subscriber is to register our consumer so that the bus can resolve it from the container.
Next we simply grab the bus and our consumer from the container and call start on the consumer passing it the bus. A nice little bit of double dispatch :)
Now we can start up our Publisher and Subscriber and send messages between them.
Wow it works! I got a lot of childish pleasure from starting up multiple instances of my publisher and subscriber on multiple machines and watching the messages go back and forth. But then I’m a simple soul.
Looking at the MSMQ snap-in, we can see that the MSMQ queues have been automatically created for mt_mike_publisher and mt_mike_subscriber.
MassTransit System View also shows that the NewCustomerMessage is subscribed to on mt_mike_subscriber. It also shows the current status of our services. You can see that I have been turning them on and off through the morning.
Overall I’m impressed with MassTransit. Like most new open source projects the documentation is non-existent, but I was able to get started by looking at the Starbucks sample and reading Rhys C’s excellent blog posts. Kudos to Chris Patterson (AKA PhatBoyG) and Dru Sellers for putting such a cool project together.
Published at DZone with permission of Mike Hadlow , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}{{ parent.urlSource.name }} | https://dzone.com/articles/first-look-masstransit | CC-MAIN-2018-34 | refinedweb | 1,615 | 50.12 |
Hi Guys,
I'm rebuilding my server and trialling Cloudmin. I've got over the first few hurdles but I've hit a wall and need some help.
I'm running Debian 7 64bit with Xen as the host and using the image "Debian Wheezy Xen instance with base OS" which I'm guessing is 32bit
When I first created the instance everything worked fine until I added some cores to the instance and rebooted it. Now I get the above error and can't boot the instance.
The output of /var/log/xen/xend.log is:
[2013-11-13 07:40:38 2553] DEBUG (XendDomainInfo:2498) XendDomainInfo.constructDomain
[2013-11-13 07:40:38 2553] DEBUG (balloon:187) Balloon: 2104996 KiB free; need 16384; done.
[2013-11-13 07:40:38 2553] DEBUG (XendDomain:476) Adding Domain: 17
[2013-11-13 07:40:38 2553] DEBUG (XendDomainInfo:2836) XendDomainInfo.initDomain: 17 256
[2013-11-13 07:40:38 29282] DEBUG (XendBootloader:113) Launching bootloader as ['/usr/lib/xen-4.1/bin/pygrub', '--output=/var/run/xend/boot/xenbl.16350', '-q', '/xen/duo.img'].
[2013-11-13 07:40:38 2553] ERROR (XendBootloader:214) Boot loader didn't return any data!
[2013-11-13 07:40:38 2553]!
[2013-11-13 07:40:38 2553] DEBUG (XendDomainInfo:3071) XendDomainInfo.destroy: domid=17
[2013-11-13 07:40:38 2553] DEBUG (XendDomainInfo:2406) No device model
[2013-11-13 07:40:38 2553] DEBUG (XendDomainInfo:2408) Releasing devices
[2013-11-13 07:40:38 2553] ERROR (XendDomainInfo:108) Domain construction failed
Traceback (most recent call last):
File "/usr/lib/xen-4.1/bin/../lib/python/xen/xend/XendDomainInfo.py", line 106, in create
vm!
I've tried switching the boot methods. When I tied the Pv-Grub I get change failed : Pv-Grub command /usr/lib/xen/boot/pv-grub-x86_32.gz was not found on the host system
These are the kernels reported by Cloudmin:
System type Xen Virtual system's kernel Linux version 3.2.0-4-686-pae for i686 Host system's kernel Linux version 3.2.0-4-amd64 for x86_64
I'm not sure of the exact steps that caused this .. butI did to an apt-get upgrade on both the host and guest prior
Submitted by JamieCameron on Tue, 11/12/2013 - 15:25 Comment #1
Which Xen version are you running there? We are currently looking into an issue that can trigger this with certain Xen 4.x releases.
Submitted by RyanJohnson on Tue, 11/12/2013 - 15:57 Comment #2
Thanks for getting back to me so quickly.
I'm not sure how to check the version as this is day two for me :) .. But these are some of the packages:
xen-hypervisor-4.1-amd64 4.1.4-3+deb7u1 xen-linux-system-3.2.0-4-amd64 3.2.51-1 xen-linux-system-amd64 3.2+46 xen-system-amd64 4.1.4-3+deb7u1
Do you know if there's a manual workaround for the time being? I was going to attempt compiling xen to get the /usr/lib/xen/boot/pv-grub-x86_32.gz file from this wiki But this may stuff things up ??
Ryan
Submitted by JamieCameron on Tue, 11/12/2013 - 16:15 Comment #3
I can send you a fix for this specific issue (of VM creation failing), but it doesn't completely solve the deeper issue - that is still being worked on. Let me know if you are interested.
Submitted by RyanJohnson on Tue, 11/12/2013 - 16:22 Comment #4
Yes please Jamie. I need to quickly get off my old relic as it's failing ;)
Submitted by RyanJohnson on Tue, 11/12/2013 - 17:37 Comment #5
BTW .. The creation works fine. I had an instance running all day until I decided to increase the cpu's and reboot it.
When you say deeper issue .. That sounds serious. Is this a xen related issue or Cloudmin or both? I've not found much out there about this particular error.
Submitted by RyanJohnson on Wed, 11/13/2013 - 20:23 Comment #6
Hi Jamie,
I've managed to to mount the xen image from Dom0. Do you mind pointing me in the right direction for getting the right kernel into the instance or a way to get the instance back up?
Submitted by JamieCameron on Thu, 11/14/2013 - 00:19 Comment #7
Sorry, I missed your comments on this bug. I can send you a patch, I just need to know which Linux distribution you are running your Cloudmin master on, and if you have the Pro or GPL version.
Submitted by RyanJohnson on Thu, 11/14/2013 - 00:24 Comment #8
Hi Jamie,
No probs!
I'm using Cloudmin GPL on Debian Wheezy 64bit .. The guest is Debian Wheezy 32bit
Submitted by JamieCameron on Thu, 11/14/2013 - 19:02 Comment #9
So one work-around to fix your currently broken VM is to shut down the VM, SSH in as root and run :
cd /xen
xm delete yourvmname
xm new yourvmname.cfg
This won't actually delete the VM, just re-sync it with the .cfg file. You should then be able to start it. Let me know how it goes..
Submitted by RyanJohnson on Thu, 11/14/2013 - 19:19 Comment #10
Not looking good .. First I did this:
root@xen:/xen# xm delete duo
Error: <Fault 3: 'duo'>
Usage: xm delete <DomainName>
And then this:
root@xen:/xen# xm new duo.cfg
Unexpected error: <type 'exceptions.ImportError'>
Please report to [email protected]
Traceback (most recent call last):
File "/usr/lib/xen-4.1/bin/xm", line 8, in <module> "<string>", line 1, in <lambda>
File "/usr/lib/xen-4.1/bin/../lib/python/xen/xm/main.py", line 1518, in xm_importcommand
cmd = __import__(command, globals(), locals(), 'xen.xm')
File "/usr/lib/xen-4.1/bin/../lib/python/xen/xm/new.py", line 26, in <module>
from xen.xm.xenapi_create import *
File "/usr/lib/xen-4.1/bin/../lib/python/xen/xm/xenapi_create.py", line 24, in <module>
from lxml import etree
ImportError: No module named lxml
This is my cfg:
root@xen:/xen# cat duo.cfg
memory = 2048
maxmem = 4096
name = 'duo'
vif = ['ip=MYIPADDRESS,mac=00:16:3e:86:93:CD']
address = 'MYIPADDRESS'
netmask = '255.255.255.0'
disk = ['file:/xen/duo.img,xvda1,w']
vnc = 1
vnclisten = "0.0.0.0"
vncunused = 1
vncpasswd = "MYPASSWORD"
vfb = ['type=vnc,vncunused=1,vncpasswd=MYPASSWORD,vnclisten=0.0.0.0']
vcpus = 2
bootloader = "/usr/lib/xen-4.1/bin/pygrub"
pae = 1
Submitted by JamieCameron on Thu, 11/14/2013 - 22:40 Comment #11
Does the Xen VM named
duoactually exist? You can check by running the command
xm list duo
Submitted by RyanJohnson on Thu, 11/14/2013 - 22:56 Comment #12
Scrub that last comment .. I needed to "apt-get install python-lxml" first.. but still no luck . Although at least now it shows up in xm list
This is the resulting errors
From Cloudmin
failed : Error: VM name 'duo' already exists Using config file "/xen/duo.cfg".
From xm start duo
xm start duo
Error: Boot loader didn't return any data!
Submitted by RyanJohnson on Fri, 11/15/2013 - 00:16 Comment #13
Yes . it looks like it's there:
Name ID Mem VCPUs State Time(s)
duo 2048 2 0.0
When I list them all, duo is the only one without an ID and other things
Name ID Mem VCPUs State Time(s)
Domain-0 0 7144 8 r----- 1215.5
duo 2048 2 0.0
make 3 256 1 -b---- 11.0
Submitted by JamieCameron on Fri, 11/15/2013 - 17:25 Comment #14
FYI, I am still working on the underlying issue here - I will update this bug when fixed.
Submitted by RyanJohnson on Mon, 11/18/2013 - 16:26 Comment #15
Thanks for letting me know .. in the meantime .. If I Switch to KVM will I have the same issues?
If I do switch, is removing Xen, Cloudmin and starting again possible?
Submitted by JamieCameron on Mon, 11/18/2013 - 17:08 Comment #16
Ok, I have a fix now for these Xen 4.x issues. Anyone who'd like to try it out, let me know if you are running Cloudmin GPL or Pro, and on what Linux distribution.
Submitted by RyanJohnson on Mon, 11/18/2013 - 17:16 Comment #17
I'll try it out please Jamie.
I'm using Cloudmin GPL + Debian 7 (wheezy) 64bit
Submitted by JamieCameron on Tue, 11/19/2013 - 00:25 Comment #18
Ok, updated package sent. | https://www.virtualmin.com/node/31115 | CC-MAIN-2020-40 | refinedweb | 1,448 | 66.74 |
[Part 5] Create your own Calendar (Date/Time) library from scratch using Java
Part 5 - Next date
In Part 4, we have created a method that will return the next month of any given date. We have also eliminated the manual work of doing so and the exception we have encountered in Part 3. We are left with the task of getting the next day and year so we can get the actual next date.
Since we have reached the fifth part, I have some news.
We're on GitHub!
The source code from Part 1 - 5 are now on GitHub. You can download the source code and play around with it. Some source codes are available before they are discussed here. The link to the repository can be found at the end of this article.
Getting the next year
The first method we're going to create would be easy and simple. The nextYear() method with an int return type accepts a parameter called "date" with a string data type and contains the full date including day, month, and year. We initialized the int variable called "nextYear" with the value of the year that we will get when we parse the value of the parameter "date" plus 1 in order to get the next year. The value of "nextYear" is returned.
This is pretty straightforward and there is no need for conditional statements since all you need is to add 1 at all times.
public int nextYear(String date){ int nextYear = getYear(date) + 1; return nextYear; }
Getting the next day
For the nextDay() method, we have two conditional statements. We need to find out first if the day that is passed into the method is the last day of the month or not then we decide whether we should add 1 to or assign 1 to the value of the "nextDay" variable.
In the "if" statement, we took the day out of the full date and checked if it not equal to the number of days of the month in the full date. If it's not, the day will simply be added 1 and the result will be assigned to the variable "nextDay". For the example below, we will use the date "03-MAR-2000".
public int nextDay(String date){ int nextDay = 0; if (getDay(date) != numOfDays(date)){ nextDay = getDay(date) + 1; } else nextDay = 1; return nextDay; }
Example
This is an example of a day that is not equivalent the last day of a month.
Code (Underlined): if (getDay(date) != numOfDays(date))
Actual value (Result): "03-MAR-2000"
Code (Underlined): if (getDay(date) != numOfDays(date))
Actual value (Result): numOfDays = 31
Code (Underlined): if (getDay(date) != numOfDays(date))
Actual value (Result): "03-MAR-2000"
Code (Underlined): if (getDay(date) != numOfDays(date))
Actual value (Result): 3
Code (Underlined): if (getDay(date) != numOfDays(date))
Actual value (Result): 3 != 31
Is the day 3 not equal to 31 which is the last day of March? True. Since the condition is true, it will execute the code under the if statement.
nextDay = getDay(date) + 1;
nextDay = 3 + 1
nextDay = 4
We got the answer 4, let's see if we will get the same result when we run the code.
SampleClass
System.out.println("The next day after " + myCalendar.getDay("03-MAR-2000") + " in 03-MAR-2000" + " is " + myCalendar.nextDay("03-MAR-2000") + ".");
Now what if the day passed to the method is the last day of the month? Since it will not satisfy the first condition (if day is not equal to last day), it will proceed to the "else" part and execute the code below it.
As simple as it is, the value of the variable "nextDay" would simply be assigned the value 1. Since the day has reached the end of a month, the next day is the first day of the next month.
else
nextDay = 1;
System.out.println("The next day after " + myCalendar.getDay("31-JAN-2015") + " in 31-JAN-2015" + " is " + myCalendar.nextDay("31-JAN-2015") + ".");
Getting the next date
Now that we created methods to get the next day, next month, and next year, we can now combine these individual and specific methods to form another method that can give us the complete next date after a given full date.; }
We have three conditions under the "nextDate()" method.
[1] If the next day is not equivalent to 1.
[2] If the next day is equivalent to 1 and the month is not December.
[3] None of the above.
MyCalendar
Below is the code for the nextDate() method and the other three methods; nextDay(), nextMonth(), and nextYear().
public int nextDay(String date){ int nextDay = 0; if (getDay(date) != numOfDays(date)){ nextDay = getDay(date) + 1; } else nextDay = 1; return nextDay; } public String nextMonth(String date){ String nextMonth = ""; if (monthID(date) != 12){ nextMonth = monthName(monthID(date) + 1); } else nextMonth = monthName(1); return nextMonth; } public int nextYear(String date){ int nextYear = getYear(date) + 1; return nextYear; }; }
SampleClass
I wrote a few samples for possible and reasonable values that may be passed to our method. This includes:
[1] Ordinary days; days that are not:
[2] Last day of a month
[3] Last day of February on a leap year
[4] Last day of the year
public class SampleClass { public static void main(String[] args) { MyCalendar myCalendar = new MyCalendar(); System.out.println("************** Ordinary days ***************"); System.out.println("Next to " + "01-JAN-2016" + " is " + myCalendar.nextDate("01-JAN-2016")); System.out.println("Next to " + "26-FEB-1991" + " is " + myCalendar.nextDate("26-FEB-1991")); System.out.println("Next to " + "03-MAR-2013" + " is " + myCalendar.nextDate("03-MAR-2013")); System.out.println("Next to " + "08-APR-1868" + " is " + myCalendar.nextDate("08-APR-1868")); System.out.println("Next to " + "11-MAY-2001" + " is " + myCalendar.nextDate("11-MAY-2001")); System.out.println("Next to " + "21-JUN-2011" + " is " + myCalendar.nextDate("21-JUN-2011")); System.out.println("Next to " + "15-JUL-1998" + " is " + myCalendar.nextDate("15-JUL-1998")); System.out.println("Next to " + "03-AUG-2013" + " is " + myCalendar.nextDate("03-AUG-2013")); System.out.println("Next to " + "30-SEP-2005" + " is " + myCalendar.nextDate("30-SEP-2005")); System.out.println("Next to " + "27-OCT-1984" + " is " + myCalendar.nextDate("27-OCT-1984")); System.out.println("Next to " + "06-NOV-2003" + " is " + myCalendar.nextDate("06-NOV-2003")); System.out.println("Next to " + "04-DEC-1879" + " is " + myCalendar.nextDate("04-DEC-1879")); System.out.println("\n********** Last day of each month **********"); System.out.println("Next to " + "31-JAN-2016" + " is " + myCalendar.nextDate("31-JAN-2016")); System.out.println("Next to " + "28-FEB-1991" + " is " + myCalendar.nextDate("28-FEB-1991")); System.out.println("Next to " + "31-MAR-2013" + " is " + myCalendar.nextDate("31-MAR-2013")); System.out.println("Next to " + "30-APR-1868" + " is " + myCalendar.nextDate("30-APR-1868")); System.out.println("Next to " + "31-MAY-2001" + " is " + myCalendar.nextDate("31-MAY-2001")); System.out.println("Next to " + "30-JUN-2011" + " is " + myCalendar.nextDate("30-JUN-2011")); System.out.println("Next to " + "31-JUL-1998" + " is " + myCalendar.nextDate("31-JUL-1998")); System.out.println("Next to " + "31-AUG-2013" + " is " + myCalendar.nextDate("31-AUG-2013")); System.out.println("Next to " + "30-SEP-2005" + " is " + myCalendar.nextDate("30-SEP-2005")); System.out.println("Next to " + "31-OCT-1984" + " is " + myCalendar.nextDate("31-OCT-1984")); System.out.println("Next to " + "30-NOV-2003" + " is " + myCalendar.nextDate("30-NOV-2003")); System.out.println("\n**************** Leap year *****************"); System.out.println("Next to " + "28-FEB-2016" + " is " + myCalendar.nextDate("28-FEB-2016")); System.out.println("\n*************** End of year ****************"); System.out.println("Next to " + "31-DEC-1879" + " is " + myCalendar.nextDate("31-DEC-1879")); } }
Importance of very simple methods
Looks like we got the right results. The isLeapYear() method we created in Part 2 was pretty useful too. This is the advantage of creating each method that only does a very specific task. It becomes very easy to re-use that it is no longer necessary to hard-code its contents to a method where we will be needing it.
Repository on GitHub
I uploaded the source code on GitHub. I also added a few samples so you can test the methods and play around with it. It would be more convenient than having to go back to Part 1 just to manually copy the codes and assemble it all together. So go ahead and experiment with the code. If you encounter any problems, you can reach out to me via email.
Also, if you find any bugs or something that just doesn't work, please let me know. If you have any questions, you can email me at [email protected].
End of Part 5
We now have a complete method that returns the next date in "DD-MON-YYYY" format. One of the features that our library should have is to make operations using dates such as adding and subtracting days, months, or years. We should also be able to do something as simple as counting the days between two different dates. All of these will be discussed in the next parts.
© 2015 Joann Mistica
Popular | https://hubpages.com/technology/Create-your-own-Calendar-DateTime-library-from-scratch-using-Java-part-5 | CC-MAIN-2018-43 | refinedweb | 1,508 | 66.94 |
The detachSurface command detaches a surface into pieces, given a list of parameter values and a direction. You can also specify which pieces to keep and which to discard using the -kflag. The names of the newly detached surface(s) are returned. If history is on, the name of the resulting dependency node is also returned. You can only detach in either U or V (not both) with a single detachSurface operation. You can use this command to open a closed surface at a particular parameter value. You would use this command with only one -pflag. If you are specifying -kflags, then you must specify one, none or all -kflags. If you are specifying all -kflags, there must be one more -kflag than -pflags.
Derived from mel command maya.cmds.detachSurface
Example:
import pymel.core as pm pm.detachSurface( 'surface1', ch=True, d=1, p=0.3, rpo=False ) pm.detachSurface( 'surface1.u[0.3]', ch=True ) # Detaches surface1 into two pieces at u = 0.3. # The results are two surface pieces, and a detachSurface dependency node. # Since no "-keep" flag is used, all pieces are kept. pm.detachSurface( 'surface1', ch=True, k=(1,0), rpo=False, p=0.34, d=0 ) pm.detachSurface( 'surface1.v[0.34]', ch=True, k=(1,0), rpo=False ) # Detaches surface1 at v = 0.34. Because of the "k" flags, two # surfaces are created but the second surface is empty. A # detachSurface dependency node is also returned. pm.detachSurface( 'surface1', ch=True, rpo=True, p=(0.2, 0.5), d=1 ) pm.detachSurface( 'surface1.u[0.2]', 'surface1.u[0.5]', ch=True, rpo=True ) # Detaches surface1 into three pieces. Because of the "-rpo" flag, # the first surface piece is used to replace the original surface1. # The results are the three surfaces (including the original surface). # Even though the "ch" flag is on, a dependency node is not created # if surface1 is not a result of construction history. If surface1 # is the result of construction history, then a dependency node is # created and its name is returned. pm.detachSurface( 'cylinder1', ch=True, d=0, p=0.3, rpo=False ) # Detaches cylinder1, which is periodic in V, where the V parameter # ranges between 0.0 and 8.0. The parameter, 0.3, is used to move # the start point of the cylinder, also known as the "seam". # The resulting surface's V parameter range is 0.0 to 0.3. pm.detachSurface( 'cylinder1', ch=True, d=0, p=(0.3, 0.7), rpo=False ) # Detaches cylinder1, which is periodic in V, where the V parameter # ranges between 0.0 and 8.0. The 1st parameter, 0.3, is used to move # the start point of the cylinder, also known as the "seam". # The second parameter, 0.7, is used to detach the cylinder again. # The result is only TWO surfaces; the first surface's V parameter ranges # from 0.0 to 0.3. The second surface's V parameter ranges from 0.3 to 0.7. | http://www.luma-pictures.com/tools/pymel/docs/1.0/generated/functions/pymel.core.modeling/pymel.core.modeling.detachSurface.html#pymel.core.modeling.detachSurface | crawl-003 | refinedweb | 501 | 62.34 |
Good all day! Error-D:\Classes\mutex1\mutex1.cpp | 9 | error: ' mutex ' in namespace ' std ' does not name a type |
Something is wrong with my compiler. So far, everything has always been well compiled, worked remarkably well.
Various advice and research problems I accept with joy.
I act through CodeBlocks and my computer has 32 bits.
Downloaded D: \ gcc-6.3.0 \ gcc-6.3.0 (gcc-6.3.0.tar.bz2)
It can somehow be connected in the right places?
Is not it necessary to compile something at first?
In general, I imagine the steps of correcting the problem rather poorly. What additional libraries are available?
Last edited by Дмитро; August 5th, 2017 at 04:01 PM.
Did you try to search for this problem with google?
Victor Nijegorodov
Originally Posted by VictorN
Did you try to search for this problem with google?
Loool Google is a man's best friend
Forum Rules | http://forums.codeguru.com/showthread.php?559983-mutex-in-namespace-std-does-not-name-a-type&s=4f889e0b06c9c63633cbaf56ee3a59c9&p=2216641 | CC-MAIN-2018-39 | refinedweb | 154 | 70.09 |
I'd like to stream a big log file over the network using asyncio. I retrieve the data from the database, format it, compress it using python's zlib and stream it over the network.
Here is basically the code I use:
@asyncio.coroutine
def logs(requests):
# ...
yield from resp.prepare(request)
# gzip magic number and compression format
resp.write(b'\x1f\x8b\x08\x00\x00\x00\x00\x00')
compressor = compressobj()
for row in rows:
ip, uid, date, url, answer, volume = row
NCSA_ROW = '{} {} - [{}] "GET {} HTTP/1.0" {} {}\n'
row = NCSA_ROW.format(ip, uid, date, url, answer, volume)
row = row.encode('utf-8')
data = compressor.compress(row)
resp.write(data)
resp.write(compressor.flush())
return resp
The file that I retrieve can not be opened with gunzip and zcat raise the following error:
gzip: out.gz: unexpected end of file
Your gzip header is wrong (8 bytes instead of 10), and you follow it with a zlib stream which uses a different header and trailer. Even had you had a correct gzip header, and if you had a raw deflate stream instead of a gzip stream, you would still have not written a gzip trailer.
To do this right, do not attempt to write your own gzip header. Instead request that zlib write a complete gzip stream, which will write the correct header, compressed data, and trailer. You can do this by providing a
wbits value of
31 to
compressobj(). | http://m.dlxedu.com/m/askdetail/3/0407e89dba9049da3f52d8fc1f52e700.html | CC-MAIN-2018-47 | refinedweb | 239 | 66.74 |
Allin Cottrell
Department of Economics
Wake Forest University
Riccardo Jack Lucchetti
Dipartimento di Economia
Universit Politecnica delle Marche
March, 2011
Permission is granted to copy, distribute and/or modify this document under the terms of the
GNU Free Documentation License, Version 1.1 or any later version published by the Free Software
Foundation (see).
Contents
I
2
Introduction
1.1
Features at a glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2
Acknowledgements
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3
Getting started
2.1
2.2
Estimation output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3
2.4
Keyboard shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
2.5
11
Modes of working
13
3.1
Command scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13
3.2
15
3.3
15
3.4
16
Data files
19
4.1
Native format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
4.2
19
4.3
Binary databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
4.4
20
4.5
Structuring a dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
4.6
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
4.7
27
4.8
27
30
5.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30
5.2
Long-run variance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30
5.3
Time-series filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30
5.4
34
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
i
Contents
ii
5.5
35
5.6
36
5.7
37
5.8
37
5.9
Numerical procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
39
41
Sub-sampling a dataset
45
6.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45
6.2
45
6.3
46
6.4
Random sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
47
6.5
47
48
7.1
Gnuplot graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
48
7.2
Boxplots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
52
Discrete variables
53
8.1
53
8.2
54
Loop constructs
58
9.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
58
9.2
58
9.3
Progressive mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
61
9.4
Loop examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
61
10 User-defined functions
66
66
68
69
69
75
82
83
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
83
11.2 Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
83
11.3 Scalars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
11.4 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
Contents
iii
11.5 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
11.6 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
11.7 Bundles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
86
89
89
93
13 Matrix manipulation
97
97
98
99
114
II
Econometric methods
119
120
128
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Contents
iv
134
146
151
163
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
173
175
Contents
189
196
213
217
229
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Contents
vi
247
III
Technical details
251
252
258
268
272
Contents
33 Troubleshooting gretl
vii
276
277
IV
Appendices
278
279
A.1
A.2
A.3
282
B.1
B.2
B.3
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
B.4
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Building gretl
288
C.1
Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
C.2
Numerical accuracy
293
294
Listing of URLs
295
Bibliography
296
Chapter 1
Introduction
1.1
Features at a glance
Gretl is an econometrics package, including a shared library, a command-line client program and a
graphical user interface.
User-friendly Gretl offers an intuitive user interface; it is very easy to get up and running with
econometric analysis. Thanks to its association with the econometrics textbooks by Ramu
Ramanathan, Jeffrey Wooldridge, and James Stock and Mark Watson, the package offers many
practice data files and command scripts. These are well annotated and accessible. Two other
useful resources for gretl users are the available documentation and the gretl-users mailing
list.
Flexible You can choose your preferred point on the spectrum from interactive point-and-click to
batch processing, and can easily combine these approaches.
Cross-platform Gretls home platform is Linux but it is also available for MS Windows and Mac
OS X, and should work on any unix-like system that has the appropriate basic libraries (see
Appendix C).
Open source The full source code for gretl is available to anyone who wants to critique it, patch it,
or extend it. See Appendix C.
Sophisticated Gretl offers a full range of least-squares based estimators, either for single equations
and for systems, including vector autoregressions and vector error correction models. Several specific maximum likelihood estimators (e.g. probit, ARIMA, GARCH) are also provided
natively; more advanced estimation methods can be implemented by the user via generic
maximum likelihood or nonlinear GMM.
Extensible Users can enhance gretl by writing their own functions and procedures in gretls scripting language, which includes a wide range of matrix functions.
Accurate Gretl has been thoroughly tested on several benchmarks, among which the NIST reference datasets. See Appendix D.
Internet ready Gretl can access and fetch databases from a server at Wake Forest University. The
MS Windows version comes with an updater program which will detect when a new version is
available and offer the option of auto-updating.
International Gretl will produce its output in English, French, Italian, Spanish, Polish, Portuguese,
German, Basque, Turkish or Russian depending on your computers native language setting.
1.2
Acknowledgements
The gretl code base originally derived from the program ESL (Econometrics Software Library),
written by Professor Ramu Ramanathan of the University of California, San Diego. We are much in
debt to Professor Ramanathan for making this code available under the GNU General Public Licence
and for helping to steer gretls early development.
Chapter 1. Introduction
We are also grateful to the authors of several econometrics textbooks for permission to package for
gretl various datasets associated with their texts. This list currently includes William Greene, author of Econometric Analysis; Jeffrey Wooldridge (Introductory Econometrics: A Modern Approach);
James Stock and Mark Watson (Introduction to Econometrics); Damodar Gujarati (Basic Econometrics); Russell Davidson and James MacKinnon (Econometric Theory and Methods); and Marno Verbeek (A Guide to Modern Econometrics).
GARCH estimation in gretl is based on code deposited in the archive of the Journal of Applied
Econometrics by Professors Fiorentini, Calzolari and Panattoni, and the code to generate p-values
for DickeyFuller tests is due to James MacKinnon. In each case we are grateful to the authors for
permission to use their work.
With regard to the internationalization of gretl, thanks go to Ignacio Daz-Emparanza (Spanish),
Michel Robitaille and Florent Bresson (French), Cristian Rigamonti (Italian), Tadeusz Kufel and Pawel
Kufel (Polish), Markus Hahn and Sven Schreiber (German), Hlio Guilherme and Henrique Andrade
(Portuguese), Susan Orbe (Basque), Talha Yalta (Turkish) and Alexander Gedranovich (Russian).
Gretl has benefitted greatly from the work of numerous developers of free, open-source software:
for specifics please see Appendix C. Our thanks are due to Richard Stallman of the Free Software
Foundation, for his support of free software in general and for agreeing to adopt gretl as a GNU
program in particular.
Many users of gretl have submitted useful suggestions and bug reports. In this connection particular thanks are due to Ignacio Daz-Emparanza, Tadeusz Kufel, Pawel Kufel, Alan Isaac, Cri
Rigamonti, Sven Schreiber, Talha Yalta, Andreas Rosenblad, and Dirk Eddelbuettel, who maintains
the gretl package for Debian GNU/Linux.
1.3
Linux
On the Linux1 platform you have the choice of compiling the gretl code yourself or making use of a
pre-built package. Building gretl from the source is necessary if you want to access the development
version or customize gretl to your needs, but this takes quite a few skills; most users will want to
go for a pre-built package.
Some Linux distributions feature gretl as part of their standard offering: Debian, for example, or
Ubuntu (in the universe repository). If this is the case, all you need to do is install gretl through
your package manager of choice (e.g. synaptic).
Ready-to-run packages are available in rpm format (suitable for Red Hat Linux and related systems)
on the gretl webpage.
However, were hopeful that some users with coding skills may consider gretl sufficiently interesting to be worth improving and extending. The documentation of the libgretl API is by no means
complete, but you can find some details by following the link Libgretl API docs on the gretl homepage. People interested in the gretl development are welcome to subscribe to the gretl-devel mailing
list.
If you prefer to compile your own (or are using a unix system for which pre-built packages are not
available), instructions on building gretl can be found in Appendix C.
MS Windows
The MS Windows version comes as a self-extracting executable. Installation is just a matter of
downloading gretl_install.exe and running this program. You will be prompted for a location
to install the package.
1 In this manual we use Linux as shorthand to refer to the GNU/Linux operating system. What is said herein about
Linux mostly applies to other unix-type systems too, though some local modifications may be needed.
Chapter 1. Introduction
Updating
If your computer is connected to the Internet, then on start-up gretl can query its home website
at Wake Forest University to see if any program updates are available; if so, a window will open
up informing you of that fact. If you want to activate this feature, check the box marked Tell me
about gretl updates under gretls Tools, Preferences, General menu.
The MS Windows version of the program goes a step further: it tells you that you can update gretl
automatically if you wish. To do this, follow the instructions in the popup window: close gretl
then run the program titled gretl updater (you should find this along with the main gretl program
item, under the Programs heading in the Windows Start menu). Once the updater has completed
its work you may restart gretl.
Part I
Chapter 2
Getting started
2.1
This introduction is mostly angled towards the graphical client program; please see Chapter 34
below and the Gretl Command Reference for details on the command-line program, gretlcli.
You can supply the name of a data file to open as an argument to gretl, but for the moment lets
not do that: just fire up the program.1 You should see a main window (which will hold information
on the data set but which is at first blank) and various menus, some of them disabled at first.
What can you do at this point? You can browse the supplied data files (or databases), open a data
file, create a new data file, read the help items, or open a command script. For now lets browse the
supplied data files. Under the File menu choose Open data, Sample file. A second notebook-type
window will open, presenting the sets of data files supplied with the package (see Figure 2.1). Select
the first tab, Ramanathan. The numbering of the files in this section corresponds to the chapter
organization of Ramanathan (2002), which contains discussion of the analysis of these data. The
data will be useful for practice purposes even without the text.
If you select a row in this window and click on Info this opens a window showing information on
the data set in question (for example, on the sources and definitions of the variables). If you find
a file that is of interest, you may open it by clicking on Open, or just double-clicking on the file
name. For the moment lets open data3-6.
+ In gretl windows containing lists, double-clicking on a line launches a default action for the associated list
entry: e.g. displaying the values of a data series, opening a file.
1 For convenience we refer to the graphical client program simply as gretl in this manual. Note, however, that the
specific name of the program differs according to the computer platform. On Linux it is called gretl_x11 while on MS
Windows it is gretlw32.exe. On Linux systems a wrapper script named gretl is also installed see also the Gretl
Command Reference.
This file contains data pertaining to a classic econometric chestnut, the consumption function.
The data window should now display the name of the current data file, the overall data range and
sample range, and the names of the variables along with brief descriptive tags see Figure 2.2.
OK, what can we do now? Hopefully the various menu options should be fairly self explanatory. For
now well dip into the Model menu; a brief tour of all the main window menus is given in Section 2.3
below.
gretls Model menu offers numerous various econometric estimation routines. The simplest and
most standard is Ordinary Least Squares (OLS). Selecting OLS pops up a dialog box calling for a
model specification see Figure 2.3.
To select the dependent variable, highlight the variable you want in the list on the left and click
the arrow that points to the Dependent variable slot. If you check the Set as default box this
variable will be pre-selected as dependent when you next open the model dialog box. Shortcut:
double-clicking on a variable on the left selects it as dependent and also sets it as the default. To
select independent variables, highlight them on the left and click the green arrow (or right-click the
highlighted variable); to remove variables from the selected list, use the rad arrow. To select several
variable in the list box, drag the mouse over them; to select several non-contiguous variables, hold
down the Ctrl key and click on the variables you want. To run a regression with consumption as
the dependent variable and income as independent, click Ct into the Dependent slot and add Yt to
the Independent variables list.
2.2
Estimation output
Once youve specified a model, a window displaying the regression output will appear. The output
is reasonably comprehensive and in a standard format (Figure 2.4).
The output window contains menus that allow you to inspect or graph the residuals and fitted
values, and to run various diagnostic tests on the model.
For most models there is also an option to print the regression output in LATEX format. See Chapter 29 for details.
To import gretl output into a word processor, you may copy and paste from an output window,
using its Edit menu (or Copy button, in some contexts) to the target program. Many (not all) gretl
windows offer the option of copying in RTF (Microsofts Rich Text Format) or as LATEX. If you are
pasting into a word processor, RTF may be a good option because the tabular formatting of the
output is preserved.2 Alternatively, you can save the output to a (plain text) file then import the
file into the target program. When you finish a gretl session you are given the option of saving all
the output from the session to a single file.
Note that on the gnome desktop and under MS Windows, the File menu includes a command to
send the output directly to a printer.
+ When pasting or importing plain text gretl output into a word processor, select a monospaced or typewriterstyle font (e.g. Courier) to preserve the outputs tabular formatting. Select a small font (10-point Courier
should do) to prevent the output lines from being broken in the wrong place.
2 Note that when you copy as RTF under MS Windows, Windows will only allow you to paste the material into applications that understand RTF. Thus you will be able to paste into MS Word, but not into notepad. Note also that there
appears to be a bug in some versions of Windows, whereby the paste will not work properly unless the target application
(e.g. MS Word) is already running prior to copying the material in question.
2.3
Reading left to right along the main windows menu bar, we find the File, Tools, Data, View, Add,
Sample, Variable, Model and Help menus.
File menu
Open data: Open a native gretl data file or import from other formats. See Chapter 4.
Append data: Add data to the current working data set, from a gretl data file, a commaseparated values file or a spreadsheet file.
Save data: Save the currently open native gretl data file.
Save data as: Write out the current data set in native format, with the option of using
gzip data compression. See Chapter 4.
Export data: Write out the current data set in Comma Separated Values (CSV) format, or
the formats of GNU R or GNU Octave. See Chapter 4 and also Appendix E.
Send to: Send the current data set as an e-mail attachment.
New data set: Allows you to create a blank data set, ready for typing in values or for
importing series from a database. See below for more on databases.
Clear data set: Clear the current data set out of memory. Generally you dont have to do
this (since opening a new data file automatically clears the old one) but sometimes its
useful.
Script files: A script is a file containing a sequence of gretl commands. This item
contains entries that let you open a script you have created previously (User file), open
a sample script, or open an editor window in which you can create a new script.
Session files: A session file contains a snapshot of a previous gretl session, including
the data set used and any models or graphs that you saved. Under this item you can
open a saved session or save the current session.
Databases: Allows you to browse various large databases, either on your own computer
or, if you are connected to the internet, on the gretl database server. See Section 4.3 for
details.
Function files: Handles function packages (see Section 10.5), which allow you to access
functions written by other users and share the ones written by you.
Exit: Quit the program. Youll be prompted to save any unsaved work.
Tools menu
Statistical tables: Look up critical values for commonly used distributions (normal or
Gaussian, t, chi-square, F and DurbinWatson).
P-value finder: Look up p-values from the Gaussian, t, chi-square, F, gamma, binomial or
Poisson distributions. See also the pvalue command in the Gretl Command Reference.
Distribution graphs: Produce graphs of various probability distributions. In the resulting
graph window, the pop-up menu includes an item Add another curve, which enables
you to superimpose a further plot (for example, you can draw the t distribution with
various different degrees of freedom).
Test statistic calculator: Calculate test statistics and p-values for a range of common hypothesis tests (population mean, variance and proportion; difference of means, variances
and proportions).
Nonparametric tests: Calculate test statistics for various nonparametric tests (Sign test,
Wilcoxon rank sum test, Wilcoxon signed rank test, Runs test).
Seed for random numbers: Set the seed for the random number generator (by default
this is set based on the system time when the program is started).
Command log: Open a window containing a record of the commands executed so far.
Gretl console: Open a console window into which you can type commands as you would
using the command-line program, gretlcli (as opposed to using point-and-click).
Start Gnu R: Start R (if it is installed on your system), and load a copy of the data set
currently open in gretl. See Appendix E.
Sort variables: Rearrange the listing of variables in the main window, either by ID number
or alphabetically by name.
NIST test suite: Check the numerical accuracy of gretl against the reference results for
linear regression made available by the (US) National Institute of Standards and Technology.
Preferences: Set the paths to various files gretl needs to access. Choose the font in which
gretl displays text output. Activate or suppress gretls messaging about the availability
of program updates, and so on. See the Gretl Command Reference for further details.
Data menu
Select all: Several menu items act upon those variables that are currently selected in the
main window. This item lets you select all the variables.
Display values: Pops up a window with a simple (not editable) printout of the values of
the selected variable or variables.
Edit values: Opens a spreadsheet window where you can edit the values of the selected
variables.
Add observations: Gives a dialog box in which you can choose a number of observations
to add at the end of the current dataset; for use with forecasting.
Remove extra observations: Active only if extra observations have been added automatically in the process of forecasting; deletes these extra observations.
Read info, Edit info: Read info just displays the summary information for the current
data file; Edit info allows you to make changes to it (if you have permission to do so).
Print description: Opens a window containing a full account of the current dataset, including the summary information and any specific information on each of the variables.
Add case markers: Prompts for the name of a text file containing case markers (short
strings identifying the individual observations) and adds this information to the data set.
See Chapter 4.
Remove case markers: Active only if the dataset has case markers identifying the observations; removes these case markers.
Dataset structure: invokes a series of dialog boxes which allow you to change the structural interpretation of the current dataset. For example, if data were read in as a cross
section you can get the program to interpret them as time series or as a panel. See also
section 4.5.
Compact data: For time-series data of higher than annual frequency, gives you the option
of compacting the data to a lower frequency, using one of four compaction methods
(average, sum, start of period or end of period).
Expand data: For time-series data, gives you the option of expanding the data to a higher
frequency.
Transpose data: Turn each observation into a variable and vice versa (or in other words,
each row of the data matrix becomes a column in the modified data matrix); can be useful
with imported data that have been read in sideways.
View menu
10
Icon view: Opens a window showing the content of the current session as a set of icons;
see section 3.4.
Graph specified vars: Gives a choice between a time series plot, a regular XY scatter
plot, an XY plot using impulses (vertical bars), an XY plot with factor separation (i.e.
with the points colored differently depending to the value of a given dummy variable),
boxplots, and a 3-D graph. Serves up a dialog box where you specify the variables to
graph. See Chapter 7 for details.
Multiple graphs: Allows you to compose a set of up to six small graphs, either pairwise
scatter-plots or time-series graphs. These are displayed together in a single window.
Summary statistics: Shows a full set of descriptive statistics for the variables selected in
the main window.
Correlation matrix: Shows the pairwise correlation coefficients for the selected variables.
Cross Tabulation: Shows a cross-tabulation of the selected variables. This works only if
at least two variables in the data set have been marked as discrete (see Chapter 8).
Principal components: Produces a Principal Components Analysis for the selected variables.
Mahalanobis distances: Computes the Mahalanobis distance of each observation from
the centroid of the selected set of variables.
Cross-correlogram: Computes and graphs the cross-correlogram for two selected variables.
Add menu Offers various standard transformations of variables (logs, lags, squares, etc.) that
you may wish to add to the data set. Also gives the option of adding random variables, and
(for time-series data) adding seasonal dummy variables (e.g. quarterly dummy variables for
quarterly data).
Sample menu
Set range: Select a different starting and/or ending point for the current sample, within
the range of data available.
Restore full range: self-explanatory.
Define, based on dummy: Given a dummy (indicator) variable with values 0 or 1, this
drops from the current sample all observations for which the dummy variable has value
0.
Restrict, based on criterion: Similar to the item above, except that you dont need a predefined variable: you supply a Boolean expression (e.g. sqft > 1400) and the sample is
restricted to observations satisfying that condition. See the entry for genr in the Gretl
Command Reference for details on the Boolean operators that can be used.
Random sub-sample: Draw a random sample from the full dataset.
Drop all obs with missing values: Drop from the current sample all observations for
which at least one variable has a missing value (see Section 4.6).
Count missing values: Give a report on observations where data values are missing. May
be useful in examining a panel data set, where its quite common to encounter missing
values.
Set missing value code: Set a numerical value that will be interpreted as missing or not
available. This is intended for use with imported data, when gretl has not recognized
the missing-value code used.
Variable menu Most items under here operate on a single variable at a time. The active
variable is set by highlighting it (clicking on its row) in the main data window. Most options
will be self-explanatory. Note that you can rename a variable and can edit its descriptive label
under Edit attributes. You can also Define a new variable via a formula (e.g. involving
11
some function of one or more existing variables). For the syntax of such formulae, look at the
online help for Generate variable syntax or see the genr command in the Gretl Command
Reference. One simple example:
foo = x1 * x2
will create a new variable foo as the product of the existing variables x1 and x2. In these
formulae, variables must be referenced by name, not number.
Model menu For details on the various estimators offered under this menu please consult the
Gretl Command Reference. Also see Chapter 18 regarding the estimation of nonlinear models.
Help menu Please use this as needed! It gives details on the syntax required in various dialog
entries.
2.4
Keyboard shortcuts
When working in the main gretl window, some common operations may be performed using the
keyboard, as shown in the table below.
2.5
Return
Pressing this key has the effect of deleting the selected variables. A confirmation is required, to prevent accidental deletions.
Has the same effect as selecting Edit attributes from the Variable menu.
F2
Has the same effect as selecting Define new variable from the Variable
menu (which maps onto the genr command).
F1
Refreshes the variable list in the main window: has the same effect as selecting
Refresh window from the Data menu.
Graphs the selected variable; a line graph is used for time-series datasets,
whereas a distribution plot is used for cross-sectional data.
The icons have the following functions, reading from left to right:
1. Launch a calculator program. A convenience function in case you want quick access to a
calculator when youre working in gretl. The default program is calc.exe under MS Windows, or xcalc under the X window system. You can change the program under the Tools,
Preferences, General menu, Programs tab.
2. Start a new script. Opens an editor window in which you can type a series of commands to be
sent to the program as a batch.
3. Open the gretl console. A shortcut to the Gretl console menu item (Section 2.3 above).
12
Chapter 3
Modes of working
3.1
Command scripts
As you execute commands in gretl, using the GUI and filling in dialog entries, those commands are
recorded in the form of a script or batch file. Such scripts can be edited and re-run, using either
gretl or the command-line client, gretlcli.
To view the current state of the script at any point in a gretl session, choose Command log under
the Tools menu. This log file is called session.inp and it is overwritten whenever you start a new
session. To preserve it, save the script under a different name. Script files will be found most easily,
using the GUI file selector, if you name them with the extension .inp.
To open a script you have written independently, use the File, Script files menu item; to create a
script from scratch use the File, Script files, New script item or the new script toolbar button.
In either case a script window will open (see Figure 3.1).
The toolbar at the top of the script window offers the following functions (left to right): (1) Save
the file; (2) Save the file under a specified name; (3) Print the file (this option is not available on all
platforms); (4) Execute the commands in the file; (5) Copy selected text; (6) Paste the selected text;
(7) Find and replace text; (8) Undo the last Paste or Replace action; (9) Help (if you place the cursor
in a command word and press the question mark you will get help on that command); (10) Close
the window.
When you execute the script, by clicking on the Execute icon or by pressing Ctrl-r, all output is
directed to a single window, where it can be edited, saved or copied to the clipboard. To learn
more about the possibilities of scripting, take a look at the gretl Help item Command reference,
13
14
or start up the command-line program gretlcli and consult its help, or consult the Gretl Command
Reference.
If you run the script when part of it is highlighted, gretl will only run that portion. Moreover, if you
want to run just the current line, you can do so by pressing Ctrl-Enter.1
Clicking the right mouse button in the script editor window produces a pop-up menu. This gives
you the option of executing either the line on which the cursor is located, or the selected region of
the script if theres a selection in place. If the script is editable, this menu also gives the option of
adding or removing comment markers from the start of the line or lines.
The gretl package includes over 70 practice scripts. Most of these relate to Ramanathan (2002),
but they may also be used as a free-standing introduction to scripting in gretl and to various points
of econometric theory. You can explore the practice files under File, Script files, Practice file There
you will find a listing of the files along with a brief description of the points they illustrate and the
data they employ. Open any file and run it to see the output. Note that long commands in a script
can be broken over two or more lines, using backslash as a continuation character.
You can, if you wish, use the GUI controls and the scripting approach in tandem, exploiting each
method where it offers greater convenience. Here are two suggestions.
Open a data file in the GUI. Explore the data generate graphs, run regressions, perform
tests. Then open the Command log, edit out any redundant commands, and save it under
a specific name. Run the script to generate a single file containing a concise record of your
work.
Start by establishing a new script file. Type in any commands that may be required to set
up transformations of the data (see the genr command in the Gretl Command Reference).
Typically this sort of thing can be accomplished more efficiently via commands assembled
with forethought rather than point-and-click. Then save and run the script: the GUI data
window will be updated accordingly. Now you can carry out further exploration of the data
via the GUI. To revisit the data at a later point, open and rerun the preparatory script first.
Scripts and data files
One common way of doing econometric research with gretl is as follows: compose a script; execute
the script; inspect the output; modify the script; run it again with the last three steps repeated
as many times as necessary. In this context, note that when you open a data file this clears out
most of gretls internal state. Its therefore probably a good idea to have your script start with an
open command: the data file will be re-opened each time, and you can be confident youre getting
fresh results.
One further point should be noted. When you go to open a new data file via the graphical interface,
you are always prompted: opening a new data file will lose any unsaved work, do you really want
to do this? When you execute a script that opens a data file, however, you are not prompted. The
assumption is that in this case youre not going to lose any work, because the work is embodied
in the script itself (and it would be annoying to be prompted at each iteration of the work cycle
described above).
This means you should be careful if youve done work using the graphical interface and then decide
to run a script: the current data file will be replaced without any questions asked, and its your
responsibility to save any changes to your data first.
1 This feature is not unique to gretl; other econometric packages offer the same facility. However, experience shows
that while this can be remarkably useful, it can also lead to writing dinosaur scripts that are never meant to be executed
all at once, but rather used as a chaotic repository to cherry-pick snippets from. Since gretl allows you to have several
script windows open at the same time, you may want to keep your scripts tidy and reasonably small.
3.2
15
When you estimate a model using point-and-click, the model results are displayed in a separate
window, offering menus which let you perform tests, draw graphs, save data from the model, and
so on. Ordinarily, when you estimate a model using a script you just get a non-interactive printout
of the results. You can, however, arrange for models estimated in a script to be captured, so that
you can examine them interactively when the script is finished. Here is an example of the syntax
for achieving this effect:
Model1 <- ols Ct 0 Yt
That is, you type a name for the model to be saved under, then a back-pointing assignment arrow,
then the model command. You may use names that have embedded spaces if you like, but such
names must be wrapped in double quotes:
"Model 1" <- ols Ct 0 Yt
Models saved in this way will appear as icons in the gretl icon view window (see Section 3.4) after
the script is executed. In addition, you can arrange to have a named model displayed (in its own
window) automatically as follows:
Model1.show
The same facility can be used for graphs. For example the following will create a plot of Ct against
Yt, save it under the name CrossPlot (it will appear under this name in the icon view window),
and have it displayed:
CrossPlot <- gnuplot Ct Yt
CrossPlot.show
You can also save the output from selected commands as named pieces of text (again, these will
appear in the session icon window, from where you can open them later). For example this command sends the output from an augmented DickeyFuller test to a text object named ADF1 and
displays it in a window:
ADF1 <- adf 2 x1
ADF1.show
Objects saved in this way (whether models, graphs or pieces of text output) can be destroyed using
the command .free appended to the name of the object, as in ADF1.free.
3.3
A further option is available for your computing convenience. Under gretls Tools menu you will
find the item Gretl console (there is also an open gretl console button on the toolbar in the
main window). This opens up a window in which you can type commands and execute them one
by one (by pressing the Enter key) interactively. This is essentially the same as gretlclis mode of
operation, except that the GUI is updated based on commands executed from the console, enabling
you to work back and forth as you wish.
In the console, you have command history; that is, you can use the up and down arrow keys to
navigate the list of command you have entered to date. You can retrieve, edit and then re-enter a
previous command.
16
In console mode, you can create, display and free objects (models, graphs or text) aa described
above for script mode.
3.4
gretl offers the idea of a session as a way of keeping track of your work and revisiting it later.
The basic idea is to provide an iconic space containing various objects pertaining to your current
working session (see Figure 3.2). You can add objects (represented by icons) to this space as you
go along. If you save the session, these added objects should be available again if you re-open the
session later.
Figure 3.2: Icon view: one model and one graph have been added to the default icons
If you start gretl and open a data set, then select Icon view from the View menu, you should see
the basic default set of icons: these give you quick access to information on the data set (if any),
correlation matrix (Correlations) and descriptive summary statistics (Summary). All of these
are activated by double-clicking the relevant icon. The Data set icon is a little more complex:
double-clicking opens up the data in the built-in spreadsheet, but you can also right-click on the
icon for a menu of other actions.
To add a model to the Icon view, first estimate it using the Model menu. Then pull down the File
menu in the model window and select Save to session as icon. . . or Save as icon and close.
Simply hitting the S key over the model window is a shortcut to the latter action.
To add a graph, first create it (under the View menu, Graph specified vars, or via one of gretls
other graph-generating commands). Click on the graph window to bring up the graph menu, and
select Save to session as icon.
Once a model or graph is added its icon will appear in the Icon view window. Double-clicking on the
icon redisplays the object, while right-clicking brings up a menu which lets you display or delete
the object. This popup menu also gives you the option of editing graphs.
The model table
In econometric research it is common to estimate several models with a common dependent variable the models differing in respect of which independent variables are included, or perhaps in
respect of the estimator used. In this situation it is convenient to present the regression results
in the form of a table, where each column contains the results (coefficient estimates and standard
errors) for a given model, and each row contains the estimates for a given variable across the
models.
In the Icon view window gretl provides a means of constructing such a table (and copying it in plain
text, LATEX or Rich Text Format). The procedure is outlined below. (The model table can also be built
17
non-interactively, in script mode. For details, see the entry for modeltab in the Gretl Command
Reference.)
1. Estimate a model which you wish to include in the table, and in the model display window,
under the File menu, select Save to session as icon or Save as icon and close.
2. Repeat step 1 for the other models to be included in the table (up to a total of six models).
3. When you are done estimating the models, open the icon view of your gretl session, by selecting Icon view under the View menu in the main gretl window, or by clicking the session
icon view icon on the gretl toolbar.
4. In the Icon view, there is an icon labeled Model table. Decide which model you wish to
appear in the left-most column of the model table and add it to the table, either by dragging
its icon onto the Model table icon, or by right-clicking on the model icon and selecting Add
to model table from the pop-up menu.
5. Repeat step 4 for the other models you wish to include in the table. The second model selected
will appear in the second column from the left, and so on.
6. When you are finished composing the model table, display it by double-clicking on its icon.
Under the Edit menu in the window which appears, you have the option of copying the table
to the clipboard in various formats.
7. If the ordering of the models in the table is not what you wanted, right-click on the model
table icon and select Clear table. Then go back to step 4 above and try again.
A simple instance of gretls model table is shown in Figure 3.3.
18
Programs tab in the Preferences dialog box (under the Tools menu in the main window). Usually
this should be pdflatex for PDF output or latex for PostScript. In the latter case you must have a
working set-up for handling PostScript, which will usually include dvips, ghostscript and a viewer
such as gv, ggv or kghostview.
In the Icon view window, you can drag up to eight graphs onto the graph page icon. When you
double-click on the icon (or right-click and select Display), a page containing the selected graphs
(in PDF or EPS format) will be composed and opened in your viewer. From there you should be able
to print the page.
To clear the graph page, right-click on its icon and select Clear.
As with the model table, it is also possible to manipulate the graph page via commands in script or
console mode see the entry for the graphpg command in the Gretl Command Reference.
Saving and re-opening sessions
If you create models or graphs that you think you may wish to re-examine later, then before quitting
gretl select Session files, Save session from the File menu and give a name under which to save
the session. To re-open the session later, either
Start gretl then re-open the session file by going to the File, Session files, Open session, or
From the command line, type gretl -r sessionfile, where sessionfile is the name under which
the session was saved, or
Drag the icon representing a gretl session file onto gretl.
Chapter 4
Data files
4.1
Native format
gretl has its own format for data files. Most users will probably not want to read or write such files
outside of gretl itself, but occasionally this may be useful and full details on the file formats are
given in Appendix A.
4.2
4.3
Binary databases
For working with large amounts of data gretl is supplied with a database-handling routine. A
database, as opposed to a data file, is not read directly into the programs workspace. A database
1 See.
19
20
can contain series of mixed frequencies and sample ranges. You open the database and select
series to import into the working dataset. You can then save those series in a native format data
file if you wish. Databases can be accessed via gretls menu item File, Databases.
For details on the format of gretl databases, see Appendix A.
Online access to databases
As of version 0.40, gretl is able to access databases via the internet. Several databases are available
from Wake Forest University. Your computer must be connected to the internet for this option to
work. Please see the description of the data command under gretls Help menu.
+ Visit the gretl data page for details and updates on available data.
Foreign database formats
Thanks to Thomas Doan of Estima, who made available the specification of the database format
used by RATS 4 (Regression Analysis of Time Series), gretl can handle such databases or at least,
a subset of same, namely time-series databases containing monthly and quarterly series.
Gretl can also import data from PcGive databases. These take the form of a pair of files, one
containing the actual data (with suffix .bn7) and one containing supplementary information (.in7).
4.4
21
Data values: these should constitute a rectangular block, with one variable per column (and
one observation per row). The number of variables (data columns) must match the number
of variable names given. See also section 4.6. Numeric data are expected, but in the case of
importing from ASCII/CSV, the program offers limited handling of character (string) data: if
a given column contains character data only, consecutive numeric codes are substituted for
the strings, and once the import is complete a table is printed showing the correspondence
between the strings and the codes.
Dates (or observation labels): Optionally, the first column may contain strings such as dates,
or labels for cross-sectional observations. Such strings have a maximum of 8 characters (as
with variable names, longer strings will be truncated). A column of this sort should be headed
with the string obs or date, or the first row entry may be left blank.
For dates to be recognized as such, the date strings must adhere to one or other of a set of
specific formats, as follows. For annual data: 4-digit years. For quarterly data: a 4-digit year,
followed by a separator (either a period, a colon, or the letter Q), followed by a 1-digit quarter.
Examples: 1997.1, 2002:3, 1947Q1. For monthly data: a 4-digit year, followed by a period or
a colon, followed by a two-digit month. Examples: 1997.01, 2002:10.
CSV files can use comma, space or tab as the column separator. When you use the Import CSV
menu item you are prompted to specify the separator. In the case of Import ASCII the program
attempts to auto-detect the separator that was used.
If you use a spreadsheet to prepare your data you are able to carry out various transformations of
the raw data with ease (adding things up, taking percentages or whatever): note, however, that
you can also do this sort of thing easily perhaps more easily within gretl, by using the tools
under the Add menu.
Appending imported data
You may wish to establish a gretl dataset piece by piece, by incremental importation of data from
other sources. This is supported via the File, Append data menu items: gretl will check the new
data for conformability with the existing dataset and, if everything seems OK, will merge the data.
You can add new variables in this way, provided the data frequency matches that of the existing
dataset. Or you can append new observations for data series that are already present; in this case
the variable names must match up correctly. Note that by default (that is, if you choose Open
data rather than Append data), opening a new data file closes the current one.
Using the built-in spreadsheet
Under gretls File, New data set menu you can choose the sort of dataset you want to establish
(e.g. quarterly time series, cross-sectional). You will then be prompted for starting and ending dates
(or observation numbers) and the name of the first variable to add to the dataset. After supplying
this information you will be faced with a simple spreadsheet into which you can type data values. In
the spreadsheet window, clicking the right mouse button will invoke a popup menu which enables
you to add a new variable (column), to add an observation (append a row at the foot of the sheet),
or to insert an observation at the selected point (move the data down and insert a blank row.)
Once you have entered data into the spreadsheet you import these into gretls workspace using the
spreadsheets Apply changes button.
Please note that gretls spreadsheet is quite basic and has no support for functions or formulas.
Data transformations are done via the Add or Variable menus in the main gretl window.
Selecting from a database
Another alternative is to establish your dataset by selecting variables from a database.
22
Begin with gretls File, Databases menu item. This has four forks: Gretl native, RATS 4,
PcGive and On database server. You should be able to find the file fedstl.bin in the file
selector that opens if you choose the Gretl native option this file, which contains a large
collection of US macroeconomic time series, is supplied with the distribution.
You wont find anything under RATS 4 unless you have purchased RATS data.2 If you do possess
RATS data you should go into gretls Tools, Preferences, General dialog, select the Databases tab,
and fill in the correct path to your RATS files.
If your computer is connected to the internet you should find several databases (at Wake Forest
University) under On database server. You can browse these remotely; you also have the option
of installing them onto your own computer. The initial remote databases window has an item
showing, for each file, whether it is already installed locally (and if so, if the local version is up to
date with the version at Wake Forest).
Assuming you have managed to open a database you can import selected series into gretls workspace
by using the Series, Import menu item in the database window, or via the popup menu that appears if you click the right mouse button, or by dragging the series into the programs main window.
Creating a gretl data file independently
It is possible to create a data file in one or other of gretls own formats using a text editor or
software tools such as awk, sed or perl. This may be a good choice if you have large amounts of
data already in machine readable form. You will, of course, need to study the gretl data formats
(XML format or traditional format) as described in Appendix A.
4.5
Structuring a dataset
Once your data are read by gretl, it may be necessary to supply some information on the nature of
the data. We distinguish between three kinds of datasets:
1. Cross section
2. Time series
3. Panel data
The primary tool for doing this is the Data, Dataset structure menu entry in the graphical interface, or the setobs command for scripts and the command-line interface.
Cross sectional data
By a cross section we mean observations on a set of units (which may be firms, countries, individuals, or whatever) at a common point in time. This is the default interpretation for a data
file: if gretl does not have sufficient information to interpret data as time-series or panel data,
they are automatically interpreted as a cross section. In the unlikely event that cross-sectional data
are wrongly interpreted as time series, you can correct this by selecting the Data, Dataset structure menu item. Click the cross-sectional radio button in the dialog box that appears, then click
Forward. Click OK to confirm your selection.
Time series data
When you import data from a spreadsheet or plain text file, gretl will make fairly strenuous efforts
to glean time-series information from the first column of the data, if it looks at all plausible that
such information may be present. If time-series structure is present but not recognized, again you
2 See
23
can use the Data, Dataset structure menu item. Select Time series and click Forward; select the
appropriate data frequency and click Forward again; then select or enter the starting observation
and click Forward once more. Finally, click OK to confirm the time-series interpretation if it is
correct (or click Back to make adjustments if need be).
Besides the basic business of getting a data set interpreted as time series, further issues may arise
relating to the frequency of time-series data. In a gretl time-series data set, all the series must
have the same frequency. Suppose you wish to make a combined dataset using series that, in their
original state, are not all of the same frequency. For example, some series are monthly and some
are quarterly.
Your first step is to formulate a strategy: Do you want to end up with a quarterly or a monthly data
set? A basic point to note here is that compacting data from a higher frequency (e.g. monthly) to
a lower frequency (e.g. quarterly) is usually unproblematic. You lose information in doing so, but
in general it is perfectly legitimate to take (say) the average of three monthly observations to create
a quarterly observation. On the other hand, expanding data from a lower to a higher frequency is
not, in general, a valid operation.
In most cases, then, the best strategy is to start by creating a data set of the lower frequency, and
then to compact the higher frequency data to match. When you import higher-frequency data from
a database into the current data set, you are given a choice of compaction method (average, sum,
start of period, or end of period). In most instances average is likely to be appropriate.
You can also import lower-frequency data into a high-frequency data set, but this is generally not
recommended. What gretl does in this case is simply replicate the values of the lower-frequency
series as many times as required. For example, suppose we have a quarterly series with the value
35.5 in 1990:1, the first quarter of 1990. On expansion to monthly, the value 35.5 will be assigned
to the observations for January, February and March of 1990. The expanded variable is therefore
useless for fine-grained time-series analysis, outside of the special case where you know that the
variable in question does in fact remain constant over the sub-periods.
When the current data frequency is appropriate, gretl offers both Compact data and Expand
data options under the Data menu. These options operate on the whole data set, compacting or
exanding all series. They should be considered expert options and should be used with caution.
Panel data
Panel data are inherently three dimensional the dimensions being variable, cross-sectional unit,
and time-period. For example, a particular number in a panel data set might be identified as the
observation on capital stock for General Motors in 1980. (A note on terminology: we use the
terms cross-sectional unit, unit and group interchangeably below to refer to the entities that
compose the cross-sectional dimension of the panel. These might, for instance, be firms, countries
or persons.)
For representation in a textual computer file (and also for gretls internal calculations) the three
dimensions must somehow be flattened into two. This flattening involves taking layers of the
data that would naturally stack in a third dimension, and stacking them in the vertical dimension.
Gretl always expects data to be arranged by observation, that is, such that each row represents
an observation (and each variable occupies one and only one column). In this context the flattening
of a panel data set can be done in either of two ways:
Stacked time series: the successive vertical blocks each comprise a time series for a given
unit.
Stacked cross sections: the successive vertical blocks each comprise a cross-section for a
given period.
You may input data in whichever arrangement is more convenient. Internally, however, gretl always
stores panel data in the form of stacked time series.
24
When you import panel data into gretl from a spreadsheet or comma separated format, the panel
nature of the data will not be recognized automatically (most likely the data will be treated as
undated). A panel interpretation can be imposed on the data using the graphical interface or via
the setobs command.
In the graphical interface, use the menu item Data, Dataset structure. In the first dialog box
that appears, select Panel. In the next dialog you have a three-way choice. The first two options,
Stacked time series and Stacked cross sections are applicable if the data set is already organized
in one of these two ways. If you select either of these options, the next step is to specify the number
of cross-sectional units in the data set. The third option, Use index variables, is applicable if the
data set contains two variables that index the units and the time periods respectively; the next step
is then to select those variables. For example, a data file might contain a country code variable and
a variable representing the year of the observation. In that case gretl can reconstruct the panel
structure of the data regardless of how the observation rows are organized.
The setobs command has options that parallel those in the graphical interface. If suitable index
variables are available you can do, for example
setobs unitvar timevar --panel-vars
where unitvar is a variable that indexes the units and timevar is a variable indexing the periods.
Alternatively you can use the form setobs freq 1:1 structure, where freq is replaced by the block
size of the data (that is, the number of periods in the case of stacked time series, or the number
of units in the case of stacked cross-sections) and structure is either --stacked-time-series or
--stacked-cross-section. Two examples are given below: the first is suitable for a panel in
the form of stacked time series with observations from 20 periods; the second for stacked cross
sections with 5 units.
setobs 20 1:1 --stacked-time-series
setobs 5 1:1 --stacked-cross-section
1970
1975
1980
1985
AR
100.0
110.5
118.7
131.2
160.4
AZ
100.0
104.3
113.8
120.9
140.6
If a datafile with this sort of structure is read into gretl,3 the program will interpret the columns as
distinct variables, so the data will not be usable as is. But there is a mechanism for correcting the
situation, namely the stack function within the genr command.
Consider the first data column in the fragment above: the first 50 rows of this column constitute a
cross-section for the variable x1 in the year 1965. If we could create a new variable by stacking the
first 50 entries in the second column underneath the first 50 entries in the first, we would be on the
3 Note that you will have to modify such a datafile slightly before it can be read at all. The line containing the variable
name (in this example x1) will have to be removed, and so will the initial row containing the years, otherwise they will be
taken as numerical data.
25
way to making a data set by observation (in the first of the two forms mentioned above, stacked
cross-sections). That is, wed have a column comprising a cross-section for x1 in 1965, followed by
a cross-section for the same variable in 1970.
The following gretl script illustrates how we can accomplish the stacking, for both x1 and x2. We
assume that the original data file is called panel.txt, and that in this file the columns are headed
with variable names p1, p2, . . . , p5. (The columns are not really variables, but in the first instance
we pretend that they are.)
open panel.txt
genr x1 = stack(p1..p5) --length=50
genr x2 = stack(p1..p5) --offset=50 --length=50
setobs 50 1:1 --stacked-cross-section
store panel.gdt x1 x2
The second line illustrates the syntax of the stack function. The double dots within the parentheses indicate a range of variables to be stacked: here we want to stack all 5 columns (for all 5 years).
The full data set contains 100 rows; in the stacking of variable x1 we wish to read only the first 50
rows from each column: we achieve this by adding --length=50. Note that if you want to stack a
non-contiguous set of columns you can give a comma-separated list of variable names, as in
genr x = stack(p1,p3,p5)
or you can provide within the parentheses the name of a previously created list (see chapter 12).
On line 3 we do the stacking for variable x2. Again we want a length of 50 for the components of
the stacked series, but this time we want gretl to start reading from the 50th row of the original
data, and we specify --offset=50. Line 4 imposes a panel interpretation on the data; finally, we
save the data in gretl format, with the panel interpretation, discarding the original variables p1
through p5.
The illustrative script above is appropriate when the number of variable to be processed is small.
When then are many variables in the data set it will be more efficient to use a command loop to
accomplish the stacking, as shown in the following script. The setup is presumed to be the same
as in the previous section (50 units, 5 periods), but with 20 variables rather than 2.
open panel.txt
loop for i=1..20
genr k = ($i - 1) * 50
genr x$i = stack(p1..p5) --offset=k --length=50
endloop
setobs 50 1.01 --stacked-cross-section
store panel.gdt x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 \
x11 x12 x13 x14 x15 x16 x17 x18 x19 x20
26
The first line generates a 1-based index representing the period of each observation, and the second
line uses the time variable to generate a variable representing the year of the observation. The
third line contains this special feature: if (and only if) the name of the new variable to generate
is markers, the portion of the command following the equals sign is taken as C-style format string
(which must be wrapped in double quotes), followed by a comma-separated list of arguments.
The arguments will be printed according to the given format to create a new set of observation
markers. Valid arguments are either the names of variables in the dataset, or the string marker
which denotes the pre-existing observation marker. The format specifiers which are likely to be
useful in this context are %s for a string and %d for an integer. Strings can be truncated: for
example %.3s will use just the first three characters of the string. To chop initial characters off
an existing observation marker when constructing a new one, you can use the syntax marker + n,
where n is a positive integer: in the case the first n characters will be skipped.
After the commands above are processed, then, the observation markers will look like, for example,
AR:1965, where the two-letter state code and the year of the observation are spliced together with
a colon.
4.6
These are represented internally as DBL_MAX, the largest floating-point number that can be represented on the system (which is likely to be at least 10 to the power 300, and so should not be
confused with legitimate data values). In a native-format data file they should be represented as
NA. When importing CSV data gretl accepts several common representations of missing values including 999, the string NA (in upper or lower case), a single dot, or simply a blank cell. Blank cells
should, of course, be properly delimited, e.g. 120.6,,5.38, in which the middle value is presumed
missing.
As for handling of missing values in the course of statistical analysis, gretl does the following:
In calculating descriptive statistics (mean, standard deviation, etc.) under the summary command, missing values are simply skipped and the sample size adjusted appropriately.
In running regressions gretl first adjusts the beginning and end of the sample range, truncating the sample if need be. Missing values at the beginning of the sample are common in
time series work due to the inclusion of lags, first differences and so on; missing values at the
end of the range are not uncommon due to differential updating of series and possibly the
inclusion of leads.
If gretl detects any missing values inside the (possibly truncated) sample range for a regression,
the result depends on the character of the dataset and the estimator chosen. In many cases, the
program will automatically skip the missing observations when calculating the regression results.
In this situation a message is printed stating how many observations were dropped. On the other
hand, the skipping of missing observations is not supported for all procedures: exceptions include
all autoregressive estimators, system estimators such as SUR, and nonlinear least squares. In the
case of panel data, the skipping of missing observations is supported only if their omission leaves
a balanced panel. If missing observations are found in cases where they are not supported, gretl
gives an error message and refuses to produce estimates.
In case missing values in the middle of a dataset present a problem, the misszero function (use
with care!) is provided under the genr command. By doing genr foo = misszero(bar) you can
produce a series foo which is identical to bar except that any missing values become zeros. Then
you can use carefully constructed dummy variables to, in effect, drop the missing observations
from the regression while retaining the surrounding sample range.4
4 genr
also offers the inverse function to misszero, namely zeromiss, which replaces zeros in a given series with the
missing observation code.
4.7
27
Basically, the size of data sets (both the number of variables and the number of observations per
variable) is limited only by the characteristics of your computer. Gretl allocates memory dynamically, and will ask the operating system for as much memory as your data require. Obviously, then,
you are ultimately limited by the size of RAM.
Aside from the multiple-precision OLS option, gretl uses double-precision floating-point numbers
throughout. The size of such numbers in bytes depends on the computer platform, but is typically
eight. To give a rough notion of magnitudes, suppose we have a data set with 10,000 observations
on 500 variables. Thats 5 million floating-point numbers or 40 million bytes. If we define the
megabyte (MB) as 1024 1024 bytes, as is standard in talking about RAM, its slightly over 38 MB.
The program needs additional memory for workspace, but even so, handling a data set of this size
should be quite feasible on a current PC, which at the time of writing is likely to have at least 256
MB of RAM.
If RAM is not an issue, there is one further limitation on data size (though its very unlikely to
be a binding constraint). That is, variables and observations are indexed by signed integers, and
on a typical PC these will be 32-bit values, capable of representing a maximum positive value of
231 1 = 2, 147, 483, 647.
The limits mentioned above apply to gretls native functionality. There are tighter limits with
regard to two third-party programs that are available as add-ons to gretl for certain sorts of timeseries analysis including seasonal adjustment, namely TRAMO/SEATS and X-12-ARIMA. These programs employ a fixed-size memory allocation, and cant handle series of more than 600 observations.
4.8
If youre using gretl in a teaching context you may be interested in adding a collection of data files
and/or scripts that relate specifically to your course, in such a way that students can browse and
access them easily.
There are three ways to access such collections of files:
For data files: select the menu item File, Open data, Sample file, or click on the folder icon
on the gretl toolbar.
For script files: select the menu item File, Script files, Practice file.
When a user selects one of the items:
The data or script files included in the gretl distribution are automatically shown (this includes
files relating to Ramanathans Introductory Econometrics and Greenes Econometric Analysis).
The program looks for certain known collections of data files available as optional extras,
for instance the datafiles from various econometrics textbooks (Davidson and MacKinnon,
Gujarati, Stock and Watson, Verbeek, Wooldridge) and the Penn World Table (PWT 5.6). (See
the data page at the gretl website for information on these collections.) If the additional files
are found, they are added to the selection windows.
The program then searches for valid file collections (not necessarily known in advance) in
these places: the system data directory, the system script directory, the user directory,
and all first-level subdirectories of these. For reference, typical values for these directories
are shown in Table 4.1. (Note that PERSONAL is a placeholder that is expanded by Windows,
corresponding to My Documents on English-language systems.)
28
Linux
MS Windows
/usr/share/gretl/data
/usr/share/gretl/scripts
c:\Program Files\gretl\scripts
user dir
$HOME/gretl
PERSONAL\gretl
c:\Program Files\gretl\data
Any valid collections will be added to the selection windows. So what constitutes a valid file collection? This comprises either a set of data files in gretl XML format (with the .gdt suffix) or a set of
script files containing gretl commands (with .inp suffix), in each case accompanied by a master
file or catalog. The gretl distribution contains several example catalog files, for instance the file
descriptions in the misc sub-directory of the gretl data directory and ps_descriptions in the
misc sub-directory of the scripts directory.
If you are adding your own collection, data catalogs should be named descriptions and script
catalogs should be be named ps_descriptions. In each case the catalog should be placed (along
with the associated data or script files) in its own specific sub-directory (e.g. /usr/share/gretl/
data/mydata or c:\userdata\gretl\data\mydata).
The syntax of the (plain text) description files is straightforward. Here, for example, are the first
few lines of gretls collections supplied
misc script catalog:
# Gretl: various sample scripts
"arma","ARMA modeling","artificial data"
"ects_nls","Nonlinear least squares (Davidson)","artificial data"
"leverage","Influential observations","artificial data"
"longley","Multicollinearity","US employment"
If you want to make your own data collection available to users, these are the steps:
1. Assemble the data, in whatever format is convenient.
2. Convert the data to gretl format and save as gdt files. It is probably easiest to convert the data
by importing them into the program from plain text, CSV, or a spreadsheet format (MS Excel
or Gnumeric) then saving them. You may wish to add descriptions of the individual variables
(the Variable, Edit attributes menu item), and add information on the source of the data (the
Data, Edit info menu item).
29
Chapter 5
Introduction
The genr command provides a flexible means of defining new variables. It is documented in the
Gretl Command Reference. This chapter offers a more expansive discussion of some of the special
functions available via genr and some of the finer points of the command.
5.2
Long-run variance
As is well known, the variance of the average of T random variables x1 , x2 , . . . , xT with equal variance 2 equals 2 /T if the data are uncorrelated. In this case, the sample variance of xt over the
sample size provides a consistent estimator.
P
= T 1 Tt=1 xt must be
If, however, there is serial correlation among the xt s, the variance of X
estimated differently. One of the most widely used statistics for this purpose is a nonparametric
kernel estimator with the Bartlett kernel defined as
TX
k
k
X
2
1
,
(k) = T
wi (xt X)(x
(5.1)
ti X)
t=k
i=k
where the integer k is known as the window size and the wi terms are the so-called Bartlett weights,
|i|
2 (k)/T yields a consistent
defined as wi = 1 k+1
. It can be shown that, for k large enough,
5.3
Time-series filters
One sort of specialized function in genr is time-series filtering. In addition to the usual application
of lags and differences, gretl provides fractional differencing and two filters commonly used in
macroeconomics for trend-cycle decomposition: the HodrickPrescott filter (Hodrick and Prescott,
1997) and the BaxterKing bandpass filter (Baxter and King, 1999).
Fractional differencing
The concept of differencing a time series d times is pretty obvious when d is an integer; it may seem
odd when d is fractional. However, this idea has a well-defined mathematical content: consider the
function
f (z) = (1 z)d ,
where z and d are real numbers. By taking a Taylor series expansion around z = 0, we see that
f (z) = 1 + dz +
d(d + 1) 2
z +
2
30
31
i z i
i=1
with
Qk
k =
i=1 (d
+ i 1)
d+k1
= k1
k!
k
The same expansion can be used with the lag operator, so that if we defined
Yt = (1 L)0.5 Xt
this could be considered shorthand for
Yt = Xt 0.5Xt1 0.125Xt2 0.0625Xt3
In gretl this transformation can be accomplished by the syntax
genr Y = fracdiff(X,0.5)
(yt gt )2 +
t=1
TX
1
2
t=2
The first term above is the sum of squared cyclical components ct = yt gt . The second term is a
multiple of the sum of squares of the trend components second differences. This second term
penalizes variations in the growth rate of the trend component: the larger the value of , the higher
is the penalty and hence the smoother the trend series.
Note that the hpfilt function in gretl produces the cyclical component, ct , of the original series.
If you want the smoothed trend you can subtract the cycle from the original:
genr ct = hpfilt(yt)
genr gt = yt - ct
Hodrick and Prescott (1997) suggest that a value of = 1600 is reasonable for quarterly data. The
default value in gretl is 100 times the square of the data frequency (which, of course, yields 1600
for quarterly data). The value can be adjusted using an optional second argument to hpfilt(), as
in
genr ct = hpfilt(yt, 1300)
32
To extract the component of yt that lies between the frequencies and one could apply a
bandpass filter:
Z
F ()ei dZ()
ct =
where F () = 1 for < || < and 0 elsewhere. This would imply, in the time domain,
applying to the series a filter with an infinite number of coefficients, which is undesirable. The
Baxter and King bandpass filter applies to yt a finite polynomial in the lag operator A(L):
ct = A(L)yt
where A(L) is defined as
A(L) =
k
X
ai Li
i=k
The coefficients ai are chosen such that F () = A(ei )A(ei ) is the best approximation to F ()
for a given k. Clearly, the higher k the better the approximation is, but since 2k observations have
to be discarded, a compromise is usually sought. Moreover, the filter has also other appealing
theoretical properties, among which the property that A(1) = 0, so a series with a single unit root
is made stationary by application of the filter.
In practice, the filter is normally used with monthly or quarterly data to extract the business
cycle component, namely the component between 6 and 36 quarters. Usual choices for k are 8 or
12 (maybe higher for monthly series). The default values for the frequency bounds are 8 and 32,
and the default value for the approximation order, k, is 8. You can adjust these values using the
full form of bkfilt(), which is
bkfilt(seriesname, f1, f2, k)
where f1 and f2 represent the lower and upper frequency bounds respectively.
The Butterworth filter
The Butterworth filter (Butterworth, 1930) is an approximation to an ideal square-wave filter.
The ideal filter divides the spectrum of a time series into a pass-band (frequencies less than some
chosen ? for a low-pass filter, or frequencies greater than ? for high-pass) and a stop-band; the
gain is 1 for the pass-band and 0 for the stop-band. The ideal filter is unattainable in practice since
it would require an infinite number of coefficients, but the Butterworth filter offers a remarkably
good approximation. This filter is derived and persuasively advocated by Pollock (1997).
For data y, the filtered sequence x is given by
x = y Q(M + Q0 Q)1 Q0 y
(5.2)
where
T 2
= {2IT (LT + L1
T )}
and
T
M = {2IT + (LT + L1
T )}
is a Toeplitz matrix.
33
The behavior of the Butterworth filter is governed by two parameters: the frequency cutoff ? and
an integer order, n, which determines the number of coefficients used. The that appears in (5.2)
is tan(? /2)2n . Higher values of n produce a better approximation to the ideal filter in principle
(i.e. a sharper cut between the pass-band and the stop-band) but there is a downside: with a greater
number of coefficients numerical instability may be an issue, and the influence of the initial values
in the sample may be exaggerated.
In gretl the Butterworth filter is implemented by the bwfilt() function,1 which takes three arguments: the series to filter, the order n and the frequency cutoff, ? , expressed in degrees. The
cutoff value must be greater than 0 and less than 180. This function operates as a low-pass filter;
for the high-pass variant, subtract the filtered series from the original, as in
series bwcycle = y - bwfilt(y, 8, 67)
Pollock recommends that the parameters of the Butterworth filter be tuned to the data: one should
examine the periodogram of the series in question (possibly after removal of a polynomial trend)
in search of a dead spot of low power between the frequencies one wishes to exclude and the
frequencies one wishes to retain. If ? is placed in such a dead spot then the job of separation
can be done with a relatively small n, hence avoiding numerical problems. By way of illustration,
consider the periodogram for quarterly observations on new cars sales in the US,2 1975:1 to 1990:4
(the upper panel in Figure 5.1).
periods
64.0
10.7
5.8
4.0
3.0
2.5
2.1
300000
250000
200000
150000
100000
50000
0
20
40
60
80
100
120
140
160
180
degrees
3400
3200
3000
0.8
2800
0.6
2600
0.4
2400
2200
0.2
2000
1800
1600
1976
1978
1980
1982
1984
1986
1988
/4
/2
3/4
1990
34
The apparatus that supports this sort of analysis in the gretl GUI can be found under the Variable
menu in the main window: the items Periodogram and Filter. In the periodogram dialog box you
have the option of expressing the frequency axis in degrees, which is helpful when selecting a
Butterworth filter; and in the Butterworth filter dialog you have the option of plotting the frequency
response as well as the smoothed series and/or the residual or cycle.
5.4
Dummy variables
In a panel study you may wish to construct dummy variables of one or both of the following sorts:
(a) dummies as unique identifiers for the units or groups, and (b) dummies as unique identifiers for
the time periods. The former may be used to allow the intercept of the regression to differ across
the units, the latter to allow the intercept to differ across periods.
Two special functions are available to create such dummies. These are found under the Add
menu in the GUI, or under the genr command in script mode or gretlcli.
1. unit dummies (script command genr unitdum). This command creates a set of dummy
variables identifying the cross-sectional units. The variable du_1 will have value 1 in each
row corresponding to a unit 1 observation, 0 otherwise; du_2 will have value 1 in each row
corresponding to a unit 2 observation, 0 otherwise; and so on.
2. time dummies (script command genr timedum). This command creates a set of dummy
variables identifying the periods. The variable dt_1 will have value 1 in each row corresponding to a period 1 observation, 0 otherwise; dt_2 will have value 1 in each row corresponding
to a period 2 observation, 0 otherwise; and so on.
If a panel data set has the YEAR of the observation entered as one of the variables you can create a
periodic dummy to pick out a particular year, e.g. genr dum = (YEAR=1960). You can also create
periodic dummy variables using the modulus operator, %. For instance, to create a dummy with
value 1 for the first observation and every thirtieth observation thereafter, 0 otherwise, do
genr index
genr dum = ((index-1) % 30) = 0
35
creates a series of this form: the first 8 values (corresponding to unit 1) contain the mean of x for
unit 1, the next 8 values contain the mean for unit 2, and so on. The psd() function works in a
similar manner. The sample standard deviation for group i is computed as
sP
i )2
(x x
si =
Ti 1
i denotes the group
where Ti denotes the number of valid observations on x for the given unit, x
mean, and the summation is across valid observations for the group. If Ti < 2, however, the
standard deviation is recorded as 0.
One particular use of psd() may be worth noting. If you want to form a sub-sample of a panel that
contains only those units for which the variable x is time-varying, you can either use
smpl (pmin(x) < pmax(x)) --restrict
or
smpl (psd(x) > 0) --restrict
5.5
Another specialized function is the resampling, with replacement, of a series. Given an original
data series x, the command
genr xr = resample(x)
creates a new series each of whose elements is drawn at random from the elements of x. If the
original series has 100 observations, each element of x is selected with probability 1/100 at each
drawing. Thus the effect is to shuffle the elements of x, with the twist that each element of x may
appear more than once, or not at all, in xr.
The primary use of this function is in the construction of bootstrap confidence intervals or p-values.
Here is a simple example. Suppose we estimate a simple regression of y on x via OLS and find that
the slope coefficient has a reported t-ratio of 2.5 with 40 degrees of freedom. The two-tailed pvalue for the null hypothesis that the slope parameter equals zero is then 0.0166, using the t(40)
distribution. Depending on the context, however, we may doubt whether the ratio of coefficient to
standard error truly follows the t(40) distribution. In that case we could derive a bootstrap p-value
as shown in Example 5.1.
36
Under the null hypothesis that the slope with respect to x is zero, y is simply equal to its mean plus
an error term. We simulate y by resampling the residuals from the initial OLS and re-estimate the
model. We repeat this procedure a large number of times, and record the number of cases where
the absolute value of the t-ratio is greater than 2.5: the proportion of such cases is our bootstrap
p-value. For a good discussion of simulation-based tests and bootstrapping, see Davidson and
MacKinnon (2004, chapter 4).
Example 5.1: Calculation of bootstrap p-value
ols y 0 x
# save the residuals
genr ui = $uhat
scalar ybar = mean(y)
# number of replications for bootstrap
scalar replics = 10000
scalar tcount = 0
series ysim = 0
loop replics --quiet
# generate simulated y by resampling
ysim = ybar + resample(ui)
ols ysim 0 x
scalar tsim = abs($coeff(x) / $stderr(x))
tcount += (tsim > 2.5)
endloop
printf "proportion of cases with |t| > 2.5 = %g\n", tcount / replics
5.6
The two functions cdf and pvalue provide complementary means of examining values from several
probability distributions: the standard normal, Students t, 2 , F , gamma, and binomial. The syntax
of these functions is set out in the Gretl Command Reference; here we expand on some subtleties.
The cumulative density function or CDF for a random variable is the integral of the variables
density from its lower limit (typically either or 0) to any specified value x. The p-value (at
least the one-tailed, right-hand p-value as returned by the pvalue function) is the complementary
probability, the integral from x to the upper limit of the distribution, typically +.
In principle, therefore, there is no need for two distinct functions: given a CDF value p0 you could
easily find the corresponding p-value as 1 p0 (or vice versa). In practice, with finite-precision
computer arithmetic, the two functions are not redundant. This requires a little explanation. In
gretl, as in most statistical programs, floating point numbers are represented as doubles
double-precision values that typically have a storage size of eight bytes or 64 bits. Since there are
only so many bits available, only so many floating-point numbers can be represented: doubles do
not model the real line. Typically doubles can represent numbers over the range (roughly) 1.7977
10308 , but only to about 15 digits of precision.
Suppose youre interested in the left tail of the 2 distribution with 50 degrees of freedom: youd
like to know the CDF value for x = 0.9. Take a look at the following interactive session:
? genr p1
Generated
? genr p2
Generated
37
? genr test = 1 - p2
Generated scalar test (ID 4) = 0
The cdf function has produced an accurate value, but the pvalue function gives an answer of 1,
from which it is not possible to retrieve the answer to the CDF question. This may seem surprising
at first, but consider: if the value of p1 above is correct, then the correct value for p2 is 18.94977
1035 . But theres no way that value can be represented as a double: that would require over 30
digits of precision.
Of course this is an extreme example. If the x in question is not too far off into one or other tail
of the distribution, the cdf and pvalue functions will in fact produce complementary answers, as
shown below:
? genr p1 = cdf(X, 50, 30)
Generated scalar p1 (ID 2) = 0.0111648
? genr p2 = pvalue(X, 50, 30)
Generated scalar p2 (ID 3) = 0.988835
? genr test = 1 - p2
Generated scalar test (ID 4) = 0.0111648
But the moral is that if you want to examine extreme values you should be careful in selecting the
function you need, in the knowledge that values very close to zero can be represented as doubles
while values very close to 1 cannot.
5.7
Four special functions are available for the handling of missing values. The boolean function
missing() takes the name of a variable as its single argument; it returns a series with value 1
for each observation at which the given variable has a missing value, and value 0 otherwise (that is,
if the given variable has a valid value at that observation). The function ok() is complementary to
missing; it is just a shorthand for !missing (where ! is the boolean NOT operator). For example,
one can count the missing values for variable x using
genr nmiss_x = sum(missing(x))
The function zeromiss(), which again takes a single series as its argument, returns a series where
all zero values are set to the missing code. This should be used with caution one does not want
to confuse missing values and zeros but it can be useful in some contexts. For example, one can
determine the first valid observation for a variable x using
genr time
genr x0 = min(zeromiss(time * ok(x)))
The function misszero() does the opposite of zeromiss, that is, it converts all missing values to
zero.
It may be worth commenting on the propagation of missing values within genr formulae. The
general rule is that in arithmetical operations involving two variables, if either of the variables has
a missing value at observation t then the resulting series will also have a missing value at t. The
one exception to this rule is multiplication by zero: zero times a missing value produces zero (since
this is mathematically valid regardless of the unknown value).
5.8
The genr command provides a means of retrieving various values calculated by the program in
the course of estimating models or testing hypotheses. The variables that can be retrieved in this
38
way are listed in the Gretl Command Reference; here we say a bit more about the special variables
$test and $pvalue.
These variables hold, respectively, the value of the last test statistic calculated using an explicit
testing command and the p-value for that test statistic. If no such test has been performed at the
time when these variables are referenced, they will produce the missing value code. The explicit
testing commands that work in this way are as follows: add (joint test for the significance of variables added to a model); adf (Augmented DickeyFuller test, see below); arch (test for ARCH); chow
(Chow test for a structural break); coeffsum (test for the sum of specified coefficients); cusum (the
HarveyCollier t-statistic); kpss (KPSS stationarity test, no p-value available); lmtest (see below);
meantest (test for difference of means); omit (joint test for the significance of variables omitted
from a model); reset (Ramseys RESET); restrict (general linear restriction); runs (runs test for
randomness); testuhat (test for normality of residual); and vartest (test for difference of variances). In most cases both a $test and a $pvalue are stored; the exception is the KPSS test, for
which a p-value is not currently available.
An important point to notice about this mechanism is that the internal variables $test and $pvalue
are over-written each time one of the tests listed above is performed. If you want to reference these
values, you must do so at the correct point in the sequence of gretl commands.
A related point is that some of the test commands generate, by default, more than one test statistic
and p-value; in these cases only the last values are stored. To get proper control over the retrieval
of values via $test and $pvalue you should formulate the test command in such a way that the
result is unambiguous. This comment applies in particular to the adf and lmtest commands.
By default, the adf command generates three variants of the DickeyFuller test: one based
on a regression including a constant, one using a constant and linear trend, and one using a
constant and a quadratic trend. When you wish to reference $test or $pvalue in connection
with this command, you can control the variant that is recorded by using one of the flags
--nc, --c, --ct or --ctt with adf.
By default, the lmtest command (which must follow an OLS regression) performs several
diagnostic tests on the regression in question. To control what is recorded in $test and
$pvalue you should limit the test using one of the flags --logs, --autocorr, --squares or
--white.
As an aid in working with values retrieved using $test and $pvalue, the nature of the test to which
these values relate is written into the descriptive label for the generated variable. You can read the
label for the variable using the label command (with just one argument, the name of the variable),
to check that you have retrieved the right value. The following interactive session illustrates this
point.
? adf 4 x1 --c
Augmented Dickey-Fuller tests, order 4, for x1
sample size 59
unit-root null hypothesis: a = 1
test with constant
model: (1 - L)y = b0 + (a-1)*y(-1) + ... + e
estimated value of (a - 1): -0.216889
test statistic: t = -1.83491
asymptotic p-value 0.3638
P-values based on MacKinnon (JAE, 1996)
? genr pv = $pvalue
Generated scalar pv (ID 13) = 0.363844
? label pv
pv=Dickey-Fuller pvalue (scalar)
5.9
39
Numerical procedures
Two special functions are available to aid in the construction of special-purpose estimators, namely
BFGSmax (the BFGS maximizer, discussed in Chapter 19) and fdjac, which produces a forwarddifference approximation to the Jacobian.
The BFGS maximizer
The BFGSmax function has two required arguments: a vector holding the initial values of a set of
parameters, and a call to a function that calculates the (scalar) criterion to be maximized, given
the current parameter values and any other relevant data. If the object is in fact minimization, this
function should return the negative of the criterion. On successful completion, BFGSmax returns the
maximized value of the criterion and the matrix given via the first argument holds the parameter
values which produce the maximum. Here is an example:
matrix X = { dataset }
matrix theta = { 1, 100 }
scalar J = BFGSmax(theta, ObjFunc(&theta, &X))
It is assumed here that ObjFunc is a user-defined function (see Chapter 10) with the following
general set-up:
function scalar ObjFunc (matrix *theta, matrix *X)
scalar val = ... # do some computation
return val
end function
The operation of the BFGS maximizer can be adjusted using the set variables bfgs_maxiter and
bfgs_toler (see Chapter 19). In addition you can provoke verbose output from the maximizer by
assigning a positive value to max_verbose, again via the set command.
The Rosenbrock function is often used as a test problem for optimization algorithms. It is also
known as Rosenbrocks Valley or Rosenbrocks Banana Function, on account of the fact that its
contour lines are banana-shaped. It is defined by:
f (x, y) = (1 x)2 + 100(y x 2 )2
The function has a global minimum at (x, y) = (1, 1) where f (x, y) = 0. Example 5.2 shows a gretl
script that discovers the minimum using BFGSmax (giving a verbose account of progress).
40
Computing a Jacobian
Gretl offers the possibility of differentiating numerically a user-defined function via the fdjac
function.
This function again takes two arguments: an n 1 matrix holding initial parameter values and a
function call that calculates and returns an m 1 matrix, given the current parameter values and
41
any other relevant data. On successful completion it returns an m n matrix holding the Jacobian.
For example,
matrix Jac = fdjac(theta, SumOC(&theta, &X))
where we assume that SumOC is a user-defined function with the following structure:
function matrix SumOC (matrix *theta, matrix *X)
matrix V = ... # do some computation
return V
end function
This may come in handy in several cases: for example, if you use BFGSmax to estimate a model, you
may wish to calculate a numerical approximation to the relevant Jacobian to construct a covariance
matrix for your estimates.
Another example is the delta method: if you have a consistent estimator of a vector of parameters
and a consistent estimate of its covariance matrix , you may need to compute estimates for a
,
nonlinear continuous transformation = g(). In this case, a standard result in asymptotic theory
is that
p
p = g()
= g()
=
d
T
T
d N(0, )
N(0, JJ 0 )
g(x)
where T is the sample size and J is the Jacobian x
.
x=
Script 5.4 exemplifies such a case: the example is taken from Greene (2003), section 9.3.1. The
slight differences between the results reported in the original source and what gretl returns are
due to the fact that the Jacobian is computed numerically, rather than analytically as in the book.
5.10
The discrete Fourier transform can be best thought of as a linear, invertible transform of a complex
vector. Hence, if x is an n-dimensional vector whose k-th element is xk = ak + ibk , then the output
of the discrete Fourier transform is a vector f = F (x) whose k-th element is
fk =
n1
X
ei(j,k) xj
j=0
jk
where (j, k) = 2 i n . Since the transformation is invertible, the vector x can be recovered from
f via the so-called inverse transform
xk =
n1
1 X i(j,k)
e
fj .
n j=0
The Fourier transform is used in many diverse situations on account of this key property: the
convolution of two vectors can be performed efficiently by multiplying the elements of their Fourier
transforms and inverting the result. If
zk =
n
X
xj ykj ,
j=1
then
F (z) = F (x) F (y).
That is, F (z)k = F (x)k F (y)k .
42
43
For computing the Fourier transform, gretl uses the external library fftw3: see Frigo and Johnson
(2005). This guarantees extreme speed and accuracy. In fact, the CPU time needed to perform
the transform is O(n log n) for any n. This is why the array of numerical techniques employed in
fftw3 is commonly known as the Fast Fourier Transform.
Gretl provides two matrix functions3 for performing the Fourier transform and its inverse: fft and
ffti. In fact, gretls implementation of the Fourier transform is somewhat more specialized: the
input to the fft function is understood to be real. Conversely, ffti takes a complex argument and
delivers a real result. For example:
x1 = { 1 ; 2 ; 3 }
# perform the transform
f = fft(a)
# perform the inverse transform
x2 = ffti(f)
yields
x1 =
2
3
f =
1.5
1.5
0.866
0.866
x2 =
2
3
where the first column of f holds the real part and the second holds the complex part. In general,
if the input to fft has n columns, the output has 2n columns, where the real parts are stored in
the odd columns and the complex parts in the even ones. Should it be necessary to compute the
Fourier transform on several vectors with the same number of elements, it is numerically more
efficient to group them into a matrix rather than invoking fft for each vector separately.
As an example, consider the multiplication of two polynomals:
a(x)
1 + 0.5x
b(x)
1 + 0.3x 0.8x 2
The coefficients of the polynomial c(x) are the convolution of the coefficents of a(x) and b(x); the
following gretl code fragment illustrates how to compute the coefficients of c(x):
# define the two polynomials
a = { 1, 0.5, 0, 0 }
b = { 1, 0.3, -0.8, 0 }
# perform the transforms
fa = fft(a)
fb = fft(b)
# complex-multiply the two transforms
fc = cmult(fa, fb)
# compute the coefficients of c via the inverse transform
c = ffti(fc)
Maximum efficiency would have been achieved by grouping a and b into a matrix. The computational advantage is so little in this case that the exercise is a bit silly, but the following alternative
may be preferable for a large number of rows/columns:
#
a
b
#
f
3 See
chapter 13.
44
Traditionally, the Fourier tranform in econometrics has been mostly used in time-series analysis,
the periodogram being the best known example. Example script 5.5 shows how to compute the
periodogram of a time series via the fft function.
Example 5.5: Periodogram via the Fourier transform
nulldata 50
# generate an AR(1) process
series e = normal()
series x = 0
x = 0.9*x(-1) + e
# compute the periodogram
scale = 2*pi*$nobs
X = { x }
F = fft(X)
S = sumr(F.^2)
S = S[2:($nobs/2)+1]/scale
omega = seq(1,($nobs/2)) .* (2*pi/$nobs)
omega = omega ~ S
# compare the built-in command
pergm x
print omega
Chapter 6
Sub-sampling a dataset
6.1
Introduction
Some subtle issues can arise here. This chapter attempts to explain the issues.
A sub-sample may be defined in relation to a full data set in two different ways: we will refer to
these as setting the sample and restricting the sample respectively.
6.2
By setting the sample we mean defining a sub-sample simply by means of adjusting the starting
and/or ending point of the current sample range. This is likely to be most relevant for time-series
data. For example, one has quarterly data from 1960:1 to 2003:4, and one wants to run a regression
using only data from the 1970s. A suitable command is then
smpl 1970:1 1979:4
Or one wishes to set aside a block of observations at the end of the data period for out-of-sample
forecasting. In that case one might do
smpl ; 2000:4
where the semicolon is shorthand for leave the starting observation unchanged. (The semicolon
may also be used in place of the second parameter, to mean that the ending observation should be
unchanged.) By unchanged here, we mean unchanged relative to the last smpl setting, or relative
to the full dataset if no sub-sample has been defined up to this point. For example, after
smpl 1970:1 2003:4
smpl ; 2000:4
will advance the starting observation by one while preserving the ending observation, and
smpl +2 -1
will both advance the starting observation by two and retard the ending observation by one.
An important feature of setting the sample as described above is that it necessarily results in
the selection of a subset of observations that are contiguous in the full dataset. The structure of
the dataset is therefore unaffected (for example, if it is a quarterly time series before setting the
sample, it remains a quarterly time series afterwards).
45
6.3
46
By restricting the sample we mean selecting observations on the basis of some Boolean (logical)
criterion, or by means of a random number generator. This is likely to be most relevant for crosssectional or panel data.
Suppose we have data on a cross-section of individuals, recording their gender, income and other
characteristics. We wish to select for analysis only the women. If we have a gender dummy variable
with value 1 for men and 0 for women we could do
smpl gender=0 --restrict
to this effect. Or suppose we want to restrict the sample to respondents with incomes over $50,000.
Then we could use
smpl income>50000 --restrict
A question arises here. If we issue the two commands above in sequence, what do we end up with
in our sub-sample: all cases with income over 50000, or just women with income over 50000? By
default, in a gretl script, the answer is the latter: women with income over 50000. The second
restriction augments the first, or in other words the final restriction is the logical product of the
new restriction and any restriction that is already in place. If you want a new restriction to replace
any existing restrictions you can first recreate the full dataset using
smpl --full
Alternatively, you can add the replace option to the smpl command:
smpl income>50000 --restrict --replace
This option has the effect of automatically re-establishing the full dataset before applying the new
restriction.
Unlike a simple setting of the sample, restricting the sample may result in selection of noncontiguous observations from the full data set. It may also change the structure of the data set.
This can be seen in the case of panel data. Say we have a panel of five firms (indexed by the variable
firm) observed in each of several years (identified by the variable year). Then the restriction
smpl year=1995 --restrict
produces a dataset that is not a panel, but a cross-section for the year 1995. Similarly
smpl firm=3 --restrict
47
The fact that restricting the sample results in the creation of a reduced copy of the original
dataset may raise an issue when the dataset is very large (say, several thousands of observations).
With such a dataset in memory, the creation of a copy may lead to a situation where the computer
runs low on memory for calculating regression results. You can work around this as follows:
1. Open the full data set, and impose the sample restriction.
2. Save a copy of the reduced data set to disk.
3. Close the full dataset and open the reduced one.
4. Proceed with your analysis.
6.4
Random sampling
With very large datasets (or perhaps to study the properties of an estimator) you may wish to draw
a random sample from the full dataset. This can be done using, for example,
smpl 100 --random
to select 100 cases. If you want the sample to be reproducible, you should set the seed for the
random number generator first, using set. This sort of sampling falls under the restriction
category: a reduced copy of the dataset is made.
6.5
The discussion above has focused on the script command smpl. You can also use the items under
the Sample menu in the GUI program to select a sub-sample.
The menu items work in the same way as the corresponding smpl variants. When you use the item
Sample, Restrict based on criterion, and the dataset is already sub-sampled, you are given the
option of preserving or replacing the current restriction. Replacing the current restriction means,
in effect, invoking the replace option described above (Section 6.3).
Chapter 7
Gnuplot graphs
A separate program, gnuplot, is called to generate graphs. Gnuplot is a very full-featured graphing
program with myriad options. It is available from (but note that a suitable copy
of gnuplot is bundled with the packaged versions of gretl for MS Windows and Mac OS X). gretl
gives you direct access, via a graphical interface, to a subset of gnuplots options and it tries to
choose sensible values for you; it also allows you to take complete control over graph details if you
wish.
With a graph displayed, you can click on the graph window for a pop-up menu with the following
options.
Save as PNG: Save the graph in Portable Network Graphics format (the same format that you
see on screen).
Save as postscript: Save in encapsulated postscript (EPS) format.
Save as Windows metafile: Save in Enhanced Metafile (EMF) format.
Save to session as icon: The graph will appear in iconic form when you select Icon view from
the View menu.
Zoom: Lets you select an area within the graph for closer inspection (not available for all
graphs).
Print: (Current GTK or MS Windows only) lets you print the graph directly.
Copy to clipboard: MS Windows only, lets you paste the graph into Windows applications such
as MS Word.
Edit: Opens a controller for the plot which lets you adjust many aspects of its appearance.
Close: Closes the graph window.
Displaying data labels
For simple X-Y scatter plots, some further options are available if the dataset includes case markers (that is, labels identifying each observation).1 With a scatter plot displayed, when you move
the mouse pointer over a data point its label is shown on the graph. By default these labels are
transient: they do not appear in the printed or copied version of the graph. They can be removed by
selecting Clear data labels from the graph pop-up menu. If you want the labels to be affixed permanently (so they will show up when the graph is printed or copied), select the option Freeze data
labels from the pop-up menu; Clear data labels cancels this operation. The other label-related
option, All data labels, requests that case markers be shown for all observations. At present the
display of case markers is disabled for graphs containing more than 250 data points.
1 For an example of such a dataset, see the Ramanathan file data4-10: this contains data on private school enrollment
for the 50 states of the USA plus Washington, DC; the case markers are the two-letter codes for the states.
48
49
50
Unless youre a gnuplot expert, most likely youll only need to edit a couple of lines at the top of
the file, specifying a driver (plus options) and an output file. We offer here a brief summary of some
points that may be useful.
First, gnuplots output mode is set via the command set term followed by the name of a supported
driver (terminal in gnuplot parlance) plus various possible options. (The top line in the plot
commands window shows the set term line that gretl used to make a PNG file, commented out.)
The graphic formats that are most suitable for publication are PDF and EPS. These are supported
by the gnuplot term types pdf, pdfcairo and postscript (with the eps option). The pdfcairo
driver has the virtue that is behaves in a very similar manner to the PNG one, the output of which
you see on screen. This is provided by the version of gnuplot that is included in the gretl packages
for MS Windows and Mac OS X; if youre on Linux it may or may be supported. If pdfcairo is not
available, the pdf terminal may be available; the postscript terminal is almost certainly available.
Besides selecting a term type, if you want to get gnuplot to write the actual output file you need
to append a set output line giving a filename. Here are a few examples of the first two lines you
might type in the window editing your plot commands. Well make these more realistic shortly.
set term pdfcairo
set output mygraph.pdf
set term pdf
set output mygraph.pdf
set term postscript eps
set output mygraph.eps
There are a couple of things worth remarking here. First, you may want to adjust the size of the
graph, and second you may want to change the font. The default sizes produced by the above
drivers are 5 inches by 3 inches for pdfcairo and pdf, and 5 inches by 3.5 inches for postscript
eps. In each case you can change this by giving a size specification, which takes the form XX,YY
(examples below).
51
You may ask, why bother changing the size in the gnuplot command file? After all, PDF and EPS are
both vector formats, so the graphs can be scaled at will. True, but a uniform scaling will also affect
the font size, which may end looking wrong. You can get optimal results by experimenting with
the font and size options to gnuplots set term command. Here are some examples (comments
follow below).
# pdfcairo, regular size, slightly amended
set term pdfcairo font "Sans,6" size 5in,3.5in
# or small size
set term pdfcairo font "Sans,5" size 3in,2in
# pdf, regular size, slightly amended
set term pdf font "Helvetica,8" size 5in,3.5in
# or small
set term pdf font "Helvetica,6" size 3in,2in
# postscript, regular
set term post eps solid font "Helvetica,16"
# or small
set term post eps solid font "Helvetica,12" size 3in,2in
On the first line we set a sans serif font for pdfcairo at a suitable size for a 5 3.5 inch plot
(which you may find looks better than the rather letterboxy default of 5 3). And on the second
we illustrate what you might do to get a smaller 3 2 inch plot. You can specify the plot size in
centimeters if you prefer, as in
set term pdfcairo font "Sans,6" size 6cm,4cm
We then repeat the exercise for the pdf terminal. Notice that here were specifying one of the 35
standard PostScript fonts, namely Helvetica. Unlike pdfcairo, the plain pdf driver is unlikely to
be able to find fonts other than these.
In the third pair of lines we illustrate options for the postscript driver (which, as you see, can
be abbreviated as post). Note that here we have added the option solid. Unlike most other
drivers, this one uses dashed lines unless you specify the solid option. Also note that weve
(apparently) specified a much larger font in this case. Thats because the eps option in effect tells
the postscript driver to work at half-size (among other things), so we need to double the font
size.
Table 7.1 summarizes the basics for the three drivers we have mentioned.
Terminal
suggested font
pdfcairo
53
Sans,6
53
Helvetica,8
5 3.5
Helvetica,16
post eps
To find out more about gnuplot visit. This site has documentation for the current
version of the program in various formats.
Additional tips
To be written. Line widths, enhanced text. Show a before and after example.
7.2
52
Boxplots
These plots (after Tukey and Chambers) display the distribution of a variable. The central box
encloses the middle 50 percent of the data, i.e. it is bounded by the first and third quartiles. The
whiskers extend to the minimum and maximum values. A line is drawn across the box at the
median and a + sign identifies the mean see Figure 7.3.
0.25
0.2
0.15
Q3
0.1
mean
median
Q1
0.05
ENROLL
In the case of boxplots with confidence intervals, dotted lines show the limits of an approximate 90
percent confidence interval for the median. This is obtained by the bootstrap method, which can
take a while if the data series is very long.
After each variable specified in the boxplot command, a parenthesized boolean expression may
be added, to limit the sample for the variable in question. A space must be inserted between the
variable name or number and the expression. Suppose you have salary figures for men and women,
and you have a dummy variable GENDER with value 1 for men and 0 for women. In that case you
could draw comparative boxplots with the following line in the boxplots dialog:
salary (GENDER=1) salary (GENDER=0)
Chapter 8
Discrete variables
When a variable can take only a finite, typically small, number of values, then the variable is said to
be discrete. Some gretl commands act in a slightly different way when applied to discrete variables;
moreover, gretl provides a few commands that only apply to discrete variables. Specifically, the
dummify and xtab commands (see below) are available only for discrete variables, while the freq
(frequency distribution) command produces different output for discrete variables.
8.1
Gretl uses a simple heuristic to judge whether a given variable should be treated as discrete, but
you also have the option of explicitly marking a variable as discrete, in which case the heuristic
check is bypassed.
The heuristic is as follows: First, are all the values of the variable reasonably round, where this
is taken to mean that they are all integer multiples of 0.25? If this criterion is met, we then ask
whether the variable takes on a fairly small set of distinct values, where fairly small is defined
as less than or equal to 8. If both conditions are satisfied, the variable is automatically considered
discrete.
To mark a variable as discrete you have two options.
1. From the graphical interface, select Variable, Edit Attributes from the menu. A dialog box
will appear and, if the variable seems suitable, you will see a tick box labeled Treat this
variable as discrete. This dialog box can also be invoked via the context menu (right-click on
a variable) or by pressing the F2 key.
2. From the command-line interface, via the discrete command. The command takes one or
more arguments, which can be either variables or list of variables. For example:
list xlist = x1 x2 x3
discrete z1 xlist z2
This syntax makes it possible to declare as discrete many variables at once, which cannot
presently be done via the graphical interface. The switch --reverse reverses the declaration
of a variable as discrete, or in other words marks it as continuous. For example:
discrete foo
# now foo is discrete
discrete foo --reverse
# now foo is continuous
The command-line variant is more powerful, in that you can mark a variable as discrete even if it
does not seem to be suitable for this treatment.
Note that marking a variable as discrete does not affect its content. It is the users responsibility
to make sure that marking a variable as discrete is a sensible thing to do. Note that if you want
to recode a continuous variable into classes, you can use the genr command and its arithmetic
functions, as in the following example:
53
54
nulldata 100
# generate a variable with mean 2 and variance 1
genr x = normal() + 2
# split into 4 classes
genr z = (x>0) + (x>2) + (x>4)
# now declare z as discrete
discrete z
Once a variable is marked as discrete, this setting is remembered when you save the file.
8.2
The effect of the above command is to generate 5 new dummy variables, labeled DZ5_1 through
DZ5_5, which correspond to the different values in Z5. Hence, the variable DZ5_4 is 1 if Z5 equals
4 and 0 otherwise. This functionality is also available through the graphical interface by selecting
the menu item Add, Dummies for selected discrete variables.
The dummify command can also be used with the following syntax:
list dlist = dummify(x)
This not only creates the dummy variables, but also a named list (see section 12.1) that can be used
afterwards. The following example computes summary statistics for the variable Y for each value
of Z5:
open greene22_2
discrete Z5 # mark Z5 as discrete
list foo = dummify(Z5)
loop foreach i foo
smpl $i --restrict --replace
summary Y
endloop
smpl --full
Since dummify generates a list, it can be used directly in commands that call for a list as input, such
as ols. For example:
open greene22_2
discrete Z5 # mark Z5 as discrete
ols Y 0 dummify(Z5)
55
For discrete variables, frequencies are counted for each distinct value that the variable takes. For
continuous variables, values are grouped into bins and then the frequencies are counted for each
bin. The number of bins, by default, is computed as a function of the number of valid observations
in the currently selected sample via the rule shown in Table 8.1. However, when the command is
invoked through the menu item Variable, Frequency Plot, this default can be overridden by the
user.
Observations
Bins
8 n < 16
16 n < 50
50 n 850
d ne
n > 850
29
yields
Read datafile /usr/local/share/gretl/data/greene/greene19_1.gdt
periodicity: 1, maxobs: 32,
observations range: 1-32
Listing 5 variables:
0) const
1) GPA
2) TUCE
3) PSI
4) GRADE
? freq TUCE
Frequency distribution for TUCE, obs 1-32
number of bins = 7, mean = 21.9375, sd = 3.90151
interval
<
13.417 16.250 19.083 21.917 24.750 >=
midpt
13.417
16.250
19.083
21.917
24.750
27.583
27.583
frequency
12.000
14.833
17.667
20.500
23.333
26.167
29.000
1
1
6
6
9
7
2
rel.
cum.
3.12%
3.12%
18.75%
18.75%
28.12%
21.88%
6.25%
3.12%
6.25%
25.00%
43.75%
71.88%
93.75%
100.00%
1
1
rel.
3.12%
3.12%
cum.
3.12% *
6.25% *
*
*
******
******
**********
*******
**
3
3
2
4
2
4
3
4
2
1
1
1
9.38%
9.38%
6.25%
12.50%
6.25%
12.50%
9.38%
12.50%
6.25%
3.12%
3.12%
3.12%
56
15.62%
25.00%
31.25%
43.75%
50.00%
62.50%
71.88%
84.38%
90.62%
93.75%
96.88%
100.00%
***
***
**
****
**
****
***
****
**
*
*
*
As can be seen from the sample output, a Doornik-Hansen test for normality is computed automatically. This test is suppressed for discrete variables where the number of distinct values is less
than 10.
This command accepts two options: --quiet, to avoid generation of the histogram when invoked
from the command line and --gamma, for replacing the normality test with Lockes nonparametric
test, whose null hypothesis is that the data follow a Gamma distribution.
If the distinct values of a discrete variable need to be saved, the values() matrix construct can be
used (see chapter 13).
The xtab command
The xtab command cab be invoked in either of the following ways. First,
xtab ylist ; xlist
where ylist and xlist are lists of discrete variables. This produces cross-tabulations (two-way
frequencies) of each of the variables in ylist (by row) against each of the variables in xlist (by
column). Or second,
xtab xlist
In the second case a full set of cross-tabulations is generated; that is, each variable in xlist is tabulated against each other variable in the list. In the graphical interface, this command is represented
by the Cross Tabulation item under the View menu, which is active if at least two variables are
selected.
Here is an example of use:
open greene22_2
discrete Z* # mark Z1-Z8 as discrete
xtab Z1 Z4 ; Z5 Z6
which produces
Cross-tabulation of Z1 (rows) against Z5 (columns)
[
[
[
0]
1]
1][
20
28
2][
91
73
3][
75
54
4][
93
97
5]
36
34
TOT.
315
286
48
164
129
57
190
70
601
0]
1]
TOTAL
9][
12][
4
3
36
8
44
14][
16][
17][
18][
20]
TOT.
106
48
70
45
52
37
45
67
2
78
315
286
154
115
89
112
80
601
0]
1]
TOTAL
1][
2][
3][
4][
5]
TOT.
17
31
60
104
35
94
45
145
14
56
171
430
48
164
129
190
70
601
0]
1]
TOTAL
9][
12][
1
6
8
36
44
14][
16][
17][
18][
20]
TOT.
39
115
47
68
30
59
32
80
14
66
171
430
154
115
89
112
80
601
Pearsons 2 test for independence is automatically displayed, provided that all cells have expected
frequencies under independence greater than 107 . However, a common rule of thumb states that
this statistic is valid only if the expected frequency is 5 or greater for at least 80 percent of the
cells. If this condition is not met a warning is printed.
Additionally, the --row or --column options can be given: in this case, the output displays row or
column percentages, respectively.
If you want to cut and paste the output of xtab to some other program, e.g. a spreadsheet, you
may want to use the --zeros option; this option causes cells with zero frequency to display the
number 0 instead of being empty.
Chapter 9
Loop constructs
9.1
Introduction
The command loop opens a special mode in which gretl accepts a block of commands to be repeated zero or more times. This feature may be useful for, among other things, Monte Carlo
simulations, bootstrapping of test statistics and iterative estimation procedures. The general form
of a loop is:
loop control-expression [ --progressive | --verbose | --quiet ]
loop body
endloop
corrgm
cusum
data
delete
eqnprint
function
hurst
include
rmplot
run
scatters
setmiss
setobs
leverage
nulldata
open
tabprint
vif
xcorrgm
By default, the genr command operates quietly in the context of a loop (without printing information on the variable generated). To force the printing of feedback from genr you may specify the
--verbose option to loop. The --quiet option suppresses the usual printout of the number of
iterations performed, which may be desirable when loops are nested.
The --progressive option to loop modifies the behavior of the commands print and store,
and certain estimation commands, in a manner that may be useful with Monte Carlo analyses (see
Section 9.3).
The following sections explain the various forms of the loop control expression and provide some
examples of use of loops.
+ If you are carrying out a substantial Monte Carlo analysis with many thousands of repetitions, memory
capacity and processing time may be an issue. To minimize the use of computer resources, run your script
using the command-line program, gretlcli, with output redirected to a file.
9.2
Count loop
The simplest form of loop control is a direct specification of the number of times the loop should
be repeated. We refer to this as a count loop. The number of repetitions may be a numerical
constant, as in loop 1000, or may be read from a scalar variable, as in loop replics.
58
59
In the case where the loop count is given by a variable, say replics, in concept replics is an
integer; if the value is not integral, it is converted to an integer by truncation. Note that replics is
evaluated only once, when the loop is initially compiled.
While loop
A second sort of control expression takes the form of the keyword while followed by a boolean
expression. For example,
loop while essdiff > .00001
Execution of the commands within the loop will continue so long as (a) the specified condition
evaluates as true and (b) the number of iterations does not exceed the value of the internal variable loop_maxiter. By default this equals 250, but you can specify a different value via the set
command (see the Gretl Command Reference).
Index loop
A third form of loop control uses an index variable, for example i.1 In this case you specify starting
and ending values for the index, which is incremented by one each time round the loop. The syntax
looks like this: loop i=1..20.
The index variable may be a pre-existing scalar; if this is not the case, the variable is created
automatically and is destroyed on exit from the loop.
The index may be used within the loop body in either of two ways: you can access the integer value
of i (see Example 9.4) or you can use its string representation, $i (see Example 9.5).
The starting and ending values for the index can be given in numerical form, by reference to predefined scalar variables, or as expressions that evaluate to scalars. In the latter two cases the
variables are evaluated once, at the start of the loop. In addition, with time series data you can give
the starting and ending values in the form of dates, as in loop i=1950:1..1999:4.
This form of loop control is intended to be quick and easy, and as such it is subject to certain
limitations. In particular, the index variable is always incremented by one at each iteration. If, for
example, you have
loop i=m..n
where m and n are scalar variables with values m > n at the time of execution, the index will not be
decremented; rather, the loop will simply be bypassed.
If you need more complex loop control, see the for form below.
The index loop is particularly useful in conjunction with the values() matrix function when some
operation must be carried out for each value of some discrete variable (see chapter 8). Consider
the following example:
open greene22_2
discrete Z8
v8 = values(Z8)
loop i=1..rows(v8)
scalar xi = v8[i]
smpl (Z8=xi) --restrict --replace
printf "mean(Y | Z8 = %g) = %8.5f, sd(Y | Z8 = %g) = %g\n", \
xi, mean(Y), xi, sd(Y)
endloop
1 It is common programming practice to use simple, one-character names for such variables. However, you may use any
name that is acceptable by gretl: up to 15 characters, starting with a letter, and containing nothing but letters, numerals
and the underscore character.
60
In this case, we evaluate the conditional mean and standard deviation of the variable Y for each
value of Z8.
Foreach loop
The fourth form of loop control also uses an index variable, in this case to index a specified list
of strings. The loop is executed once for each string in the list. This can be useful for performing
repetitive operations on a list of variables. Here is an example of the syntax:
loop foreach i peach pear plum
print "$i"
endloop
This loop will execute three times, printing out peach, pear and plum on the respective iterations. The numerical value of the index starts at 1 and is incremented by 1 at each iteration.
If you wish to loop across a list of variables that are contiguous in the dataset, you can give the
names of the first and last variables in the list, separated by .., rather than having to type all
the names. For example, say we have 50 variables AK, AL, . . . , WY, containing income levels for the
states of the US. To run a regression of income on time for each of the states we could do:
genr time
loop foreach i AL..WY
ols $i const time
endloop
This loop variant can also be used for looping across the elements in a named list (see chapter 12).
For example:
list ylist = y1 y2 y3
loop foreach i ylist
ols $i const x1 x2
endloop
Note that if you use this idiom inside a function (see chapter 10), looping across a list that has been
supplied to the function as an argument, it is necessary to use the syntax listname.$i to reference
the list-member variables. In the context of the example above, this would mean replacing the third
line with
ols ylist.$i const x1 x2
For loop
The final form of loop control emulates the for statement in the C programming language. The
sytax is loop for, followed by three component expressions, separated by semicolons and surrounded by parentheses. The three components are as follows:
1. Initialization: This is evaluated only once, at the start of the loop. Common example: setting
a scalar control variable to some starting value.
2. Continuation condition: this is evaluated at the top of each iteration (including the first). If
the expression evaluates as true (non-zero), iteration continues, otherwise it stops. Common
example: an inequality expressing a bound on a control variable.
3. Modifier: an expression which modifies the value of some variable. This is evaluated prior
to checking the continuation condition, on each iteration after the first. Common example: a
control variable is incremented or decremented.
61
In this example the variable r will take on the values 0.01, 0.02, . . . , 0.99 across the 99 iterations.
Note that due to the finite precision of floating point arithmetic on computers it may be necessary
to use a continuation condition such as the above, r<.991, rather than the more natural r<=.99.
(Using double-precision numbers on an x86 processor, at the point where you would expect r to
equal 0.99 it may in fact have value 0.990000000000001.)
Any or all of the three expressions governing a for loop may be omitted the minimal form is
(;;). If the continuation test is omitted it is implicitly true, so you have an infinite loop unless you
arrange for some other way out, such as a break statement.
If the initialization expression in a for loop takes the common form of setting a scalar variable to
a given value, the string representation of that scalars value is made available within the loop via
the accessor $varname.
9.3
Progressive mode
If the --progressive option is given for a command loop, special behavior is invoked for certain
commands, namely, print, store and simple estimation commands. By simple here we mean
commands which (a) estimate a single equation (as opposed to a system of equations) and (b) do
so by means of a single command statement (as opposed to a block of statements, as with nls and
mle). The paradigm is ols; other possibilities include tsls, wls, logit and so on.
The special behavior is as follows.
Estimators: The results from each individual iteration of the estimator are not printed. Instead,
after the loop is completed you get a printout of (a) the mean value of each estimated coefficient
across all the repetitions, (b) the standard deviation of those coefficient estimates, (c) the mean
value of the estimated standard error for each coefficient, and (d) the standard deviation of the
estimated standard errors. This makes sense only if there is some random input at each step.
print: When this command is used to print the value of a variable, you do not get a print each time
round the loop. Instead, when the loop is terminated you get a printout of the mean and standard
deviation of the variable, across the repetitions of the loop. This mode is intended for use with
variables that have a scalar value at each iteration, for example the error sum of squares from a
regression. Data series cannot be printed in this way, and neither can matrices.
store: This command writes out the values of the specified scalars, from each time round the
loop, to a specified file. Thus it keeps a complete record of their values across the iterations. For
example, coefficient estimates could be saved in this way so as to permit subsequent examination
of their frequency distribution. Only one such store can be used in a given loop.
9.4
Loop examples
62
nulldata 50
set seed 547
genr x = 100 * uniform()
# open a "progressive" loop, to be repeated 100 times
loop 100 --progressive
genr u = 10 * normal()
# construct the dependent variable
genr y = 10*x + u
# run OLS regression
ols y const x
# grab the coefficient estimates and R-squared
genr a = $coeff(const)
genr b = $coeff(x)
genr r2 = $rsq
# arrange for printing of stats on these
print a b r2
# and save the coefficients to file
store coeffs.gdt a b
endloop
63
open greene11_3.gdt
# run initial OLS
ols C 0 Y
genr essbak = $ess
genr essdiff = 1
genr beta = $coeff(Y)
genr gamma = 1
# iterate OLS till the error sum of squares converges
loop while essdiff > .00001
# form the linearized variables
genr C0 = C + gamma * beta * Y^gamma * log(Y)
genr x1 = Y^gamma
genr x2 = beta * Y^gamma * log(Y)
# run OLS
ols C0 0 x1 x2 --print-final --no-df-corr --vcv
genr beta = $coeff(x1)
genr gamma = $coeff(x2)
genr ess = $ess
genr essdiff = abs(ess - essbak)/essbak
genr essbak = ess
endloop
# print parameter estimates using their "proper names"
set echo off
printf "alpha = %g\n", $coeff(0)
printf "beta = %g\n", beta
printf "gamma = %g\n", gamma
64
open armaloop.gdt
genr c = 0
genr a = 0.1
genr m = 0.1
series e = 1.0
genr de_c = e
genr de_a = e
genr de_m = e
genr crit = 1
loop while crit > 1.0e-9
# one-step forecast errors
genr e = y - c - a*y(-1) - m*e(-1)
# log-likelihood
genr loglik = -0.5 * sum(e^2)
print loglik
# partials of forecast errors wrt c, a, and m
genr de_c = -1 - m * de_c(-1)
genr de_a = -y(-1) -m * de_a(-1)
genr de_m = -e(-1) -m * de_m(-1)
# partials of l wrt
genr sc_c = -de_c *
genr sc_a = -de_a *
genr sc_m = -de_m *
c, a and m
e
e
e
# OPG regression
ols const sc_c sc_a sc_m --print-final --no-df-corr --vcv
# Update the parameters
genr dc = $coeff(sc_c)
genr c = c + dc
genr da = $coeff(sc_a)
genr a = a + da
genr dm = $coeff(sc_m)
genr m = m + dm
printf "
printf "
printf "
constant
= %.8g (gradient = %#.6g)\n", c, dc
ar1 coefficient = %.8g (gradient = %#.6g)\n", a, da
ma1 coefficient = %.8g (gradient = %#.6g)\n", m, dm
65
open hospitals.gdt
loop i=1991..2000
smpl (year=i) --restrict --replace
summary 1 2 3 4
endloop
open bea.dat
loop i=1987..2001
genr V = COMP$i
genr TC = GOC$i - PBT$i
genr C = TC - V
ols PBT$i const TC V
endloop
Chapter 10
User-defined functions
10.1
Defining a function
Gretl offers a mechanism for defining functions, which may be called via the command line, in
the context of a script, or (if packaged appropriately, see section 10.5) via the programs graphical
interface.
The syntax for defining a function looks like this:1
function return-type function-name (parameters)
function body
end function
The opening line of a function definition contains these elements, in strict order:
1. The keyword function.
2. return-type, which states the type of value returned by the function, if any. This must be one
of void (if the function does not return anything), scalar, series, matrix, list or string.
3. function-name, the unique identifier for the function. Names must start with a letter. They
have a maximum length of 31 characters; if you type a longer name it will be truncated.
Function names cannot contain spaces. You will get an error if you try to define a function
having the same name as an existing gretl command.
4. The functionss parameters, in the form of a comma-separated list enclosed in parentheses.
This may be run into the function name, or separated by white space as shown.
Function parameters can be of any of the types shown below.2
Type
Description
bool
int
scalar
scalar variable
series
data series
list
matrix
matrix or vector
string
bundle
Each element in the listing of parameters must include two terms: a type specifier, and the name
by which the parameter shall be known within the function. An example follows:
1 The syntax given here differs from the standard prior to gretl version 1.8.4. For reasons of backward compatibility
the old syntax is still supported; see section 10.6 for details.
2 An additional parameter type is available for GUI use, namely obs; this is equivalent to int except for the way it is
represented in the graphical interface for calling a function.
66
67
Each of the type-specifiers, with the exception of list and string, may be modified by prepending
an asterisk to the associated parameter name, as in
function scalar myfunc (series *y, scalar *b)
The meaning of this modification is explained below (see section 10.4); it is related to the use of
pointer arguments in the C programming language.
Function parameters: optional refinements
Besides the required elements mentioned above, the specification of a function parameter may
include some additional fields, as follows:
The const modifier.
For scalar or int parameters: minimum, maximum and default values; or for bool parameters, just a default value.
For all parameters, a descriptive string.
For int parameters with minimum and maximum values specified, a set of strings to associate
with the allowed numerical values (value labels).
The first two of these options may be useful in many contexts; the last two may be helpful if a
function is to be packaged for use in the gretl GUI (but probably not otherwise). We now expand on
each of the options.
The const modifier: must be given as a prefix to the basic parameter specification, as in
const matrix M
This constitutes a promise that the corresponding argument will not be modified within the
function; gretl will flag an error if the function attempts to modify the argument.
Minimum, maximum and default values for scalar or int types: These values should directly follow the name of the parameter, enclosed in square brackets and with the individual
elements separated by colons. For example, suppose we have an integer parameter order for
which we wish to specify a minimum of 1, a maximum of 12, and a default of 4. We can write
int order[1:12:4]
If you wish to omit any of the three specifiers, leave the corresponding field empty. For
example [1::4] would specify a minimum of 1 and a default of 4 while leaving the maximum
unlimited.
For a parameter of type bool (whose values are just zero or non-zero), you can specify a
default of 1 (true) or 0 (false), as in
bool verbose[0]
Descriptive string: This will show up as an aid to the user if the function is packaged (see
section 10.5 below) and called via gretls graphical interface. The string should be enclosed
in double quotes and separated from the preceding elements of the parameter specification
with a space, as in
series y "dependent variable"
68
Value labels: These may be used only with int parameters for which minimum and maximum
values have been specified, so there is a fixed number of admissible values, and the number
of labels must match the number of values. They will show up in the graphical interface
in the form of a drop-down list, making the function writers intent clearer when an integer
argument represents a categorical selection. A set of value labels must be enclosed in braces,
and the individual labels must be enclosed in double quotes and separated by commas or
spaces. For example:
int case[1:3:1] {"Fixed effects", "Between model", "Random effects"}
If two or more of the trailing optional fields are given in a parameter specification, they must be
given in the order shown above: minmaxdefault, description, value labels. Note that there is
no facility for escaping characters within descriptive strings or value labels; these may contain
spaces but they cannot contain the double-quote character.
Here is an example of a well-formed function specification using all the elements mentioned above:
function matrix myfunc (series y "dependent variable",
list X "regressors",
int p[0::1] "lag order",
int c[1:2:1] "criterion" {"AIC", "BIC"},
bool quiet[0])
One advantage of specifying default values for parameters, where applicable, is that in script or
command-line mode users may omit trailing arguments that have defaults. For example, myfunc
above could be invoked with just two arguments, corresponding to y and X; implicitly p = 1, c = 1
and quiet is false.
Functions taking no parameters
You may define a function that has no parameters (these are called routines in some programming
languages). In this case, use the keyword void in place of the listing of parameters:
function matrix myfunc2 (void)
10.2
Calling a function
A user function is called by typing its name followed by zero or more arguments enclosed in
parentheses. If there are two or more arguments these should be separated by commas.
There are automatic checks in place to ensure that the number of arguments given in a function
call matches the number of parameters, and that the types of the given arguments match the types
specified in the definition of the function. An error is flagged if either of these conditions is violated.
One qualification: allowance is made for omitting arguments at the end of the list, provided that
default values are specified in the function definition. To be precise, the check is that the number
of arguments is at least equal to the number of required parameters, and is no greater than the
total number of parameters.
A scalar, series or matrix argument to a function may be given either as the name of a pre-existing
variable or as an expression which evaluates to a variable of the appropriate type. Scalar arguments
may also be given as numerical values. List arguments must be specified by name.
69
The following trivial example illustrates a function call that correctly matches the function definition.
# function definition
function scalar ols_ess(series y, list xvars)
ols y 0 xvars --quiet
scalar myess = $ess
printf "ESS = %g\n", myess
return myess
end function
# main script
open data4-1
list xlist = 2 3 4
# function call (the return value is ignored here)
ols_ess(price, xlist)
The function call gives two arguments: the first is a data series specified by name and the second
is a named list of regressors. Note that while the function offers the variable myess as a return
value, it is ignored by the caller in this instance. (As a side note here, if you want a function to
calculate some value having to do with a regression, but are not interested in the full results of the
regression, you may wish to use the --quiet flag with the estimation command as shown above.)
A second example shows how to write a function call that assigns a return value to a variable in the
caller:
# function definition
function series get_uhat(series y, list xvars)
ols y 0 xvars --quiet
series uh = $uhat
return uh
end function
# main script
open data4-1
list xlist = 2 3 4
# function call
series resid = get_uhat(price, xlist)
10.3
Deleting a function
If you have defined a function and subsequently wish to clear it out of memory, you can do so using
the keywords delete or clear, as in
function myfunc delete
function get_uhat clear
Note, however, that if myfunc is already a defined function, providing a new definition automatically
overwrites the previous one, so it should rarely be necessary to delete functions explicitly.
10.4
70
end function
function series triple2(series *x)
return 3*x
end function
These two functions are nearly identical (and yield the same result); the only difference is that you
need to feed a series into triple1, as in triple1(myseries), while triple2 must be supplied a
pointer to a series, as in triple2(&myseries).
Why make the distinction? There are two main reasons for doing so: modularity and performance.
By modularity we mean the insulation of a function from the rest of the script which calls it. One of
the many benefits of this approach is that your functions are easily reusable in other contexts. To
achieve modularity, variables created within a function are local to that function, and are destroyed
when the function exits, unless they are made available as return values and these values are picked
up or assigned by the caller.
In addition, functions do not have access to variables in outer scope (that is, variables that exist
in the script from which the function is called) except insofar as these are explicitly passed to the
function as arguments.
By default, when a variable is passed to a function as an argument, what the function actually gets
is a copy of the outer variable, which means that the value of the outer variable is not modified by
anything that goes on inside the function. But the use of pointers allows a function and its caller
to cooperate such that an outer variable can be modified by the function. In effect, this allows a
function to return more than one value (although only one variable can be returned directly
see below). The parameter in question is marked with a prefix of * in the function definition, and
the corresponding argument is marked with the complementary prefix & in the caller. For example,
function series get_uhat_and_ess(series y, list xvars, scalar *ess)
ols y 0 xvars --quiet
ess = $ess
series uh = $uhat
return uh
end function
# main script
open data4-1
list xlist = 2 3 4
# function call
scalar SSR
series resid = get_uhat_and_ess(price, xlist, &SSR)
In the above, we may say that the function is given the address of the scalar variable SSR, and it
assigns a value to that variable (under the local name ess). (For anyone used to programming in C:
note that it is not necessary, or even possible, to dereference the variable in question within the
function using the * operator. Unadorned use of the name of the variable is sufficient to access the
variable in outer scope.)
An address parameter of this sort can be used as a means of offering optional information to the
caller. (That is, the corresponding argument is not strictly needed, but will be used if present). In
that case the parameter should be given a default value of null and the the function should test to
see if the caller supplied a corresponding argument or not, using the built-in function isnull().
For example, here is the simple function shown above, modified to make the filling out of the ess
value optional.
function series get_uhat_and_ess(series y, list xvars, scalar *ess[null])
ols y 0 xvars --quiet
if !isnull(ess)
ess = $ess
71
endif
return $uhat
end function
If the caller does not care to get the ess value, it can use null in place of a real argument:
series resid = get_uhat_and_ess(price, xlist, null)
Alternatively, trailing function arguments that have default values may be omitted, so the following
would also be a valid call:
series resid = get_uhat_and_ess(price, xlist)
Pointer arguments may also be useful for optimizing performance: even if a variable is not modified
inside the function, it may be a good idea to pass it as a pointer if it occupies a lot of memory.
Otherwise, the time gretl spends transcribing the value of the variable to the local copy may be
non-negligible, compared to the time the function spends doing the job it was written for.
Example 10.1 takes this to the extreme. We define two functions which return the number of rows
of a matrix (a pretty fast operation). One function gets a matrix as argument, the other one a pointer
to a matrix. The two functions are evaluated on a matrix with 2000 rows and 2000 columns; on a
typical system, floating-point numbers take 8 bytes of memory, so the space occupied by the matrix
is roughly 32 megabytes.
Running the code in example 10.1 will produce output similar to the following (the actual numbers
depend on the machine youre running the example on):
Elapsed time:
without pointers (copy) = 3.66 seconds,
with pointers (no copy) = 0.01 seconds.
If a pointer argument is used for this sort of purpose and the object to which the pointer points
is not modified by the function it is a good idea to signal this to the user by adding the const
qualifier, as shown for function b in Example 10.1. When a pointer argument is qualified in this
way, any attempt to modify the object within the function will generate an error.
List arguments
The use of a named list as an argument to a function gives a means of supplying a function with
a set of variables whose number is unknown when the function is written for example, sets of
regressors or instruments. Within the function, the list can be passed on to commands such as
ols.
A list argument can also be unpacked using a foreach loop construct, but this requires some
care. For example, suppose you have a list X and want to calculate the standard deviation of each
variable in the list. You can do:
loop foreach i X
scalar sd_$i = sd(X.$i)
endloop
Please note: a special piece of syntax is needed in this context. If we wanted to perform the above
task on a list in a regular script (not inside a function), we could do
loop foreach i X
scalar sd_$i = sd($i)
endloop
72
73
where $i gets the name of the variable at position i in the list, and sd($i) gets its standard
deviation. But inside a function, working on a list supplied as an argument, if we want to reference
an individual variable in the list we must use the syntax listname.varname. Hence in the example
above we write sd(X.$i).
This is necessary to avoid possible collisions between the name-space of the function and the namespace of the caller script. For example, suppose we have a function that takes a list argument, and
that defines a local variable called y. Now suppose that this function is passed a list containing
a variable named y. If the two name-spaces were not separated either wed get an error, or the
external variable y would be silently over-written by the local one. It is important, therefore, that
list-argument variables should not be visible by name within functions. To get hold of such
variables you need to use the form of identification just mentioned: the name of the list, followed
by a dot, followed by the name of the variable.
Constancy of list arguments When a named list of variables is passed to a function, the function
is actually provided with a copy of the list. The function may modify this copy (for instance, adding
or removing members), but the original list at the level of the caller is not modified.
Optional list arguments If a list argument to a function is optional, this should be indicated by
appending a default value of null, as in
function scalar myfunc (scalar y, list X[null])
In that case, if the caller gives null as the list argument (or simply omits the last argument) the
named list X inside the function will be empty. This possibility can be detected using the nelem()
function, which returns 0 for an empty list.
String arguments
String arguments can be used, for example, to provide flexibility in the naming of variables created
within a function. In the following example the function mavg returns a list containing two moving
averages constructed from an input series, with the names of the newly created variables governed
by the string argument.
function list mavg (series y, string vname)
series @vname_2 = (y+y(-1)) / 2
series @vname_4 = (y+y(-1)+y(-2)+y(-3)) / 4
list retlist = @vname_2 @vname_4
return retlist
end function
open data9-9
list malist = mavg(nocars, "nocars")
print malist --byobs
The last line of the script will print two variables named nocars_2 and nocars_4. For details on
the handling of named strings, see chapter 12.
If a string argument is considered optional, it may be given a null default value, as in
function scalar foo (series y, string vname[null])
74
we have the series known as y. It may be useful, however, to be able to determine the names of
the variables provided as arguments. This can be done using the function argname, which takes
the name of a function parameter as its single argument and returns a string. Here is a simple
illustration:
function void namefun (series y)
printf "the series given as y was named %s\n", argname(y)
end function
open data9-7
namefun(QNC)
Please note that this will not always work: the arguments given to functions may be anonymous
variables, created on the fly, as in somefun(log(QNC)) or somefun(CPI/100). In that case the
argname function fails to return a string. Function writers who wish to make use of this facility
should check the return from argname using the isstring() function, which returns 1 when given
the name of a string variable, 0 otherwise.
Return values
Functions can return nothing (just printing a result, perhaps), or they can return a single variable
a scalar, series, list, matrix, string, or bundle (see section 11.7). The return value, if any, is
specified via a statement within the function body beginning with the keyword return, followed by
either the name of a variable (which must be of the type announced on the first line of the function
definition) or an expression which produces a value of the correct type.
Having a function return a list or bundle is a way of permitting the return of more than one
variable. For example, you can define several series inside a function and package them as a list;
in this case they are not destroyed when the function exits. Here is a simple example, which also
illustrates the possibility of setting the descriptive labels for variables generated in a function.
function list make_cubes (list xlist)
list cubes = null
loop foreach i xlist --quiet
series $i3 = (xlist.$i)^3
setinfo $i3 -d "cube of $i"
list cubes += $i3
endloop
return cubes
end function
open data4-1
list xlist = price sqft
list cubelist = make_cubes(xlist)
print xlist cubelist --byobs
labels
A return statement causes the function to return (exit) at the point where it appears within the
body of the function. A function may also exit when (a) the end of the function code is reached (in
the case of a function with no return value), (b) a gretl error occurs, or (c) a funcerr statement is
reached.
75
The funcerr keyword, which may be followed by a string enclosed in double quotes, causes a
function to exit with an error flagged. If a string is provided, this is printed on exit, otherwise a
generic error message is printed. This mechanism enables the author of a function to pre-empt an
ordinary execution error and/or offer a more specific and helpful error message. For example,
if nelem(xlist) = 0
funcerr "xlist must not be empty"
endif
However, it is recommended programming practice to have a single return point from a function
unless this is very inconvenient. The simple example above would be better written as
function scalar multi (bool s)
return s ? 1000 : 10
end function
Error checking
When gretl first reads and compiles a function definition there is minimal error-checking: the
only checks are that the function name is acceptable, and, so far as the body is concerned, that you
are not trying to define a function inside a function (see Section 10.1). Otherwise, if the function
body contains invalid commands this will become apparent only when the function is called and
its commands are executed.
Debugging
The usual mechanism whereby gretl echoes commands and reports on the creation of new variables
is by default suppressed when a function is being executed. If you want more verbose output from
a particular function you can use either or both of the following commands within the function:
set echo on
set messages on
Alternatively, you can achieve this effect for all functions via the command set debug 1. Usually
when you set the value of a state variable using the set command, the effect applies only to the
current level of function execution. For instance, if you do set messages on within function f1,
which in turn calls function f2, then messages will be printed for f1 but not f2. The debug variable,
however, acts globally; all functions become verbose regardless of their level.
Further, you can do set debug 2: in addition to command echo and the printing of messages, this
is equivalent to setting max_verbose (which produces verbose output from the BFGS maximizer) at
all levels of function execution.
10.5
Function packages
Since gretl 1.6.0 there has been a mechanism to package functions and make them available to
other users of gretl. Here is a walk-through of the process.
76
In this case, we have appended a string to the function argument, as explained in section 10.1, so
as to make our interface more informative. This is not obligatory: if you omit the descriptive string,
gretl will supply a predefined one.
Now run your function. You may want to make sure it works properly by running a few tests. For
example, you may open the console and type
genr x = uniform()
genr dpcx = pc(x)
print x dpcx --byobs
You should see something similar to figure 10.1. The function seems to work ok. Once your
function is debugged, you may proceed to the next stage.
Create a package
We first present the mechanism for creating a function package via gretls graphical interface. This
can also be done via the command line, which offers some additional functionality for package
authors; an explanation is given later in this section.
77
Start the GUI program and take a look at the File, Function files menu. This menu contains four
items: On local machine, On server, Edit package, New package.
Select New package. (This will produce an error message unless at least one user-defined function
is currently loaded in memory see the previous point.) In the first dialog you get to select:
A public function to package.
Zero or more private helper functions.
Public functions are directly available to users; private functions are part of the behind the scenes
mechanism in a function package.
On clicking OK a second dialog should appear (see Figure 10.2), where you get to enter the package
information (author, version, date, and a short description). You can also enter help text for the
public interface. You have a further chance to edit the code of the function(s) to be packaged, by
clicking on Edit function code. (If the package contains more than one function, a drop-down
selector will be shown.) And you get to add a sample script that exercises your package. This
will be helpful for potential users, and also for testing. A sample script is required if you want to
upload the package to the gretl server (for which a check-box is supplied).
You wont need it right now, but the button labeled Save as script allows you to reverse engineer
a function package, writing out a script that contains all the relevant function definitions.
Clicking Save in this dialog leads you to a File Save dialog. All being well, this should be pointing
towards a directory named functions, either under the gretl system directory (if you have write
permission on that) or the gretl user directory. This is the recommended place to save function
package files, since that is where the program will look in the special routine for opening such files
(see below).
Needless to say, the menu command File, Function files, Edit package allows you to make changes
to a local function package.
78
A word on the file you just saved. By default, it will have a .gfn extension. This is a function
package file: unlike an ordinary gretl script file, it is an XML file containing both the function code
and the extra information entered in the packager. Hackers might wish to write such a file from
scratch rather than using the GUI packager, but most people are likely to find it awkward. Note
that XML-special characters in the function code have to be escaped, e.g. & must be represented as
&. Also, some elements of the function syntax differ from the standard script representation:
the parameters and return values (if any) are represented in XML. Basically, the function is preparsed, and ready for fast loading using libxml.
Load a package
Why package functions in this way? To see whats on offer so far, try the next phase of the walkthrough.
Close gretl, then re-open it. Now go to File, Function files, On local machine. If the previous stage
above has gone OK, you should see the file you packaged and saved, with its short description. If
you click on Info you get a window with all the information gretl has gleaned from the function
package. If you click on the View code icon in the toolbar of this new window, you get a script
view window showing the actual function code. Now, back to the Function packages window, if
you click on the packages name, the relevant functions are loaded into gretls workspace, ready to
be called by clicking on the Call button.
After loading the function(s) from the package, open the GUI console. Try typing help foo, replacing foo with the name of the public interface from the loaded function package: if any help text
was provided for the function, it should be presented.
In a similar way, you can browse and load the function packages available on the gretl server, by
selecting File, Function files, On server.
Once your package is installed on your local machine, you can use the function it contains via
the graphical interface as described above, or by using the CLI, namely in a script or through the
console. In the latter case, you load the function via the include command, specifying the package
file as the argument, complete with the .gfn extension.
To continue with our example, load the file np.gdt (supplied with gretl among the sample datasets).
Suppose you want to compute the rate of change for the variable iprod via your new function and
store the result in a series named foo.
Go to File, Function files, On local machine. You will be shown a list of the installed packages,
including the one you have just created. If you select it and click on Execute (or double-click on
79
the name of the function package), a window similar to the one shown in figure 10.3 will appear.
Notice that the description string Series to process, supplied with the function definition, appears
to the left of the top series chooser.
Click Ok and the series foo will be generated (see figure 10.4). You may have to go to Data,
Refresh data in order to have your new variable show up in the main window variable list (or just
press the r key).
80
Note that the makepkg command takes one argument, the name of the package file to be created.
The package specification file should have the same basename but the extension .spec. In this case
gretl will therefore look for foo.spec. It should look something like this:
# foo.spec
author = A. U. Thor
version = 1.0
date = 2011-02-01
description = Does something with time series
public = foo
help = foohelp.txt
sample-script = example.inp
min-version = 1.9.3
data-requirement = needs-time-series-data
As you can see, the format of each line in this file is key = value, with two qualifications: blank
lines are permitted (and ignored, as are comment lines that start with #).
All the fields included in the above example are required, with the exception of data-requirement,
though the order in which they appear is immaterial. Heres a run-down of the basic fields:
author: the name(s) of the author(s). Accented or other non-ASCII characters should be given
as UTF-8.
version: the version number of the package, which should be limited to two integers separated by a period.
date: the release date of the current verson of the package, in ISO 8601 format: YYYY-MM-DD.
description: a brief description of the functionality offered by the package. This will be
displayed in the GUI function packages window so it should be just one short line.
public: the listing of public functions.
help: the name of a plain text (UTF-8) file containing help; all packages must provide help.
sample-script: the name of a sample script that illustrates use of the package; all packages
must supply a sample script.
min-version: the minimum version of gretl required for the package to work correctly. If
youre unsure about this, the conservative thing is to give the current gretl version.
The public field indicates which function or functions are to be made directly available to users (as
opposed to private helper functions). In the example above there is just one public function. Note
that any functions in memory when makepkg is invoked, other than those designated as public, are
assumed to be private functions that should also be included in the package. That is, the list of
private functions (if any) is implicit.
The data-requirement field should be specified if the package requires time-series or panel data,
or alternatively if no dataset is required. If the data-requirement field is omitted, the assumption
is that the package needs a dataset in place, but it doesnt matter what kind; if the packaged
functions do not use any series or lists this requirement can be explicitly relaxed. Valid values for
this field are:
needs-time-series-data
needs-qm-data
needs-panel-data
(must be a panel)
no-data-ok
81
For a more complex example, lets look at the gig (GARCH-in-gretl) package. The driver script for
building gig looks something like this:
set echo off
set messages off
include gig_mle.inp
include gig_setup.inp
include gig_estimate.inp
include gig_printout.inp
include gig_plot.inp
makepkg gig.gfn
In this case the functions to be packaged (of which there are many) are distributed across several
script files, each of which is the target of an include command. The set commands at the top are
included to cut down on the verbosity of the output.
The content of gig.spec is as follows:
author = Riccardo "Jack" Lucchetti and Stefano Balietti
version = 2.0
date = 2010-12-21
description = An assortment of univariate GARCH models
public = GUI_gig \
gig_setup gig_set_dist gig_set_pq gig_set_vQR \
gig_print gig_estimate \
gig_plot gig_dplot \
gig_bundle_print GUI_gig_plot
gui-main = GUI_gig
bundle-print = gig_bundle_print
bundle-plot = GUI_gig_plot
help = gig.pdf
sample-script = examples/example1.inp
min-version = 1.9.3
data-requirement = needs-time-series-data
Note that backslash continuation can be used for the elements of the public function listing.
In addition to the fields shown in the simple example above, gig.spec includes three optional
fields: gui-main, bundle-print and bundle-plot. These keywords are used to designate certain
functions as playing a special role in the gretl graphical interface. A function picked out in this way
must be in the public list and must satisfy certain further requirements.
gui-main: this specifies a function as the one which will be presented automatically to GUI
users (instead of users being faced with a choice of interfaces). This makes sense only for
packages that have multiple public functions. In addition, the gui-main function must return
a bundle (see section 11.7).
bundle-print: this picks out a function that should be used to print the contents of a bundle
returned by the gui-main function. It must take a pointer-to-bundle as its first argument.
The second argument, if present, should be an int switch, with two or more valid values, that
controls the printing in some way. Any further arguments must have default values specified
so that they can be omitted.
bundle-plot: selects a function for the role of producing a plot or graph based on the contents of a returned bundle. The requirements on this function are as for bundle-print.
The GUI special tags support a user-friendly mode of operation. On a successful call to gui-main,
gretl opens a window displaying the contents of the returned bundle (formatted via bundle-print).
82
Menus in this window give the user the option of saving the entire bundle (in which case its represented as an icon in the icon view window) or of extracting specific elements from the bundle
(series or matrices, for example).
If the package has a bundle-plot function, the bundle window also has a Graph menu. In gig, for
example, the bundle-plot function has this signature:
function void GUI_gig_plot(bundle *model, int ptype[0:1:0] \
"Plot type" {"Time series", "Density"})
The ptype switch is used to choose between a time-series plot of the residual and its conditional
variance, and a kernel density plot of the innovation against the theoretical distribution it is supposed to follow. The use of the value-labels Time series and Density means that the Graph menu
will display these two choices.
One other feature of the gig spec file is noteworthy: the help field specifies gig.pdf, documentation in PDF format. Unlike plain-text help, this cannot be rolled into the gfn (XML) file produced
by the makepkg command; rather, both gig.gfn and gig.pdf are packaged into a zip archive for
distribution. This represents a form of package which is new in gretl 1.9.4. More details will be
made available before long.
10.6
As mentioned at the start of this chapter, different rules were in force for defining functions prior
to gretl 1.8.4. While the old syntax is still supported to date, this may not always be the case. But
it is straightforward to convert a function to the new style. The only thing that must be changed
for compatibility with the new syntax is the declaration of the functions return type. Previously
this was placed inline in the return statement, whereas now it is placed right after the function
keyword. For example:
# old style
function triple (series x)
y = 3*x
return series y # note the "series" here
end function
# new style
function series triple (series x)
y = 3*x
return y
end function
Note also that the role of the return statement has changed (and its use has become more flexible):
The return statement now causes the function to return directly, and you can have more
than one such statement, wrapped in conditionals. Before there could only be one return
statement, and its role was just to specify the type available for assignment by the caller.
The final element in the return statement can now be an expression that evaluates to a value
of the advertised return type; before, it had to be the name of a pre-defined variable.
Chapter 11
Introduction
series
matrix
list
string
bundle
The numerical values mentioned above are all double-precision floating point numbers.
In this chapter we give a run-down of the basic characteristics of each of these types and also
explain their life cycle (creation, modification and destruction). The list and matrix types, whose
uses are relatively complex, are discussed at greater length in the following two chapters.
11.2
Series
We begin with the series type, which is the oldest and in a sense the most basic type in gretl. When
you open a data file in the gretl GUI, what you see in the main window are the ID numbers, names
(and descriptions, if available) of the series read from the file. All the series existing at any point in
a gretl session are of the same length, although some may have missing values. The variables that
can be added via the items under the Add menu in the main window (logs, squares and so on) are
also series.
For a gretl session to contain any series, a common series length must be established. This is
usually achieved by opening a data file, or importing a series from a database, in which case the
length is set by the first import. But one can also use the nulldata command, which takes as it
single argument the desired length, a positive integer.
Each series has these basic attributes: an ID number, a name, and of course n numerical values. In
addition a series may have a description (which is shown in the main window and is also accessible
via the labels command), a display name for use in graphs, a record of the compaction method
used in reducing the variables frequency (for time-series data only) and a flag marking the variable
as discrete. These attributes can be edited in the GUI by choosing Edit Attributes (either under the
Variable menu or via right-click), or by means of the setinfo command.
In the context of most commands you are able to reference series by name or by ID number as you
wish. The main exception is the definition or modification of variables via a formula; here you must
use names since ID numbers would get confused with numerical constants.
Note that series ID numbers are always consecutive, and the ID number for a given series will change
if you delete a lower-numbered series. In some contexts, where gretl is liable to get confused by
such changes, deletion of low-numbered series is disallowed.
83
11.3
84
Scalars
The scalar type is relatively simple: just a convenient named holder for a single numerical value.
Scalars have none of the additional attributes pertaining to series, do not have public ID numbers,
and must be referenced by name. A common use of scalar variables is to record information made
available by gretl commands for further processing, as in scalar s2 = $sigma2 to record the
square of the standard error of the regression following an estimation command such as ols.
You can define and work with scalars in gretl without having any dataset in place.
In the gretl GUI, scalar variables can be inspected and their values edited via the Scalars item
under the View menu in the main window.
11.4
Matrices
Matrices in gretl work much as in other mathematical software (e.g. MATLAB, Octave). Like scalars
they have no public ID numbers and must be referenced by name, and they can be used without any
dataset in place. Matrix indexing is 1-based: the top-left element of matrix A is A[1,1]. Matrices
are discussed at length in chapter 13; advanced users of gretl will want to study this chapter in
detail.
Matrices have one optional attribute beyond their numerical content: they may have column names
attached, which are displayed when the matrix is printed. See the colnames function for details.
In the gretl GUI, matrices can be inspected, analysed and edited via the Icon view item under the
View menu in the main window: each currently defined matrix is represented by an icon.
11.5
Lists
As with matrices, lists merit an explication of their own (see chapter 12). Briefly, named lists can
(and should!) be used to make commands scripts less verbose and repetitious, and more easily
modifiable. Since lists are in fact lists of series ID numbers they can be used only when a dataset is
in place.
In the gretl GUI, named lists can be inspected and edited under the Data menu in the main window,
via the item Define or edit list.
11.6
Strings
String variables may be used for labeling, or for constructing commands. They are discussed in
chapter 12. They must be referenced by name; they can be defined in the absence of a dataset.
Such variables can be created and modified via the command-line in the gretl console or via script;
there is no means of editing them via the gretl GUI.
11.7
Bundles
A bundle is a container or wrapper for various sorts of objects specifically, scalars, series,
matrices, strings and bundles. (Yes, a bundle can contain other bundles). A bundle takes the form
of a hash table or associative array: each item placed in the bundle is associated with a key string
which can used to retrieve it subsequently. We begin by explaining the mechanics of bundles then
offer some thoughts on what they are good for.
To use a bundle you must first declare it, as in
bundle foo
85
To add an object to a bundle you assign to a compound left-hand value: the name of the bundle
followed by the key string in square brackets. For example, the statement
foo["matrix1"] = m
adds an object called m (presumably a matrix) to bundle foo under the key matrix1. To get an item
out of a bundle, again use the name of the bundle followed by the bracketed key, as in
matrix bm = foo["matrix1"]
A bundle key may be given as a double-quoted string literal, as shown above, or as the name of
a pre-defined string variable. Key strings have a maximum length of 15 characters and cannot
contain spaces.
Note that the key identifying an object within a given bundle is necessarily unique. If you reuse an
existing key in a new assignment, the effect is to replace the object which was previously stored
under the given key. It is not required that the type of the replacement object is the same as that
of the original.
Also note that when you add an object to a bundle, what in fact happens is that the bundle acquires
a copy of the object. The external object retains its own identity and is unaffected if the bundled
object is replaced by another. Consider the following script fragment:
bundle foo
matrix m = I(3)
foo["mykey"] = m
scalar x = 20
foo["mykey"] = x
After the above commands are completed bundle foo does not contain a matrix under mykey, but
the original matrix m is still in good health.
To delete an object from a bundle use the delete command, as in
delete foo["mykey"]
This destroys the object associated with the key and removes the key from the hash table.
Besides adding, accessing, replacing and deleting individual items, the other operations that are
supported for bundles are union, printing and deletion. As regards union, if bundles b1 and b2 are
defined you can say
bundle b3 = b1 + b2
to create a new bundle that is the union of the two others. The algorithm is: create a new bundle
that is a copy of b1, then add any items from b2 whose keys are not already present in the new
bundle. (This means that bundle union is not commutative if the bundles have one or more key
strings in common.)
If b is a bundle and you say print b, you get a listing of the bundles keys along with the types of
the corresponding objects, as in
? print b
bundle b:
x (scalar)
mat (matrix)
inside (bundle)
86
The bundle type can also be used to advantage as the return value from a packaged function, in
cases where a package writer wants to give the user the option of accessing various results. In the
gretl GUI, function packages that return a bundle are treated specially: the output window that
displays the printed results acquires a menu showing the bundled items (their names and types),
from which the user can save items of interest. For example, a function package that estimates a
model might return a bundle containing a vector of parameter estimates, a residual series and a
covariance matrix for the parameter estimates, among other possibilities.
As a refinement to support the use of bundles as a function return type, the setnote function can
be used to add a brief explanatory note to a bundled item such notes will then be shown in the
GUI menu. This function takes three arguments: the name of a bundle, a key string, and the note.
For example
setnote(b, "vcv", "covariance matrix")
After this, the object under the key vcv in bundle b will be shown as covariance matrix in a GUI
11.8
Creation
The most basic way to create a new variable of any type is by declaration, where one states the type
followed by the name of the variable to create, as in
scalar x
series y
matrix A
and so forth. In that case the object in question is given a default initialization, as follows: a new
scalar has value NA (missing); a new series is filled with zeros; a new matrix is null (zero rows and
columns); a new string is empty; a new list has no members, and a new bundle is empty.
Declaration can be supplemented by a definite initialization, as in
87
scalar x = pi
series y = log(x)
matrix A = zeros(10,4)
With the exception of bundles (as noted above), new variables in gretl do not have to be declared
by type. The traditional way of creating a new variable in gretl was via the genr command (which is
still supported), as in
genr x = y/100
Here the type of x is left implicit and will be determined automatically depending on the context: if
y is a scalar, a series or a matrix x will inherit ys type (otherwise an error will be generated, since
division is applicable to these types only). Moreover, the type of a new variable can be left implicit
without use of genr:
x = y/100
In modern gretl scripting we recommend that you state the type of a new variable explicitly.
This makes the intent clearer to a reader of the script and also guards against errors that might
otherwise be difficult to understand (i.e. a certain variable turns out to be of the wrong type for
some subsequent calculation, but you dont notice at first because you didnt say what type you
needed). An exception to this rule might reasonably be granted for clear and simple cases where
theres little possibility of confusion.
Modification
Typically, the values of variables of all types are modified by assignment, using the = operator with
the name of the variable on the left and a suitable value or formula on the right:
z = normal()
x = 100 * log(y) - log(y(-1))
M = qform(a, X)
By a suitable value we mean one that is conformable for the type in question. A gretl variable
acquires its type when it is first created and this cannot be changed via assignment; for example, if
you have a matrix A and later want a string A, you will have to delete the matrix first.
+ One point to watch out for in gretl scripting is type conflicts having to do with the names of series brought
in from a data file. For example, in setting up a command loop (see chapter 9) it is very common to call the
loop index i. Now a loop index is a scalar (typically incremented each time round the loop). If you open
a data file that happens to contain a series named i you will get a type error (Types not conformable for
operation) when you try to use i as a loop index.
Although the type of an existing variable cannot be changed on the fly, gretl nonetheless tries to be
as understanding as possible. For example if x is a series and you say
x = 100
gretl will give the series a constant value of 100 rather than complaining that you are trying to
assign a scalar to a series. This issue is particularly relevant for the matrix type see chapter 13
for details.
Besides using the regular assignment operator you also have the option of using an inflected
equals sign, as in the C programming language. This is shorthand for the case where the new value
of the variable is a function of the old value. For example,
88
For scalar variables you can use a more condensed shorthand for simple increment or decrement
by 1, namely trailing ++ or -- respectively:
x = 100
x-# x now equals 99
x++
# x now equals 100
In the case of objects holding more than one value series, matrices and bundles you can
modify particular values within the object using an expression within square brackets to identify
the elements to access. We have discussed this above for the bundle type and chapter 13 goes into
details for matrices. As for series, there are two ways to specify particular values for modification:
you can use a simple 1-based index, or if the dataset is a time series or panel (or if it has marker
strings that identify the observations) you can use an appropriate observation string. Such strings
are displayed by gretl when you print data with the --byobs flag. Examples:
x[13]
x[1995:4]
x[2003:08]
x["AZ"]
x[3:15]
=
=
=
=
=
100
100
100
100
100
#
#
#
#
#
Note that with quarterly or monthly time series there is no ambiguity between a simple index
number and a date, since dates always contain a colon. With annual time-series data, however,
such ambiguity exists and it is resolved by the rule that a number in brackets is always read as a
simple index: x[1905] means the nineteen-hundred and fifth observation, not the observation for
the year 1905. You can specify a year by quotation, as in x["1905"].
Destruction
Objects of the types discussed above, with the important exception of named lists, are all destroyed
using the delete command: delete objectname.
Lists are an exception for this reason: in the context of gretl commands, a named list expands to
the ID numbers of the member series, so if you say
delete L
for L a list, the effect is to delete all the series in L; the list itself is not destroyed, but ends up
empty. To delete the list itself (without deleting the member series) you must invert the command
and use the list keyword:
list L delete
Chapter 12
Named lists
Many gretl commands take one or more lists of series as arguments. To make this easier to handle
in the context of command scripts, and in particular within user-defined functions, gretl offers the
possibility of named lists.
Creating and modifying named lists
A named list is created using the keyword list, followed by the name of the list, an equals sign,
and an expression that forms a list. The most basic sort of expression that works in this context is
a space-separated list of variables, given either by name or by ID number. For example,
list xlist = 1 2 3 4
list reglist = income price
Note that the variables in question must be of the series type: you cannot include scalars in a
named list.
Two special forms are available:
If you use the keyword null on the right-hand side, you get an empty list.
If you use the keyword dataset on the right, you get a list containing all the series in the
current dataset (except the pre-defined const).
The name of the list must start with a letter, and must be composed entirely of letters, numbers
or the underscore character. The maximum length of the name is 15 characters; list names cannot
contain spaces.
Once a named list has been created, it will be remembered for the duration of the gretl session
(unless you delete it), and can be used in the context of any gretl command where a list of variables
is expected. One simple example is the specification of a list of regressors:
list xlist = x1 x2 x3 x4
ols y 0 xlist
Be careful: delete xlist will delete the variables contained in the list, so it implies data loss
(which may not be what you want). On the other hand, list xlist delete will simply undefine
the xlist identifier and the variables themselves will not be affected.
Similarly, to print the names of the variables in a list you have to invert the usual print command,
as in
list xlist print
89
90
If you just say print xlist the list will be expanded and the values of all the member variables
will be printed.
Lists can be modified in various ways. To redefine an existing list altogether, use the same syntax
as for creating a list. For example
list xlist = 1 2 3
xlist = 4 5 6
Another option for appending a term (or a list) to an existing list is to use +=, as in
xlist += cpi
In most contexts where lists are used in gretl, it is expected that they do not contain any duplicated
elements. If you form a new list by simple concatenation, as in list L3 = L1 L2 (where L1 and
L2 are existing lists), its possible that the result may contain duplicates. To guard against this you
can form a new list as the union of two existing ones:
list L3 = L1 || L2
The result is a list that contains all the members of L1, plus any members of L2 that are not already
in L1.
In the same vein, you can construct a new list as the intersection of two existing ones:
list L3 = L1 && L2
Here L3 contains all the elements that are present in both L1 and L2.
You can also subtract one list from another:
list L3 = L1 - L2
The result contains all the elements of L1 that are not present in L2.
Lists and matrices
Another way of forming a list is by assignment from a matrix. The matrix in question must be
interpretable as a vector containing ID numbers of (series) variables. It may be either a row or
a column vector, and each of its elements must have an integer part that is no greater than the
number of variables in the data set. For example:
matrix m = {1,2,3,4}
list L = m
91
Querying a list
You can determine whether an unknown variable actually represents a list using the function
islist().
series xl1
series xl2
list xlogs
genr is1 =
genr is2 =
= log(x1)
= log(x2)
= xl1 xl2
islist(xlogs)
islist(xl1)
The first genr command above will assign a value of 1 to is1 since xlogs is in fact a named list.
The second genr will assign 0 to is2 since xl1 is a data series, not a list.
You can also determine the number of variables or elements in a list using the function nelem().
list xlist = 1 2 3
nl = nelem(xlist)
The (scalar) variable nl will be assigned a value of 3 since xlist contains 3 members.
You can determine whether a given series is a member of a specified list using the function
inlist(), as in
scalar k = inlist(L, y)
where L is a list and y a series. The series may be specified by name or ID number. The return value
is the (1-based) position of the series in the list, or zero if the series is not present in the list.
Generating lists of transformed variables
Given a named list of variables, you are able to generate lists of transformations of these variables
using the functions log, lags, diff, ldiff, sdiff or dummify. For example
list xlist = x1 x2 x3
list lxlist = log(xlist)
list difflist = diff(xlist)
When generating a list of lags in this way, you specify the maximum lag order inside the parentheses, before the list name and separated by a comma. For example
list xlist = x1 x2 x3
list laglist = lags(2, xlist)
or
scalar order = 4
list laglist = lags(order, xlist)
These commands will populate laglist with the specified number of lags of the variables in xlist.
You can give the name of a single series in place of a list as the second argument to lags: this is
equivalent to giving a list with just one member.
The dummify function creates a set of dummy variables coding for all but one of the distinct values
taken on by the original variable, which should be discrete. (The smallest value is taken as the
omitted catgory.) Like lags, this function returns a list even if the input is a single series.
92
YpcFR
YpcGE
YpcIT
NFR
NGE
NIT
1997
114.9
124.6
119.3
59830.635
82034.771
56890.372
1998
115.3
122.7
120.0
60046.709
82047.195
56906.744
1999
115.0
122.4
117.8
60348.255
82100.243
56916.317
2000
115.6
118.8
117.2
60750.876
82211.508
56942.108
2001
116.0
116.9
118.1
61181.560
82349.925
56977.217
2002
116.3
115.5
112.2
61615.562
82488.495
57157.406
2003
112.1
116.9
111.0
62041.798
82534.176
57604.658
2004
110.3
116.6
106.9
62444.707
82516.260
58175.310
2005
112.4
115.1
105.1
62818.185
82469.422
58607.043
2006
111.9
114.2
103.3
63195.457
82376.451
58941.499
Table 12.1: GDP per capita and population in 3 European countries (Source: Eurostat)
After these commands, the series xok will have value 1 for observations where none of x1, x2, or
x3 has a missing value, and value 0 for any observations where this condition is not met.
The functions max, min, mean, sd, sum and var behave horizontally rather than vertically when their
argument is a list. For instance, the following commands
list Xlist = x1 x2 x3
series m = mean(Xlist)
produce a series m whose i-th element is the average of x1,i , x2,i and x3,i ; missing values, if any, are
implicitly discarded.
In addition, gretl provides three functions for weighted operations: wmean, wsd and wvar. Consider
as an illustration Table 12.1: the first three columns are GDP per capita for France, Germany and
Italy; columns 4 to 6 contain the population for each country. If we want to compute an aggregate
indicator of per capita GDP, all we have to do is
list Ypc = YpcFR YpcGE YpcIT
list N = NFR NGE NIT
y = wmean(Ypc, N)
so for example
y1996 =
12.2
93
Named strings
For some purposes it may be useful to save a string (that is, a sequence of characters) as a named
variable that can be reused. Versions of gretl higher than 1.6.0 offer this facility, but some of the
refinements noted below are available only in gretl 1.7.2 and higher.
To define a string variable, you can use either of two commands, string or sprintf. The string
command is simpler: you can type, for example,
string s1 = "some stuff I want to save"
string s2 = getenv("HOME")
string s3 = s1 + 11
The first field after string is the name under which the string should be saved, then comes an
equals sign, then comes a specification of the string to be saved. This can be the keyword null, to
produce an empty string, or may take any of the following forms:
a string literal (enclosed in double quotes); or
the name of an existing string variable; or
a function that returns a string (see below); or
any of the above followed by + and an integer offset.
The role of the integer offset is to use a substring of the preceding element, starting at the given
character offset. An empty string is returned if the offset is greater than the length of the string in
question.
To add to the end of an existing string you can use the operator +=, as in
string s1 = "some stuff I want to "
string s1 += "save"
Note that when you define a string variable using a string literal, no characters are treated as
special (other than the double quotes that delimit the string). Specifically, the backslash is not
used as an escape character. So, for example,
string s = "\"
is a valid assignment, producing a string that contains a single backslash character. If you wish to
use backslash-escapes to denote newlines, tabs, embedded double-quotes and so on, use sprintf
instead.
The sprintf command is more flexible. It works exactly as gretls printf command except that
the format string must be preceded by the name of a string variable. For example,
scalar x = 8
sprintf foo "var%d", x
To use the value of a string variable in a command, give the name of the variable preceded by the
at sign, @. This notation is treated as a macro. That is, if a sequence of characters in a gretl
command following the symbol @ is recognized as the name of a string variable, the value of that
variable is sustituted literally into the command line before the regular parsing of the command is
carried out. This is illustrated in the following interactive session:
94
? scalar x = 8
scalar x = 8
Generated scalar x (ID 2) = 8
? sprintf foo "var%d", x
Saved string as foo
? print "@foo"
var8
Note the effect of the quotation marks in the line print "@foo". The line
? print @foo
would not print a literal var8 as above. After pre-processing the line would read
print var8
It would therefore print the value(s) of the variable var8, if such a variable exists, or would generate
an error otherwise.
In some contexts, however, one wants to treat string variables as variables in their own right: to do
this, give the name of the variable without the leading @ symbol. This is the way to handle such
variables in the following contexts:
When they appear among the arguments to the commands printf and sprintf.
On the right-hand side of a string assignment.
When they appear as an argument to the function taking a string argument.
Here is an illustration of the use of named string arguments with printf:
string vstr = "variance"
Generated string vstr
printf "vstr: %12s\n", vstr
vstr:
variance
Note that vstr should not be put in quotes in this context. Similarly with
? string vstr_copy = vstr
Built-in strings
Apart from any strings that the user may define, some string variables are defined by gretl itself.
These may be useful for people writing functions that include shell commands. The built-in strings
are as shown in Table 12.2.
Reading strings from the environment
In addition, it is possible to read into gretls named strings, values that are defined in the external
environment. To do this you use the function getenv, which takes the name of an environment
variable as its argument. For example:
? string user = getenv("USER")
Saved string as user
? string home = getenv("HOME")
Saved string as home
? print "@users home directory is @home"
cottrells home directory is /home/cottrell
workdir
dotdir
gnuplot
tramo
x12a
tramodir
x12adir
95
To check whether you got a non-empty value from a given call to getenv, you can use the function
strlen, which retrieves the length of the string, as in
? string temp = getenv("TEMP")
Saved empty string as temp
? scalar x = strlen(temp)
Generated scalar x (ID 2) = 0
The function isstring returns 1 if its argument is the name of a string variable, 0 otherwise.
However, if the return is 1 the string may still be empty.
At present the getenv function can only be used on the right-hand side of a string assignment,
as in the above illustrations.
Capturing strings via the shell
If shell commands are enabled in gretl, you can capture the output from such commands using the
syntax
string stringname = $(shellcommand)
That is, you enclose a shell command in parentheses, preceded by a dollar sign.
Reading from a file into a string
You can read the content of a file into a string variable using the syntax
string stringname = readfile(filename)
The filename field may be given as a string variable. For example
? sprintf fname "%s/QNC.rts", x12adir
Generated string fname
? string foo = readfile(fname)
Generated string foo
The above could also be accomplished using the macro variant of a string variable, provided it is
placed in quotation marks:
string foo = readfile("@x12adir/QNC.rts")
The strstr function
Invocation of this function takes the form
string stringname = strstr(s1, s2)
96
The effect is to search s1 for the first occurrence of s2. If no such occurrence is found, an empty
string is returned; otherwise the portion of s1 starting with s2 is returned. For example:
? string hw = "hello world"
Saved string as hw
? string w = strstr(hw, "o")
Saved string as w
? print "@w"
o world
Chapter 13
Matrix manipulation
Together with the other two basic types of data (series and scalars), gretl offers a quite comprehensive array of matrix methods. This chapter illustrates the peculiarities of matrix syntax and
discusses briefly some of the more complex matrix functions. For a full listing of matrix functions
and a comprehensive account of their syntax, please refer to the Gretl Command Reference.
13.1
Creating matrices
The matrix is defined by rows; the elements on each row are separated by commas and the rows
are separated by semi-colons. The whole expression must be wrapped in braces. Spaces within the
braces are not significant. The above expression defines a 2 3 matrix. Each element should be a
numerical value, the name of a scalar variable, or an expression that evaluates to a scalar. Directly
after the closing brace you can append a single quote () to obtain the transpose.
To specify a matrix in terms of data series the syntax is, for example,
matrix A = { x1, x2, x3 }
where the names of the variables are separated by commas. Besides names of existing variables,
you can use expressions that evaluate to a series. For example, given a series x you could do
matrix A = { x, x^2 }
Each variable occupies a column (and there can only be one variable per column). You cannot use
the semicolon as a row separator in this case: if you want the series arranged in rows, append the
transpose symbol. The range of data values included in the matrix depends on the current setting
of the sample range.
Instead of giving an explicit list of variables, you may instead provide the name of a saved list (see
Chapter 12), as in
97
98
list xlist = x1 x2 x3
matrix A = { xlist }
When you provide a named list, the data series are by default placed in columns, as is natural in an
econometric context: if you want them in rows, append the transpose symbol.
As a special case of constructing a matrix from a list of variables, you can say
matrix A = { dataset }
This builds a matrix using all the series in the current dataset, apart from the constant (variable 0).
When this dummy list is used, it must be the sole element in the matrix definition {...}. You can,
however, create a matrix that includes the constant along with all other variables using horizontal
concatenation (see below), as in
matrix A = {const}~{dataset}
By default, when you build a matrix from series that include missing values the data rows that
contain NAs are skipped. But you can modify this behavior via the command set skip_missing
off. In that case NAs are converted to NaN (Not a Number). In the IEEE floating-point standard, arithmetic operations involving NaN always produce NaN. Alternatively, you can take greater
control over the observations (data rows) that are included in the matrix using the set variable
matrix_mask, as in
set matrix_mask msk
where msk is the name of a series. Subsequent commands that form matrices from series or lists will
include only observations for which msk has non-zero (and non-missing) values. You can remove
this mask via the command set matrix_mask null.
+ Names of matrices must satisfy the same requirements as names of gretl variables in general: the name
can be no longer than 15 characters, must start with a letter, and must be composed of nothing but letters,
numbers and the underscore character.
13.2
Empty matrices
The syntax
matrix A = {}
creates an empty matrix a matrix with zero rows and zero columns.
The main purpose of the concept of an empty matrix is to enable the user to define a starting point
for subsequent concatenation operations. For instance, if X is an already defined matrix of any size,
the commands
matrix A = {}
matrix B = A ~ X
99
Legal operations on empty matrices are listed in Table 13.1. (All other matrix operations generate an error when an empty matrix is given as an argument.) In line with the above interpretation, some matrix functions return an empty matrix under certain conditions: the functions diag,
vec, vech, unvech when the arguments is an empty matrix; the functions I, ones, zeros,
mnormal, muniform when one or more of the arguments is 0; and the function nullspace when
its argument has full column rank.
Function
Return value
A, transp(A)
rows(A)
cols(A)
rank(A)
det(A)
NA
ldet(A)
NA
tr(A)
NA
onenorm(A)
NA
infnorm(A)
NA
rcond(A)
NA
13.3
Selecting sub-matrices
empty
2.
a single integer
3.
4.
With regard to option 2, the integer value can be given numerically, as the name of an existing
scalar variable, or as an expression that evaluates to a scalar. With the option 4, the index matrix
given in the rows field must be either p 1 or 1 p, and should contain integer values in the range
1 to n, where n is the number of rows in the matrix from which the selection is to be made.
The cols specification works in the same way, mutatis mutandis. Here are some examples.
matrix
matrix
matrix
matrix
matrix
B =
B =
B =
idx
B =
A[1,]
A[2:3,3:5]
A[2,2]
= { 1, 2, 6 }
A[idx,]
The first example selects row 1 from matrix A; the second selects a 23 submatrix; the third selects
a scalar; and the fourth selects rows 1, 2, and 6 from matrix A.
In addition there is a pre-defined index specification, diag, which selects the principal diagonal of
a square matrix, as in B[diag], where B is square.
100
You can use selections of this sort on either the right-hand side of a matrix-generating formula or
the left. Here is an example of use of a selection on the right, to extract a 2 2 submatrix B from a
3 3 matrix A:
matrix A = { 1, 2, 3; 4, 5, 6; 7, 8, 9 }
matrix B = A[1:2,2:3]
And here are examples of selection on the left. The second line below writes a 2 2 identity matrix
into the bottom right corner of the 3 3 matrix A. The fourth line replaces the diagonal of A with
1s.
matrix
matrix
matrix
matrix
13.4
A = { 1, 2, 3; 4, 5, 6; 7, 8, 9 }
A[2:3,2:3] = I(2)
d = { 1, 1, 1 }
A[diag] = d
Matrix operators
addition
subtraction
pre-multiplication by transpose
column-wise concatenation
row-wise concatenation
**
Kronecker product
.-
.*
./
.^
.=
.>
.<
both produce m n matrices, with elements cij = aij + k and dij = aij k respectively.
By pre-multiplication by transpose we mean, for example, that
matrix C = XY
produces the product of X-transpose and Y . In effect, the expression XY is shorthand for X*Y
(which is also valid).
In matrix left division, the statement
101
matrix X = A \ B
is interpreted as a request to find the matrix X that solves AX = B. If B is a square matrix, this is
in principle equivalent to A1 B, which fails if A is singular; the numerical method employed here
is the LU decomposition. If A is a T k matrix with T > k, then X is the least-squares solution,
X = (A0 A)1 A0 B, which fails if A0 A is singular; the numerical method employed here is the QR
decomposition. Otherwise, the operation necessarily fails.
For matrix right division, as in X = A / B, X is the matrix that solves XB = A, in principle
equivalent to AB 1 .
In dot operations a binary operation is applied element by element; the result of this operation
is obvious if the matrices are of the same size. However, there are several other cases where such
operators may be applied. For example, if we write
matrix C = A .- B
then the result C depends on the dimensions of A and B. Let A be an m n matrix and let B be
p q; the result is as follows:
Case
Result
cij = ai bij
cij = aij bi
cij = aj bij
cij = aij bj
cij = ai bj
cij = aj bi
A is a scalar (m = 1 and n = 1)
cij = a bij
B is a scalar (p = 1 and q = 1)
cij = aij b
If none of the above conditions are satisfied the result is undefined and an error is flagged.
Note that this convention makes it unnecessary, in most cases, to use diagonal matrices to perform
transformations by means of ordinary matrix multiplication: if Y = XV , where V is diagonal, it is
computationally much more convenient to obtain Y via the instruction
matrix Y = X .* v
produces C =
"
produces C =
A
B
#
.
13.5
102
Matrixscalar operators
For matrix A and scalar k, the operators shown in Table 13.2 are available. (Addition and subtraction were discussed in section 13.4 but we include them in the table for completeness.) In addition,
for square A and integer k 0, B = A^k produces a matrix B which is A raised to the power k.
Expression
Effect
matrix B = A * k
bij = kaij
matrix B = A / k
bij = aij /k
matrix B = k / A
bij = k/aij
matrix B = A + k
bij = aij + k
matrix B = A - k
bij = aij k
matrix B = k - A
bij = k aij
matrix B = A % k
13.6
Matrix functions
Most of the gretl functions available for scalars and series also apply to matrices in an element-byelement fashion, and as such their behavior should be pretty obvious. This is the case for functions
such as log, exp, sin, etc. These functions have the effects documented in relation to the genr
command. For example, if a matrix A is already defined, then
matrix B = sqrt(A)
generates a matrix such that bij = aij . All such functions require a single matrix as argument, or
an expression which evaluates to a single matrix.1
In this section, we review some aspects of genr functions that apply specifically to matrices. A full
account of each function is available in the Gretl Command Reference.
Matrix reshaping
In addition to the methods discussed in sections 13.1 and 13.3, a matrix can also be created by
re-arranging the elements of a pre-existing matrix. This is accomplished via the mshape function.
It takes three arguments: the input matrix, A, and the rows and columns of the target matrix, r
and c respectively. Elements are read from A and written to the target in column-major order. If A
contains fewer elements than n = r c, they are repeated cyclically; if A has more elements, only
the first n are used.
For example:
matrix a = mnormal(2,3)
a
matrix b = mshape(a,3,1)
b
matrix b = mshape(a,5,2)
b
produces
1 Note that to find the matrix square root you need the cholesky function (see below); moreover, the exp function
computes the exponential element by element, and therefore does not return the matrix exponential unless the matrix is
diagonal to get the matrix exponential, use mexp.
103
diag
diagcat
lower
mnormal
mread
muniform
mwrite
ones
rownames
seq
unvech
upper
vec
vech
zeros
msortby
rows
Shape/size/arrangement
cols
dsort
selifc
Matrix algebra
cdiv
mreverse
mshape
selifr
sort
trimr
cholesky
cmult
det
eigengen
eigensym
eigsolve
fft
ffti
ginv
infnorm
inv
invpd
ldet
mexp
nullspace onenorm
polroots
psdroot
qform
qrdecomp
rank
rcond
svd
toepsolv
tr
transp
varsimul
corrgm
cov
cum
fcstats
Statistics/transformations
cdemean
corr
imaxc
imaxr
iminc
iminr
kdensity
maxc
maxr
mcorr
mcov
mcovg
meanc
meanr
minc
minr
mlag
mols
mpols
mrls
mxtab
pergm
princomp
quantile
resample
sdc
sumc
sumr
values
isconst
replace
filter
kfilter
ksimul
ksmooth
lrvar
fdjac
NRmax
Data utilities
Filters
Numerical methods
BFGSmax
Strings
colname
Transformations
chowlin
lincomb
Table 13.3: Matrix functions by category
104
1.2323
0.54363
0.99714
0.43928
-0.39078
-0.48467
?
matrix b = mshape(a,3,1)
Generated matrix b
?
b
b
1.2323
0.54363
0.99714
?
matrix b = mshape(a,5,2)
Replaced matrix b
?
b
b
1.2323
0.54363
0.99714
0.43928
-0.39078
-0.48467
1.2323
0.54363
0.99714
0.43928
105
eigengen
mols
Matrix OLS
qrdecomp
QR decomposition
svd
The general rule is: the main result of the function is always returned as the result proper.
Auxiliary returns, if needed, are retrieved using pre-existing matrices, which are passed to the
function as pointers (see 10.4). If such values are not needed, the pointer may be substituted with
the keyword null.
The syntax for qrdecomp, eigensym and eigengen is of the form
matrix B = func(A, &C)
The first argument, A, represents the input data, that is, the matrix whose decomposition or analysis
is required. The second argument must be either the name of an existing matrix preceded by & (to
indicate the address of the matrix in question), in which case an auxiliary result is written to that
matrix, or the keyword null, in which case the auxiliary result is not produced, or is discarded.
In case a non-null second argument is given, the specified matrix will be over-written with the
auxiliary result. (It is not required that the existing matrix be of the right dimensions to receive the
result.)
The function eigensym computes the eigenvalues, and optionally the right eigenvectors, of a symmetric n n matrix. The eigenvalues are returned directly in a column vector of length n; if the
eigenvectors are required, they are returned in an n n matrix. For example:
matrix V
matrix E = eigensym(M, &V)
matrix E = eigensym(M, null)
In the first case E holds the eigenvalues of M and V holds the eigenvectors. In the second, E holds
the eigenvalues but the eigenvectors are not computed.
The function eigengen computes the eigenvalues, and optionally the eigenvectors, of a general
n n matrix. The eigenvalues are returned directly in an n 2 matrix, the first column holding the
real components and the second column the imaginary components.
If the eigenvectors are required (that is, if the second argument to eigengen is not null), they
are returned in an n n matrix. The column arrangement of this matrix is somewhat non-trivial:
the eigenvectors are stored in the same order as the eigenvalues, but the real eigenvectors occupy
one column, whereas complex eigenvectors take two (the real part comes first); the total number of columns is still n, because the conjugate eigenvector is skipped. Example 13.1 provides a
(hopefully) clarifying example (see also subsection 13.6).
The qrdecomp function computes the QR decomposition of an m n matrix A: A = QR, where Q
is an m n orthogonal matrix and R is an n n upper triangular matrix. The matrix Q is returned
directly, while R can be retrieved via the second argument. Here are two examples:
matrix R
matrix Q = qrdecomp(M, &R)
matrix Q = qrdecomp(M, null)
/*
columns 2:3 contain the real and imaginary parts
of eigenvector 2
*/
B = A*v[,2:3]
c = cmult(ones(3,1)*(l[2,]),v[,2:3])
/* B should equal c */
print B
print c
106
107
In the first example, the triangular R is saved as R; in the second, R is discarded. The first line
above shows an example of a simple declaration of a matrix: R is declared to be a matrix variable
but is not given any explicit value. In this case the variable is initialized as a 1 1 matrix whose
single element equals zero.
The syntax for svd is
matrix B = func(A, &C, &D)
The function svd computes all or part of the singular value decomposition of the real m n matrix
A. Let k = min(m, n). The decomposition is
A = U V 0
where U is an m k orthogonal matrix, is an k k diagonal matrix, and V is an k n orthogonal
matrix.2 The diagonal elements of are the singular values of A; they are real and non-negative,
and are returned in descending order. The first k columns of U and V are the left and right singular
vectors of A.
The svd function returns the singular values, in a vector of length k. The left and/or right singular vectors may be obtained by supplying non-null values for the second and/or third arguments
respectively. For example:
matrix s = svd(A, &U, &V)
matrix s = svd(A, null, null)
matrix s = svd(A, null, &V)
In the first case both sets of singular vectors are obtained, in the second case only the singular
values are obtained; and in the third, the right singular vectors are obtained but U is not computed.
Please note: when the third argument is non-null, it is actually V 0 that is provided. To reconstitute
the original matrix from its SVD, one can do:
matrix s = svd(A, &U, &V)
matrix B = (U.*s)*V
This function returns the OLS estimates obtained by regressing the T n matrix Y on the T k
matrix X, that is, a k n matrix holding (X 0 X)1 X 0 Y . The Cholesky decomposition is used. The
matrix U , if not null, is used to store the residuals.
Reading and writing matrices from/to text files
The two functions mread and mwrite can be used for basic matrix input/output. This can be useful
to enable gretl to exchange data with other programs.
The mread function accepts one string parameter: the name of the (plain text) file from which the
matrix is to be read. The file in question must conform to the following rules:
1. The columns must be separated by spaces or tab characters.
2. The decimal separator must be the dot . character.
2 This is not the only definition of the SVD: some writers define U as m m, as m n (with k non-zero diagonal
elements) and V as n n.
108
3. The first line in the file must contain two integers, separated by a space or a tab, indicating
the number of rows and columns, respectively.
Should an error occur (such as the file being badly formatted or inaccessible), an empty matrix (see
section 13.2) is returned.
The complementary function mwrite produces text files formatted as described above. The column
separator is the tab character, so import into spreadsheets should be straightforward. Usage is
illustrated in example 13.2. Matrices stored via the mwrite command can be easily read by other
programs; the following table summarizes the appropriate commands for reading a matrix A from
a file called a.mat in some widely-used programs.3
Program
GAUSS
Sample code
tmp[] = load a.mat;
A = reshape(tmp[3:rows(tmp)],tmp[1],tmp[2]);
Octave
fd = fopen("a.mat");
[r,c] = fscanf(fd, "%d %d", "C");
A = reshape(fscanf(fd, "%g", r*c),c,r);
fclose(fd);
Ox
R
decl A = loadmat("a.mat");
A <- as.matrix(read.table("a.mat", skip=1))
nulldata 64
scalar n = 3
string f1 = "a.csv"
string f2 = "b.csv"
matrix a = mnormal(n,n)
matrix b = inv(a)
err = mwrite(a, f1)
if err != 0
fprintf "Failed to write %s\n", f1
else
err = mwrite(b, f2)
endif
if err != 0
fprintf "Failed to write %s\n", f2
else
c = mread(f1)
d = mread(f2)
a = c*d
printf "The following matrix should be an identity matrix\n"
print a
endif
3 Matlab
users may find the Octave example helpful, since the two programs are mostly compatible with one another.
13.7
109
Matrix accessors
In addition to the matrix functions discussed above, various accessor strings allow you to create
copies of internal matrices associated with models previously estimated. These are set out in
Table 13.4.
$coeff
$compan
$jalpha
$jbeta
$jvbeta
$rho
$sigma
$stderr
$uhat
matrix of residuals
$vcv
$vma
VMA matrices in stacked form see section 23.2 (after VAR or VECM estimation)
$yhat
Many of the accessors in Table 13.4 behave somewhat differently depending on the sort of model
that is referenced, as follows:
Single-equation models: $sigma gets a scalar (the standard error of the regression); $coeff
and $stderr get column vectors; $uhat and $yhat get series.
System estimators: $sigma gets the cross-equation residual covariance matrix; $uhat and
$yhat get matrices with one column per equation. The format of $coeff and $stderr depends on the nature of the system: for VARs and VECMs (where the matrix of regressors is
the same for all equations) these return matrices with one column per equation, but for other
system estimators they return a big column vector.
VARs and VECMs: $vcv is not available, but X 0 X 1 (where X is the common matrix of regressors) is available as $xtxinv.
If the accessors are given without any prefix, they retrieve results from the last model estimated, if
any. Alternatively, they may be prefixed with the name of a saved model plus a period (.), in which
case they retrieve results from the specified model. Here are some examples:
matrix u = $uhat
matrix b = m1.$coeff
matrix v2 = m1.$vcv[1:2,1:2]
The first command grabs the residuals from the last model; the second grabs the coefficient vector
from model m1; and the third (which uses the mechanism of sub-matrix selection described above)
grabs a portion of the covariance matrix from model m1.
If the model in question a VAR or VECM (only) $compan and $vma return the companion matrix and
the VMA matrices in stacked form, respectively (see section 23.2 for details). After a vector error
correction model is estimated via Johansens procedure, the matrices $jalpha and $jbeta are also
available. These have a number of columns equal to the chosen cointegration rank; therefore, the
product
matrix Pi = $jalpha * $jbeta
110
returns the reduced-rank estimate of A(1). Since is automatically identified via the Phillips normalization (see section 24.5), its unrestricted elements do have a proper covariance matrix, which
can be retrieved through the $jvbeta accessor.
13.8
Namespace issues
Matrices share a common namespace with data series and scalar variables. In other words, no two
objects of any of these types can have the same name. It is an error to attempt to change the type
of an existing variable, for example:
scalar x = 3
matrix x = ones(2,2) # wrong!
It is possible, however, to delete or rename an existing variable then reuse the name for a variable
of a different type:
scalar x = 3
delete x
matrix x = ones(2,2) # OK
13.9
Section 13.1 above describes how to create a matrix from a data series or set of series. You may
sometimes wish to go in the opposite direction, that is, to copy values from a matrix into a regular
data series. The syntax for this operation is
series sname = mspec
where sname is the name of the series to create and mspec is the name of the matrix to copy from,
possibly followed by a matrix selection expression. Here are two examples.
series s = x
series u1 = U[,1]
It is assumed that x and U are pre-existing matrices. In the second example the series u1 is formed
from the first column of the matrix U.
For this operation to work, the matrix (or matrix selection) must be a vector with length equal to
either the full length of the current dataset, n, or the length of the current sample range, n0 . If
n0 < n then only n0 elements are drawn from the matrix; if the matrix or selection comprises n
elements, the n0 values starting at element t1 are used, where t1 represents the starting observation
of the sample range. Any values in the series that are not assigned from the matrix are set to the
missing code.
13.10
To facilitate the manipulation of named lists of variables (see Chapter 12), it is possible to convert
between matrices and lists. In section 13.1 above we mentioned the facility for creating a matrix
from a list of variables, as in
matrix M = { listname }
That formulation, with the name of the list enclosed in braces, builds a matrix whose columns hold
the variables referenced in the list. What we are now describing is a different matter: if we say
matrix M = listname
111
(without the braces), we get a row vector whose elements are the ID numbers of the variables in the
list. This special case of matrix generation cannot be embedded in a compound expression. The
syntax must be as shown above, namely simple assignment of a list to a matrix.
To go in the other direction, you can include a matrix on the right-hand side of an expression that
defines a list, as in
list Xl = M
where M is a matrix. The matrix must be suitable for conversion; that is, it must be a row or column
vector containing non-negative whole-number values, none of which exceeds the highest ID number
of a variable (series or scalar) in the current dataset.
Example 13.3 illustrates the use of this sort of conversion to normalize a list, moving the constant
(variable 0) to first position.
Example 13.3: Manipulating a list
13.11
Deleting a matrix
13.12
Printing a matrix
To print a matrix, the easiest way is to give the name of the matrix in question on a line by itself,
which is equivalent to using the print command:
112
matrix M = mnormal(100,2)
M
print M
You can get finer control on the formatting of output by using the printf command, as illustrated
in the interactive session below:
? matrix Id = I(2)
matrix Id = I(2)
Generated matrix Id
? print Id
print Id
Id (2 x 2)
1
0
0
1
? printf "%10.3f", Id
1.000
0.000
0.000
1.000
For presentation purposes you may wish to give titles to the columns of a matrix. For this you can
use the colnames function: the first argument is a matrix and the second is either a named list of
variables, whose names will be used as headings, or a string that contains as many space-separated
substrings as the matrix has columns. For example,
?
?
?
M
matrix M = mnormal(3,3)
colnames(M, "foo bar baz")
print M
(3 x 3)
foo
1.7102
-0.99780
-0.91762
13.13
bar
-0.76072
-1.9003
-0.39237
baz
0.089406
-0.25123
-1.6114
Example 13.4 shows how matrix methods can be used to replicate gretls built-in OLS functionality.
open data4-1
matrix X = { const, sqft }
matrix y = { price }
matrix b = invpd(XX) * Xy
print "estimated coefficient vector"
b
matrix u = y - X*b
scalar SSR = uu
scalar s2 = SSR / (rows(X) - rows(b))
matrix V = s2 * inv(XX)
V
matrix se = sqrt(diag(V))
print "estimated standard errors"
se
# compare with built-in function
ols price const sqft --vcv
113
Chapter 14
Cheat sheet
This chapter explains how to perform some common and some not so common tasks in gretls
scripting language. Some but not all of the techniques listed here are also available through the
graphical interface. Although the graphical interface may be more intuitive and less intimidating
at first, we encourage users to take advantage of the power of gretls scripting language as soon as
they feel comfortable with the program.
14.1
Dataset handling
Weird periodicities
Problem: You have data sampled each 3 minutes from 9am onwards; youll probably want to specify
the hour as 20 periods.
Solution:
setobs 20 9:1 --special
Comment: Now functions like sdiff() (seasonal difference) or estimation methods like seasonal
ARIMA will work as expected.
Help, my data are backwards!
Problem: Gretl expects time series data to be in chronological order (most recent observation last),
but you have imported third-party data that are in reverse order (most recent first).
Solution:
setobs 1 1 --cross-section
genr sortkey = -obs
dataset sortby sortkey
setobs 1 1950 --time-series
Comment: The first line is required only if the data currently have a time series interpretation: it
removes that interpretation, because (for fairly obvious reasons) the dataset sortby operation is
not allowed for time series data. The following two lines reverse the data, using the negative of the
built-in index variable obs. The last line is just illustrative: it establishes the data as annual time
series, starting in 1950.
If you have a dataset that is mostly the right way round, but a particular variable is wrong, you can
reverse that variable as follows:
genr x = sortby(-obs, x)
115
Solution:
list X = x1 x2 x3
smpl --no missing X
Comment: You can now save the file via a store command to preserve a subsampled version of
the dataset. Alternative solution based on the ok function, such as
list X = x1 x2 x3
genr sel = ok(X)
smpl sel --restrict
are perhaps less obvious, but more flexible. Pick your poison.
By operations
Problem: You have a discrete variable d and you want to run some commands (for example, estimate
a model) by splitting the sample according to the values of d.
Solution:
matrix vd = values(d)
m = rows(vd)
loop for i=1..m
scalar sel = vd[i]
smpl (d=sel) --restrict --replace
ols y const x
endloop
smpl --full
Comment: The main ingredient here is a loop. You can have gretl perform as many instructions as
you want for each value of d, as long as they are allowed inside a loop. Note, however, that if all
you want is descriptive statistics, the summary command does have a --by option.
Adding a time series to a panel
Problem: You have a panel dataset (comprising observations of n indidivuals in each of T periods)
and you want to add a variable which is available in straight time-series form. For example, you
want to add annual CPI data to a panel in order to deflate nominal income figures.
In gretl a panel is represented in stacked time-series format, so in effect the task is to create a new
variable which holds n stacked copies of the original time series. Lets say the panel comprises 500
individuals observed in the years 1990, 1995 and 2000 (n = 500, T = 3), and we have these CPI
data in the ASCII file cpi.txt:
date
1990
1995
2000
cpi
130.658
152.383
172.192
What we need is for the CPI variable in the panel to repeat these three values 500 times.
Solution: Simple! With the panel dataset open in gretl,
append cpi.txt
Comment: If the length of the time series is the same as the length of the time dimension in the
panel (3 in this example), gretl will perform the stacking automatically. Rather than using the
116
append command you could use the Append data item under the File menu in the GUI program.
For this to work, your main dataset must be recognized as a panel. This can be arranged via the
setobs command or the Dataset structure item under the Data menu.
14.2
Creating/modifying variables
Comment: The internal variable t is used to refer to observations in string form, so if you have a
cross-section sample you may just use d = (t="123"); of course, if the dataset has data labels,
use the corresponding label. For example, if you open the dataset mrw.gdt, supplied with gretl
among the examples, a dummy variable for Italy could be generated via
genr DIta = (t="Italy")
Note that this method does not require scripting at all. In fact, you might as well use the GUI Menu
Add/Define new variable for the same purpose, with the same syntax.
Generating an ARMA(1,1)
Problem: Generate yt = 0.9yt1 + t 0.5t1 , with t NIID(0, 1).
Recommended solution:
alpha = 0.9
theta = -0.5
series y = filter(normal(), {1, theta}, alpha)
Comment: The filter function is specifically designed for this purpose so in most cases youll
want to take advantage of its speed and flexibility. That said, in some cases you may want to
generate the series in a manner which is more transparent (maybe for teaching purposes).
In the second solution, the statement series y = 0 is necessary because the next statement evaluates y recursively, so y[1] must be set. Note that you must use the keyword series here instead
of writing genr y = 0 or simply y = 0, to ensure that y is a series and not a scalar.
Recoding a variable
Problem: You want to recode a variable by classes. For example, you have the age of a sample of
individuals (xi ) and you need to compute age classes (yi ) as
yi = 1
for
xi < 18
yi = 2
for
18 xi < 65
yi = 3
for
xi 65
117
Solution:
series y = 1 + (x >= 18) + (x >= 65)
Comment: True and false expressions are evaluated as 1 and 0 respectively, so they can be manipulated algebraically as any other number. The same result could also be achieved by using the
conditional assignment operator (see below), but in most cases it would probably lead to more
convoluted constructs.
Conditional assignment
Problem: Generate yt via the following rule:
(
yt =
xt
for dt > a
zt
for dt a
Solution:
series y = (d > a) ? x : z
Comment: There are several alternatives to the one presented above. One is a brute force solution
using loops. Another one, more efficient but still suboptimal, would be
series y = (d>a)*x + (d<=a)*z
However, the ternary conditional assignment operator is not only the most numerically efficient
way to accomplish what we want, it is also remarkably transparent to read when one gets used to
it. Some readers may find it helpful to note that the conditional assignment operator works exactly
the same way as the =IF() function in spreadsheets.
Generating a time index for panel datasets
Problem: Gretl has a $unit accessor, but not the equivalent for time. What should I use?
Solution:
series x = time
Comment: The special construct genr time and its variants are aware of whether a dataset is a
panel.
14.3
Neat tricks
Interaction dummies
Problem: You want to estimate the model yi = xi 1 + zi 2 + di 3 + (di zi )4 + t , where di is a
dummy variable while xi and zi are vectors of explanatory variables.
Solution:
list X = x1 x2
list Z = z1 z2
list dZ = null
loop foreach i
series d$i =
list dZ = dZ
endloop
ols y X Z d dZ
x3
Z
d * $i
d$i
118
Comment: Its amazing what string substitution can do for you, isnt it?
Realized volatility
Problem: P
Given data by the minute, you want to compute the realized volatility for the hour as
60
1
2
RVt = 60
=1 yt: . Imagine your sample starts at time 1:1.
Solution:
smpl --full
genr time
genr minute = int(time/60) + 1
genr second = time % 60
setobs minute second --panel
genr rv = psd(y)^2
setobs 1 1
smpl second=1 --restrict
store foo rv
Comment: Here we trick gretl into thinking that our dataset is a panel dataset, where the minutes
are the units and the seconds are the time; this way, we can take advantage of the special
function psd(), panel standard deviation. Then we simply drop all observations but one per minute
and save the resulting data (store foo rv translates as store in the gretl datafile foo.gdt the
series rv).
Looping over two paired lists
Problem: Suppose you have two lists with the same number of elements, and you want to apply
some command to corresponding elements over a loop.
Solution:
list L1 = a b c
list L2 = x y z
k1 = 1
loop foreach i L1 --quiet
k2 = 1
loop foreach j L2 --quiet
if k1=k2
ols $i 0 $j
endif
k2++
endloop
k1++
endloop
Comment: The simplest way to achieve the result is to loop over all possible combinations and
filter out the unneeded ones via an if condition, as above. That said, in some cases variable names
can help. For example, if
list Lx = x1 x2 x3
list Ly = y1 y2 y3
looping over the integers is quite intuitive and certainly more elegant:
loop for i=1..3
ols y$i const x$i
endloop
Part II
Econometric methods
119
Chapter 15
Introduction
(15.1)
(15.2)
If the condition E(u|X) = 0 is satisfied, this is an unbiased estimator; under somewhat weaker
conditions the estimator is biased but consistent. It is straightforward to show that when the OLS
) = 0), its variance is
estimator is unbiased (that is, when E(
= E (
)(
)0 = (X 0 X)1 X 0 X(X 0 X)1
(15.3)
Var()
where = E(uu0 ) is the covariance matrix of the error terms.
Under the assumption that the error terms are independently and identically distributed (iid) we
can write = 2 I, where 2 is the (common) variance of the errors (and the covariances are zero).
In that case (15.3) simplifies to the classical formula,
= 2 (X 0 X)1
Var()
(15.4)
If the iid assumption is not satisfied, two things follow. First, it is possible in principle to construct
a more efficient estimator than OLS for instance some sort of Feasible Generalized Least Squares
(FGLS). Second, the simple classical formula for the variance of the least squares estimator is no
longer correct, and hence the conventional OLS standard errors which are just the square roots
of the diagonal elements of the matrix defined by (15.4) do not provide valid means of statistical
inference.
In the recent history of econometrics there are broadly two approaches to the problem of noniid errors. The traditional approach is to use an FGLS estimator. For example, if the departure
from the iid condition takes the form of time-series dependence, and if one believes that this
could be modeled as a case of first-order autocorrelation, one might employ an AR(1) estimation
method such as CochraneOrcutt, HildrethLu, or PraisWinsten. If the problem is that the error
variance is non-constant across observations, one might estimate the variance as a function of the
independent variables and then perform weighted least squares, using as weights the reciprocals
of the estimated variances.
While these methods are still in use, an alternative approach has found increasing favor: that
is, use OLS but compute standard errors (or more generally, covariance matrices) that are robust
with respect to deviations from the iid assumption. This is typically combined with an emphasis on
using large datasets large enough that the researcher can place some reliance on the (asymptotic)
consistency property of OLS. This approach has been enabled by the availability of cheap computing
power. The computation of robust standard errors and the handling of very large datasets were
daunting tasks at one time, but now they are unproblematic. The other point favoring the newer
120
121
methodology is that while FGLS offers an efficiency advantage in principle, it often involves making
additional statistical assumptions which may or may not be justified, which may not be easy to test
rigorously, and which may threaten the consistency of the estimator for example, the common
factor restriction that is implied by traditional FGLS corrections for autocorrelated errors.
James Stock and Mark Watsons Introduction to Econometrics illustrates this approach at the level of
undergraduate instruction: many of the datasets they use comprise thousands or tens of thousands
of observations; FGLS is downplayed; and robust standard errors are reported as a matter of course.
In fact, the discussion of the classical standard errors (labeled homoskedasticity-only) is confined
to an Appendix.
Against this background it may be useful to set out and discuss all the various options offered
by gretl in respect of robust covariance matrix estimation. The first point to notice is that gretl
produces classical standard errors by default (in all cases apart from GMM estimation). In script
mode you can get robust standard errors by appending the --robust flag to estimation commands.
In the GUI program the model specification dialog usually contains a Robust standard errors
check box, along with a configure button that is activated when the box is checked. The configure
button takes you to a configuration dialog (which can also be reached from the main menu bar:
Tools Preferences General HCCME). There you can select from a set of possible robust
estimation variants, and can also choose to make robust estimation the default.
The specifics of the available options depend on the nature of the data under consideration
cross-sectional, time series or panel and also to some extent the choice of estimator. (Although
we introduced robust standard errors in the context of OLS above, they may be used in conjunction
with other estimators too.) The following three sections of this chapter deal with matters that are
specific to the three sorts of data just mentioned. Note that additional details regarding covariance
matrix estimation in the context of GMM are given in chapter 20.
We close this introduction with a brief statement of what robust standard errors can and cannot
achieve. They can provide for asymptotically valid statistical inference in models that are basically
correctly specified, but in which the errors are not iid. The asymptotic part means that they
may be of little use in small samples. The correct specification part means that they are not a
magic bullet: if the error term is correlated with the regressors, so that the parameter estimates
themselves are biased and inconsistent, robust standard errors will not save the day.
15.2
With cross-sectional data, the most likely departure from iid errors is heteroskedasticity (nonconstant variance).1 In some cases one may be able to arrive at a judgment regarding the likely
form of the heteroskedasticity, and hence to apply a specific correction. The more common case,
however, is where the heteroskedasticity is of unknown form. We seek an estimator of the covariance matrix of the parameter estimates that retains its validity, at least asymptotically, in face of
unspecified heteroskedasticity. It is not obvious, a priori, that this should be possible, but White
(1980) showed that
0
= (X 0 X)1 X 0 X(X
d h ()
Var
X)1
(15.5)
does the trick. (As usual in statistics, we need to say under certain conditions, but the conditions
is in this context a diagonal matrix, whose non-zero elements may be
are not very restrictive.)
estimated using squared OLS residuals. White referred to (15.5) as a heteroskedasticity-consistent
covariance matrix estimator (HCCME).
Davidson and MacKinnon (2004, chapter 5) offer a useful discussion of several variants on Whites
HCCME theme. They refer to the original variant of (15.5) in which the diagonal elements of
2t as HC0 . (The associated standard errors
are estimated directly by the squared OLS residuals, u
are often called Whites standard errors.) The various refinements of Whites proposal share a
1 In some specialized contexts spatial autocorrelation may be an issue. Gretl does not have any built-in methods to
handle this and we will not discuss it here.
122
common point of departure, namely the idea that the squared OLS residuals are likely to be too
satisfy by design
small on average. This point is quite intuitive. The OLS parameter estimates, ,
the criterion that the sum of squared residuals,
X
2t =
u
X
2
yt Xt
OLS is not biased, it would be a miracle if the calculated from any finite sample
were
P
P exactly equal
to . But in that case thePsum of squares of the true, unobserved errors, u2t = (yt Xt )2 is
2t . The elaborated variants on HC0 take this point on board as follows:
bound to be greater than u
HC1 : Applies a degrees-of-freedom correction, multiplying the HC0 matrix by T /(T k).
uses u
2t for the diagonal elements of ,
2t /(1 ht ), where ht =
HC2 : Instead of using u
0
1 0
th
Xt (X X) Xt , the t diagonal element of the projection matrix, P , which has the property
The relevance of ht is that if the variance of all the ut is 2 , the expectation
that P y = y.
2
2
2t /(1 ht ) has expectation 2 . As Davidson
t is (1 ht ), or in other words, the ratio u
of u
and MacKinnon show, 0 ht < 1 for all t, so this adjustment cannot reduce the the diagonal
and in general revises them upward.
elements of
2t /(1 ht )2 . The additional factor of (1 ht ) in the denominator, relative to
HC3 : Uses u
HC2 , may be justified on the grounds that observations with large variances tend to exert a
lot of influence on the OLS estimates, so that the corresponding residuals tend to be underestimated. See Davidson and MacKinnon for a fuller explanation.
The relative merits of these variants have been explored by means of both simulations and theoretical analysis. Unfortunately there is not a clear consensus on which is best. Davidson and
MacKinnon argue that the original HC0 is likely to perform worse than the others; nonetheless,
Whites standard errors are reported more often than the more sophisticated variants and therefore, for reasons of comparability, HC0 is the default HCCME in gretl.
If you wish to use HC1 , HC2 or HC3 you can arrange for this in either of two ways. In script mode,
you can do, for example,
set hc_version 2
In the GUI program you can go to the HCCME configuration dialog, as noted above, and choose any
of these variants to be the default.
15.3
Heteroskedasticity may be an issue with time series data too, but it is unlikely to be the only, or
even the primary, concern.
One form of heteroskedasticity is common in macroeconomic time series, but is fairly easily dealt
with. That is, in the case of strongly trending series such as Gross Domestic Product, aggregate
consumption, aggregate investment, and so on, higher levels of the variable in question are likely
to be associated with higher variability in absolute terms. The obvious fix, employed in many
macroeconometric studies, is to use the logs of such series rather than the raw levels. Provided the
proportional variability of such series remains roughly constant over time, the log transformation
is effective.
Other forms of heteroskedasticity may resist the log transformation, but may demand a special
treatment distinct from the calculation of robust standard errors. We have in mind here autoregressive conditional heteroskedasticity, for example in the behavior of asset prices, where large
disturbances to the market may usher in periods of increased volatility. Such phenomena call for
specific estimation strategies, such as GARCH (see chapter 22).
123
Despite the points made above, some residual degree of heteroskedasticity may be present in time
series data: the key point is that in most cases it is likely to be combined with serial correlation
the estimated
(autocorrelation), hence demanding a special treatment. In Whites approach, ,
covariance matrix of the ut , remains conveniently diagonal: the variances, E(u2t ), may differ by
t but the covariances, E(ut us ), are all zero. Autocorrelation in time series data means that at
should be non-zero. This introduces a substantial
least some of the the off-diagonal elements of
complication and requires another piece of terminology; estimates of the covariance matrix that
are asymptotically valid in face of both heteroskedasticity and autocorrelation of the error process
are termed HAC (heteroskedasticity and autocorrelation consistent).
The issue of HAC estimation is treated in more technical terms in chapter.
That said, the obvious extension of Whites HCCME to the case of autocorrelated errors would
(that is, the autocovariances, E(ut us ))
seem to be this: estimate the off-diagonal elements of
ts = u
t u
s . This is basically right, but demands
using, once again, the appropriate OLS residuals:
an important amendment. We seek a consistent estimator, one that converges towards the true
as the sample size tends towards infinity. This cant work if we allow unbounded serial dependence. Bigger samples will enable us to estimate more of the true ts elements (that is, for t and
s more widely separated in time) but will not contribute ever-increasing information regarding the
maximally separated ts pairs, since the maximal separation itself grows with the sample size.
To ensure consistency, we have to confine our attention to processes exhibiting temporally limited
ts values at some maximum value
dependence, or in other words cut off the computation of the
of p = t s (where p is treated as an increasing function of the sample size, T , although it cannot
increase in proportion to T ).
The simplest variant of this idea is to truncate the computation at some finite lag order p, where
may not be a positive definite
p grows as, say, T 1/4 . The trouble with this is that the resulting
matrix. In practical terms, we may end up with negative estimated variances. One solution to this
problem is offered by The NeweyWest estimator (Newey and West, 1987), which assigns declining
weights to the sample autocovariances as the temporal separation increases.
To understand this point it is helpful to look more closely at the covariance matrix given in (15.5),
namely,
0
(X 0 X)1 (X 0 X)(X
X)1
This is known as a sandwich estimator. The bread, which appears on both sides, is (X 0 X)1 .
This is a k k matrix, and is also the key ingredient in the computation of the classical covariance
matrix. The filling in the sandwich is
(kk)
X0
(kT )
(T T )
(T k)
Since = E(uu0 ), the matrix being estimated here can also be written as
= E(X 0 u u0 X)
which expresses as the long-run covariance of the random k-vector X 0 u.
From a computational point of view, it is not necessary or desirable to store the (potentially very
as such. Rather, one computes the sandwich filling by summation as
large) T T matrix
=
(0) +
p
X
j=1
wj
(j) +
0 (j)
124
(j) =
T
1 X
tj Xt0 Xtj
t u
u
T t=j+1
1 j
jp
p+1
wj =
0
j>p
so the weights decline linearly as j increases. The other two options are the Parzen kernel and the
Quadratic Spectral (QS) kernel. For the Parzen kernel,
3
2
0
a >1
j
sin mj
cos mj
mj
Bartlett
Parzen
QS
In gretl you select the kernel using the set command with the hac_kernel parameter:
set hac_kernel parzen
set hac_kernel qs
set hac_kernel bartlett
125
As shown in Table 15.1 the choice between nw1 and nw2 does not make a great deal of difference.
T
p (nw1)
p (nw2)
50
100
150
200
300
400
You also have the option of specifying a fixed numerical value for p, as in
set hac_lag 6
In addition you can set a distinct bandwidth for use with the Quadratic Spectral kernel (since this
need not be an integer). For example,
set qs_bandwidth 3.5
VLR (ut )
(1 )2
In most cases, ut is likely to be less autocorrelated than xt , so a smaller bandwidth should suffice.
Estimation of VLR (xt ) can therefore proceed in three steps: (1) estimate ; (2) obtain a HAC estimate
t = xt x
t1 ; and (3) divide the result by (1 )2 .
of u
The application of the above concept to our problem implies estimating a finite-order Vector Au t . In general, the VAR can be of any order, but
toregression (VAR) on the vector variables t = Xt u
in most cases 1 is sufficient; the aim is not to build a watertight model for t , but just to mop up
a substantial part of the autocorrelation. Hence, the following VAR is estimated
t = At1 + t
Then an estimate of the matrix X 0 X can be recovered via
1
0 )1
(I A
(I A)
is any HAC estimator, applied to the VAR residuals.
where
You can ask for prewhitening in gretl using
set hac_prewhiten on
126
There is at present no mechanism for specifying an order other than 1 for the initial VAR.
A further refinement is available in this context, namely data-based bandwidth selection. It makes
intuitive sense that the HAC bandwidth should not simply be based on the size of the sample,
but should somehow take into account the time-series properties of the data (and also the kernel
chosen). A nonparametric method for doing this was proposed by Newey and West (1994); a good
concise account of the method is given in Hall (2005). This option can be invoked in gretl via
set hac_lag nw3
This option is the default when prewhitening is selected, but you can override it by giving a specific
numerical value for hac_lag.
Even the NeweyWest data-based method does not fully pin down the bandwidth for any particular
sample. The first step involves calculating a series of residual covariances. The length of this series
is given as a function of the sample size, but only up to a scalar multiple for example, it is given
as O(T 2/9 ) for the Bartlett kernel. Gretl uses an implied multiple of 1.
15.4
Since panel data have both a time-series and a cross-sectional dimension one might expect that, in
general, robust estimation of the covariance matrix would require handling both heteroskedasticity
and autocorrelation (the HAC approach). In addition, some special features of panel data require
attention.
The variance of the error term may differ across the cross-sectional units.
The covariance of the errors across the units may be non-zero in each time period.
If the between variation is not removed, the errors may exhibit autocorrelation, not in the
usual time-series sense but in the sense that the mean error for unit i may differ from that of
unit j. (This is particularly relevant when estimation is by pooled OLS.)
Gretl currently offers two robust covariance matrix estimators specifically for panel data. These are
available for models estimated via fixed effects, pooled OLS, and pooled two-stage least squares.
The default robust estimator is that suggested by Arellano (2003), which is HAC provided the panel
is of the large n, small T variety (that is, many units are observed in relatively few periods). The
Arellano estimator is
n
1 X
1
0
0
0
A = X X
iu
i Xi X 0 X
Xi u
i=1
where X is the matrix of regressors (with the group means subtracted, in the case of fixed effects)
i denotes the vector of residuals for unit i, and n is the number of cross-sectional units. Cameron
u
and Trivedi (2005) make a strong case for using this estimator; they note that the ordinary White
HCCME can produce misleadingly small standard errors in the panel context because it fails to take
autocorrelation into account.
In cases where autocorrelation is not an issue, however, the estimator proposed by Beck and Katz
(1995) and discussed by Greene (2003, chapter 13) may be appropriate. This estimator, which takes
into account contemporaneous correlation across the units and heteroskedasticity by unit, is
n X
n
1 X
1
0
0
BK = X X
ij Xi Xj X 0 X
i=1 j=1
0i u
j
u
T
127
where T is the length of the time series for each unit. Beck and Katz call the associated standard
errors Panel-Corrected Standard Errors (PCSE). This estimator can be invoked in gretl via the
command
set pcse on
(Note that regardless of the pcse setting, the robust estimator is not used unless the --robust flag
is given, or the Robust box is checked in the GUI program.)
Chapter 16
Panel data
16.1
(16.1)
where yit is the observation on the dependent variable for cross-sectional unit i in period t, Xit
is a 1 k vector of independent variables observed for unit i in period t, is a k 1 vector of
parameters, and uit is an error or disturbance term specific to unit i in period t.
The fixed and random effects models have in common that they decompose the unitary pooled
error term, uit . For the fixed effects model we write uit = i + it , yielding
yit = Xit + i + it
(16.2)
That is, we decompose uit into a unit-specific and time-invariant component, i , and an observationspecific error, it .1 The i s are then treated as fixed parameters (in effect, unit-specific y-intercepts),
which are to be estimated. This can be done by including a dummy variable for each cross-sectional
unit (and suppressing the global constant). This is sometimes called the Least Squares Dummy Variables (LSDV) method. Alternatively, one can subtract the group mean from each of variables and
estimate a model without a constant. In the latter case the dependent variable may be written as
it = yit y
i
y
i , is defined as
The group mean, y
i =
y
Ti
1 X
yit
Ti t=1
1 It is possible to break a third component out of u , namely w , a shock that is time-specific but common to all the
t
it
units in a given period. In the interest of simplicity we do not pursue that option here.
128
129
where Ti is the number of observations for unit i. An exactly analogous formulation applies to the
obtained using such de-meaned data we can
independent variables. Given parameter estimates, ,
recover estimates of the i s using
i =
Ti
1 X
yit Xit
Ti t=1
These two methods (LSDV, and using de-meaned data) are numerically equivalent. Gretl takes the
approach of de-meaning the data. If you have a small number of cross-sectional units, a large number of time-series observations per unit, and a large number of regressors, it is more economical
in terms of computer memory to use LSDV. If need be you can easily implement this manually. For
example,
genr unitdum
ols y x du_*
(16.3)
In contrast to the fixed effects model, the vi s are not treated as fixed parameters, but as random
drawings from a given probability distribution.
The celebrated GaussMarkov theorem, according to which OLS is the best linear unbiased estimator (BLUE), depends on the assumption that the error term is independently and identically
distributed (IID). In the panel context, the IID assumption means that E(u2it ), in relation to equation 16.1, equals a constant, u2 , for all i and t, while the covariance E(uis uit ) equals zero for all
s t and the covariance E(ujt uit ) equals zero for all j i.
If these assumptions are not met and they are unlikely to be met in the context of panel data
OLS is not the most efficient estimator. Greater efficiency may be gained using generalized least
squares (GLS), taking into account the covariance structure of the error term.
Consider observations on a given unit i at two different times s and t. From the hypotheses above
it can be worked out that Var(uis ) = Var(uit ) = v2 + 2 , while the covariance between uis and uit
is given by E(uis uit ) = v2 .
In matrix notation, we may group all the Ti observations for unit i into the vector yi and write it as
yi = Xi + ui
(16.4)
The vector ui , which includes all the disturbances for individual i, has a variancecovariance matrix
given by
Var(ui ) = i = 2 I + v2 J
(16.5)
where J is a square matrix with all elements equal to 1. It can be shown that the matrix
Ki = I
r
where = 1
2
,
2 +Ti v2
J,
Ti
130
(16.6)
satisfies the GaussMarkov conditions, and OLS estimation of (16.6) provides efficient inference.
But since
Ki yi = yi
yi
GLS estimation is equivalent to OLS using quasi-demeaned variables; that is, variables from which
we subtract a fraction of their average. Notice that for 2 0, 1, while for v2 0, 0.
This means that if all the variance is attributable to the individual effects, then the fixed effects
estimator is optimal; if, on the other hand, individual effects are negligible, then pooled OLS turns
out, unsurprisingly, to be the optimal estimator.
To implement the GLS approach we need to calculate , which in turn requires estimates of the
variances 2 and v2 . (These are often referred to as the within and between variances respectively, since the former refers to variation within each cross-sectional unit and the latter to variation
between the units). Several means of estimating these magnitudes have been suggested in the literature (see Baltagi, 1995); gretl uses the method of Swamy and Arora (1972): 2 is estimated by the
residual variance from the fixed effects model, and the sum 2 + Ti v2 is estimated as Ti times the
residual variance from the between estimator,
i + ei
i = X
y
The latter regression is implemented by constructing a data set consisting of the group means of
all the relevant variables.
Choice of estimator
Which panel method should one use, fixed effects or random effects?
One way of answering this question is in relation to the nature of the data set. If the panel comprises
observations on a fixed and relatively small set of units of interest (say, the member states of the
European Union), there is a presumption in favor of fixed effects. If it comprises observations on a
large number of randomly selected individuals (as in many epidemiological and other longitudinal
studies), there is a presumption in favor of random effects.
Besides this general heuristic, however, various statistical issues must be taken into account.
1. Some panel data sets contain variables whose values are specific to the cross-sectional unit
but which do not vary over time. If you want to include such variables in the model, the fixed
effects option is simply not available. When the fixed effects approach is implemented using
dummy variables, the problem is that the time-invariant variables are perfectly collinear with
the per-unit dummies. When using the approach of subtracting the group means, the issue is
that after de-meaning these variables are nothing but zeros.
2. A somewhat analogous prohibition applies to the random effects estimator. This estimator is
in effect a matrix-weighted average of pooled OLS and the between estimator. Suppose we
have observations on n units or individuals and there are k independent variables of interest.
If k > n, the between estimator is undefined since we have only n effective observations
and hence so is the random effects estimator.
If one does not fall foul of one or other of the prohibitions mentioned above, the choice between
fixed effects and random effects may be expressed in terms of the two econometric desiderata,
efficiency and consistency.
From a purely statistical viewpoint, we could say that there is a tradeoff between robustness and
efficiency. In the fixed effects approach, we do not make any hypotheses on the group effects
(that is, the time-invariant differences in mean between the groups) beyond the fact that they exist
131
and that can be tested; see below. As a consequence, once these effects are swept out by taking
deviations from the group means, the remaining parameters can be estimated.
On the other hand, the random effects approach attempts to model the group effects as drawings
from a probability distribution instead of removing them. This requires that individual effects are
representable as a legitimate part of the disturbance term, that is, zero-mean random variables,
uncorrelated with the regressors.
As a consequence, the fixed-effects estimator always works, but at the cost of not being able to
estimate the effect of time-invariant regressors. The richer hypothesis set of the random-effects
estimator ensures that parameters for time-invariant regressors can be estimated, and that estimation of the parameters for time-varying regressors is carried out more efficiently. These advantages, though, are tied to the validity of the additional hypotheses. If, for example, there is reason
to think that individual effects may be correlated with some of the explanatory variables, then the
random-effects estimator would be inconsistent, while fixed-effects estimates would still be valid.
It is precisely on this principle that the Hausman test is built (see below): if the fixed- and randomeffects estimates agree, to within the usual statistical margin of error, there is no reason to think
the additional hypotheses invalid, and as a consequence, no reason not to use the more efficient RE
estimator.
Testing panel models
If you estimate a fixed effects or random effects model in the graphical interface, you may notice
that the number of items available under the Tests menu in the model window is relatively limited.
Panel models carry certain complications that make it difficult to implement all of the tests one
expects to see for models estimated on straight time-series or cross-sectional data.
Nonetheless, various panel-specific tests are printed along with the parameter estimates as a matter
of course, as follows.
When you estimate a model using fixed effects, you automatically get an F -test for the null hypothesis that the cross-sectional units all have a common intercept. That is to say that all the i s
are equal, in which case the pooled model (16.1), with a column of 1s included in the X matrix, is
adequate.
When you estimate using random effects, the BreuschPagan and Hausman tests are presented
automatically.
The BreuschPagan test is the counterpart to the F -test mentioned above. The null hypothesis is
that the variance of vi in equation (16.3) equals zero; if this hypothesis is not rejected, then again
we conclude that the simple pooled model is adequate.
The Hausman test probes the consistency of the GLS estimates. The null hypothesis is that these
estimates are consistent that is, that the requirement of orthogonality of the vi and the Xi
is satisfied. The test is based on a measure, H, of the distance between the fixed-effects and
random-effects estimates, constructed such that under the null it follows the 2 distribution with
degrees of freedom equal to the number of time-varying regressors in the matrix X. If the value of
H is large this suggests that the random effects estimator is not consistent and the fixed-effects
model is preferable.
There are two ways of calculating H, the matrix-difference method and the regression method. The
procedure for the matrix-difference method is this:
and the corresponding random-effects esti Collect the fixed-effects estimates in a vector
then form the difference vector (
).
mates in ,
)
= Var()
Var()
= ,
Form the covariance matrix of the difference vector as Var(
where Var() and Var() are estimated by the sample variance matrices of the fixed- and
random-effects models respectively.2
2 Hausman
is an efficient estimator
(1978) showed that the covariance of the difference takes this simple form when
132
0
1
.
Compute H =
and ,
the matrix should be positive definite, in which case
Given the relative efficiencies of
H is positive, but in finite samples this is not guaranteed and of course a negative 2 value is not
admissible. The regression method avoids this potential problem. The procedure is:
Treat the random-effects model as the restricted model, and record its sum of squared residuals as SSRr .
Estimate via OLS an unrestricted model in which the dependent variable is quasi-demeaned y
and the regressors include both quasi-demeaned X (as in the RE model) and the de-meaned
variants of all the time-varying variables (i.e. the fixed-effects regressors); record the sum of
squared residuals from this model as SSRu .
Compute H = n (SSRr SSRu ) /SSRu , where n is the total number of observations used. On
this variant H cannot be negative, since adding additional regressors to the RE model cannot
raise the SSR.
By default gretl computes the Hausman test via the regression method, but it uses the matrixdifference method if you pass the option --matrix-diff to the panel command.
Robust standard errors
For most estimators, gretl offers the option of computing an estimate of the covariance matrix that
is robust with respect to heteroskedasticity and/or autocorrelation (and hence also robust standard
errors). In the case of panel data, robust covariance matrix estimators are available for the pooled
and fixed effects model but not currently for random effects. Please see section 15.4 for details.
16.2
Special problems arise when a lag of the dependent variable is included among the regressors in a
panel model. Consider a dynamic variant of the pooled model (16.1):
yit = Xit + yit1 + uit
(16.7)
First, if the error uit includes a group effect, vi , then yit1 is bound to be correlated with the error,
since the value of vi affects yi at all t. That means that OLS applied to (16.7) will be inconsistent
as well as inefficient. The fixed-effects model sweeps out the group effects and so overcomes this
particular problem, but a subtler issue remains, which applies to both fixed and random effects
estimation. Consider the de-meaned representation of fixed effects, as applied to the dynamic
model,
it + y
it = X
i,t1 + it
y
it = yit y
i and it = uit u
i (or uit i , using the notation of equation 16.2). The trouble
where y
i,t1 will be correlated with it via the group mean, y
i . The disturbance it influences yit
is that y
i , which, by construction, affects the value of y
it for all t. The same
directly, which influences y
issue arises in relation to the quasi-demeaning used for random effects. Estimators which ignore
this correlation will be consistent only as T (in which case the marginal effect of it on the
group mean of y tends to vanish).
One strategy for handling this problem, and producing consistent estimates of and , was proposed by Anderson and Hsiao (1981). Instead of de-meaning the data, they suggest taking the first
difference of (16.7), an alternative tactic for sweeping out the group effects:
yit = Xit + yi,t1 + it
is inefficient.
and
(16.8)
133
where it = uit = (vi + it ) = it i,t1 . Were not in the clear yet, given the structure of the
error it : the disturbance i,t1 is an influence on both it and yi,t1 = yit yi,t1 . The next step
is then to find an instrument for the contaminated yi,t1 . Anderson and Hsiao suggest using
either yi,t2 or yi,t2 , both of which will be uncorrelated with it provided that the underlying
errors, it , are not themselves serially correlated.
The AndersonHsiao estimator is not provided as a built-in function in gretl, since gretls sensible
handling of lags and differences for panel data makes it a simple application of regression with
instrumental variables see Example 16.1, which is based on a study of country growth rates by
Nerlove (1999).3
Example 16.1: The AndersonHsiao estimator for a dynamic panel model
Although the AndersonHsiao estimator is consistent, it is not most efficient: it does not make the
fullest use of the available instruments for yi,t1 , nor does it take into account the differenced
structure of the error it . It is improved upon by the methods of Arellano and Bond (1991) and
Blundell and Bond (1998). These methods are taken up in the next chapter.
3 Also
Chapter 17
17.1
Introduction
Notation
A dynamic linear panel data model can be represented as follows (in notation based on Arellano
(2003)):
yit = yi,t1 + 0 xit + i + vit
(17.1)
The main idea on which the difference estimator is based is to get rid of the individual effect via
differencing:1 first-differencing eq. (17.1) yields
yit = yi,t1 + 0 xit + vit = 0 Wit + vit ,
(17.2)
in obvious notation. The error term of (17.2) is, by construction, autocorrelated and also correlated
with the lagged dependent variable, so an estimator that takes both issues into account is needed.
The endogeneity issue is solved by noting that all values of yi,tk , with k > 1 can be used as
instruments for yi,t1 : unobserved values of yi,tk (because they could be missing, or pre-sample)
can safely be substituted with 0. In the language of GMM, this amounts to using the relation
E(vit yi,tk ) = 0,
k>1
(17.3)
as an orthogonality condition.
Autocorrelation is dealt with by noting that, if vit is a white noise, then the covariance matrix of the
vector whose typical element is vit is proportional to a matrix H that has 2 on the main diagonal,
1 on the first subdiagonals and 0 elsewhere. In practice, one-step GMM estimation of equation
(17.2) amounts to computing
1
1
N
N
N
X
X 0 X 0
=
Z0i Wi
Wi Zi
Zi HZi
i=1
N
X
i=1
i=1
W0i Zi
N
X
i=1
1
Z0i HZi
i=1
N
X
Z0i yi
(17.4)
i=1
1 An
alternative is orthogonal deviations: this is implemented in arbond, but not in dpanel, since it was a lot of work
and OD is very rarely seen in the wild.
134
135
where
yi
h
"
Wi
Zi
i0
yi,3
yi,T
yi,2
yi,T 1
xi,3
xi,T
#0
yi1
xi3
yi1
yi2
..
.
yi,T 2
xi4
xiT
Once the 1-step estimator is computed, the sample covariance matrix of the estimated residuals
can be used instead of H to obtain 2-step estimates, which are not only consistent but asymptotically efficient.2 Standard GMM theory applies, except for one thing: Windmeijer (2005) has
computed finite-sample corrections to the asymptotic covariance matrix of the parameters, which
are nowadays almost universally used.
The difference estimator is consistent, but has been shown to have poor properties in finite samples
when is near one. People these days prefer the so-called system estimator, which complements
the differenced data (with lagged levels used as instruments) with data in levels (using lagged
differences as instruments). The system estimator relies on an extra orthogonality condition which
has to do with the earliest value of the dependent variable yi,1 . The interested reader is referred
to Blundell and Bond (1998, pp. 124125) for details, but here it suffices to say that this condition
is satisfied in mean-stationary models and brings about efficiency that may be substantial in many
cases.
The set of orthogonality conditions exploited in the system approach is not very much larger than
with the difference estimator, the reason being that most of the possible orthogonality conditions
associated with the equations in levels are redundant, given those already used for the equations
in differences.
The key equations of the system estimator can be written as
1
1
N
N
N
X 0 X 0 X 0
=
WZ
ZH Z
ZW
i=1
N
X
i=1
2 In
i=1
0Z
W
N
X
i=1
i=1
1
0 H Z
N
X
0
Z
yi
i=1
(17.5)
136
where
yi
h
"
i
W
i
Z
yi3
i0
yiT
yi3
yiT
yi2
yi,T 1
yi2
yi,T 1
xiT
xi3
xiT
#0
xi3
yi1
xi,3
yi1
yi2
..
.
0
..
.
yi,T 2
0
..
.
yi2
yi,T 1
xi,4
xiT
xi3
xiT
In this case choosing a precise form for the matrix H for the first step is no trivial matter. Its
north-west block should be as similar as possible to the covariance matrix of the vector vit , so
the same choice as the difference estimator is appropriate. Ideally, the south-east block should
be proportional to the covariance matrix of the vector i + v, that is v2 I + 2 0 ; but since 2 is
unknown and any positive definite matrix renders the estimator consistent, people just use I. The
off-diagonal blocks should, in principle, contain the covariances between vis and vit , which would
be an identity matrix if vit is white noise. However, since the south-east block is typically given a
conventional value anyway, the benefit in making this choice is not obvious. Some packages use I;
others use a zero matrix. Asymptotically, it should not matter, but on real datasets the difference
between the resulting estimates can be noticeable.
Rank deficiency
Both the difference estimator
and the system estimator (17.5) depend, for their existence, on
PN (17.4)
. This matrix may turn out to be singular for several reasons.
0 H Z
the invertibility of A = i=1 Z
However, this does not mean that the estimator is not computable: in some cases, adjustments
are possible such that the estimator does exist, but the user must be aware that in these cases not
all software packages use the same strategy and replication of results may prove difficult or even
impossible.
A first reason why A may be singular could be the unavailability of instruments, chiefly because
i is zero for all
of missing observations. This case is easy to handle. If a particular row of Z
units, the corresponding orthogonality condition (or the corresponding instrument if you prefer) is
automatically dropped; of course, the overidentification rank is adjusted for testing purposes.
Even if no instruments are zero, however, A could be rank deficient. A trivial case occurs if there
are collinear instruments, but a less trivial case may arise when T (the total number of time periods
available) is not much smaller than N (the number of units), as, for example, in some macro datasets
where the units are countries. The total number of potentially usable orthogonality conditions is
O(T 2 ), which may well exceed N in some cases. Of course A is the sum of N matrices which have,
at most, rank 2T 3 and therefore it could well happen that A is singular.
In all these cases, what we consider the proper way to go is to substitute the pseudo-inverse of
A (MoorePenrose) for its regular inverse. Again, our choice is shared by some software packages,
but not all, so replication may be hard.
137
yt
where = nonmissing and = missing. Estimation seems to be unfeasible, since there are no
periods in which yt and yt1 are both observable.
However, we can use a k-difference operator and get
k yt = k yt1 + k t
where k = 1 Lk and past levels of yt are perfectly valid instruments. In this example, we can
choose k = 3 and use y1 as an instrument, so this unit is in fact perfectly usable.
Not all software packages seem to be aware of this possibility, so replicating published results may
prove tricky if your dataset contains individuals with gaps between valid observations.
17.2
Usage
One of the concepts underlying the syntax of dpanel is that you get default values for several
choices you may want to make, so that in a standard situation the command itself is very short
to write (and read). The simplest case of the model (17.1) is a plain AR(1) process:
yi,t = yi,t1 + i + vit .
(17.6)
gretl assumes that you want to estimate (17.6) via the difference estimator (17.4), using as many
orthogonality conditions as possible. The scalar 1 between dpanel and the semicolon indicates that
only one lag of y is included as an explanatory variable; using 2 would give an AR(2) model. The
syntax that gretl uses for the non-seasonal AR and MA lags in an ARMA model is also supported in
this context.3 For example, if you want the first and third lags of y (but not the second) included as
explanatory variables you can say
dpanel {1 3} ; y
To use a single lag of y other than the first you need to employ this mechanism:
3 This
138
To use the system estimator instead, you add the --system option, as in
dpanel 1 ; y --system
The level orthogonality conditions and the corresponding instrument are appended automatically
(see eq. 17.5).
Regressors
If we want to introduce additional regressors, we list them after the dependent variable in the same
way as other gretl commands, such as ols.
For the difference orthogonality relations, dpanel takes care of transforming the regressors in parallel with the dependent variable. Note that this differs from gretls arbond command, where only
the dependent variable is differenced automatically; it brings us more in line with other software.
One case of potential ambiguity is when an intercept is specified but the difference-only estimator
is selected, as in
dpanel 1 ; y const
In this case the default dpanel behavior, which agrees with Statas xtabond2, is to drop the constant (since differencing reduces it to nothing but zeros). However, for compatibility with the
DPD package for Ox, you can give the option --dpdstyle, in which case the constant is retained
(equivalent to including a linear trend in equation 17.1). A similar point applies to the periodspecific dummy variables which can be added in dpanel via the --time-dummies option: in the
differences-only case these dummies are entered in differenced form by default, but when the
--dpdstyle switch is applied they are entered in levels.
The standard gretl syntax applies if you want to use lagged explanatory variables, so for example
the command
dpanel 1 ; y const x(0 to -1) --system
139
dpanel 1 ; y z
dpanel 1 ; y z ; z
The instrument specification in the second case simply confirms what is implicit in the first: that
z is exogenous. Note, though, that if you have some additional variable z2 which you want to add
as a regular instrument, it then becomes necessary to include z in the instrument list if it is to be
treated as exogenous:
dpanel 1 ; y z ; z2
# z is now implicitly endogenous
dpanel 1 ; y z ; z z2 # z is treated as exogenous
The specification of GMM-style instruments is handled by the special constructs GMM() and
GMMlevel(). The first of these relates to instruments for the equations in differences, and the
second to the equations in levels. The syntax for GMM() is
GMM(varname, minlag, maxlag)
where varname is replaced by the name of a series, and minlag and maxlag are replaced by the
minimum and maximum lags to be used as instruments. The same goes for GMMlevel().
One common use of GMM() is to limit the number of lagged levels of the dependent variable used
as instruments for the equations in differences. Its well known that although exploiting all possible orthogonality conditions yields maximal asymptotic efficiency, in finite samples it may be
preferable to use a smaller subset (but see also Okui (2009)). For example, the specification
dpanel 1 ; y ; GMM(y, 2, 4)
the variable x is considered an endogenous regressor, and up to 5 lags of z are used as instruments.
Note that in the following script fragment
dz = diff(z)
dpanel 1 ; y dz
dpanel 1 ; y dz ; GMM(z,0,0)
the two estimation commands should not be expected to give the same result, as the sets of orthogonality relationships are subtly different. In the latter case, you have T 2 separate orthogonality
relationships pertaining to zit , none of which has any implication for the other ones; in the former
case, you only have one. In terms of the Zi matrix, the first form adds a single row to the bottom
of the instruments matrix, while the second form adds a diagonal block with T 2 columns, that is
h
i
zi3 zi4 zit
versus
zi3
zi4
..
.
..
.
zit
17.3
140
In this section we show how to replicate the results of some of the pioneering work with dynamic
panel-data estimators by Arellano, Bond and Blundell. As the DPD manual (Doornik, Arellano and
Bond, 2006) explains, it is difficult to replicate the original published results exactly, for two main
reasons: not all of the data used in those studies are publicly available; and some of the choices
made in the original software implementation of the estimators have been superseded. Here, therefore, our focus is on replicating the results obtained using the current DPD package and reported
in the DPD manual.
The examples are based on the program files abest1.ox, abest3.ox and bbest1.ox. These
are included in the DPD package, along with the ArellanoBond database files abdata.bn7 and
abdata.in7.4 The ArellanoBond data are also provided with gretl, in the file abdata.gdt. In the
following we do not show the output from DPD or gretl; it is somewhat voluminous, and is easily
generated by the user. As of this writing the results from Ox/DPD and gretl are identical in all
relevant respects for all of the examples shown.5
A complete Ox/DPD program to generate the results of interest takes this general form:
#include <oxstd.h>
#import <packages/dpd/dpd>
main()
{
decl dpd = new DPD();
dpd.Load("abdata.in7");
dpd.SetYear("YEAR");
// model-specific code here
delete dpd;
}
In the examples below we take this template for granted and show just the model-specific code.
Example 1
The following Ox/DPD codedrawn from abest1.ox replicates column (b) of Table 4 in Arellano
and Bond (1991), an instance of the differences-only or GMM-DIF estimator. The dependent variable
is the log of employment, n; the regressors include two lags of the dependent variable, current and
lagged values of the log real-product wage, w, the current value of the log of gross capital, k, and
current and lagged values of the log of industry output, ys. In addition the specification includes
a constant and five year dummies; unlike the stochastic regressors, these deterministic terms are
not differenced. In this specification the regressors w, k and ys are treated as exogenous and serve
as their own instruments. In DPD syntax this requires entering these variables twice, on the X_VAR
and I_VAR lines. The GMM-type (block-diagonal) instruments in this example are the second and
subsequent lags of the level of n. Both 1-step and 2-step estimates are computed.
dpd.SetOptions(FALSE); // dont use robust standard errors
dpd.Select(Y_VAR, {"n", 0, 2});
dpd.Select(X_VAR, {"w", 0, 1, "k", 0, 0, "ys", 0, 1});
dpd.Select(I_VAR, {"w", 0, 1, "k", 0, 0, "ys", 0, 1});
4 See.
be specific, this is using Ox Console version 5.10, version 1.24 of the DPD package, and gretl built from CVS as of
2010-10-23, all on Linux.
5 To
141
dpd.Gmm("n", 2, 99);
dpd.SetDummies(D_CONSTANT + D_TIME);
print("\n\n***** Arellano & Bond (1991), Table 4 (b)");
dpd.SetMethod(M_1STEP);
dpd.Estimate();
dpd.SetMethod(M_2STEP);
dpd.Estimate();
Note that in gretl the switch to suppress robust standard errors is --asymptotic, here abbreviated
to --asy.6 The --dpdstyle flag specifies that the constant and dummies should not be differenced,
in the context of a GMM-DIF model. With gretls dpanel command it is not necessary to specify the
exogenous regressors as their own instruments since this is the default; similarly, the use of the
second and all longer lags of the dependent variable as GMM-type instruments is the default and
need not be stated explicitly.
Example 2
The DPD file abest3.ox contains a variant of the above that differs with regard to the choice of
instruments: the variables w and k are now treated as predetermined, and are instrumented GMMstyle using the second and third lags of their levels. This approximates column (c) of Table 4 in
Arellano and Bond (1991). We have modified the code in abest3.ox slightly to allow the use of
robust (Windmeijer-corrected) standard errors, which are the default in both DPD and gretl with
2-step estimation:
dpd.Select(Y_VAR, {"n", 0, 2});
dpd.Select(X_VAR, {"w", 0, 1, "k", 0, 0, "ys", 0, 1});
dpd.Select(I_VAR, {"ys", 0, 1});
dpd.SetDummies(D_CONSTANT + D_TIME);
dpd.Gmm("n", 2, 99);
dpd.Gmm("w", 2, 3);
dpd.Gmm("k", 2, 3);
print("\n***** Arellano & Bond (1991), Table 4 (c)\n");
print("
(but using different instruments!!)\n");
dpd.SetMethod(M_2STEP);
dpd.Estimate();
Note that since we are now calling for an instrument set other then the default (following the second
semicolon), it is necessary to include the Ivars specification for the variable ys. However, it is
not necessary to specify GMM(n,2,99) since this remains the default treatment of the dependent
variable.
6 Option
flags in gretl can always be truncated, down to the minimal unique abbreviation.
142
Example 3
Our third example replicates the DPD output from bbest1.ox: this uses the same dataset as the
previous examples but the model specifications are based on Blundell and Bond (1998), and involve
comparison of the GMM-DIF and GMM-SYS (system) estimators. The basic specification is slightly
simplified in that the variable ys is not used and only one lag of the dependent variable appears as
a regressor. The Ox/DPD code is:
dpd.Select(Y_VAR, {"n", 0, 1});
dpd.Select(X_VAR, {"w", 0, 1, "k", 0, 1});
dpd.SetDummies(D_CONSTANT + D_TIME);
print("\n\n***** Blundell & Bond (1998), Table 4: 1976-86 GMM-DIF");
dpd.Gmm("n", 2, 99);
dpd.Gmm("w", 2, 99);
dpd.Gmm("k", 2, 99);
dpd.SetMethod(M_2STEP);
dpd.Estimate();
print("\n\n***** Blundell & Bond (1998), Table 4: 1976-86 GMM-SYS");
dpd.GmmLevel("n", 1, 1);
dpd.GmmLevel("w", 1, 1);
dpd.GmmLevel("k", 1, 1);
dpd.SetMethod(M_2STEP);
dpd.Estimate();
Note the use of the --system option flag to specify GMM-SYS, including the default treatment of
the dependent variable, which corresponds to GMMlevel(n,1,1). In this case we also want to
use lagged differences of the regressors w and k as instruments for the levels equations so we
need explicit GMMlevel entries for those variables. If you want something other than the default
treatment for the dependent variable as an instrument for the levels equations, you should give an
explicit GMMlevel specification for that variable and in that case the --system flag is redundant
(but harmless).
For the sake of completeness, note that if you specify at least one GMMlevel term, dpanel will then
include equations in levels, but it will not automatically add a default GMMlevel specification for
the dependent variable unless the --system option is given.
17.4
The previous examples all used the ArellanoBond dataset; for this example we use the dataset
CEL.gdt, which is also included in the gretl distribution. As with the ArellanoBond data, there
are numerous missing values. Details of the provenance of the data can be found by opening the
dataset information window in the gretl GUI (Data menu, Dataset info item). This is a subset of the
BarroLee 138-country panel dataset, an approximation to which is used in Caselli, Esquivel and
143
Lefort (1996) and Bond, Hoeffler and Temple (2001).7 Both of these papers explore the dynamic
panel-data approach in relation to the issues of growth and convergence of per capita income across
countries.
The dependent variable is growth in real GDP per capita over successive five-year periods; the
regressors are the log of the initial (five years prior) value of GDP per capita, the log-ratio of investment to GDP, s, in the prior five years, and the log of annual average population growth, n,
over the prior five years plus 0.05 as stand-in for the rate of technical progress, g, plus the rate of
depreciation, (with the last two terms assumed to be constant across both countries and periods).
The original model is
5 yit = yi,t5 + sit + (nit + g + ) + t + i + it
(17.7)
which allows for a time-specific disturbance t . The Solow model with CobbDouglas production
function implies that = , but this assumption is not imposed in estimation. The time-specific
disturbance is eliminated by subtracting the period mean from each of the series.
Equation (17.7) can be transformed to an AR(1) dynamic panel-data model by adding yi,t5 to both
sides, which gives
yit = (1 + )yi,t5 + sit + (nit + g + ) + i + it
(17.8)
where all variables are now assumed to be time-demeaned.
In (rough) replication of Bond et al. (2001) we now proceed to estimate the following two models:
(a) equation (17.8) via GMM-DIF, using as instruments the second and all longer lags of yit , sit and
nit + g + ; and (b) equation (17.8) via GMM-SYS, using yi,t1 , si,t1 and (ni,t1 + g + ) as
additional instruments in the levels equations. We report robust standard errors throughout. (As a
purely notational matter, we now use t 1 to refer to values five years prior to t, as in Bond et al.
(2001)).
The gretl script to do this job is shown below. Note that the final transformed versions of the
variables (logs, with time-means subtracted) are named ly (yit ), linv (sit ) and lngd (nit + g + ).
open CEL.gdt
ngd = n + 0.05
ly = log(y)
linv = log(s)
lngd = log(ngd)
# take out time means
loop i=1..8 --quiet
smpl (time == i) --restrict --replace
ly -= mean(ly)
linv -= mean(linv)
lngd -= mean(lngd)
endloop
smpl --full
list X = linv lngd
# 1-step GMM-DIF
dpanel 1 ; ly X ; GMM(linv,2,99) GMM(lngd,2,99)
# 2-step GMM-DIF
dpanel 1 ; ly X ; GMM(linv,2,99) GMM(lngd,2,99) --two-step
# GMM-SYS
dpanel 1 ; ly X ; GMM(linv,2,99) GMM(lngd,2,99) \
GMMlevel(linv,1,1) GMMlevel(lngd,1,1) --two-step --sys
7 We
say an approximation because we have not been able to replicate exactly the OLS results reported in the papers
cited, though it seems from the description of the data in Caselli et al. (1996) that we ought to be able to do so. We note
that Bond et al. (2001) used data provided by Professor Caselli yet did not manage to reproduce the latters results.
144
For comparison we estimated the same two models using Ox/DPD and the Stata command xtabond2.
(In each case we constructed a comma-separated values dataset containing the data as transformed
in the gretl script shown above, using a missing-value code appropriate to the target program.) For
reference, the commands used with Stata are reproduced below:
insheet using CEL.csv
tsset unit time
xtabond2 ly L.ly linv lngd, gmm(L.ly, lag(1 99)) gmm(linv, lag(2 99))
gmm(lngd, lag(2 99)) rob nolev
xtabond2 ly L.ly linv lngd, gmm(L.ly, lag(1 99)) gmm(linv, lag(2 99))
gmm(lngd, lag(2 99)) rob nolev twostep
xtabond2 ly L.ly linv lngd, gmm(L.ly, lag(1 99)) gmm(linv, lag(2 99))
gmm(lngd, lag(2 99)) rob nocons twostep
For the GMM-DIF model all three programs find 382 usable observations and 30 instruments, and
yield identical parameter estimates and robust standard errors (up to the number of digits printed,
or more); see Table 17.1.8
1-step
coeff
2-step
std. error
coeff
std. error
0.577564
0.1292
0.610056
0.1562
linv
0.0565469
0.07082
0.100952
0.07772
lngd
0.143950
0.2753
0.310041
0.2980
ly(-1)
Results for GMM-SYS estimation are shown in Table 17.2. In this case we show two sets of gretl
results: those labeled gretl(1) were obtained using gretls --dpdstyle option, while those labeled
gretl(2) did not use that optionthe intent being to reproduce the H matrices used by Ox/DPD
and xtabond2 respectively.
gretl(1)
ly(-1)
0.9237 (0.0385)
Ox/DPD
0.9167 (0.0373)
gretl(2)
0.9073 (0.0370)
xtabond2
0.9073 (0.0370)
linv
0.1592 (0.0449)
0.1636 (0.0441)
0.1856 (0.0411)
0.1856 (0.0411)
lngd
0.2370 (0.1485)
0.2178 (0.1433)
0.2355 (0.1501)
0.2355 (0.1501)
In this case all three programs use 479 observations; gretl and xtabond2 use 41 instruments and
produce the same estimates (when using the same H matrix) while Ox/DPD nominally uses 66.9
It is noteworthy that with GMM-SYS plus messy missing observations, the results depend on the
precise array of instruments used, which in turn depends on the details of the implementation of
the estimator.
Auxiliary test statistics
We have concentrated above on the parameter estimates and standard errors. It may be worth
adding a few words on the additional test statistics that typically accompany both GMM-DIF and
8 The coefficient shown for ly(-1) in the Tables is that reported directly by the software; for comparability with the
original model (eq. 17.7) it is necesary to subtract 1, which produces the expected negative value indicating conditional
convergence in per capita income.
9 This is a case of the issue described in section 17.1: the full A matrix turns out to be singular and special measures
must be taken to produce estimates.
145
GMM-SYS estimation. These include the Sargan test for overidentification, one or more Wald tests
for the joint significance of the regressors, and time dummies if applicable, and tests for first- and
second-order autocorrelation of the residuals from the equations in differences.
In general we see a good level of agreement between gretl, DPD and xtabond2 with regard to these
statistics, with a few relatively minor exceptions. Specifically, xtabond2 computes both a Sargan
test and a Hansen test for overidentification, but what it calls the Hansen test is what DPD and
gretl call the Sargan test. (We have had difficulty determining from the xtabond2 documentation
(Roodman, 2006) exactly how its Sargan test is computed.) In addition there are cases where the
degrees of freedom for the Sargan test differ between DPD and gretl; this occurs when the A matrix
is singular (section 17.1). In concept the df equals the number of instruments minus the number
of parameters estimated; for the first of these terms gretl uses the rank of A, while DPD appears to
use the full dimension of A.
17.5
flag
effect
--asymptotic
--two-step
--system
--time-dummies
--dpdstyle
--verbose
--vcv
--quiet
Chapter 18
Gretl supports nonlinear least squares (NLS) using a variant of the LevenbergMarquardt algorithm.
The user must supply a specification of the regression function; prior to giving this specification the
parameters to be estimated must be declared and given initial values. Optionally, the user may
supply analytical derivatives of the regression function with respect to each of the parameters.
If derivatives are not given, the user must instead give a list of the parameters to be estimated
(separated by spaces or commas), preceded by the keyword params. The tolerance (criterion for
terminating the iterative estimation procedure) can be adjusted using the set command.
The syntax for specifying the function to be estimated is the same as for the genr command. Here
are two examples, with accompanying derivatives.
# Consumption function from Greene
nls C = alpha + beta * Y^gamma
deriv alpha = 1
deriv beta = Y^gamma
deriv gamma = beta * Y^gamma * log(Y)
end nls
# Nonlinear function from Russell Davidson
nls y = alpha + beta * x1 + (1/beta) * x2
deriv alpha = 1
deriv beta = x1 - x2/(beta*beta)
end nls --vcv
Note the command words nls (which introduces the regression function), deriv (which introduces
the specification of a derivative), and end nls, which terminates the specification and calls for
estimation. If the --vcv flag is appended to the last line the covariance matrix of the parameter
estimates is printed.
18.2
The parameters of the regression function must be given initial values prior to the nls command.
This can be done using the genr command (or, in the GUI program, via the menu item Variable,
Define new variable).
In some cases, where the nonlinear function is a generalization of (or a restricted form of) a linear
model, it may be convenient to run an ols and initialize the parameters from the OLS coefficient
estimates. In relation to the first example above, one might do:
ols C 0 Y
genr alpha = $coeff(0)
genr beta = $coeff(Y)
genr gamma = 1
147
ols y 0 x1 x2
genr alpha = $coeff(0)
genr beta = $coeff(x1)
18.3
It is probably most convenient to compose the commands for NLS estimation in the form of a
gretl script but you can also do so interactively, by selecting the item Nonlinear Least Squares
under the Model, Nonlinear models menu. This opens a dialog box where you can type the
function specification (possibly prefaced by genr lines to set the initial parameter values) and the
derivatives, if available. An example of this is shown in Figure 18.1. Note that in this context you
do not have to supply the nls and end nls tags.
18.4
If you are able to figure out the derivatives of the regression function with respect to the parameters, it is advisable to supply those derivatives as shown in the examples above. If that is not
possible, gretl will compute approximate numerical derivatives. However, the properties of the NLS
algorithm may not be so good in this case (see section 18.7).
This is done by using the params statement, which should be followed by a list of identifiers
containing the parameters to be estimated. In this case, the examples above would read as follows:
# Greene
nls C = alpha + beta * Y^gamma
params alpha beta gamma
end nls
# Davidson
nls y = alpha + beta * x1 + (1/beta) * x2
params alpha beta
end nls
If analytical derivatives are supplied, they are checked for consistency with the given nonlinear
function. If the derivatives are clearly incorrect estimation is aborted with an error message. If the
148
derivatives are suspicious a warning message is issued but estimation proceeds. This warning
may sometimes be triggered by incorrect derivatives, but it may also be triggered by a high degree
of collinearity among the derivatives.
Note that you cannot mix analytical and numerical derivatives: you should supply expressions for
all of the derivatives or none.
18.5
Controlling termination
The NLS estimation procedure is an iterative process. Iteration is terminated when the criterion for
convergence is met or when the maximum number of iterations is reached, whichever comes first.
Let k denote the number of parameters being estimated. The maximum number of iterations is
100 (k + 1) when analytical derivatives are given, and 200 (k + 1) when numerical derivatives
are used.
Let denote a small number. The iteration is deemed to have converged if at least one of the
following conditions is satisfied:
Both the actual and predicted relative reductions in the error sum of squares are at most .
The relative error between two consecutive iterates is at most .
This default value of is the machine precision to the power 3/4,1 but it can be adjusted using the
set command with the parameter nls_toler. For example
set nls_toler .0001
18.6
The underlying engine for NLS estimation is based on the minpack suite of functions, available
from netlib.org. Specifically, the following minpack functions are called:
lmder
chkder
lmdif
fdjac2
dpmpar
a 32-bit Intel Pentium machine a likely value for this parameter is 1.82 1012 .
18.7
149
Numerical accuracy
Table 18.1 shows the results of running the gretl NLS procedure on the 27 Statistical Reference
Datasets made available by the U.S. National Institute of Standards and Technology (NIST) for testing nonlinear regression software.2 For each dataset, two sets of starting values for the parameters
are given in the test files, so the full test comprises 54 runs. Two full tests were performed, one
using all analytical derivatives and one using all numerical approximations. In each case the default
tolerance was used.3
Out of the 54 runs, gretl failed to produce a solution in 4 cases when using analytical derivatives,
and in 5 cases when using numeric approximation. Of the four failures in analytical derivatives
mode, two were due to non-convergence of the LevenbergMarquardt algorithm after the maximum
number of iterations (on MGH09 and Bennett5, both described by NIST as of Higher difficulty) and
two were due to generation of range errors (out-of-bounds floating point values) when computing
the Jacobian (on BoxBOD and MGH17, described as of Higher difficulty and Average difficulty
respectively). The additional failure in numerical approximation mode was on MGH10 (Higher difficulty, maximum number of iterations reached).
The table gives information on several aspects of the tests: the number of outright failures, the
average number of iterations taken to produce a solution and two sorts of measure of the accuracy
of the estimates for both the parameters and the standard errors of the parameters.
For each of the 54 runs in each mode, if the run produced a solution the parameter estimates
obtained by gretl were compared with the NIST certified values. We define the minimum correct
figures for a given run as the number of significant figures to which the least accurate gretl estimate agreed with the certified value, for that run. The table shows both the average and the worst
case value of this variable across all the runs that produced a solution. The same information is
shown for the estimated standard errors.4
The second measure of accuracy shown is the percentage of cases, taking into account all parameters from all successful runs, in which the gretl estimate agreed with the certified value to at least
the 6 significant figures which are printed by default in the gretl regression output.
Using analytical derivatives, the worst case values for both parameters and standard errors were
improved to 6 correct figures on the test machine when the tolerance was tightened to 1.0e14.
Using numerical derivatives, the same tightening of the tolerance raised the worst values to 5
correct figures for the parameters and 3 figures for standard errors, at a cost of one additional
failure of convergence.
Note the overall superiority of analytical derivatives: on average solutions to the test problems
were obtained with substantially fewer iterations and the results were more accurate (most notably
for the estimated standard errors). Note also that the six-digit results printed by gretl are not 100
percent reliable for difficult nonlinear problems (in particular when using numerical derivatives).
Having registered this caveat, the percentage of cases where the results were good to six digits or
better seems high enough to justify their printing in this form.
2 For
150
Failures in 54 tests
Average iterations
Mean of min. correct figures,
Analytical derivatives
Numerical derivatives
32
127
8.120
6.980
8.000
5.673
96.5
91.9
97.7
77.3
parameters
Worst of min. correct figures,
parameters
Mean of min. correct figures,
standard errors
Worst of min. correct figures,
standard errors
Percent correct to at least 6 figures,
parameters
Percent correct to at least 6 figures,
standard errors
Chapter 19
T
X
`t ()
t=1
which is true in most cases of interest. The functions `t () are called the log-likelihood contributions.
Moreover, the location of the maximum is obviously determined by the data Y. This means that the
value
(Y)
=Argmax `()
(19.1)
is some function of the observed data (a statistic), which has the property, under mild conditions,
of being a consistent, asymptotically normal and asymptotically efficient estimator of .
151
152
T
X
`t ()
`()
=
i
i
t=1
d OPG ()
Var
)
is the T k matrix of contributions to the gradient. Two other options are available. If
where G()
the --hessian flag is given, the covariance matrix is computed from a numerical approximation to
the Hessian at convergence. If the --robust option is selected, the quasi-ML sandwich estimator
is used:
= H()
1 G0 ()G(
1
d QML ()
Var
)H(
)
where H denotes the numerical approximation to the Hessian.
19.2
153
Gamma estimation
p p1
exp (xt )
x
(p) t
(19.2)
The log-likelihood for the entire sample can be written as the logarithm of the joint density of all
the observations. Since these are independent and identical, the joint density is the product of the
individual densities, and hence its log is
#
T
X
p p1
`t
exp (xt ) =
xt
`(, p) =
log
(p)
t=1
t=1
T
X
"
(19.3)
where
`t = p log(xt ) (p) log xt xt
and () is the log of the gamma function. In order to estimate the parameters and p via ML, we
need to maximize (19.3) with respect to them. The corresponding gretl code snippet is
scalar alpha = 1
scalar p = 1
mle logl = p*ln(alpha * x) - lngamma(p) - ln(x) - alpha * x
params alpha p
end mle
are necessary to ensure that the variables alpha and p exist before the computation of logl is
attempted. Inside the mle block these variables are identified as the parameters that should be
adjusted to maximize the likelihood via the params keyword. Their values will be changed by
the execution of the mle command; upon successful completion, they will be replaced by the ML
estimates. The starting value is 1 for both; this is arbitrary and does not matter much in this
example (more on this later).
The above code can be made more readable, and marginally more efficient, by defining a variable
to hold xt . This command can be embedded in the mle block as follows:
mle logl = p*ln(ax) - lngamma(p) - ln(x) - ax
series ax = alpha*x
params alpha p
end mle
The variable ax is not added to the params list, of course, since it is just an auxiliary variable to
facilitate the calculations. You can insert as many such auxiliary lines as you require before the
params line, with the restriction that they must contain either (a) commands to generate series,
scalars or matrices or (b) print commands (which may be used to aid in debugging).
In a simple example like this, the choice of the starting values is almost inconsequential; the algorithm is likely to converge no matter what the starting values are. However, consistent method-ofmoments estimators of p and can be simply recovered from the sample mean m and variance V :
since it can be shown that
E(xt ) = p/
V (xt ) = p/2
154
m/V
are consistent, and therefore suitable to be used as starting point for the algorithm. The gretl script
code then becomes
scalar m = mean(x)
scalar alpha = m/var(x)
scalar p = m*alpha
mle logl = p*ln(ax) - lngamma(p) - ln(x) - ax
series ax = alpha*x
params alpha p
end mle
Another thing to note is that sometimes parameters are constrained within certain boundaries: in
this case, for example, both and p must be positive numbers. Gretl does not check for this: it
is the users responsibility to ensure that the function is always evaluated at an admissible point
in the parameter space during the iterative search for the maximum. An effective technique is to
define a variable for checking that the parameters are admissible and setting the log-likelihood as
undefined if the check fails. An example, which uses the conditional assignment operator, follows:
scalar m = mean(x)
scalar alpha = m/var(x)
scalar p = m*alpha
mle logl
series
scalar
params
end mle
19.3
When modeling a cost function, it is sometimes worthwhile to incorporate explicitly into the statistical model the notion that firms may be inefficient, so that the observed cost deviates from the
theoretical figure not only because of unobserved heterogeneity between firms, but also because
two firms could be operating at a different efficiency level, despite being identical under all other
respects. In this case we may write
Ci = Ci + ui + vi
where Ci is some variable cost indicator, Ci is its theoretical value, ui is a zero-mean disturbance
term and vi is the inefficiency term, which is supposed to be nonnegative by its very nature.
A linear specification for Ci is often chosen. For example, the CobbDouglas cost function arises
when Ci is a linear function of the logarithms of the input prices and the output quantities.
The stochastic frontier model is a linear model of the form yi = xi + i in which
the error term
i is the sum of ui and vi . A common postulate is that ui N(0, u2 ) and vi N(0, v2 ). If
independence between ui and vi is also assumed, then it is possible to show that the density
function of i has the form:
s
2
i 1
i
f (i ) =
(19.4)
where
q () and () are, respectively, the distribution and density function of the standard normal,
u
= u2 + v2 and =
v .
155
As a consequence, the log-likelihood for one observation takes the form (apart form an irrelevant
constant)
#
"
i2
i
`t = log
log( ) +
2 2
Therefore, a CobbDouglas cost function with stochastic frontier is the model described by the
following equations:
log Ci
log Ci + i
log Ci
c+
m
X
j log yij +
j=1
ui + vi
ui
vi
N(0, u2 )
N(0, v2 )
n
X
j log pij
j=1
In most cases, one wants to ensure that the homogeneity of the cost function
with respect to
Pn
the prices holds by construction. Since this requirement is equivalent to j=1 j = 1, the above
equation for Ci can be rewritten as
log Ci log pin = c +
m
X
j log yij +
j=1
n
X
(19.5)
j=2
The above equation could be estimated by OLS, but it would suffer from two drawbacks: first,
the OLS estimator for the intercept c is inconsistent because the disturbance term has a non-zero
expected value; second, the OLS estimators for the other parameters are consistent, but inefficient
in view of the non-normality of i . Both issues can be addressed by estimating (19.5) by maximum
likelihood. Nevertheless, OLS estimation is a quick and convenient way to provide starting values
for the MLE algorithm.
Example 19.1 shows how to implement the model described so far. The banks91 file contains part
of the data used in Lucchetti, Papi and Zazzaro (2001).
19.4
GARCH models
GARCH models are handled by gretl via a native function. However, it is instructive to see how they
can be estimated through the mle command.
The following equations provide the simplest example of a GARCH(1,1) model:
yt
+ t
ut t
ut
N(0, 1)
ht
2
+ t1
+ ht1 .
Since the variance of yt depends on past values, writing down the log-likelihood function is not
simply a matter of summing the log densities for individual observations. As is common in time
series models, yt cannot be considered independent of the other observations in our sample, and
consequently the density function for the whole sample (the joint density for all observations) is
not just the product of the marginal densities.
Maximum likelihood estimation, in these cases, is achieved by considering conditional densities, so
what we maximize is a conditional likelihood function. If we define the information set at time t as
Ft = yt , yt1 , . . . ,
open banks91
# Cobb-Douglas cost function
ols cost const y p1 p2 p3
# Cobb-Douglas cost function with homogeneity restrictions
genr rcost = cost - p3
genr rp1 = p1 - p3
genr rp2 = p2 - p3
ols rcost const y rp1 rp2
# Cobb-Douglas cost function with homogeneity restrictions
# and inefficiency
scalar
scalar
scalar
scalar
b0
b1
b2
b3
=
=
=
=
$coeff(const)
$coeff(y)
$coeff(rp1)
$coeff(rp2)
scalar su = 0.1
scalar sv = 0.1
mle logl
scalar
scalar
series
params
end mle
156
157
T
Y
f (yt , yt1 , . . .) =
f (yt |Ft1 ) f (y0 )
t=1
If we treat y0 as fixed, then the term f (y0 ) does not depend on the unknown parameters, and therefore the conditional log-likelihood can then be written as the sum of the individual contributions
as
T
X
`(, , , ) =
`t
(19.6)
t=1
where
"
1
`t = log p
ht
yt
p
ht
!#
"
#
(yt )2
1
log(ht ) +
=
2
ht
The following script shows a simple application of this technique, which uses the data file djclose;
it is one of the example dataset supplied with gretl and contains daily data from the Dow Jones
stock index.
open djclose
series y = 100*ldiff(djclose)
scalar
scalar
scalar
scalar
mu = 0.0
omega = 1
alpha = 0.4
beta = 0.0
mle ll =
series
series
series
params
end mle
19.5
-0.5*(log(h) + (e^2)/h)
e = y - mu
h = var(y)
h = omega + alpha*(e(-1))^2 + beta*h(-1)
mu omega alpha beta
Analytical derivatives
Computation of the score vector is essential for the working of the BFGS method. In all the previous
examples, no explicit formula for the computation of the score was given, so the algorithm was fed
numerically evaluated gradients. Numerical computation of the score for the i-th parameter is
performed via a finite approximation of the derivative, namely
`(1 , . . . , n )
`(1 , . . . , i + h, . . . , n ) `(1 , . . . , i h, . . . , n )
'
i
2h
where h is a small number.
In many situations, this is rather efficient and accurate. However, one might want to avoid the
approximation and specify an exact function for the derivatives. As an example, consider the
following script:
nulldata 1000
158
genr x1 = normal()
genr x2 = normal()
genr x3 = normal()
genr ystar = x1 + x2 + x3 + normal()
genr y = (ystar > 0)
scalar
scalar
scalar
scalar
b0
b1
b2
b3
=
=
=
=
0
0
0
0
Here, 1000 data points are artificially generated for an ordinary probit model:2 yt is a binary
variable, which takes the value 1 if yt = 1 x1t + 2 x2t + 3 x3t + t > 0 and 0 otherwise. Therefore,
yt = 1 with probability (1 x1t + 2 x2t + 3 x3t ) = t . The probability function for one observation
can be written as
y
P (yt ) = t t (1 t )1yt
Since the observations are independent and identically distributed, the log-likelihood is simply the
sum of the individual contributions. Hence
`=
T
X
yt log(t ) + (1 yt ) log(1 t )
t=1
The --verbose switch at the end of the end mle statement produces a detailed account of the
iterations done by the BFGS algorithm.
In this case, numerical differentiation works rather well; nevertheless, computation of the analytical
`
score is straightforward, since the derivative
can be written as
i
`
` t
=
i
t i
via the chain rule, and it is easy to see that
`
t
t
i
yt
1 yt
t
1 t
The mle block in the above script can therefore be modified as follows:
mle logl = y*ln(P) + (1-y)*ln(1-P)
series ndx = b0 + b1*x1 + b2*x2 + b3*x3
series P = cnorm(ndx)
series tmp = dnorm(ndx)*(y/P - (1-y)/(1-P))
deriv b0 = tmp
deriv b1 = tmp*x1
deriv b2 = tmp*x2
deriv b3 = tmp*x3
end mle --verbose
2 Again, gretl does provide a native probit command (see section 27.1), but a probit model makes for a nice example
here.
159
Note that the params statement has been replaced by a series of deriv statements; these have the
double function of identifying the parameters over which to optimize and providing an analytical
expression for their respective score elements.
19.6
Debugging ML scripts
We have discussed above the main sorts of statements that are permitted within an mle block,
namely
auxiliary commands to generate helper variables;
deriv statements to specify the gradient with respect to each of the parameters; and
a params statement to identify the parameters in case analytical derivatives are not given.
For the purpose of debugging ML estimators one additional sort of statement is allowed: you can
print the value of a relevant variable at each step of the iteration. This facility is more restricted
then the regular print command. The command word print should be followed by the name of
just one variable (a scalar, series or matrix).
In the last example above a key variable named tmp was generated, forming the basis for the
analytical derivatives. To track the progress of this variable one could add a print statement within
the ML block, as in
series tmp = dnorm(ndx)*(y/P - (1-y)/(1-P))
print tmp
19.7
Using functions
The mle command allows you to estimate models that gretl does not provide natively: in some
cases, it may be a good idea to wrap up the mle block in a user-defined function (see Chapter 10),
so as to extend gretls capabilities in a modular and flexible way.
As an example, we will take a simple case of a model that gretl does not yet provide natively:
the zero-inflated Poisson model, or ZIP for short.3 In this model, we assume that we observe a
mixed population: for some individuals, the variable yt is (conditionally on a vector of exogenous
covariates xt ) distributed as a Poisson random variate; for some others, yt is identically 0. The
trouble is, we dont know which category a given individual belongs to.
For instance, suppose we have a sample of women, and the variable yt represents the number of
children that woman t has. There may be a certain proportion, , of women for whom yt = 0 with
certainty (maybe out of a personal choice, or due to physical impossibility). But there may be other
women for whom yt = 0 just as a matter of chance they havent happened to have any children
at the time of observation.
In formulae:
y
"
t
P (yt = k|xt )
dt + (1 ) e
dt
exp(xt )
(
1 for yt = 0
0
t t
yt !
for yt > 0
160
mle ll = logprob
series xb = exp(b0 + b1 * x)
series d = (y=0)
series poiprob = exp(-xb) * xb^y / gamma(y+1)
series logprob = (alpha>0) && (alpha<1) ? \
log(alpha*d + (1-alpha)*poiprob) : NA
params alpha b0 b1
end mle -v
However, the code above has to be modified each time we change our specification by, say, adding
an explanatory variable. Using functions, we can simplify this task considerably and eventually be
able to write something easy like
list X = const x
zip(y, X)
/*
user-level function: estimate the model and print out
the results
*/
function void zip(series y, list X)
matrix coef_stde = zip_estimate(y, X)
printf "\nZero-inflated Poisson model:\n"
string parnames = "alpha,"
string parnames += varname(X)
modprint coef_stde parnames
end function
Lets see how this can be done. First we need to define a function called zip() that will take two arguments: a dependent variable y and a list of explanatory variables X. An example of such function
can be seen in script 19.2. By inspecting the function code, you can see that the actual estimation
does not happen here: rather, the zip() function merely uses the built-in modprint command to
print out the results coming from another user-written function, namely zip_estimate().
The function zip_estimate() is not meant to be executed directly; it just contains the numbercrunching part of the job, whose results are then picked up by the end function zip(). In turn,
zip_estimate() calls other user-written functions to perform other tasks. The whole set of internal functions is shown in the panel 19.3.
All the functions shown in 19.2 and 19.3 can be stored in a separate inp file and executed once, at
the beginning of our job, by means of the include command. Assuming the name of this script file
is zip_est.inp, the following is an example script which (a) includes the script file, (b) generates a
simulated dataset, and (c) performs the estimation of a ZIP model on the artificial data.
set echo off
set messages off
# include the user-written functions
include zip_est.inp
# generate the artificial data
nulldata 1000
161
162
A further step may then be creating a function package for accessing your new zip() function via
gretls graphical interface. For details on how to do this, see section 10.5.
Chapter 20
GMM estimation
20.1
The Generalized Method of Moments (GMM) is a very powerful and general estimation method,
which encompasses practically all the parametric estimation techniques used in econometrics. It
was introduced in Hansen (1982) and Hansen and Singleton (1982); an excellent and thorough
treatment is given in chapter 17 of Davidson and MacKinnon (1993).
The basic principle on which GMM is built is rather straightforward. Suppose we wish to estimate
a scalar parameter based on a sample x1 , x2 , . . . , xT . Let 0 indicate the true value of . Theoretical considerations (either of statistical or economic nature) may suggest that a relationship like
the following holds:
E xt g() = 0 a = 0 ,
(20.1)
with g() a continuous and invertible function. That is to say, there exists a function of the data
and the parameter, with the property that it has expectation zero if and only if it is evaluated at the
true parameter value. For example, economic models with rational expectations lead to expressions
like (20.1) quite naturally.
If the sampling model for the xt s is such that some version of the Law of Large Numbers holds,
then
T
1 X
p
=
X
xt g(0 );
T t=1
hence, since g() is invertible, the statistic
= g 1 (X)
p 0 ,
1
F () =
T
T
X
2
g() 2 ;
(xt g()) = X
(20.2)
t=1
= g 1 (X),
since the expression in square brackets equals 0.
the minimum is trivially reached at
The above reasoning can be generalized as follows: suppose is an n-vector and we have m
relations like
E [fi (xt , )] = 0 for i = 1 . . . m,
(20.3)
where E[] is a conditional expectation on a set of p variables zt , called the instruments. In the
above simple example, m = 1 and f (xt , ) = xt g(), and the only instrument used is zt = 1.
Then, it must also be true that
h
i
h
i
E fi (xt , ) zj,t = E fi,j,t () = 0 for i = 1 . . . m and j = 1 . . . p;
(20.4)
equation (20.4) is known as an orthogonality condition, or moment condition. The GMM estimator is
defined as the minimum of the quadratic form
F (, W ) =
f0 W
f,
163
(20.5)
164
where
f is a (1 m p) vector holding the average of the orthogonality conditions and W is some
symmetric, positive definite matrix, known as the weights matrix. A necessary condition for the
minimum to exist is the order condition n m p.
The statistic
=Argmin F (, W )
(20.6)
is a consistent estimator of whatever the choice of W . However, to achieve maximum asymptotic efficiency W must be proportional to the inverse of the long-run covariance matrix of the
orthogonality conditions; if W is not known, a consistent estimator will suffice.
These considerations lead to the following empirical strategy:
1 . Customary choices
1. Choose a positive definite W and compute the one-step GMM estimator
for W are Imp or Im (Z 0 Z)1 .
1 to estimate V (fi,j,t ()) and use its inverse as the weights matrix. The resulting esti2. Use
2 is called the two-step estimator.
mator
2 and obtain
3 ; iterate until convergence. Asymp3. Re-estimate V (fi,j,t ()) by means of
totically, these extra steps are unnecessary, since the two-step estimator is consistent and
efficient; however, the iterated estimator often has better small-sample properties and should
be independent of the choice of W made at step 1.
In the special case when the number of parameters n is equal to the total number of orthogonality
is the same for any choice of the weights matrix W , so the
conditions m p, the GMM estimator
first step is sufficient; in this case, the objective function is 0 at the minimum.
If, on the contrary, n < m p, the second step (or successive iterations) is needed to achieve
efficiency, and the estimator so obtained can be very different, in finite samples, from the onestep estimator. Moreover, the value of the objective function at the minimum, suitably scaled by
the number of observations, yields Hansens J statistic; this statistic can be interpreted as a test
statistic that has a 2 distribution with m p n degrees of freedom under the null hypothesis of
correct specification. See Davidson and MacKinnon (1993, section 17.6) for details.
In the following sections we will show how these ideas are implemented in gretl through some
examples.
20.2
OLS as GMM
It is instructive to start with a somewhat contrived example: consider the linear model yt = xt +
ut . Although most of us are used to read it as the sum of a hazily defined systematic part plus an
equally hazy disturbance, a more rigorous interpretation of this familiar expression comes from
the hypothesis that the conditional mean E(yt |xt ) is linear and the definition of ut as yt E(yt |xt ).
From the definition of ut , it follows that E(ut |xt ) = 0. The following orthogonality condition is
therefore available:
E [f ()] = 0,
(20.7)
where f () = (yt xt )xt . The definitions given in the previous section therefore specialize here
to:
is ;
the instrument is xt ;
fi,j,t () is (yt xt )xt = ut xt ; the orthogonality condition is interpretable as the requirement
that the regressors should be uncorrelated with the disturbances;
165
W can be any symmetric positive definite matrix, since the number of parameters equals the
number of orthogonality conditions. Lets say we choose I.
The function F (, W ) is in this case
2
T
X
1
t x t )
F (, W ) =
(u
T t=1
and it is easy to see why OLS and GMM coincide here: the GMM objective function has the
same minimizer as the objective function of OLS, the residual sum of squares. Note, however,
that the two functions are not equal to one another: at the minimum, F (, W ) = 0 while the
minimized sum of squared residuals is zero only in the special case of a perfect linear fit.
The code snippet contained in Example 20.1 uses gretls gmm command to make the above operational.
Example 20.1: OLS via GMM
/* initialize stuff */
series e = 0
scalar beta = 0
matrix V = I(1)
/* proceed with estimation */
gmm
series e = y - x*beta
orthog e ; x
weights V
params beta
end gmm
We feed gretl the necessary ingredients for GMM estimation in a command block, starting with gmm
and ending with end gmm. After the end gmm statement two mutually exclusive options can be
specified: --two-step or --iterate, whose meaning should be obvious.
Three elements are compulsory within a gmm block:
1. one or more orthog statements
2. one weights statement
3. one params statement
The three elements should be given in the stated order.
The orthog statements are used to specify the orthogonality conditions. They must follow the
syntax
orthog x ; Z
where x may be a series, matrix or list of series and Z may also be a series, matrix or list. In
example 20.1, the series e holds the residuals and the series x holds the regressor. If x had been
a list (a matrix), the orthog statement would have generated one orthogonality condition for each
element (column) of x. Note the structure of the orthogonality condition: it is assumed that the
term to the left of the semicolon represents a quantity that depends on the estimated parameters
(and so must be updated in the process of iterative estimation), while the term on the right is a
constant function of the data.
166
The weights statement is used to specify the initial weighting matrix and its syntax is straightforward. Note, however, that when more than one step is required that matrix will contain the final
weight matrix, which most likely will be different from its initial value.
The params statement specifies the parameters with respect to which the GMM criterion should be
minimized; it follows the same logic and rules as in the mle and nls commands.
The minimum is found through numerical minimization via BFGS (see section 5.9 and chapter 19).
The progress of the optimization procedure can be observed by appending the --verbose switch
to the end gmm line. (In this example GMM estimation is clearly a rather silly thing to do, since a
closed form solution is easily given by OLS.)
20.3
TSLS as GMM
Moving closer to the proper domain of GMM, we now consider two-stage least squares (TSLS) as a
case of GMM.
TSLS is employed in the case where one wishes to estimate a linear model of the form yt = Xt +ut ,
but where one or more of the variables in the matrix X are potentially endogenous correlated
with the error term, u. We proceed by identifying a set of instruments, Zt , which are explanatory
for the endogenous variables in X but which are plausibly uncorrelated with u. The classic twostage procedure is (1) regress the endogenous elements of X on Z; then (2) estimate the equation
of interest, with the endogenous elements of X replaced by their fitted values from (1).
as usual. But
t as yt Xt ,
An alternative perspective is given by GMM. We define the residual u
instead of relying on E(u|X) = 0 as in OLS, we base estimation on the condition E(u|Z) = 0. In this
case it is natural to base the initial weighting matrix on the covariance matrix of the instruments.
Example 20.2 presents a model from Stock and Watsons Introduction to Econometrics. The demand
for cigarettes is modeled as a linear function of the logs of price and income; income is treated as
exogenous while price is taken to be endogenous and two measures of tax are used as instruments.
Since we have two instruments and one endogenous variable the model is over-identified and therefore the weights matrix will influence the solution. Partial output from this script is shown in 20.3.
The estimated standard errors from GMM are robust by default; if we supply the --robust option
to the tsls command we get identical results.1
20.4
The covariance matrix of the estimated parameters depends on the choice of W through
= (J 0 W J)1 J 0 W W J(J 0 W J)1
(20.8)
fi
j
ft ()ft ()0
T t=1
(20.9)
This estimator is robust with respect to heteroskedasticity, but not with respect to autocorrelation. A heteroskedasticity- and autocorrelation-consistent (HAC) variant can be obtained using the
1 The data file used in this example is available in the Stock and Watson package for gretl. See.
sourceforge.net/gretl_data.html.
167
open cig_ch10.gdt
# real avg price including sales tax
genr ravgprs = avgprs / cpi
# real avg cig-specific tax
genr rtax = tax / cpi
# real average total tax
genr rtaxs = taxs / cpi
# real average sales tax
genr rtaxso = rtaxs - rtax
# logs of consumption, price, income
genr lpackpc = log(packpc)
genr lravgprs = log(ravgprs)
genr perinc = income / (pop*cpi)
genr lperinc = log(perinc)
# restrict sample to 1995 observations
smpl --restrict year=1995
# Equation (10.16) by tsls
list xlist = const lravgprs lperinc
list zlist = const rtaxso rtax lperinc
tsls lpackpc xlist ; zlist --robust
# setup for gmm
matrix Z = { zlist }
matrix W = inv(ZZ)
series e = 0
scalar b0 = 1
scalar b1 = 1
scalar b2 = 1
gmm e = lpackpc - b0 - b1*lravgprs - b2*lperinc
orthog e ; Z
weights W
params b0 b1 b2
end gmm
168
COEFFICIENT
9.89496
-1.27742
0.280405
STDERROR
0.928758
0.241684
0.245828
T STAT
10.654
-5.286
1.141
P-VALUE
<0.00001 ***
<0.00001 ***
0.25401
ESTIMATE
9.89496
-1.27742
0.280405
STDERROR
0.928758
0.241684
0.245828
T STAT
10.654
-5.286
1.141
P-VALUE
<0.00001 ***
<0.00001 ***
0.25401
Bartlett kernel or similar. A univariate version of this is used in the context of the lrvar() function
see equation (5.1). The multivariate version is set out in equation (20.10).
TX
k
k
X
1
0
k () =
wi ft ()fti () ,
T t=k i=k
(20.10)
Gretl computes the HAC covariance matrix by default when a GMM model is estimated on time
series data. You can control the kernel and the bandwidth (that is, the value of k in 20.10) using
the set command. See chapter 15 for further discussion of HAC estimation. You can also ask gretl
not to use the HAC version by saying
set force_hc on
20.5
To illustrate gretls implementation of GMM, we will replicate the example given in chapter 3 of
Hall (2005). The model to estimate is a classic application of GMM, and provides an example of a
case when orthogonality conditions do not stem from statistical considerations, but rather from
economic theory.
A rational individual who must allocate his income between consumption and investment in a
financial asset must in fact choose the consumption path of his whole lifetime, since investment
translates into future consumption. It can be shown that an optimal consumption path should
satisfy the following condition:
pU 0 (ct ) = k E rt+k U 0 (ct+k )|Ft ,
(20.11)
where p is the asset price, U() is the individuals utility function, is the individuals subjective
discount rate and rt+k is the assets rate of return between time t and time t + k. Ft is the information set at time t; equation (20.11) says that the utility lost at time t by purchasing the asset
instead of consumption goods must be matched by a corresponding increase in the (discounted)
169
future utility of the consumption financed by the assets return. Since the future is uncertain, the
individual considers his expectation, conditional on what is known at the time when the choice is
made.
We have said nothing about the nature of the asset, so equation (20.11) should hold whatever asset
we consider; hence, it is possible to build a system of equations like (20.11) for each asset whose
price we observe.
If we are willing to believe that
the economy as a whole can be represented as a single gigantic and immortal representative
individual, and
the function U(x) =
x 1
then, setting k = 1, equation (20.11) implies the following for any asset j:
"
#
rj,t+1 Ct+1 1
Ft = 1,
E
pj,t
Ct
(20.12)
where Ct is aggregate consumption and and are the risk aversion and discount rate of the
representative individual. In this case, it is easy to see that the deep parameters and can be
estimated via GMM by using
rj,t+1 Ct+1 1
et =
1
pj,t
Ct
as the moment condition, while any variable known at time t may serve as an instrument.
In the example code given in 20.4, we replicate selected portions of table 3.7 in Hall (2005). The
variable consrat is defined as the ratio of monthly consecutive real per capita consumption (services and nondurables) for the US, and ewr is the returnprice ratio of a fictitious asset constructed
by averaging all the stocks in the NYSE. The instrument set contains the constant and two lags of
each variable.
The command set force_hc on on the second line of the script has the sole purpose of replicating
the given example: as mentioned above, it forces gretl to compute the long-run variance of the
orthogonality conditions according to equation (20.9) rather than (20.10).
We run gmm four times: one-step estimation for each of two initial weights matrices, then iterative
estimation starting from each set of initial weights. Since the number of orthogonality conditions
(5) is greater than the number of estimated parameters (2), the choice of initial weights should
make a difference, and indeed we see fairly substantial differences between the one-step estimates
(Models 1 and 2). On the other hand, iteration reduces these differences almost to the vanishing
point (Models 3 and 4).
Part of the output is given in 20.5. It should be noted that the J test leads to a rejection of the
hypothesis of correct specification. This is perhaps not surprising given the heroic assumptions
required to move from the microeconomic principle in equation (20.11) to the aggregate system
that is actually estimated.
20.6
Caveats
A few words of warning are in order: despite its ingenuity, GMM is possibly the most fragile estimation method in econometrics. The number of non-obvious choices one has to make when using
GMM is high, and in finite samples each of these can have dramatic consequences on the eventual
output. Some of the factors that may affect the results are:
1. Orthogonality conditions can be written in more than one way: for example, if E(xt ) = 0,
then E(xt / 1) = 0 holds too. It is possible that a different specification of the moment
conditions leads to different results.
open hall.gdt
set force_hc on
scalar alpha = 0.5
scalar delta = 0.5
series e = 0
list inst = const consrat(-1) consrat(-2) ewr(-1) ewr(-2)
matrix V0 = 100000*I(nelem(inst))
matrix Z = { inst }
matrix V1 = $nobs*inv(ZZ)
gmm e = delta*ewr*consrat^(alpha-1) - 1
orthog e ; inst
weights V0
params alpha delta
end gmm
gmm e = delta*ewr*consrat^(alpha-1) - 1
orthog e ; inst
weights V1
params alpha delta
end gmm
gmm e = delta*ewr*consrat^(alpha-1) - 1
orthog e ; inst
weights V0
params alpha delta
end gmm --iterate
gmm e = delta*ewr*consrat^(alpha-1) - 1
orthog e ; inst
weights V1
params alpha delta
end gmm --iterate
170
171
Example 20.5: Estimation of the Consumption Based Asset Pricing Model output
ESTIMATE
-3.14475
0.999215
STDERROR
6.84439
0.0121044
T STAT
-0.459
82.549
P-VALUE
0.64590
<0.00001 ***
ESTIMATE
alpha
d
0.398194
0.993180
STDERROR
2.26359
0.00439367
T STAT
0.176
226.048
P-VALUE
0.86036
<0.00001 ***
ESTIMATE
-0.344325
0.991566
STDERROR
2.21458
0.00423620
T STAT
-0.155
234.070
P-VALUE
0.87644
<0.00001 ***
ESTIMATE
-0.344315
0.991566
STDERROR
2.21359
0.00423469
T STAT
-0.156
234.153
P-VALUE
0.87639
<0.00001 ***
172
2. As with all other numerical optimization algorithms, weird things may happen when the objective function is nearly flat in some directions or has multiple minima. BFGS is usually quite
good, but there is no guarantee that it always delivers a sensible solution, if one at all.
3. The 1-step and, to a lesser extent, the 2-step estimators may be sensitive to apparently trivial
details, like the re-scaling of the instruments. Different choices for the initial weights matrix
can also have noticeable consequences.
4. With time-series data, there is no hard rule on the appropriate number of lags to use when
computing the long-run covariance matrix (see section 20.4). Our advice is to go by trial and
error, since results may be greatly influenced by a poor choice. Future versions of gretl will
include more options on covariance matrix estimation.
One of the consequences of this state of things is that replicating various well-known published
studies may be extremely difficult. Any non-trivial result is virtually impossible to reproduce unless
all details of the estimation procedure are carefully recorded.
Chapter 21
Introduction
In some contexts the econometrician chooses between alternative models based on a formal hypothesis test. For example, one might choose a more general model over a more restricted one if
the restriction in question can be formulated as a testable null hypothesis, and the null is rejected
on an appropriate test.
In other contexts one sometimes seeks a criterion for model selection that somehow measures the
balance between goodness of fit or likelihood, on the one hand, and parsimony on the other. The
balancing is necessary because the addition of extra variables to a model cannot reduce the degree
of fit or likelihood, and is very likely to increase it somewhat even if the additional variables are
not truly relevant to the data-generating process.
The best known such criterion, for linear models estimated via least squares, is the adjusted R 2 ,
2 = 1
R
SSR/(n k)
TSS/(n 1)
where n is the number of observations in the sample, k denotes the number of parameters estimated, and SSR and TSS denote the sum of squared residuals and the total sum of squares for
the dependent variable, respectively. Compared to the ordinary coefficient of determination or
unadjusted R 2 ,
SSR
R2 = 1
TSS
the adjusted calculation penalizes the inclusion of additional parameters, other things equal.
21.2
Information criteria
A more general criterion in a similar spirit is Akaikes (1974) Information Criterion (AIC). The
original formulation of this measure is
+ 2k
AIC = 2`()
(21.1)
represents the maximum loglikelihood as a function of the vector of parameter estiwhere `()
mates, , and k (as above) denotes the number of independently adjusted parameters within the
model. In this formulation, with AIC negatively related to the likelihood and positively related to
the number of parameters, the researcher seeks the minimum AIC.
The AIC can be confusing, in that several variants of the calculation are in circulation. For example, Davidson and MacKinnon (2004) present a simplified version,
k
AIC = `()
which is just 2 times the original: in this case, obviously, one wants to maximize AIC.
In the case of models estimated by least squares, the loglikelihood can be written as
=
`()
n
n
(1 + log 2 log n) log SSR
2
2
173
(21.2)
174
(21.3)
Some authors simplify the formula for the case of models estimated via least squares. For instance,
William Greene writes
2k
SSR
+
(21.4)
AIC = log
n
n
This variant can be derived from (21.3) by dividing through by n and subtracting the constant
1 + log 2 . That is, writing AICG for the version given by Greene, we have
AICG =
1
AIC (1 + log 2 )
n
SSR 2k/n
e
n
Chapter 22
Introduction
Time series models are discussed in this chapter and the next. In this chapter we concentrate on
ARIMA models, unit root tests, and GARCH. The following chapter deals with cointegration and
error correction.
22.2
ARIMA models
(22.1)
where (L), and (L) are polynomials in the lag operator, L, defined such that Ln xt = xtn , and
t is a white noise process. The exact content of yt , of the AR polynomial (), and of the MA
polynomial (), will be explained in the following.
Mean terms
The process yt as written in equation (22.1) has, without further qualifications, mean zero. If the
model is to be applied to real data, it is necessary to include some term to handle the possibility
that yt has non-zero mean. There are two possible ways to represent processes with nonzero
mean: one is to define t as the unconditional mean of yt , namely the central value of its marginal
t = yt t has mean 0, and the model (22.1) applies to y
t . In
distribution. Therefore, the series y
practice, assuming that t is a linear function of some observable variables xt , the model becomes
(L)(yt xt ) = (L)t
(22.2)
This is sometimes known as a regression model with ARMA errors; its structure may be more
apparent if we represent it using two equations:
yt
xt + ut
(L)ut
(L)t
The model just presented is also sometimes known as ARMAX (ARMA + eXogenous variables). It
seems to us, however, that this label is more appropriately applied to a different model: another
way to include a mean term in (22.1) is to base the representation on the conditional mean of yt ,
that is the central value of the distribution of yt given its own past. Assuming, again, that this can
be represented as a linear combination of some observable variables zt , the model would expand
to
(L)yt = zt + (L)t
(22.3)
The formulation (22.3) has the advantage that can be immediately interpreted as the vector of
marginal effects of the zt variables on the conditional mean of yt . And by adding lags of zt to
175
176
this specification one can estimate Transfer Function models (which generalize ARMA by adding
the effects of exogenous variable distributed across time).
Gretl provides a way to estimate both forms. Models written as in (22.2) are estimated by maximum
likelihood; models written as in (22.3) are estimated by conditional maximum likelihood. (For more
on these options see the section on Estimation below.)
In the special case when xt = zt = 1 (that is, the models include a constant but no exogenous
variables) the two specifications discussed above reduce to
(L)(yt ) = (L)t
(22.4)
(L)yt = + (L)t
(22.5)
and
respectively. These formulations are essentially equivalent, but if they represent one and the same
process and are, fairly obviously, not numerically identical; rather
= 1 1 . . . p
The gretl syntax for estimating (22.4) is simply
arma p q ; y
The AR and MA lag orders, p and q, can be given either as numbers or as pre-defined scalars.
The parameter can be dropped if necessary by appending the option --nc (no constant) to the
command. If estimation of (22.5) is needed, the switch --conditional must be appended to the
command, as in
arma p q ; y --conditional
Generalizing this principle to the estimation of (22.2) or (22.3), you get that
arma p q ; y const x1 x2
177
Seasonal models
A more flexible lag structure is desirable when analyzing time series that display strong seasonal
patterns. Model (22.1) can be expanded to
(L)(Ls )yt = (L)(Ls )t .
(22.7)
where p and q represent the non-seasonal AR and MA orders, and P and Q the seasonal orders. For
example,
arma 1 1 ; 1 1 ; y
Both forms above specify an ARMA model in which AR lags 1 and 4 are used (but not 2 and 3).
This facility is available only for the non-seasonal component of the ARMA specification.
Differencing and ARIMA
The above discussion presupposes that the time series yt has already been subjected to all the
transformations deemed necessary for ensuring stationarity (see also section 22.3). Differencing is
the most common of these transformations, and gretl provides a mechanism to include this step
into the arma command: the syntax
arma p d q ; y
178
series tmp = y
loop for i=1..d
tmp = diff(tmp)
endloop
arma p q ; tmp
where we use the sdiff function to create a seasonal difference (e.g. for quarterly data, yt yt4 ).
In specifying an ARIMA model with exogenous regressors we face a choice which relates back to the
discussion of the variant models (22.2) and (22.3) above. If we choose model (22.2), the regression
model with ARMA errors, how should this be extended to the case of ARIMA? The issue is whether
or not the differencing that is applied to the dependent variable should also be applied to the
regressors. Consider the simplest case, ARIMA with non-seasonal differencing of order 1. We may
estimate either
(L)(1 L)(yt Xt ) = (L)t
(22.8)
or
(L) (1 L)yt Xt = (L)t
(22.9)
The first of these formulations can be described as a regression model with ARIMA errors, while the
second preserves the levels of the X variables. As of gretl version 1.8.6, the default model is (22.8),
in which differencing is applied to both yt and Xt . However, when using the default estimation
method (native exact ML, see below), the option --y-diff-only may be given, in which case gretl
estimates (22.9).1
Estimation
The default estimation method for ARMA models is exact maximum likelihood estimation (under
the assumption that the error term is normally distributed), using the Kalman filter in conjunction with the BFGS maximization algorithm. The gradient of the log-likelihood with respect to the
parameter estimates is approximated numerically. This method produces results that are directly
comparable with many other software packages. The constant, and any exogenous variables, are
treated as in equation (22.2). The covariance matrix for the parameters is computed using a numerical approximation to the Hessian at convergence.
The alternative method, invoked with the --conditional switch, is conditional maximum likelihood (CML), also known as conditional sum of squares (see Hamilton, 1994, p. 132). This method
was exemplified in the script 9.3, and only a brief description will be given here. Given a sample of
size T , the CML method minimizes the sum of squared one-step-ahead prediction errors generated
1 Prior
to gretl 1.8.6, the default model was (22.9). We changed this for the sake of consistency with other software.
179
by the model for the observations t0 , . . . , T . The starting point t0 depends on the orders of the AR
polynomials in the model. The numerical maximization method used is BHHH, and the covariance
matrix is computed using a GaussNewton regression.
The CML method is nearly equivalent to maximum likelihood under the hypothesis of normality;
the difference is that the first (t0 1) observations are considered fixed and only enter the likelihood function as conditioning variables. As a consequence, the two methods are asymptotically
equivalent under standard conditions except for the fact, discussed above, that our CML implementation treats the constant and exogenous variables as per equation (22.3).
The two methods can be compared as in the following example
open data10-1
arma 1 1 ; r
arma 1 1 ; r --conditional
which produces the estimates shown in Table 22.1. As you can see, the estimates of and are
quite similar. The reported constants differ widely, as expected see the discussion following
equations (22.4) and (22.5). However, dividing the CML constant by 1 we get 7.38, which is not
far from the ML estimate of 6.93.
Table 22.1: ML and CML estimates
Parameter
ML
CML
6.93042
(0.923882)
1.07322
(0.488661)
0.855360
(0.0511842)
0.852772
(0.0450252)
0.588056
(0.0986096)
0.591838
(0.0456662)
180
The specified matrix should have just as many parameters as the model: in the example above
there are three parameters, since the model implicitly includes a constant. The constant, if present,
is always given first; otherwise the order in which the parameters are expected is the same as the
order of specification in the arma or arima command. In the example the constant is set to zero,
1 to 0.85, and 1 to 0.34.
You can get gretl to revert to automatic initialization via the command set initvals auto.
Two variants of the BFGS algorithm are available in gretl. In general we recommend the default variant, which is based on an implementation by Nash (1990), but for some problems the alternative,
limited-memory version (L-BFGS-B, see Byrd et al., 1995) may increase the chances of convergence
on the ML solution. This can be selected via the --lbfgs option to the arma command.
Estimation via X-12-ARIMA
As an alternative to estimating ARMA models using native code, gretl offers the option of using
the external program X-12-ARIMA. This is the seasonal adjustment software produced and maintained by the U.S. Census Bureau; it is used for all official seasonal adjustments at the Bureau.
Gretl includes a module which interfaces with X-12-ARIMA: it translates arma commands using the
syntax outlined above into a form recognized by X-12-ARIMA, executes the program, and retrieves
the results for viewing and further analysis within gretl. To use this facility you have to install
X-12-ARIMA separately. Packages for both MS Windows and GNU/Linux are available from the gretl
website,.
To invoke X-12-ARIMA as the estimation engine, append the flag --x-12-arima, as in
arma p q ; y --x-12-arima
As with native estimation, the default is to use exact ML but there is the option of using conditional
ML with the --conditional flag. However, please note that when X-12-ARIMA is used in conditional
ML mode, the comments above regarding the variant treatments of the mean of the process yt do
not apply. That is, when you use X-12-ARIMA the model that is estimated is (22.2), regardless
of whether estimation is by exact ML or conditional ML. In addition, the treatment of exogenous
regressors in the context of ARIMA differencing is always that shown in equation (22.8).
Forecasting
ARMA models are often used for forecasting purposes. The autoregressive component, in particular, offers the possibility of forecasting a process out of sample over a substantial time horizon.
Gretl supports forecasting on the basis of ARMA models using the method set out by Box and
Jenkins (1976).2 The Box and Jenkins algorithm produces a set of integrated AR coefficients which
take into account any differencing of the dependent variable (seasonal and/or non-seasonal) in the
ARIMA context, thus making it possible to generate a forecast for the level of the original variable.
By contrast, if you first difference a series manually and then apply ARMA to the differenced series,
forecasts will be for the differenced series, not the level. This point is illustrated in Example 22.1.
The parameter estimates are identical for the two models. The forecasts differ but are mutually
consistent: the variable fcdiff emulates the ARMA forecast (static, one step ahead within the
sample range, and dynamic out of sample).
2 See
181
open greene18_2.gdt
# log of quarterly U.S. nominal GNP, 1950:1 to 1983:4
genr y = log(Y)
# and its first difference
genr dy = diff(y)
# reserve 2 years for out-of-sample forecast
smpl ; 1981:4
# Estimate using ARIMA
arima 1 1 1 ; y
# forecast over full period
smpl --full
fcast fc1
# Return to sub-sample and run ARMA on the first difference of y
smpl ; 1981:4
arma 1 1 ; dy
smpl --full
fcast fc2
genr fcdiff = (t<=1982:1)? (fc1 - y(-1)) : (fc1 - fc1(-1))
# compare the forecasts over the later period
smpl 1981:1 1983:4
print y fc1 fc2 fcdiff --byobs
y
7.964086
7.978654
8.009463
8.015625
8.014997
8.026562
8.032717
8.042249
8.062685
8.091627
8.115700
8.140811
fc1
7.940930
7.997576
7.997503
8.033695
8.029698
8.046037
8.063636
8.081935
8.100623
8.119528
8.138554
8.157646
fc2
0.02668
0.03349
0.01885
0.02423
0.01407
0.01634
0.01760
0.01830
0.01869
0.01891
0.01903
0.01909
fcdiff
0.02668
0.03349
0.01885
0.02423
0.01407
0.01634
0.01760
0.01830
0.01869
0.01891
0.01903
0.01909
22.3
182
This test statistic is probably the best-known and most widely used unit root test. It is a one-sided
test whose null hypothesis is = 0 versus the alternative < 0 (and hence large negative values
of the test statistic lead to the rejection of the null). Under the null, yt must be differenced at least
once to achieve stationarity; under the alternative, yt is already stationary and no differencing is
required.
One peculiar aspect of this test is that its limit distribution is non-standard under the null hypothesis: moreover, the shape of the distribution, and consequently the critical values for the test,
depends on the form of the t term. A full analysis of the various cases is inappropriate here:
Hamilton (1994) contains an excellent discussion, but any recent time series textbook covers this
topic. Suffice it to say that gretl allows the user to choose the specification for t among four
different alternatives:
t
command option
--nc
--c
0 + 1 t
0 + 1 t + 1 t
--ct
2
--ctt
These option flags are not mutually exclusive; when they are used together the statistic will be
reported separately for each selected case. By default, gretl uses the combination --c --ct. For
each case, approximate p-values are calculated by means of the algorithm developed in MacKinnon
(1996).
The gretl command used to perform the test is adf; for example
adf 4 x1
would compute the test statistic as the t-statistic for in equation 22.10 with p = 4 in the two
cases t = 0 and t = 0 + 1 t.
The number of lags (p in equation 22.10) should be chosen as to ensure that (22.10) is a parametrization flexible enough to represent adequately the short-run persistence of yt . Setting p
too low results in size distortions in the test, whereas setting p too high leads to low power. As
a convenience to the user, the parameter p can be automatically determined. Setting p to a negative number triggers a sequential procedure that starts with p lags and decrements p until the
t-statistic for the parameter p exceeds 1.645 in absolute value.
The ADF-GLS test
Elliott, Rothenberg and Stock (1996) proposed a variant of the ADF test which involves an alternative method of handling the parameters pertaining to the deterministic term t : these are estimated
first via Generalized Least Squares, and in a second stage an ADF regression is performed using the
GLS residuals. This variant offers greater power than the regular ADF test for the cases t = 0 and
t = 0 + 1 t.
The ADF-GLS test is available in gretl via the --gls option to the adf command. When this option
is selected the --nc and --ctt options become unavailable, and only one case can be selected at
183
a time; by default the constant-only model is used but a trend can be added using the --ct flag.
When a trend is present in this test MacKinnon-type p-values are not available; instead we show
critical values from Table 1 in Elliott et al. (1996).
The KPSS test
The KPSS test (Kwiatkowski, Phillips, Schmidt and Shin, 1992) is a unit root test in which the null
hypothesis is opposite to that in the ADF test: under the null, the series in question is stationary;
the alternative is that the series is I(1).
The basic intuition behind this test statistic is very simple: if yt can be written as yt = + ut ,
where ut is some zero-mean stationary process, then not only does the sample average of the yt s
provide a consistent estimator of , but the long-run variance of ut is a well-defined, finite number.
Neither of these properties hold under the alternative.
The test itself is based on the following statistic:
PT
=
2
i=1 St
2
T 2
(22.11)
Pt
2 is an estimate of the long-run variance of et = (yt y).
Under the null,
where St = s=1 es and
this statistic has a well-defined (nonstandard) asymptotic distribution, which is free of nuisance
parameters and has been tabulated by simulation. Under the alternative, the statistic diverges.
As a consequence, it is possible to construct a one-sided test based on , where H0 is rejected if
is bigger than the appropriate critical value; gretl provides the 90, 95 and 99 percent quantiles.
The critical values are computed via the method presented by Sephton (1995), which offers greater
accuracy than the values tabulated in Kwiatkowski et al. (1992).
Usage example:
kpss m y
where m is an integer representing the bandwidth or window size used in the formula for estimating
the long run variance:
m
X
|i|
2 =
i
m+1
i=m
i terms denote the empirical autocovariances of et from order m through m. For this
The
estimator to be consistent, m must be large enough to accommodate the short-run persistence of
et , but not too large compared to the sample size T . If the supplied m is non-positive a default value
1/4
T
is computed, namely the integer part of 4 100
.
The above concept can be generalized to the case where yt is thought to be stationary around a
deterministic trend. In this case, formula (22.11) remains unchanged, but the series et is defined as
the residuals from an OLS regression of yt on a constant and a linear trend. This second form of
the test is obtained by appending the --trend option to the kpss command:
kpss n y --trend
Note that in this case the asymptotic distribution of the test is different and the critical values
reported by gretl differ accordingly.
Panel unit root tests
The most commonly used unit root tests for panel data involve a generalization of the ADF procedure, in which the joint null hypothesis is that a given times series is non-stationary for all
individuals in the panel.
184
yit = it + i yi,t1 +
pi
X
ij yi,tj + it
(22.12)
j=1
The model (22.12) allows for maximal heterogeneity across the individuals in the panel: the parameters of the deterministic term, the autoregressive coefficient , and the lag order p are all
specific to the individual, indexed by i.
One possible modification of this model is to impose the assumption that i = for all i; that is,
the individual time series share a common autoregressive root (although they may differ in respect
of other statistical properties). The choice of whether or not to impose this assumption has an
important bearing on the hypotheses under test. Under model (22.12) the joint null is i = 0 for
all i, meaning that all the individual time series are non-stationary, and the alternative (simply the
negation of the null) is that at least one individual time series is stationary. When a common is
assumed, the null is that = 0 and the alternative is that < 0. The null still says that all the
individual series are non-stationary, but the alternative now says that they are all stationary. The
choice of model should take this point into account, as well as the gain in power from forming a
pooled estimate of and, of course, the plausibility of assuming a common AR(1) coefficient.3
In gretl, the formulation (22.12) is used automatically when the adf command is used on panel
data. The joint test statistic is formed using the method of Im, Pesaran and Shin (2003). In this
context the behavior of adf differs from regular time-series data: only one case of the deterministic
term is handled per invocation of the command; the default is that it includes just a constant but
the --nc and --ct flags can be used to suppress the constant or to include a trend, respectively;
and the quadratic trend option --ctt is not available.
The alternative that imposes a common value of is implemented via the levinlin command.
The test statistic is computed as per Levin, Lin and Chu (2002). As with the adf command, the first
argument is the lag order and the second is the name of the series to test; and the default case for
the deterministic component is a constant only. The options --nc and --ct have the same effect
as with adf. One refinement is that the lag order may be given in either of two forms: if a scalar
is given, this is taken to represent a common value of p for all individuals, but you may instead
provide a vector holding a set of pi values, hence allowing the order of autocorrelation of the series
to differ by individual. So, for example, given
levinlin 2 y
levinlin {2,2,3,3,4,4} y
the first command runs a joint ADF test with a common lag order of 2, while the second (which
assumes a panel with six individuals) allows for differing short-run dynamics. The first argument
to levinlin can be given as a set of comma-separated integers enclosed in braces, as shown above,
or as the name of an appropriately dimensioned pre-defined matrix (see chapter 13).
Besides variants of the ADF test, the KPSS test also can be used with panel data via the kpss
command. In this case the test (of the null hypothesis that the given time series is stationary for
all individuals) is implemented using the method of Choi (2001). This is an application of metaanalysis, the statistical technique whereby an overall or composite p-value for the test of a given
null hypothesis can be computed from the p-values of a set of separate tests. Unfortunately, in
the case of the KPSS test we are limited by the unavailability of precise p-values, although if an
individual test statistic falls between the 10 percent and 1 percent critical values we are able to
interpolate with a fair degree of confidence. This gives rise to four cases.
1. All the individual KPSS test statistics fall between the 10 percent and 1 percent critical values:
the Choi method gives us a plausible composite p-value.
3 If the assumption of a common seems excessively restrictive, bear in mind that we routinely assume common slope
coefficients when estimating panel models, even if this is unlikely to be literally true.
185
2. Some of the KPSS test statistics exceed the 1 percent value and none fall short of the 10
percent value: we can give an upper bound for the composite p-value by setting the unknown
p-values to 0.01.
3. Some of the KPSS test statistics fall short of the 10 percent critical value but none exceed the
1 percent value: we can give a lower bound to the composite p-value by setting the unknown
p-values to 0.10.
4. None of the above conditions are satisfied: the Choi method fails to produce any result for
the composite KPSS test.
22.4
Cointegration tests
The generally recommended test for cointegration is the Johansen test, which is discussed in detail
in chapter 24. In this context we offer a few remarks on the cointegration test of Engle and Granger
(1987), which builds on the ADF test discussed above (section 22.3).
For the EngleGranger test, the procedure is:
1. Test each series for a unit root using an ADF test.
2. Run a cointegrating regression via OLS. For this we select one of the potentially cointegrated
variables as dependent, and include the other potentially cointegrated variables as regressors.
3. Perform an ADF test on the residuals from the cointegrating regression.
The idea is that cointegration is supported if (a) the null of non-stationarity is not rejected for each
of the series individually, in step 1, while (b) the null is rejected for the residuals at step 3. That is,
each of the individual series is I(1) but some linear combination of the series is I(0).
This test is implemented in gretl by the coint command, which requires an integer lag order
(for the ADF tests) followed by a list of variables to be tested, the first of which will be taken
as dependent in the cointegrating regression. Please see the online help for coint, or the Gretl
Command Reference, for further details.
22.5
Heteroskedasticity means a non-constant variance of the error term in a regression model. Autoregressive Conditional Heteroskedasticity (ARCH) is a phenomenon specific to time series models,
whereby the variance of the error displays autoregressive behavior; for instance, the time series exhibits successive periods where the error variance is relatively large, and successive periods where
it is relatively small. This sort of behavior is reckoned to be quite common in asset markets: an
unsettling piece of news can lead to a period of increased volatility in the market.
An ARCH error process of order q can be represented as
ut = t t ;
t2 E(u2t |t1 ) = 0 +
q
X
i u2ti
i=1
where the t s are independently and identically distributed (iid) with mean zero and variance 1,
and where t is taken to be the positive square root of t2 . t1 denotes the information set as of
time t 1 and t2 is the conditional variance: that is, the variance conditional on information dated
t 1 and earlier.
It is important to notice the difference between ARCH and an ordinary autoregressive error process.
The simplest (first-order) case of the latter can be written as
ut = ut1 + t ;
1 < < 1
186
where the t s are independently and identically distributed with mean zero and variance 2 . With
an AR(1) error, if is positive then a positive value of ut will tend to be followed, with probability
greater than 0.5, by a positive ut+1 . With an ARCH error process, a disturbance ut of large absolute
value will tend to be followed by further large absolute values, but with no presumption that the
successive values will be of the same sign. ARCH in asset prices is a stylized fact and is consistent
with market efficiency; on the other hand autoregressive behavior of asset prices would violate
market efficiency.
One can test for ARCH of order q in the following way:
2t .
1. Estimate the model of interest via OLS and save the squared residuals, u
2. Perform an auxiliary regression in which the current squared residual is regressed on a constant and q lags of itself.
3. Find the T R 2 value (sample size times unadjusted R 2 ) for the auxiliary regression.
4. Refer the T R 2 value to the 2 distribution with q degrees of freedom, and if the p-value is
small enough reject the null hypothesis of homoskedasticity in favor of the alternative of
ARCH(q).
This test is implemented in gretl via the modtest command with the --arch option, which must
follow estimation of a time-series model by OLS (either a single-equation model or a VAR). For
example,
ols y 0 x
modtest 4 --arch
This example specifies an ARCH order of q = 4; if the order argument is omitted, q is set equal to
the periodicity of the data. In the graphical interface, the ARCH test is accessible from the Tests
menu in the model window (again, for single-equation OLS or VARs).
GARCH
The simple ARCH(q) process is useful for introducing the general concept of conditional heteroskedasticity in time series, but it has been found to be insufficient in empirical work. The
dynamics of the error variance permitted by ARCH(q) are not rich enough to represent the patterns
found in financial data. The generalized ARCH or GARCH model is now more widely used.
The representation of the variance of a process in the GARCH model is somewhat (but not exactly)
analogous to the ARMA representation of the level of a time series. The variance at time t is allowed
to depend on both past values of the variance and past values of the realized squared disturbance,
as shown in the following system of equations:
yt
Xt + ut
ut
t t
(22.14)
p
t2
0 +
(22.13)
X
i=1
i u2ti +
2
j tj
(22.15)
j=1
As above, t is an iid sequence with unit variance. Xt is a matrix of regressors (or in the simplest
case, just a vector of 1s allowing for a non-zero mean of yt ). Note that if p = 0, GARCH collapses
to ARCH(q): the generalization is embodied in the j terms that multiply previous values of the
error variance.
In principle the underlying innovation, t , could follow any suitable probability distribution, and
besides the obvious candidate of the normal or Gaussian distribution the Students t distribution
has been used in this context. Currently gretl only handles the case where t is assumed to be
187
Gaussian. However, when the --robust option to the garch command is given, the estimator gretl
uses for the covariance matrix can be considered Quasi-Maximum Likelihood even with non-normal
disturbances. See below for more on the options regarding the GARCH covariance matrix.
Example:
garch p q ; y const x
where p 0 and q > 0 denote the respective lag orders as shown in equation (22.15). These values
can be supplied in numerical form or as the names of pre-defined scalar variables.
GARCH estimation
Estimation of the parameters of a GARCH model is by no means a straightforward task. (Consider
equation 22.15: the conditional variance at any point in time, t2 , depends on the conditional
variance in earlier periods, but t2 is not observed, and must be inferred by some sort of Maximum
Likelihood procedure.) By default gretl uses native code that employs the BFGS maximizer; you
also have the option (activated by the --fcp command-line switch) of using the method proposed
by Fiorentini et al. (1996),4 which was adopted as a benchmark in the study of GARCH results
by McCullough and Renfro (1998). It employs analytical first and second derivatives of the loglikelihood, and uses a mixed-gradient algorithm, exploiting the information matrix in the early
iterations and then switching to the Hessian in the neighborhood of the maximum likelihood. (This
progress can be observed if you append the --verbose option to gretls garch command.)
Several options are available for computing the covariance matrix of the parameter estimates in
connection with the garch command. At a first level, one can choose between a standard and a
robust estimator. By default, the Hessian is used unless the --robust option is given, in which
case the QML estimator is used. A finer choice is available via the set command, as shown in
Table 22.2.
Table 22.2: Options for the GARCH covariance matrix
command
effect
set garch_vcv im
set garch_vcv op
QML estimator
set garch_vcv bw
It is not uncommon, when one estimates a GARCH model for an arbitrary time series, to find that
the iterative calculation of the estimates fails to converge. For the GARCH model to make sense,
there are strong restrictions on the admissible parameter values, and it is not always the case
that there exists a set of values inside the admissible parameter space for which the likelihood is
maximized.
The restrictions in question can be explained by reference to the simplest (and much the most
common) instance of the GARCH model, where p = q = 1. In the GARCH(1, 1) model the conditional
variance is
2
(22.16)
t2 = 0 + 1 u2t1 + 1 t1
Taking the unconditional expectation of (22.16) we get
2 = 0 + 1 2 + 1 2
4 The algorithm is based on Fortran code deposited in the archive of the Journal of Applied Econometrics by the authors,
and is used by kind permission of Professor Fiorentini.
188
0
1 1 1
For this unconditional variance to exist, we require that 1 + 1 < 1, and for it to be positive we
require that 0 > 0.
A common reason for non-convergence of GARCH estimates (that is, a common reason for the nonexistence of i and i values that satisfy the above requirements and at the same time maximize
the likelihood of the data) is misspecification of the model. It is important to realize that GARCH, in
itself, allows only for time-varying volatility in the data. If the mean of the series in question is not
constant, or if the error process is not only heteroskedastic but also autoregressive, it is necessary
to take this into account when formulating an appropriate model. For example, it may be necessary
to take the first difference of the variable in question and/or to add suitable regressors, Xt , as in
(22.13).
Chapter 23
23.1
Notation
A VAR is a structure whose aim is to model the time persistence of a vector of n time series, yt ,
via a multivariate autoregression, as in
yt = A1 yt1 + A2 yt2 + + Ap ytp + Bxt + t
(23.1)
The number of lags p is called the order of the VAR. The vector xt , if present, contains a set of
exogenous variables, often including a constant, possibly with a time trend and seasonal dummies.
The vector t is typically assumed to be a vector white noise, with covariance matrix .
Equation (23.1) can be written more compactly as
A(L)yt = Bxt + t
(23.2)
yt
yt1
ytp1
yt1
= A yt2
ytp
0
+
0
t
xt + 0
(23.3)
A1
A2
A= 0
..
.
I
..
.
..
.
Ap
..
.
yt
ti
(23.4)
The i matrices may be derived by recursive substitution in equation (23.1): for example, assuming
for simplicity that B = 0 and p = 1, equation (23.1) would become
yt = Ayt1 + t
189
190
X
yt E(yt ) =
i ti
(23.5)
i=0
23.2
Estimation
The gretl command for estimating a VAR is var which, in the command line interface, is invoked
in the following manner:
[ modelname <- ] var p Ylist [; Xlist]
where p is a scalar (the VAR order) and Ylist is a list of variables describing the content of yt . If
the list Xlist is absent, the vector xt is understood to contain a constant only; if present, must be
separated from Ylist by a semi-colon and contains the other exogenous variables. Note, however,
that a few common choices can be obtained in a simpler way via options: the options gretl provides
are --trend, --seasonals and --nc (no constant). Either Ylist and Xlist may be named lists
(see section 12.1). The <- construct can be used to store the model under a name (see section
3.2), if so desired. To estimate a VAR using the graphical interface, choose Time Series, Vector
Autoregression, under the Model menu.
The parameters in eq. (23.1) are typically free from restrictions, which implies that multivariate
OLS provides a consistent and asymptotically efficient estimator of all the parameters.1 Given
the simplicity of OLS, this is what every software package, including gretl, uses: example script
23.1 exemplifies the fact that the var command gives you exactly the output you would have
from a battery of OLS regressions. The advantage of using the dedicated command is that, after
estimation is done, it makes it much easier to access certain quantities and manage certain tasks.
For example, the $coeff accessor returns the estimated coefficients as a matrix with n columns
and $sigma returns an estimate of the matrix , the covariance matrix of t .
Moreover, for each variable in the system an F test is automatically performed, in which the null hypothesis is that no lags of variable j are significant in the equation for variable i. This is commonly
known as a Granger causality test.
In addition, two accessors become available for the companion matrix ($compan) and the VMA representation ($vma). The latter deserves a detailed description: since the VMA representation (23.5)
is of infinite order, gretl defines a horizon up to which the i matrices are computed automatically.
By default, this is a function of the periodicity of the data (see table 23.1), but it can be set by the
user to any desired value via the set command with the horizon parameter, as in
1 In fact, under normality of OLS is indeed the conditional ML estimator. You may want to use other methods if you
t
need to estimate a VAR in which some parameters are constrained.
191
Input:
open sw_ch14.gdt
genr infl = 400*sdiff(log(PUNEW))
scalar p = 2
list X = LHUR infl
list Xlag = lags(p,X)
loop foreach i X
ols $i const Xlag
end loop
var p X
6.019198
8.654176
1.502549
0.237830
...
6.019198
8.654176
1.502549
0.237830
192
Periodicity
Quarterly
Monthly
Daily
All other cases
horizon
20 (5 years)
24 (2 years)
3 weeks
10
set horizon 30
Calling the horizon h, the $vma accessor returns an (h + 1) n2 matrix, in which the (i + 1)-th row
is the vectorized form of i .
VAR order selection
In order to help the user choose the most appropriate VAR order, gretl provides a special syntax
construct to the var command:
var p Ylist [; Xlist] --lagselect
When the command is invoked with the --lagselect option, estimation is performed for all lags
up to p and a table is printed: it displays, for each order, a LR test for the order p versus p 1,
plus an array of information criteria (see chapter 21). For each information criterion in the table, a
star indicates what appears to be the best choice. The same output can be obtained through the
graphical interface via the Time Series, VAR lag selection entry under the Model menu.
Warning: in finite samples the choice of p may affect the outcome of the procedure. This is not a
bug, but rather a nasty but unavoidable side effect of the way these comparisons should be made:
if your sample contains T observations, the lag selection procedure, if invoked with parameter p,
examines all VARs of order ranging form 1 to p, estimated on a sample of T p observations. In
other words, the comparison procedure does not use all the data available when estimating VARs
of order less than p to make sure that all the models compared are estimated on the same data
range. Under these circumstances, choosing a different value of p may alter the results, although
this is unlikely to happen if your sample size is reasonably large.
An example of this unpleasant phenomenon is given in example script 23.2. As can be seen, according to the Hannan-Quinn criterion, order 2 seems preferable to order 1 if the maximum tested
order is 4, but the situation is reversed if the maximum tested order is 6.
23.3
Structural VARs
As of today, gretl does not provide a native implementation for the class of models known as
Structural VARs; however, it provides an implementation of the Cholesky deconposition-based
approach, which is the most classic, and certainly most popular SVAR version.
IRF and FEVD
Assume that the disturbance in equation (23.1) can be thought of as a linear function of a vector
of structural shocks ut , which are assumed to have unit variance and to be incorrelated to one
another, so V (ut ) = I. If t = Kut , it follows that = V (t ) = KK 0 .
The main object of interest in this setting the sequence of matrices
Ck =
yt
= k K,
uti
(23.6)
193
Input:
open denmark
list Y = 1 2 3 4
var 4 Y --lagselect
var 6 Y --lagselect
loglik
p(LR)
1
2
3
4
609.15315
631.70153
642.38574
653.22564
0.00013
0.16478
0.15383
AIC
-23.104045
-23.360844*
-23.152382
-22.950025
BIC
-22.346466*
-21.997203
-21.182677
-20.374257
HQC
-22.814552
-22.839757*
-22.399699
-21.965748
loglik
p(LR)
1
2
3
4
5
6
594.38410
615.43480
624.97613
636.03766
658.36014
669.88472
0.00038
0.26440
0.13926
0.00016
0.11243
AIC
-23.444249
-23.650400*
-23.386781
-23.185210
-23.443271
-23.260601
BIC
-22.672078*
-22.260491
-21.379135
-20.559827
-20.200150
-19.399743
HQC
-23.151288*
-23.123070
-22.625083
-22.189144
-22.212836
-21.795797
194
known as the structural VMA representation. From the Ck matrices defined in equation (23.6) two
quantities of interest may be derived: the Impulse Response Function (IRF) and the Forecast Error
Variance Decomposition (FEVD).
The IRF of variable i to shock j is simply the sequence of the elements in row i and column j of
the Ck matrices. In formulae:
yi,t
Ii,j,k =
uj,tk
As a rule, Impulse Response Functions are plotted as a function of k, and are interpreted as the
effect that a shock has on an observable variable through time. Of course, what we observe are the
estimated IRFs, so it is natural to endow them with confidence intervals: following common practice
among econometric software, gretl computes the confidence intervals by using the bootstrap2 ;
details are later in this section.
Another quantity of interest that may be computed from the structural VMA representation is the
Forecast Error Variance Decomposition (FEVD). The forecast error variance after h steps is given by
h =
h
X
Ck Ck0
k=0
h
X
diag(Ck Ck0 )i =
k=0
h X
n
X
(k ci.l )2
k=0 l=1
where k ci.l is, trivially, the i, l element of Ck . As a consequence, the share of uncertainty on variable
i that can be attributed to the j-th shock after h periods equals
Ph
2
k=0 (k ci.j )
.
Pn
2
k=0
l=1 (k ci.l )
V Di,j,h = Ph
This makes it possible to quantify which shocks are most important to determine a certain variable
in the short and/or in the long run.
Triangularization
The formula 23.6 takes K as known, while of course it has to be estimated. The estimation problem
has been the subject of an enormous body of literature we will not even attempt to summarize
here: see for example (Ltkepohl, 2005, chapter 9).
Suffice it to say that the most popular choice dates back to Sims (1980), and consists in assuming
that K is lower triangular, so its estimate is simply the Cholesky deconposition of the estimate of .
The main consequence of this choice is that the ordering of variables within the vector yt becomes
meaningful: since K is also the matrix of Impulse Response Functions at lag 0, the triangularity
assumption means that the first variable in the ordering responds instantaneously only to shock
number 1, the second one only to shocks 1 and 2, and so forth. For this reason, each variable is
thought to own one shock: variable 1 owns shock number 1, etcetera.
This is the reason why in this sort of exercises the ordering of the variables is important and
the applied literature has developed the most exogenous first mantra. Where, in this setting,
exogenous really means instantaneously insensitive to structural shocks3 . To put it differently,
2 It is possible, in principle, to compute analytical confidence intervals via an asymptotic approximation, but this is
not a very popular choice: asymptotic formulae are known to often give a very poor approximation of the finite-sample
properties.
3 The word exogenous has caught on in this context, but its a rather unfortunate choice: for a start, each shock
impacts on every variable after one lag, so nothing is really exogenous here. A much better choice of words would
probably have been something like sturdy, but its too late now.
195
if variable foo comes before variable bar in the Y list, it follows that the shock owned by foo
affects bar instantaneously, but the reverse does not happen.
Impulse Response Functions and the FEVD can be printed out via the command line interface by using the --impulse-response and --variance-decomp options, respectively. If you need to store
them into matrices, you can compute the structural VMA and proceed from there. For example, the
following code snippet shows you how to compute a matrix containing the IRFs:
open denmark
list Y = 1 2 3 4
scalar n = nelem(Y)
var 2 Y --quiet --impulse
matrix K = cholesky($sigma)
matrix V = $vma
matrix IRF = V * (K ** I(n))
print IRF
Chapter 24
Introduction
The twin concepts of cointegration and error correction have drawn a good deal of attention in
macroeconometrics over recent years. The attraction of the Vector Error Correction Model (VECM)
is that it allows the researcher to embed a representation of economic equilibrium relationships
within a relatively rich time-series specification. This approach overcomes the old dichotomy between (a) structural models that faithfully represented macroeconomic theory but failed to fit the
data, and (b) time-series models that were accurately tailored to the data but difficult if not impossible to interpret in economic terms.
The basic idea of cointegration relates closely to the concept of unit roots (see section 22.3). Suppose we have a set of macroeconomic variables of interest, and we find we cannot reject the hypothesis that some of these variables, considered individually, are non-stationary. Specifically, suppose
we judge that a subset of the variables are individually integrated of order 1, or I(1). That is, while
they are non-stationary in their levels, their first differences are stationary. Given the statistical
problems associated with the analysis of non-stationary data (for example, the threat of spurious
regression), the traditional approach in this case was to take first differences of all the variables
before proceeding with the analysis.
But this can result in the loss of important information. It may be that while the variables in
question are I(1) when taken individually, there exists a linear combination of the variables that
is stationary without differencing, or I(0). (There could be more than one such linear combination.) That is, while the ensemble of variables may be free to wander over time, nonetheless the
variables are tied together in certain ways. And it may be possible to interpret these ties, or
cointegrating vectors, as representing equilibrium conditions.
For example, suppose we find some or all of the following variables are I(1): money stock, M, the
price level, P , the nominal interest rate, R, and output, Y . According to standard theories of the
demand for money, we would nonetheless expect there to be an equilibrium relationship between
real balances, interest rate and output; for example
m p = 0 + 1 y + 2 r
1 > 0, 2 < 0
197
24.2
Consider a VAR of order p with a deterministic part given by t (typically, a polynomial in time).
One can write the n-variate process yt as
yt = t + A1 yt1 + A2 yt2 + + Ap ytp + t
(24.1)
But since yti yt1 (yt1 + yt2 + + yti+1 ), we can re-write the above as
p1
yt = t + yt1 +
i yti + t ,
(24.2)
i=1
where =
Pp
i=1
Ai I and i =
Pp
j=i+1
yt = t + 0 yt1 +
i yti + t .
(24.3)
i=1
If were known, then zt would be observable and all the remaining parameters could be
estimated via OLS. In practice, the procedure estimates first and then the rest.
The rank of is investigated by computing the eigenvalues of a closely related matrix whose rank
is the same as : however, this matrix is by construction symmetric and positive semidefinite. As a
consequence, all its eigenvalues are real and non-negative, and tests on the rank of can therefore
be carried out by testing how many eigenvalues are 0.
If all the eigenvalues are significantly different from 0, then all the processes are stationary. If,
on the contrary, there is at least one zero eigenvalue, then the yt process is integrated, although
some linear combination 0 yt might be stationary. At the other extreme, if no eigenvalues are
significantly different from 0, then not only is the process yt non-stationary, but the same holds
for any linear combination 0 yt ; in other words, no cointegration occurs.
Estimation typically proceeds in two stages: first, a sequence of tests is run to determine r , the
cointegration rank. Then, for a given rank the parameters in equation (24.3) are estimated. The two
commands that gretl offers for estimating these systems are coint2 and vecm, respectively.
The syntax for coint2 is
198
where p is the number of lags in (24.1); ylist is a list containing the yt variables; xlist is an
optional list of exogenous variables; and zlist is another optional list of exogenous variables
whose effects are assumed to be confined to the cointegrating relationships.
The syntax for vecm is
vecm p r ylist [ ; xlist [ ; zlist ] ]
where p is the number of lags in (24.1); r is the cointegration rank; and the lists ylist, xlist and
zlist have the same interpretation as in coint2.
Both commands can be given specific options to handle the treatment of the deterministic component t . These are discussed in the following section.
24.3
Statistical inference in the context of a cointegrated system depends on the hypotheses one is
willing to make on the deterministic terms, which leads to the famous five cases.
In equation (24.2), the term t is usually understood to take the form
t = 0 + 1 t.
In order to have the model mimic as closely as possible the features of the observed data, there is a
preliminary question to settle. Do the data appear to follow a deterministic trend? If so, is it linear
or quadratic?
Once this is established, one should impose restrictions on 0 and 1 that are consistent with this
judgement. For example, suppose that the data do not exhibit a discernible trend. This means that
yt is on average zero, so it is reasonable to assume that its expected value is also zero. Write
equation (24.2) as
(L)yt = 0 + 1 t + zt1 + t ,
(24.4)
where zt = 0 yt is assumed to be stationary and therefore to possess finite moments. Taking
unconditional expectations, we get
0 = 0 + 1 t + mz .
Since the left-hand side does not depend on t, the restriction 1 = 0 is a safe bet. As for 0 , there are
just two ways to make the above expression true: either 0 = 0 with mz = 0, or 0 equals mz .
The latter possibility is less restrictive in that the vector 0 may be non-zero, but is constrained to
be a linear combination of the columns of . In that case, 0 can be written as c, and one may
write (24.4) as
#
"
0
yt1
(L)yt = c
+ t .
1
The long-run relationship therefore contains an intercept. This type of restriction is usually written
0
0 = 0,
199
"
=
"
k+m
#
+
m
"
0 +
"
+
xt
=
k+m
#"
0
"
#
1 h
yt1
xt1
"
+
xt1
0
#
yt1
"
yt1
ut + t
t
# "
xt1
#
=
ut + t
+ t = 0 + zt1 + t ,
which is not null and therefore the VECM shown above does have a constant term. The
constant, however, is subject to the restriction that its second element must be 0. More
generally, 0 is a multiple of the vector . Note that the VECM could also be written as
#
# "
#
"
"
yt1
h
i
1
u t + t
yt
1 1 k xt1 +
=
t
xt
0
1
which incorporates the intercept into the cointegration vector. This is known as the restricted
constant case.
3. m = 0 and k = 0: This case is the most restrictive: clearly, neither xt nor yt are trended, and
the mean distance between them is zero. The vector 0 is also 0, which explains why this case
is referred to as no constant.
In most cases, the choice between these three possibilities is based on a mix of empirical observation and economic reasoning. If the variables under consideration seem to follow a linear trend
200
then we should not place any restriction on the intercept. Otherwise, the question arises of whether
it makes sense to specify a cointegration relationship which includes a non-zero intercept. One example where this is appropriate is the relationship between two interest rates: generally these are
not trended, but the VAR might still have an intercept because the difference between the two (the
interest rate spread) might be stationary around a non-zero mean (for example, because of a risk
or liquidity premium).
The previous example can be generalized in three directions:
1. If a VAR of order greater than 1 is considered, the algebra gets more convoluted but the
conclusions are identical.
2. If the VAR includes more than two endogenous variables the cointegration rank r can be
greater than 1. In this case, is a matrix with r columns, and the case with restricted constant
entails the restriction that 0 should be some linear combination of the columns of .
3. If a linear trend is included in the model, the deterministic part of the VAR becomes 0 + 1 t.
The reasoning is practically the same as above except that the focus now centers on 1 rather
than 0 . The counterpart to the restricted constant case discussed above is a restricted
trend case, such that the cointegration relationships include a trend but the first differences
of the variables in question do not. In the case of an unrestricted trend, the trend appears
in both the cointegration relationships and the first differences, which corresponds to the
presence of a quadratic trend in the variables themselves (in levels).
In order to accommodate the five cases, gretl provides the following options to the coint2 and
vecm commands:
t
option flag
description
--nc
no constant
0
0 ,
0 = 0
--rc
restricted constant
--uc
0
0 + 1 t,
1 = 0
--crt
0 + 1 t
--ct
unrestricted constant
constant + restricted trend
constant + unrestricted trend
Note that for this command the above options are mutually exclusive. In addition, you have the
option of using the --seasonal options, for augmenting t with centered seasonal dummies. In
each case, p-values are computed via the approximations devised by Doornik (1998).
24.4
The two Johansen tests for cointegration are used to establish the rank of ; in other words, how
many cointegration vectors the system has. These are the -max test, for hypotheses on individual eigenvalues, and the trace test, for joint hypotheses. Suppose that the eigenvalues i are
sorted from largest to smallest. The null hypothesis for the -max test on the i-th eigenvalue is
that i = 0. The corresponding trace test, instead, considers the hypothesis j = 0 for all j i.
The gretl command coint2 performs these two tests. The corresponding menu entry in the GUI is
Model, Time Series, Cointegration Test, Johansen.
As in the ADF test, the asymptotic distribution of the tests varies with the deterministic component
t one includes in the VAR (see section 24.3 above). The following code uses the denmark data file,
supplied with gretl, to replicate Johansens example found in his 1995 book.
open denmark
coint2 2 LRM LRY IBO IDE --rc --seasonal
201
In this case, the vector yt in equation (24.2) comprises the four variables LRM, LRY, IBO, IDE. The
number of lags equals p in (24.2) (that is, the number of lags of the model written in VAR form).
Part of the output is reported below:
Johansen test:
Number of equations = 4
Lag order = 2
Estimation period: 1974:3 - 1987:3 (T = 53)
Case 2: Restricted constant
Rank Eigenvalue Trace test p-value
0
0.43317
49.144 [0.1284]
1
0.17758
19.057 [0.7833]
2
0.11279
8.6950 [0.7645]
3
0.043411
2.3522 [0.7088]
Lmax test
30.087
10.362
6.3427
2.3522
p-value
[0.0286]
[0.8017]
[0.7483]
[0.7076]
Both the trace and -max tests accept the null hypothesis that the smallest eigenvalue is 0 (see the
last row of the table), so we may conclude that the series are in fact non-stationary. However, some
linear combination may be I(0), since the -max test rejects the hypothesis that the rank of is 0
(though the trace test gives less clear-cut evidence for this, with a p-value of 0.1284).
24.5
The core problem in the estimation of equation (24.2) is to find an estimate of that has by construction rank r , so it can be written as = 0 , where is the matrix containing the cointegration
vectors and contains the adjustment or loading coefficients whereby the endogenous variables respond to deviation from equilibrium in the previous period.
Without further specification, the problem has multiple solutions (in fact, infinitely many). The
parameters and are under-identified: if all columns of are cointegration vectors, then any
arbitrary linear combinations of those columns is a cointegration vector too. To put it differently,
if = 0 00 for specific matrices 0 and 0 , then also equals (0 Q)(Q1 00 ) for any conformable
non-singular matrix Q. In order to find a unique solution, it is therefore necessary to impose
some restrictions on and/or . It can be shown that the minimum number of restrictions that
is necessary to guarantee identification is r 2 . Normalizing one coefficient per column to 1 (or 1,
according to taste) is a trivial first step, which also helps in that the remaining coefficients can be
interpreted as the parameters in the equilibrium relations, but this only suffices when r = 1.
The method that gretl uses by default is known as the Phillips normalization, or triangular
representation.1 The starting point is writing in partitioned form as in
"
=
1
2
#
,
=
=
,
2 1
B
1
with B known as the matrix of unrestricted coefficients.
The coefficients that gretl produces are ,
In terms of the underlying equilibrium relationship, the Phillips normalization expresses the system
1 For comparison with other studies, you may wish to normalize differently. Using the set command you can do
set vecm_norm diag to select a normalization that simply scales the columns of the original such that ij = 1
for i = j and i r , as used in the empirical section of Boswijk and Doornik (2004). Another alternative is
set vecm_norm first, which scales such that the elements on the first row equal 1. To suppress normalization
altogether, use set vecm_norm none. (To return to the default: set vecm_norm phillips.)
202
of r equilibrium relations as
y1,t
y2,t
=
..
.
yr ,t
br ,r +1 yr +1,t + . . . + br ,n yr ,t
1.0000
(0.0000)
0.0000
(0.0000)
0.56108
(0.10638)
-0.40446
(0.10277)
-0.54293
(0.10962)
-3.7483
(0.78082)
0.0000
(0.0000)
1.0000
(0.0000)
-24.367
(4.2113)
-0.91166
(4.0683)
24.786
(4.3394)
16.751
(30.909)
Interpretation of the coefficients of the cointegration matrix would be easier if a meaning could
be attached to each of its columns. This is possible by hypothesizing the existence of two long-run
relationships: a money demand equation
m = c1 + 1 infl + 2 y + 3 tbr
and a risk premium equation
cpr = c2 + 4 infl + 5 y + 6 tbr
2 This
203
1
0
1 4
0 1
2 5
3 6
c1 c2
This renormalization can be accomplished by means of the restrict command, to be given after
the vecm command or, in the graphical interface, by selecting the Test, Linear Restrictions menu
entry. The syntax for entering the restrictions should be fairly obvious:3
restrict
b[1,1] = -1
b[1,3] = 0
b[2,1] = 0
b[2,3] = -1
end restrict
which produces
Cointegrating vectors (standard errors in parentheses)
m
infl
cpr
y
tbr
const
24.6
-1.0000
(0.0000)
-0.023026
(0.0054666)
0.0000
(0.0000)
0.42545
(0.033718)
-0.027790
(0.0045445)
3.3625
(0.25318)
0.0000
(0.0000)
0.041039
(0.027790)
-1.0000
(0.0000)
-0.037414
(0.17140)
1.0172
(0.023102)
0.68744
(1.2870)
Over-identifying restrictions
One purpose of imposing restrictions on a VECM system is simply to achieve identification. If these
restrictions are simply normalizations, they are not testable and should have no effect on the maximized likelihood. In addition, however, one may wish to formulate constraints on and/or that
derive from the economic theory underlying the equilibrium relationships; substantive restrictions
of this sort are then testable via a likelihood-ratio statistic.
Gretl is capable of testing general linear restrictions of the form
Rb vec() = q
(24.5)
Ra vec() = 0
(24.6)
and/or
Note that the restriction may be non-homogeneous (q 0) but the restriction must be homogeneous. Nonlinear restrictions are not supported, and neither are restrictions that cross between
3 Note that in this context we are bending the usual matrix indexation convention, using the leading index to refer to
the column of (the particular cointegrating vector). This is standard practice in the literature, and defensible insofar as
it is the columns of (the cointegrating relations or equilibrium errors) that are of primary interest.
204
and . In the case where r > 1 such restrictions may be in common across all the columns of
(or ) or may be specific to certain columns of these matrices. This is the case discussed in Boswijk
(1995) and Boswijk and Doornik (2004), section 4.4.
The restrictions (24.5) and (24.6) may be written in explicit form as
vec() = H + h0
(24.7)
vec(0 ) = G
(24.8)
and
respectively, where and are the free parameter vectors associated with and respectively.
We may refer to the free parameters collectively as (the column vector formed by concatenating
and ). Gretl uses this representation internally when testing the restrictions.
If the list of restrictions that is passed to the restrict command contains more constraints than
necessary to achieve identification, then an LR test is performed; moreover, the restrict command can be given the --full switch, in which case full estimates for the restricted system are
printed (including the i terms), and the system thus restricted becomes the current model for
the purposes of further tests. Thus you are able to carry out cumulative tests, as in Chapter 7 of
Johansen (1995).
Syntax
The full syntax for specifying the restriction is an extension of that exemplified in the previous
section. Inside a restrict. . . end restrict block, valid statements are of the form
parameter linear combination = scalar
where a parameter linear combination involves a weighted sum of individual elements of or
(but not both in the same combination); the scalar on the right-hand side must be 0 for combinations involving , but can be any real number for combinations involving . Below, we give a few
examples of valid restrictions:
b[1,1]
b[1,4]
a[1,3]
a[1,1]
=
+
=
-
1.618
2*b[2,5] = 0
0
a[1,2] = 0
Special syntax is used when a certain constraint should be applied to all columns of : in this case,
one index is given for each b term, and the square brackets are dropped. Hence, the following
syntax
restrict
b1 + b2 = 0
end restrict
corresponds to
11
11
=
13
14
21
21
23
24
The same convention is used for : when only one index is given for an a term the restriction is
presumed to apply to all r columns of , or in other words the variable associated with the given
row of is weakly exogenous. For instance, the formulation
205
restrict
a3 = 0
a4 = 0
end restrict
specifies that variables 3 and 4 do not respond to the deviation from equilibrium in the previous
period. Note that when two indices are given in a restriction on the indexation is consistent with
that for restrictions: the leading index denotes the cointegrating vector and the trailing index the
equation number.
Finally, a short-cut is available for setting up complex restrictions (but currently only in relation
to ): you can specify Rb and q, as in Rb vec() = q, by giving the names of previously defined
matrices. For example,
matrix I4 = I(4)
matrix vR = I4**(I4~zeros(4,1))
matrix vq = mshape(I4,16,1)
restrict
R = vR
q = vq
end restrict
which manually imposes Phillips normalization on the estimates for a system with cointegrating
rank 4.
An example
Brand and Cassola (2004) propose a money demand system for the Euro area, in which they postulate three long-run equilibrium relationships:
money demand
m = l l + y y
Fisher equation
= l
Expectation theory of
interest rates
l=s
where m is real money demand, l and s are long- and short-term interest rates, y is output and
is inflation.4 (The names for these variables in the gretl data file are m_p, rl, rs, y and infl,
respectively.)
The cointegration rank assumed by the authors is 3 and there are 5 variables, giving 15 elements
in the matrix. 3 3 = 9 restrictions are required for identification, and a just-identified system
would have 15 9 = 6 free parameters. However, the postulated long-run relationships feature
only three free parameters, so the over-identification rank is 3.
Example 24.1 replicates Table 4 on page 824 of the Brand and Cassola article.5 Note that we use
the $lnl accessor after the vecm command to store the unrestricted log-likelihood and the $rlnl
accessor after restrict for its restricted counterpart.
The example continues in script 24.2, where we perform further testing to check whether (a) the
income elasticity in the money demand equation is 1 (y = 1) and (b) the Fisher relation is homogeneous ( = 1). Since the --full switch was given to the initial restrict command, additional
restrictions can be applied without having to repeat the previous ones. (The second script contains
4 A traditional formulation of the Fisher equation would reverse the roles of the variables in the second equation,
but this detail is immaterial in the present context; moreover, the expectation theory of interest rates implies that the
third equilibrium relationship should include a constant for the liquidity premium. However, since in this example the
system is estimated with the constant term unrestricted, the liquidity premium gets merged in the system intercept and
disappears from zt .
5 Modulo what appear to be a few typos in the article.
Input:
open brand_cassola.gdt
# perform a few transformations
m_p = m_p*100
y = y*100
infl = infl/4
rs = rs/4
rl = rl/4
# replicate table 4, page 824
vecm 2 3 m_p infl rl rs y -q
genr ll0 = $lnl
restrict --full
b[1,1] = 1
b[1,2] = 0
b[1,4] = 0
b[2,1] = 0
b[2,2] = 1
b[2,4] = 0
b[2,5] = 0
b[3,1] = 0
b[3,2] = 0
b[3,3] = 1
b[3,4] = -1
b[3,5] = 0
end restrict
genr ll1 = $rlnl
Partial output:
Unrestricted loglikelihood (lu) = 116.60268
Restricted loglikelihood (lr) = 115.86451
2 * (lu - lr) = 1.47635
P(Chi-Square(3) > 1.47635) = 0.68774
beta (cointegrating vectors, standard errors in parentheses)
m_p
infl
rl
rs
y
1.0000
(0.0000)
0.0000
(0.0000)
1.6108
(0.62752)
0.0000
(0.0000)
-1.3304
(0.030533)
0.0000
(0.0000)
1.0000
(0.0000)
-0.67100
(0.049482)
0.0000
(0.0000)
0.0000
(0.0000)
0.0000
(0.0000)
0.0000
(0.0000)
1.0000
(0.0000)
-1.0000
(0.0000)
0.0000
(0.0000)
206
207
a few printf commands, which are not strictly necessary, to format the output nicely.) It turns out
that both of the additional hypotheses are rejected by the data, with p-values of 0.002 and 0.004.
Example 24.2: Further testing of money demand system
Input:
restrict
b[1,5] = -1
end restrict
genr ll_uie = $rlnl
restrict
b[2,3] = -1
end restrict
genr ll_hfh = $rlnl
# replicate table 5, page 824
printf "Testing zero restrictions in cointegration space:\n"
printf " LR-test, rank = 3: chi^2(3) = %6.4f [%6.4f]\n", 2*(ll0-ll1), \
pvalue(X, 3, 2*(ll0-ll1))
printf "Unit income elasticity: LR-test, rank = 3:\n"
printf " chi^2(4) = %g [%6.4f]\n", 2*(ll0-ll_uie), \
pvalue(X, 4, 2*(ll0-ll_uie))
printf "Homogeneity in the Fisher hypothesis:\n"
printf " LR-test, rank = 3: chi^2(4) = %6.3f [%6.4f]\n", 2*(ll0-ll_hfh), \
pvalue(X, 4, 2*(ll0-ll_hfh))
Output:
Testing zero restrictions in cointegration space:
LR-test, rank = 3: chi^2(3) = 1.4763 [0.6877]
Unit income elasticity: LR-test, rank = 3:
chi^2(4) = 17.2071 [0.0018]
Homogeneity in the Fisher hypothesis:
LR-test, rank = 3: chi^2(4) = 15.547 [0.0037]
Another type of test that is commonly performed is the weak exogeneity test. In this context, a
variable is said to be weakly exogenous if all coefficients on the corresponding row in the matrix
are zero. If this is the case, that variable does not adjust to deviations from any of the long-run
equilibria and can be considered an autonomous driving force of the whole system.
The code in Example 24.3 performs this test for each variable in turn, thus replicating the first
column of Table 6 on page 825 of Brand and Cassola (2004). The results show that weak exogeneity
might perhaps be accepted for the long-term interest rate and real GDP (p-values 0.07 and 0.08
respectively).
Identification and testability
One point regarding VECM restrictions that can be confusing at first is that identification (does
the restriction identify the system?) and testability (is the restriction testable?) are quite separate
matters. Restrictions can be identifying but not testable; less obviously, they can be testable but
not identifying.
This can be seen quite easily in relation to a rank-1 system. The restriction 1 = 1 is identifying
(it pins down the scale of ) but, being a pure scaling, it is not testable. On the other hand, the
restriction 1 +2 = 0 is testable the system with this requirement imposed will almost certainly
Input:
restrict
a1 = 0
end restrict
ts_m = 2*(ll0 - $rlnl)
restrict
a2 = 0
end restrict
ts_p = 2*(ll0 - $rlnl)
restrict
a3 = 0
end restrict
ts_l = 2*(ll0 - $rlnl)
restrict
a4 = 0
end restrict
ts_s = 2*(ll0 - $rlnl)
restrict
a5 = 0
end restrict
ts_y = 2*(ll0 - $rlnl)
loop foreach i m p l s y --quiet
printf "\Delta $i\t%6.3f [%6.4f]\n", ts_$i, pvalue(X, 6, ts_$i)
endloop
m
p
l
s
y
18.111
21.067
11.819
16.000
11.335
[0.0060]
[0.0018]
[0.0661]
[0.0138]
[0.0786]
208
209
have a lower maximized likelihood but it is not identifying; it still leaves open the scale of .
We said above that the number of restrictions must equal at least r 2 , where r is the cointegrating
rank, for identification. This is a necessary and not a sufficient condition. In fact, when r > 1 it can
be quite tricky to assess whether a given set of restrictions is identifying. Gretl uses the method
suggested by Doornik (1995), where identification is assessed via the rank of the information matrix.
It can be shown that for restrictions of the sort (24.7) and (24.8) the information matrix has the
same rank as the Jacobian matrix
i
h
J() = (Ip )G : ( Ip1 )H
A sufficient condition for identification is that the rank of J() equals the number of free parameters. The rank of this matrix is evaluated by examination of its singular values at a randomly
selected point in the parameter space. For practical purposes we treat this condition as if it were
both necessary and sufficient; that is, we disregard the special cases where identification could be
achieved without this condition being met.6
24.7
In general, the ML estimator for the restricted VECM problem has no closed form solution, hence
the maximum must be found via numerical methods.7 In some cases convergence may be difficult,
and gretl provides several choices to solve the problem.
Switching and LBFGS
Two maximization methods are available in gretl. The default is the switching algorithm set out
in Boswijk and Doornik (2004). The alternative is a limited-memory variant of the BFGS algorithm
(LBFGS), using analytical derivatives. This is invoked using the --lbfgs flag with the restrict
command.
The switching algorithm works by explicitly maximizing the likelihood at each iteration, with re
(the covariance matrix of the residuals) in turn. This method shares a feature
and
spect to ,
with the basic Johansen eigenvalues procedure, namely, it can handle a set of restrictions that does
not fully identify the parameters.
LBFGS, on the other hand, requires that the model be fully identified. When using LBFGS, therefore,
you may have to supplement the restrictions of interest with normalizations that serve to identify
the parameters. For example, one might use all or part of the Phillips normalization (see section
24.5).
Neither the switching algorithm nor LBFGS is guaranteed to find the global ML solution.8 The
optimizer may end up at a local maximum (or, in the case of the switching algorithm, at a saddle
point).
The solution (or lack thereof) may be sensitive to the initial value selected for . By default, gretl
selects a starting point using a deterministic method based on Boswijk (1995), but two further
options are available: the initialization may be adjusted using simulated annealing, or the user may
supply an explicit initial value for .
The default initialization method is:
6 See
Boswijk and Doornik (2004), pp. 4478 for discussion of this point.
exception is restrictions that are homogeneous, common to all or all (in case r > 1), and involve either
only or only. Such restrictions are handled via the modified eigenvalues method set out by Johansen (1995). We solve
directly for the ML estimator, without any need for iterative methods.
8 In developing gretls VECM-testing facilities we have considered a fair number of tricky cases from various sources.
Wed like to thank Luca Fanelli of the University of Bologna and Sven Schreiber of Goethe University Frankfurt for their
help in devising torture-tests for gretls VECM code.
7 The
210
(24.9)
+
0
where
= 0 and A denotes the MoorePenrose inverse of A. Otherwise
0 = (H 0 H)1 H 0 vec()
(24.10)
3. vec(0 ) = H0 + h0 .
conditional on 0 , as per Johansen:
4. Calculate the unrestricted ML
= S01 0 (00 S11 0 )1
(24.11)
0 ) and vec(00 ) = G0 .
5. If is restricted by vec(0 ) = G, then 0 = (G0 G)1 G0 vec(
Alternative initialization methods
As mentioned above, gretl offers the option of adjusting the initialization using simulated annealing. This is invoked by adding the --jitter option to the restrict command.
The basic idea is this: we start at a certain point in the parameter space, and for each of n iterations
(currently n = 4096) we randomly select a new point within a certain radius of the previous one,
and determine the likelihood at the new point. If the likelihood is higher, we jump to the new
point; otherwise, we jump with probability P (and remain at the previous point with probability
1 P ). As the iterations proceed, the system gradually cools that is, the radius of the random
perturbation is reduced, as is the probability of making a jump when the likelihood fails to increase.
In the course of this procedure many points in the parameter space are evaluated, starting with the
point arrived at by the deterministic method, which well call 0 . One of these points will be best
in the sense of yielding the highest likelihood: call it . This point may or may not have a greater
likelihood than 0 . And the procedure has an end point, n , which may or may not be best.
The rule followed by gretl in selecting an initial value for based on simulated annealing is this: use
if > 0 , otherwise use n . That is, if we get an improvement in the likelihood via annealing,
we make full use of this; on the other hand, if we fail to get an improvement we nonetheless allow
the annealing to randomize the starting point. Experiments indicated that the latter effect can be
helpful.
Besides annealing, a further alternative is manual initialization. This is done by passing a predefined vector to the set command with parameter initvals, as in
set initvals myvec
The details depend on whether the switching algorithm or LBFGS is used. For the switching algorithm, there are two options for specifying the initial values. The more user-friendly one (for most
people, we suppose) is to specify a matrix that contains vec() followed by vec(). For example:
open denmark.gdt
vecm 2 1 LRM LRY IBO IDE --rc --seasonals
matrix BA = {1, -1, 6, -6, -6, -0.2, 0.1, 0.02, 0.03}
set initvals BA
restrict
b[1] = 1
b[1] + b[2] = 0
b[3] + b[4] = 0
end restrict
211
In this example from Johansen (1995) the cointegration rank is 1 and there are 4 variables.
However, the model includes a restricted constant (the --rc flag) so that has 5 elements. The
matrix has 4 elements, one per equation. So the matrix BA may be read as
(1 , 2 , 3 , 4 , 5 , 1 , 2 , 3 , 4 )
The other option, which is compulsory when using LBFGS, is to specify the initial values in terms
of the free parameters, and . Getting this right is somewhat less obvious. As mentioned above,
the implicit-form restriction Rvec() = q has explicit form vec() = H + h0 , where H = R , the
right nullspace of R. The vector is shorter, by the number of restrictions, than vec(). The
savvy user will then see what needs to be done. The other point to take into account is that if is
unrestricted, the effective length of is 0, since it is then optimal to compute using Johansens
formula, conditional on (equation 24.11 above). The example above could be rewritten as:
open denmark.gdt
vecm 2 1 LRM LRY IBO IDE --rc --seasonals
matrix phi = {-8, -6}
set initvals phi
restrict --lbfgs
b[1] = 1
b[1] + b[2] = 0
b[3] + b[4] = 0
end restrict
In this more economical formulation the initializer specifies only the two free parameters in (5
elements in minus 3 restrictions). There is no call to give values for since is unrestricted.
Scale removal
Consider a simpler version of the restriction discussed in the previous section, namely,
restrict
b[1] = 1
b[1] + b[2] = 0
end restrict
This restriction comprises a substantive, testable requirement that 1 and 2 sum to zero
and a normalization or scaling, 1 = 1. The question arises, might it be easier and more reliable
to maximize the likelihood without imposing 1 = 1?9 If so, we could record this normalization,
remove it for the purpose of maximizing the likelihood, then reimpose it by scaling the result.
Unfortunately it is not possible to say in advance whether scale removal of this sort will give
better results, for any particular estimation problem. However, this does seem to be the case more
often than not. Gretl therefore performs scale removal where feasible, unless you
explicitly forbid this, by giving the --no-scaling option flag to the restrict command; or
provide a specific vector of initial values; or
select the LBFGS algorithm for maximization.
Scale removal is deemed infeasible if there are any cross-column restrictions on , or any nonhomogeneous restrictions involving more than one element of .
In addition, experimentation has suggested to us that scale removal is inadvisable if the system is
just identified with the normalization(s) included, so we do not do it in that case. By just identified
9 As
212
we mean that the system would not be identified if any of the restrictions were removed. On that
criterion the above example is not just identified, since the removal of the second restriction would
not affect identification; and gretl would in fact perform scale removal in this case unless the user
specified otherwise.
Chapter 25
Forecasting
25.1
Introduction
In some econometric contexts forecasting is the prime objective: one wants estimates of the future
values of certain variables to reduce the uncertainty attaching to current decision making. In other
contexts where real-time forecasting is not the focus prediction may nonetheless be an important
moment in the analysis. For example, out-of-sample prediction can provide a useful check on
the validity of an econometric model. In other cases we are interested in questions of what if:
for example, how might macroeconomic outcomes have differed over a certain period if a different
policy had been pursued? In the latter cases prediction need not be a matter of actually projecting
into the future but in any case it involves generating fitted values from a given model. The term
postdiction might be more accurate but it is not commonly used; we tend to talk of prediction
even when there is no true forecast in view.
This chapter offers an overview of the methods available within gretl for forecasting or prediction
(whether forward in time or not) and explicates some of the finer points of the relevant commands.
25.2
In the simplest case, the predictions of interest are just the (within sample) fitted values from an
t = Xt .
econometric model. For the single-equation linear model, yt = Xt + ut , these are y
series can be retrieved, after estimating a model, using the accessor
In command-line mode, the y
$yhat, as in
series yh = $yhat
If the model in question takes the form of a system of equations, $yhat returns a matrix, each
column of which contains the fitted values for a particular dependent variable. To extract the fitted
series for, e.g., the dependent variable in the second equation, do
matrix Yh = $yhat
series yh2 = Yh[,2]
Having obtained a series of fitted values, you can use the fcstats function to produce a vector of
statistics that characterize the accuracy of the predictions (see section 25.4 below).
The gretl GUI offers several ways of accessing and examining within-sample predictions. In the
model display window the Save menu contains an item for saving fitted values, the Graphs menu
allows plotting of fitted versus actual values, and the Analysis menu offers a display of actual, fitted
and residual values.
25.3
The fcast command generates predictions based on the last estimated model. Several questions
arise here: How to control the range over which predictions are generated? How to control the
forecasting method (where a choice is available)? How to control the printing and/or saving of the
213
214
results? Basic answers can be found in the Gretl Command Reference; we add some more details
here.
The forecast range
The range defaults to the currently defined sample range. If this remains unchanged following estimation of the model in question, the forecast will be within sample and (with some qualifications
noted below) it will essentially duplicate the information available via the retrieval of fitted values
(see section 25.2 above).
A common situation is that a model is estimated over a given sample and then forecasts are
wanted for a subsequent out-of-sample range. The simplest way to accomplish this is via the
--out-of-sample option to fcast. For example, assuming we have a quarterly time-series dataset
containing observations from 1980:1 to 2008:4, four of which are to be reserved for forecasting:
# reserve the last 4 observations
smpl 1980:1 2007:4
ols y 0 xlist
fcast --out-of-sample
But this will work as stated only if the set of regressors in xlist does not contain any stochastic
regressors other than lags of y. The dataset addobs command attempts to detect and extrapolate
certain common deterministic variables (e.g., time trend, periodic dummy variables). In addition,
lagged values of the dependent variable can be supported via a dynamic forecast (see below for
discussion of the static/dynamic distinction). But future values of any other included regressors
must be supplied before such a forecast is possible. Note that specific values in a series can be
set directly by date, for example: x1[2009:1] = 120.5. Or, if the assumption of no change in the
regressors is warranted, one can do something like this:
loop t=2009:1..2009:4
loop foreach i xlist
$i[t] = $i[2008:4]
endloop
endloop
(25.1)
215
In some cases the presence of a lagged dependent variable is implicit in the dynamics of the error
term, for example
yt = + ut
ut = ut1 + t
which implies that
yt = (1 ) + yt1 + t
Suppose we want to forecast y for period s using a dynamic model, say (25.1) for example. If
s =
we have data on y available for period s 1 we could form a fitted value in the usual way: y
0 +
1 ys1 . But suppose that data are available only up to s 2. In that case we can apply the
25.4
Let yt be the value of a variable of interest at time t and let ft be a forecast of yt . We define the
forecast error as et = yt ft . Given a series of T observations and associated forecasts we can
construct several measures of the overall accuracy of the forecasts. Some commonly used measures
are the Mean Error (ME), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute
Error (MAE), Mean Percentage Error (MPE) and Mean Absolute Percentage Error (MAPE). These are
defined as follows.
v
u
T
T
T
T
u X
X
X
1
1
1 X
u1
2
ME =
et
MSE =
et
RMSE = t
et2
MAE =
|et |
T t=1
T t=1
T t=1
T t=1
MPE =
T
et
1 X
100
T t=1
yt
MAPE =
T
|et |
1 X
100
T t=1
yt
A further relevant statistic is Theils U (Theil, 1966), defined as the positive square root of
T 1
1 X
U =
T t=1
2
ft+1 yt+1
yt
!2 T 1
1 X
T t=1
yt+1 yt
yt
!2 1
The more accurate the forecasts, the lower the value of Theils U, which has a minimum of 0.1
This measure can be interpreted as the ratio of the RMSE of the proposed forecasting model to the
RMSE of a nave model which simply predicts yt+1 = yt for all t. The nave model yields U = 1;
values less than 1 indicate an improvement relative to this benchmark and values greater than 1 a
deterioration.
1 This statistic is sometimes called U , to distinguish it from a related but different U defined in an earlier work by
2
Theil (1961). It seems to be generally accepted that the later version of Theils U is a superior statistic, so we ignore the
earlier version here.
216
In addition, Theil (1966, pp. 3336) proposed a decomposition of the MSE which can be useful in
evaluating a set of forecasts. He showed that the MSE could be broken down into three non-negative
components as follows
2
2
+ sf r sy + 1 r 2 s 2
MSE = f y
y
are the sample means of the forecasts and the observations, sf and sy are the rewhere f and y
spective standard deviations (using T in the denominator), and r is the sample correlation between
y and f . Dividing through by MSE we get
f y
MSE
2
+
sf r sy
MSE
2
+
1 r 2 sy2
MSE
=1
(25.2)
Theil labeled the three terms on the left-hand side of (25.2) the bias proportion (U M ), regression
proportion (U R ) and disturbance proportion (U D ), respectively. If y and f represent the in-sample
observations of the dependent variable and the fitted values from a linear regression then the first
two components, U M and U R , will be zero (apart from rounding error), and the entire MSE will be
accounted for by the unsystematic part, U D . In the case of out-of-sample prediction, however (or
prediction over a sub-sample of the data used in the regression), U M and U R are not necessarily
close to zero, although this is a desirable property for a forecast to have. U M differs from zero if
and only if the mean of the forecasts differs from the mean of the realizations, and U R is non-zero
if and only if the slope of a simple regression of the realizations on the forecasts differs from 1.
The above-mentioned statistics are printed as part of the output of the fcast command. They can
also be retrieved in the form of a column vector using the function fcstats, which takes two series
arguments corresponding to y and f . The vector returned is
ME
MSE
MAE
MPE
MAPE
UM
UR
UD
0
(Note that the RMSE is not included since it can easily be obtained given the MSE.) The series given
as arguments to fcstats must not contain any missing values in the currently defined sample
range; use the smpl command to adjust the range if needed.
25.5
To be written.
25.6
To be written.
Chapter 26
Preamble
The Kalman filter has been used behind the scenes in gretl for quite some time, in computing
ARMA estimates. But user access to the Kalman filter is new and it has not yet been tested to any
great extent. We have run some tests of relatively simple cases against the benchmark of SsfPack
Basic. This is state-space software written by Koopman, Shephard and Doornik and documented in
Koopman, Shephard and Doornik (1999). It requires Doorniks ox program. Both ox and SsfPack
are available as free downloads for academic use but neither is open-source; see.
ssfpack.com. Since Koopman is one of the leading researchers in this area, presumably the results
from SsfPack are generally reliable. To date we have been able to replicate the SsfPack results in
gretl with a high degree of precision.
We welcome both success reports and bug reports.
26.2
Notation
(26.1)
(26.2)
where (26.1) is the state transition equation and (26.2) is the observation or measurement equation.
The state vector, t , is (r 1) and the vector of observables, yt , is (n 1); xt is a (k 1) vector of
exogenous variables. The (r 1) vector vt and the (n 1) vector wt are assumed to be vector white
noise:
E(vt v0s ) = Qt for t = s, otherwise 0
E(wt w0s ) = Rt for t = s, otherwise 0
The number of time-series observations will be denoted by T . In the special case when Ft = F,
Ht = H, At = A, Qt = Q and Rt = R, the model is said to be time-invariant.
The Kalman recursions
Using this notation, and assuming for the moment that vt and wt are mutually independent, the
Kalman recursions can be written as follows.
Initialization is via the unconditional mean and variance of 1 :
1)
1|0 = E(
n
0 o
1 ) 1 E(
1)
P1|0 = E 1 E(
217
218
(26.3)
t+1|t = Ft t|t1 + Kt et
(26.4)
et = yt A0t xt H0t
t|t1
and Kt is the gain matrix, given by
Kt = Ft Pt|t1 Ht 1
t
(26.5)
with
t = H0t Pt|t1 Ht + Rt
The second step then updates the estimate of the variance of the state using
Pt+1|t = Ft Pt|t1 F0t Kt t K0t + Qt
(26.6)
Cross-correlated disturbances
The formulation given above assumes mutual independence of the disturbances in the state and
observation equations, vt and wt . This assumption holds good in many practical applications, but
a more general formulation allows for cross-correlation. In place of (26.1)(26.2) we may write
t+1 = Ft t + Bt t
yt = A0t xt + H0t t + Ct t
where t is a (p 1) disturbance vector, all the elements of which have unit variance, Bt is (r p)
and Ct is (n p).
(26.7)
0
Otherwise, the equations given earlier hold good, if we write BB in place of Q and CC in place of
R.
In the account of gretls Kalman facility below we take the uncorrelated case as the baseline, but
add remarks on how to handle the correlated case where applicable.
1 For a justification of the following formulae see the classic book by Anderson and Moore (1979) or, for a more modern
treatment, Pollock (1999) or Hamilton (1994). A transcription of R. E. Kalmans original paper (Kalman, 1960) is available
at.
26.3
219
Intended usage
The Kalman filter can be used in three ways: two of these are the classic forward and backward
pass, or filtering and smoothing respectively; the third use is simulation. In the filtering/smoothing
case you have the data yt and you want to reconstruct the states t (and the forecast errors as a byproduct), but we may also have a computational apparatus that does the reverse: given artificiallygenerated series wt and vt , generate the states t (and the observables yt as a by-product).
The usefulness of the classical filter is well known; the usefulness of the Kalman filter as a simulation tool may be huge too. Think for instance of Monte Carlo experiments, simulation-based
inferencesee Gourieroux and Monfort (1996) or Bayesian methods, especially in the context of
the estimation of DSGE models.
26.4
Overview of syntax
Using the Kalman filter in gretl is a two-step process. First you set up your filter, using a block
of commands starting with kalman and ending with end kalman much like the gmm command.
Then you invoke the functions kfilter, ksmooth or ksimul to do the actual work. The next two
sections expand on these points.
26.5
Each line within the kalman . . . end kalman block takes the form
keyword value
where keyword represents a matrix, as shown below. (An additional matrix which may be useful in
some cases is introduced later under the heading Constant term in the state transition.)
Keyword
Symbol
Dimensions
obsy
T n
obsymat
r n
obsx
T k
obsxmat
kn
obsvar
nn
statemat
r r
statevar
1|0
r r
inistate
inivar
P1|0
r r
r 1
For the data matrices y and x the corresponding value may be the name of a predefined matrix, the
name of a data series, or the name of a list of series.2
For the other inputs, value may be the name of a predefined matrix or, if the input in question
happens to be (11), the name of a scalar variable or a numerical constant. If the value of a
coefficient matrix is given as the name of a matrix or scalar variable, the input is not hard-wired
into the Kalman structure, rather a record is made of the name of the variable and on each run
of a Kalman function (as described below) its value is re-read. It is therefore possible to write one
kalman block and then do several filtering or smoothing passes using different sets of coefficients.3
2 Note that the data matrices obsy and obsx have T rows. That is, the column vectors y and x in (26.1) and (26.2) are
t
t
in fact the transposes of the t-dated rows of the full matrices.
3 Note, however, that the dimensions of the various input matrices are defined via the initial kalman set-up and it is an
error if any of the matrices are changed in size.
220
An example of this technique is provided later, in the example scripts 26.1 and 26.2. This facility
to alter the values of the coefficients between runs of the filter is to be distinguished from the case
of time-varying matrices, which is discussed below.
Not all of the above-mentioned inputs need be specified in every case; some are optional. (In
addition, you can specify the matrices in any order.) The mandatory elements are y, H, F and Q, so
the minimal kalman block looks like this:
kalman
obsy y
obsymat H
statemat F
statevar Q
end kalman
The optional matrices are listed below, along with the implication of omitting the given matrix.
Keyword
If omitted. . .
obsx
obsxmat
obsvar
inistate
inivar
It might appear that the obsx (x) and obsxmat (A) matrices must go together either both are
given or neither is given. But an exception is granted for convenience. If the observation equation
includes a constant but no additional exogenous variables, you can give a (1n) value for A without
having to specify obsx. More generally, if the row dimension of A is 1 greater than the column
dimension of x, it is assumed that the first element of A is associated with an implicit column of
1s.
Regarding the automatic initialization of P1|0 (in case no inivar input is given): by default this
is done as in equation (26.3). However, this method is applicable only if all the eigenvalues of F
lie inside the unit circle. If this condition is not satisfied we instead apply a diffuse prior, setting
P1|0 = Ir with = 107 . If you wish to impose this diffuse prior from the outset, append the option
flag --diffuse to the end kalman statement.4
Time-varying matrices
Any or all of the matrices obsymat, obsxmat, obsvar, statemat and statevar may be timevarying. In that case the value corresponding to the matrix keyword should be given in a special
form: the name of an existing matrix plus a function call which modifies that matrix, separated by
a semicolon. Note that in this case you must use a matrix variable, even if the matrix in question
happens to be 1 1.
For example, suppose the matrix H is time-varying. Then we might write
obsymat H ; modify_H(&H, theta)
where modify_H is a user-defined function which modifies matrix H (and theta is a suitable additional argument to that function, if required).
4 Initialization of the Kalman filter outside of the case where equation (26.3) applies has been the subject of much
discussion in the literaturesee for example de Jong (1991), Koopman (1997). At present gretl does not implement any
of the more elaborate proposals that have been made.
221
The above is just an illustration: the matrix argument does not have to come first, and the function
can have as many arguments as you like. The essential point is that the function must modify the
specified matrix, which requires that it be given as an argument in pointer form (preceded by &).
The function need not return any value directly; if it does, that value is ignored.
Such matrix-modifying functions will be called at each time-step of the filter operation, prior to
performing any calculations. They have access to the current time-step of the Kalman filter via the
internal variable $kalman_t, which has value 1 on the first step, 2 on the second, and so on, up
to step T . They also have access to the previous n-vector of forecast errors, et1 , under the name
$kalman_uhat. When t = 1 this will be a zero vector.
Correlated disturbances
Defining a filter in which the disturbances vt and wt are correlated involves one modification to the
account given above. If you append the --cross option flag to the end kalman statement, then
the matrices corresponding to the keywords statevar and obsvar are interpreted not as Q and R
but rather as B and C as discussed in section 26.2. Gretl then computes Q = BB0 and R = CC0 as
well as the cross-product BC0 and utilizes the modified expression for the gain as given in equation
(26.7). As mentioned above, B should be (r p) and C should be (n p), where p is the number of
elements in the combined disturbance vector t .
Constant term in the state transition
In some applications it is useful to be able to represent a constant term in the state transition
equation explicitly; that is, equation (26.1) becomes
t+1 = + Ft t + vt
(26.8)
This is never strictly necessary; the system (26.1) and (26.2) is general enough to accommodate
such a term, by absorbing it as an extra (unvarying) element in the state vector. But this comes
, F, v, Q, H), making the model
at the cost of expanding all the matrices that touch the state (
relatively awkward to formulate and forecasts relatively expensive to compute.
As a simple illustration, consider a univariate model in which the state, st , is just a random walk
with drift and the observed variable, yt , is the state plus white noise:
st+1 = + st + vt
(26.9)
yt = st + wt
Putting this into the standard form of (26.1) and (26.2) we get:
"
# "
#"
# "
#
"
st+1
1 1
st
vt
v2
=
+
,
Q=
0 1
0
0
"
#
h
i st
+ wt
yt = 1 0
(26.10)
In such a simple case the notational and computational burden is not very great; nonetheless it is
clearly more natural to express this system in the form of (26.9) and (26.10) and in a multivariate
model the gain in parsimony could be substantial.
For this reason we support the use of an additional named matrix in the kalman setup, namely
stconst. This corresponds to in equation (26.8); it should be an r 1 vector (or if r = 1 may be
given as the name of a scalar variable). The use of stconst in setting up a filter corresponding to
(26.9) and (26.10) is shown below.
matrix H = {1}
matrix R = {1}
222
matrix F = {1}
matrix Q = {1}
matrix mu = {0.05}
kalman
obsy y
obsymat H
obsvar R
statemat F
statevar Q
stconst mu
end kalman
Second, the handling of missing values is not yet quite right for the case where the observable
vector yt contains more than one element. At present, if any of the elements of yt are missing
the entire observation is ignored. Clearly it should be possible to make use of any non-missing
elements, and this is not very difficult in principle, its just awkward and is not implemented yet.
Persistence and identity of the filter
At present there is no facility to create a named filter. Only one filter can exist at any point
in time, namely the one created by the last kalman block.5 If a filter is already defined, and you
give a new kalman block, the old filter is over-written. Otherwise the existing filter persists (and
remains available for the kfilter, ksmooth and ksimul functions) until either (a) the gretl session
is terminated or (b) the command delete kalman is given.
26.6
Once a filter is established, as discussed in the previous section, kfilter can be used to run a
forward, forecasting pass. This function returns a scalar code: 0 for successful completion, or 1
if numerical problems were encountered. On successful completion, two scalar accessor variables
become available: $kalman_lnl, which gives the overall log-likelihood under the joint normality
assumption,
T
T
X
X
1
0 1
t | +
`=
nT log(2 ) +
log |
et t et
2
t=1
t=1
and $kalman_s2, which gives the estimated variance,
2 =
T
1 X 0 1
e et
nT t=1 t t
5 This is not quite true: more precisely, there can be no more than one Kalman filter at each level of function execution.
That is, if a gretl script creates a Kalman filter, a user-defined function called from that script may also create a filter,
without interfering with the original one.
223
(but see below for modifications to these formulae for the case of a diffuse prior). In addition the
accessor $kalman_llt gives a (T 1) vector, element t of which is
`t =
i
1h
t | + e0t 1
n log(2 ) + log |
t et
2
The kfilter function does not require any arguments, but up to five matrix quantities may be
retrieved via optional pointer arguments. Each of these matrices has T rows, one for each timestep; the contents of the rows are shown in the following listing.
1. Forecast errors for the observable variables: e0t , n columns.
t )0 , n(n + 1)/2 columns.
2. Variance matrix for the forecast errors: vech(
0
3. Estimate of the state vector:
t|t1 , r columns.
4. MSE of estimate of the state vector: vech(Pt|t1 )0 , r (r + 1)/2 columns.
5. Kalman gain: vec(Kt )0 , r n columns.
Unwanted trailing arguments can be omitted, otherwise unwanted arguments can be skipped by
using the keyword null. For example, the following call retrieves the forecast errors in the matrix
E and the estimate of the state vector in S:
matrix E S
kfilter(&E, null, &S)
Matrices given as pointer arguments do not have to be correctly dimensioned in advance; they will
be resized to receive the specified content.
Further note: in general, the arguments to kfilter should all be matrix-pointers, but under two
conditions you can give a pointer to a series variable instead. The conditions are: (i) the matrix
in question has just one column in context (for example, the first two matrices will have a single
column if the length of the observables vector, n, equals 1) and (ii) the time-series length of the
filter is equal to the current gretl sample size.
Likelihood under the diffuse prior
There seems to be general agreement in the literature that the log-likelihood calculation should
be modified in the case of a diffuse prior for P1|0 . However, it is not clear to us that there is a
well-defined correct method for this. At present we emulate SsfPack (see Koopman et al. (1999)
and section 26.1). In case P1|0 = Ir , we set d = r and calculate
T
T
X
X
1
0 1
t | +
`=
(nT d) log(2 ) +
log |
et t et d log()
2
t=1
t=1
and
2 =
26.7
T
X
1
e0 1 et
nT d t=1 t t
This function returns the (T r ) matrix of smoothed estimates of the state vector that is, esti 0 . This function has no required
mates based on all T observations: row t of this matrix holds
t|T
arguments but it offers one optional matrix-pointer argument, which retrieves the variance of the
smoothed state estimate, Pt|T . The latter matrix is (T r (r + 1)/2); each row is in transposed vech
form. Examples:
224
These values are computed via a backward pass of the filter, from t = T to t = 1, as follows:
Lt = Ft Kt H0t
0
ut1 = Ht 1
t et + Lt ut
0
0
Ut1 = Ht 1
t Ht + Lt Ut Lt
26.8
This simulation function takes up to three arguments. The first, mandatory, argument is a (T r )
matrix containing artificial disturbances for the state transition equation: row t of this matrix
represents v0t . If the current filter has a non-null R (obsvar) matrix, then the second argument
should be a (T n) matrix containing artificial disturbances for the observation equation, on the
same pattern. Otherwise the second argument should be given as null. If r = 1 you may give a
series for the first argument, and if n = 1 a series is acceptable for the second argument.
Provided that the current filter does not include exogenous variables in the observation equation
(obsx), the T for simulation need not equal that defined by the original obsy data matrix: in effect T
is temporarily redefined by the row dimension of the first argument to ksimul. Once the simulation
is completed, the T value associated with the original data is restored.
The value returned by ksimul is a (T n) matrix holding simulated values for the observables at
each time step. A third optional matrix-pointer argument allows you to retrieve a (T r ) matrix
holding the simulated state vector. Examples:
matrix Y = ksimul(V)
# obsvar is null
Y = ksimul(V, W)
# obsvar is non-null
matrix S
Y = ksimul(V, null, &S) # the simulated state is wanted
The initial value 1 is calculated thus: we find the matrix T such that TT0 = P1|0 (as given by the
inivar element in the kalman block), multiply it into v1 , and add the result to 1|0 (as given by
inistate).
If the disturbances are correlated across the two equations the arguments to ksimul must be
revised: the first argument should be a (T p) matrix, each row of which represents 0t (see section 26.2), and the second argument should be given as null.
26.9
As is well known, the Kalman filter provides a very efficient way to compute the likelihood of ARMA
models; as an example, take an ARMA(1,1) model
yt = yt1 + t + t1
6 See
225
One of the ways the above equation can be cast in state-space form is by defining a latent process
t = (1 L)1 t . The observation equation corresponding to (26.2) is then
yt = t + t1
(26.11)
Note that the observation equation (26.11) does not include an error term; this is equivalent
to saying that V (wt ) = 0 and, as a consequence, the kalman block does not include an obsvar
keyword.
Once the filter is set up, all it takes to compute the log-likelihood for given values of , and
2 is to execute the kfilter() function and use the $kalman_lnl accessor (which returns the
total log-likelihood) or, more appropriately if the likelihood has to be maximized through mle, the
$kalman_llt accessor, which returns the series of individual contribution to the log-likelihood for
each observation. An example is shown in script 26.1.
26.10
The two unknown parameters 12 and 22 can be estimated via maximum likelihood. Script 26.2
provides an example of simulation and estimation of such a model. For the sake of brevity, simulation is carried out via ordinary gretl commands, rather than the state-space apparatus described
above.
The example contains two functions: the first one carries out the estimation of the unknown parameters 12 and 22 via maximum likelihood; the second one uses these estimates to compute a
smoothed estimate of the unobservable series t calles muhat. A plot of t and its estimate is
presented in Figure 26.1.
226
227
function matrix
/* starting
scalar s1 =
scalar s2 =
local_level (series y)
values */
1
1
228
10
mu
muhat
8
-2
-4
-6
-8
0
50
100
150
200
By appending the following code snippet to the example in Table 26.2, one may check the results
against the R command StructTS.
foreign language=R --send-data
y <- gretldata[,"y"]
a <- StructTS(y, type="level")
a
StateFromR <- as.ts(tsSmooth(a))
gretl.export(StateFromR)
end foreign
append @dotdir/StateFromR.csv
ols Uhat 0 StateFromR --simple
Chapter 27
27.1
It often happens that one wants to specify and estimate a model in which the dependent variable
is not continuous, but discrete. A typical example is a model in which the dependent variable is
the occupational status of an individual (1 = employed, 0 = unemployed). A convenient way of
formalizing this situation is to consider the variable yi as a Bernoulli random variable and analyze
its distribution conditional on the explanatory variables xi . That is,
(
1 Pi
yi =
(27.1)
0 1 Pi
where Pi = P (yi = 1|xi ) is a given function of the explanatory variables xi .
In most cases, the function Pi is a cumulative distribution function F , applied to a linear combination of the xi s. In the probit model, the normal cdf is used, while the logit model employs the
logistic function (). Therefore, we have
probit
logit
Pi = F (zi ) = (zi )
1
Pi = F (zi ) = (zi ) =
1 + ezi
k
X
zi =
xij j
(27.2)
(27.3)
(27.4)
j=1
where zi is commonly known as the index function. Note that in this case the coefficients j cannot
be interpreted as the partial derivatives of E(yi |xi ) with respect to xij . However, for a given value
of xi it is possible to compute the vector of slopes, that is
F (z)
=
slopej (x)
xj z=z
Gretl automatically computes the slopes, setting each explanatory variable at its sample mean.
Another, equivalent way of thinking about this model is in terms of an unobserved variable yi
which can be described thus:
k
X
yi =
xij j + i = zi + i
(27.5)
j=1
(i )
ei
=
i
(1 + ei )2
229
230
Both the probit and logit model are estimated in gretl via maximum likelihood, where the loglikelihood can be written as
X
X
L() =
ln[1 F (zi )] +
ln F (zi ),
(27.6)
yi =0
yi =1
which is always negative, since 0 < F () < 1. Since the score equations do not have a closed form
solution, numerical optimization is used. However, in most cases this is totally transparent to the
user, since usually only a few iterations are needed to ensure convergence. The --verbose switch
can be used to track the maximization algorithm.
Example 27.1: Estimation of simple logit and probit models
open greene19_1
logit GRADE const GPA TUCE PSI
probit GRADE const GPA TUCE PSI
As an example, we reproduce the results given in chapter 21 of Greene (2000), where the effectiveness of a program for teaching economics is evaluated by the improvements of students grades.
Running the code in example 27.1 gives the following output:
COEFFICIENT
-13.0213
2.82611
0.0951577
2.37869
STDERROR
4.93132
1.26294
0.141554
1.06456
T STAT
-2.641
2.238
0.672
2.234
SLOPE
(at mean)
0.533859
0.0179755
0.449339
COEFFICIENT
-7.45232
1.62581
STDERROR
2.54247
0.693883
T STAT
-2.931
2.343
SLOPE
(at mean)
0.533347
0.0517288
1.42633
0.0838903
0.595038
231
0.617
2.397
0.0169697
0.467908
In this context, the $uhat accessor function takes a special meaning: it returns generalized residuals as defined in Gourieroux, Monfort, Renault and Trognon (1987), which can be interpreted as
unbiased estimators of the latent disturbances t . These are defined as
yi Pi
for the logit model
ui =
(27.7)
yi (zi ) (1 yi ) (zi )
for the probit model
(
zi )
1(
zi )
Among other uses, generalized residuals are often used for diagnostic purposes. For example, it is
very easy to set up an omitted variables test equivalent to the familiar LM test in the context of a
linear regression; example 27.2 shows how to perform a variable addition test.
Example 27.2: Variable addition test in a probit model
open greene19_1
probit GRADE const GPA PSI
series u = $uhat
%$
ols u const GPA PSI TUCE -q
printf "Variable addition test for TUCE:\n"
printf "Rsq * T = %g (p. val. = %g)\n", $trsq, pvalue(X,1,$trsq)
232
model and estimation proceeds with the reduced specification. Nevertheless, it may happen that
no single perfect classifier exists among the regressors, in which case estimation is simply impossible and the algorithm stops with an error. This behavior is triggered during the iteration process
if
max zi < min zi
i:yi =0
i:yi =1
If this happens, unless your model is trivially mis-specified (like predicting if a country is an oil
exporter on the basis of oil revenues), it is normally a small-sample problem: you probably just
dont have enough data to estimate your model. You may want to drop some of your explanatory
variables.
This problem is well analyzed in Stokes (2004); the results therein are replicated in the example
script murder_rates.inp.
27.2
These models constitute a simple variation on ordinary logit/probit models, and are usually applied
when the dependent variable is a discrete and ordered measurement not simply binary, but on
an ordinal rather than an interval scale. For example, this sort of model may be applied when the
dependent variable is a qualitative assessment such as Good, Average and Bad.
In the general case, consider an ordered response variable, y, that can take on any of the J+1 values
0, 1, 2, . . . , J. We suppose, as before, that underlying the observed response is a latent variable,
y = X + = z +
Now define cut points, 1 < 2 < < J , such that
y =0
if y 1
y =1
..
.
if 1 < y 2
y =J
if y > J
For example, if the response takes on three values there will be two such cut points, 1 and 2 .
The probability that individual i exhibits response j, conditional on the characteristics xi , is then
given by
for j = 0
P (y 1 | xi ) = F (1 zi )
P (y > | x ) = 1 F ( z )
for j = J
J
j
The unknown parameters j are estimated jointly with the s via maximum likelihood. The
estimates are reported by gretl as cut1, cut2 and so on.
In order to apply these models in gretl, the dependent variable must either take on only nonnegative integer values, or be explicitly marked as discrete. (In case the variable has non-integer
values, it will be recoded internally.) Note that gretl does not provide a separate command for
ordered models: the logit and probit commands automatically estimate the ordered version if
the dependent variable is acceptable, but not binary.
Example 27.3 reproduces the results presented in section 15.10 of Wooldridge (2002a). The question of interest in this analysis is what difference it makes, to the allocation of assets in pension
funds, whether individual plan participants have a choice in the matter. The response variable is
an ordinal measure of the weight of stocks in the pension portfolio. Having reported the results
of estimation of the ordered model, Wooldridge illustrates the effect of the choice variable by reference to an average participant. The example script shows how one can compute this effect in
gretl.
/*
Replicate the results in Wooldridge, Econometric Analysis of Cross
Section and Panel Data, section 15.10, using pension-plan data from
Papke (AER, 1998).
The dependent variable, pctstck (percent stocks), codes the asset
allocation responses of "mostly bonds", "mixed" and "mostly stocks"
as {0, 50, 100}.
The independent variable of interest is "choice", a dummy indicating
whether individuals are able to choose their own asset allocations.
*/
open pension.gdt
# demographic characteristics of participant
list DEMOG = age educ female black married
# dummies coding for income level
list INCOME = finc25 finc35 finc50 finc75 finc100 finc101
# Papkes OLS approach
ols pctstck const choice DEMOG INCOME wealth89 prftshr
# save the OLS choice coefficient
choice_ols = $coeff(choice)
# estimate ordered probit
probit pctstck choice DEMOG INCOME wealth89 prftshr
k = $ncoeff
matrix b = $coeff[1:k-2]
a1 = $coeff[k-1]
a2 = $coeff[k]
/*
Wooldridge illustrates the choice effect in the ordered probit
by reference to a single, non-black male aged 60, with 13.5 years
of education, income in the range $50K - $75K and wealth of $200K,
participating in a plan with profit sharing.
*/
matrix X = {60, 13.5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 200, 1}
# with choice = 0
scalar Xb = (0 ~ X) * b
P0 = cdf(N, a1 - Xb)
P50 = cdf(N, a2 - Xb) - P0
P100 = 1 - cdf(N, a2 - Xb)
E0 = 50 * P50 + 100 * P100
# with choice = 1
Xb = (1 ~ X) * b
P0 = cdf(N, a1 - Xb)
P50 = cdf(N, a2 - Xb) - P0
P100 = 1 - cdf(N, a2 - Xb)
E1 = 50 * P50 + 100 * P100
printf "\nWith choice, E(y) = %.2f, without E(y) = %.2f\n", E1, E0
printf "Estimated choice effect via ML = %.2f (OLS = %.2f)\n", E1 - E0,
choice_ols
233
234
After estimating ordered models, the $uhat accessor yields generalized residuals as in binary modi , so it is possible to compute an unbiased
els; additionally, the $yhat accessor function returns z
estimator of the latent variable yi simply by adding the two together.
27.3
Multinomial logit
When the dependent variable is not binary and does not have a natural ordering, multinomial
models are used. Multinomial logit is supported in gretl via the --multinomial option to the
logit command. Simple models can also be handled via the mle command (see chapter 19). We
give here an example of such a model. Let the dependent variable, yi , take on integer values
0, 1, . . . p. The probability that yi = k is given by
exp(xi k )
P (yi = k|xi ) = Pp
j=0 exp(xi j )
For the purpose of identification one of the outcomes must be taken as the baseline; it is usually
assumed that 0 = 0, in which case
P (yi = k|xi ) =
exp(xi k )
Pp
1 + j=1 exp(xi j )
and
P (yi = 0|xi ) =
1
1+
Pp
j=1
exp(xi j )
Example 27.4 reproduces Table 15.2 in Wooldridge (2002a), based on data on career choice from
Keane and Wolpin (1997). The dependent variable is the occupational status of an individual (0 = in
school; 1 = not in school and not working; 2 = working), and the explanatory variables are education
and work experience (linear and square) plus a black binary variable. The full data set is a panel;
here the analysis is confined to a cross-section for 1987. For explanations of the matrix methods
employed in the script, see chapter 13.
27.4
The Tobit model is used when the dependent variable of a model is censored.1 Assume a latent
variable yi can be described as
k
X
yi =
xij j + i ,
j=1
2
yi
where i N(0, ). If
were observable, the models parameters could be estimated via ordinary
least squares. On the contrary, suppose that we observe yi , defined as
(
yi =
yi
for yi > 0
for
yi 0
(27.9)
In this case, regressing yi on the xi s does not yield consistent estimates of the parameters ,
Pk
because the conditional mean E(yi |xi ) is not equal to j=1 xij j . It can be shown that restricting
the sample to non-zero observations would not yield consistent estimates either. The solution is to
estimate the parameters via maximum likelihood. The syntax is simply
tobit depvar indvars
1 We assume here that censoring occurs from below at 0. Censoring from above, or at a point different from zero,
can be rather easily handled by re-defining the dependent variable appropriately. For the more general case of two-sided
censoring the intreg command may be used (see below).
function
scalar
scalar
matrix
matrix
series
235
236
As usual, progress of the maximization algorithm can be tracked via the --verbose switch, while
$uhat returns the generalized residuals. Note that in this case the generalized residual is defined
i = E(i |yi = 0) for censored observations, so the familiar equality u
i = yi y
i only holds for
as u
uncensored observations, that is, when yi > 0.
An important difference between the Tobit estimator and OLS is that the consequences of nonnormality of the disturbance term are much more severe: non-normality implies inconsistency for
the Tobit estimator. For this reason, the output for the tobit model includes the Chesher and Irish
(1987) normality test by default.
27.5
Interval regression
The interval regression model arises when the dependent variable is unobserved for some (possibly
all) observations; what we observe instead is an interval in which the dependent variable lies. In
other words, the data generating process is assumed to be
yi = xi + i
but we only know that mi yi Mi , where the interval may be left- or right-unbounded (but
not both). If mi = Mi , we effectively observe yi and no information loss occurs. In practice, each
observation belongs to one of four categories:
1. left-unbounded, when mi = ,
2. right-unbounded, when Mi = ,
3. bounded, when < mi < Mi < and
4. point observations when mi = Mi .
It is interesting to note that this model bears similarities to other models in several special cases:
When all observations are point observations the model trivially reduces to the ordinary linear
regression model.
When mi = Mi when yi > 0, while mi = and Mi = 0 otherwise, we have the Tobit model
(see 27.4).
The interval model could be thought of an ordered probit model (see 27.2) in which the cut
points (the j coefficients in eq. 27.8) are observed and dont need to be estimated.
The gretl command intreg estimates interval models by maximum likelihood, assuming normality
of the disturbance term i . Its syntax is
intreg minvar maxvar X
where minvar contains the mi series, with NAs for left-unbounded observations, and maxvar contains Mi , with NAs for right-unbounded observations. By default, standard errors are computed
using the negative inverse of the Hessian. If the --robust flag is given, then QML or HuberWhite
standard errors are calculated instead. In this case the estimated covariance matrix is a sandwich
of the inverse of the estimated Hessian and the outer product of the gradient.
If the model specification contains regressors other than just a constant, the output includes a
chi-square statistic for testing the joint null hypothesis that none of these regressors has any effect
on the outcome. This is a Wald statistic based on the estimated covariance matrix. If you wish
to construct a likelihood ratio test, this is easily done by estimating both the full model and the
null model (containing only the constant), saving the log-likelihood in both cases via the $lnl
accessor, and then referring twice the difference between the two log-likelihoods to the chi-square
237
Input:
nulldata 100
# generate artificial data
set seed 201449
x = normal()
epsilon = 0.2*normal()
ystar = 1 + x + epsilon
lo_bound = floor(ystar)
hi_bound = ceil(ystar)
# run the interval model
intreg lo_bound hi_bound const x
# estimate ystar
gen_resid = $uhat
yhat = $yhat + gen_resid
corr ystar yhat
950.9270
-44.21258
102.2407
p-value
Akaike criterion
Hannan-Quinn
8.3e-209
94.42517
97.58824
sigma = 0.223273
Left-unbounded observations: 0
Right-unbounded observations: 0
Bounded observations: 100
Point observations: 0
...
corr(ystar, yhat) = 0.98960092
Under the null hypothesis of no correlation:
t(98) = 68.1071, with two-tailed p-value 0.0000
distribution with k degrees of freedom, where k is the number of additional regressors (see the
pvalue command in the Gretl Command Reference). An example is contained in the sample script
wtp.inp, provided with the gretl distribution.
As with the probit and Tobit models, after a model has been estimated the $uhat accessor returns
for point
the generalized residual, which is an estimate of i : more precisely, it equals yi xi
observations and E(i |mi , Mi , xi ) otherwise. Note that it is possible to compute an unbiased pre Script 27.5 shows an example. As a further similarity
dictor of yi by summing this estimate to xi .
with Tobit, the interval regression model may deliver inconsistent estimates if the disturbances are
non-normal; hence, the Chesher and Irish (1987) test for normality is included by default here too.
27.6
238
In the sample selection model (also known as Tobit II model), there are two latent variables:
yi
k
X
xij j + i
(27.10)
zij j + i
(27.11)
j=1
si
p
X
j=1
yi
for si > 0
for si 0
(27.12)
In this context, the symbol indicates that for some observations we simply do not have data on
y: yi may be 0, or missing, or anything else. A dummy variable di is normally used to set censored
observations apart.
One of the most popular applications of this model in econometrics is a wage equation coupled
with a labor force participation equation: we only observe the wage for the employed. If yi and si
were (conditionally) independent, there would be no reason not to use OLS for estimating equation
(27.10); otherwise, OLS does not yield consistent estimates of the parameters j .
Since conditional independence between yi and si is equivalent to conditional independence between i and i , one may model the co-dependence between i and i as
i = i + vi ;
substituting the above expression in (27.10), you obtain the model that is actually estimated:
yi =
k
X
xij j +
i + vi ,
j=1
so the hypothesis that censoring does not matter is equivalent to the hypothesis H0 : = 0, which
can be easily tested.
The parameters can be estimated via maximum likelihood under the assumption of joint normality
of i and i ; however, a widely used alternative method yields the so-called Heckit estimator, named
after Heckman (1979). The procedure can be briefly outlined as follows: first, a probit model is fit
on equation (27.11); next, the generalized residuals are inserted in equation (27.10) to correct for
the effect of sample selection.
Gretl provides the heckit command to carry out estimation; its syntax is
heckit y X ; d Z
where y is the dependent variable, X is a list of regressors, d is a dummy variable holding 1 for
uncensored observations and Z is a list of explanatory variables for the censoring equation.
Since in most cases maximum likelihood is the method of choice, by default gretl computes ML
estimates. The 2-step Heckit estimates can be obtained by using the --two-step option. After
estimation, the $uhat accessor contains the generalized residuals. As in the ordinary Tobit model,
the residuals equal the difference between actual and fitted yi only for uncensored observations
(those for which di = 1).
Example 27.6 shows two estimates from the dataset used in Mroz (1987): the first one replicates
Table 22.7 in Greene (2003),2 while the second one replicates table 17.1 in Wooldridge (2002a).
2 Note that the estimates given by gretl do not coincide with those found in the printed volume. They do, however,
match those found on the errata web page for Greenes book:
ERRATA5.htm.
239
open mroz87.gdt
genr EXP2 = AX^2
genr WA2 = WA^2
genr KIDS = (KL6+K618)>0
# Greenes specification
list X = const AX EXP2 WE CIT
list Z = const WA WA2 FAMINC KIDS WE
heckit WW X ; LFP Z --two-step
heckit WW X ; LFP Z
# Wooldridges specification
series
series
list X
list Z
27.7
Count data
To be written.
27.8
Duration models
In some contexts we wish to apply econometric methods to measurements of the duration of certain
states. Classic examples include the following:
From enginering, the time to failure of electronic or mechanical components: how long do,
say, computer hard drives last until they malfunction?
From the medical realm: how does a new treatment affect the time from diagnosis of a certain
condition to exit from that condition (where exit might mean death or full recovery)?
From economics: the duration of strikes, or of spells of unemployment.
In each case we may be interested in how the durations are distributed, and how they are affected
by relevant covariates. There are several approaches to this problem; the one we discuss here
which is currently the only one supported by gretl is estimation of a parametric model by means
of Maximum Likelihood. In this approach we hypothesize that the durations follow some definite
probability law and we seek to estimate the parameters of that law, factoring in the influence of
covariates.
We may express the density (PDF) of the durations as f (t, X, ), where t is the length of time in the
state in question, X is a matrix of covariates, and is a vector of parameters. The likelihood for a
sample of n observations indexed by i is then
L=
n
Y
i=1
f (ti , xi , )
240
Rather than working with the density directly, however, it is standard practice to factor f () into
two components, namely a hazard function, , and a survivor function, S. The survivor function
gives the probability that a state lasts at least as long as t; it is therefore 1 F (t, X, ) where F
is the CDF corresponding to the density f (). The hazard function addresses this question: given
that a state has persisted as long as t, what is the likelihood that it ends within a short increment
of time beyond t that is, it ends between t and t + ? Taking the limit as goes to zero, we end
up with the ratio of the density to the survivor function:3
(t, X, ) =
f (t, X, )
S(t, X, )
(27.13)
n
X
n
X
log f (ti , xi , ) =
i=1
(27.14)
i=1
One point of interest is the shape of the hazard function, in particular its dependence (or not) on
time since the state began. If does not depend on t we say the process in question exhibits duration independence: the probability of exiting the state at any given moment neither increases nor
decreases based simply on how long the state has persisted to date. The alternatives are positive
duration dependence (the likelihood of exiting the state rises, the longer the state has persisted)
or negative duration dependence (exit becomes less likely, the longer it has persisted). Finally, the
behavior of the hazard with respect to time need not be monotonic; some parameterizations allow
for this possibility and some do not.
Since durations are inherently positive the probability distribution used in modeling must respect
this requirement, giving a density of zero for t 0. Four common candidates are the exponential,
Weibull, log-logistic and log-normal, the Weibull being the most common choice. The table below
displays the density and the hazard function for each of these distributions as they are commonly
parameterized, written as functions of t alone. ( and denote, respectively, the Gaussian PDF
and CDF.)
density, f (t)
hazard, (t)
Exponential
exp (t)
Weibull
t 1 exp [(t) ]
t 1
Log-logistic
Log-normal
1
(log t )/
t
(t)1
2
[1 + (t) ]
(t)1
[1 + (t) ]
1 (log t )/
t (log t )/
The hazard is constant for the exponential distribution. For the Weibull, it is monotone increasing
in t if > 1, or monotone decreasing for < 1. (If = 1 the Weibull collapses to the exponential.)
The log-logistic and log-normal distributions allow the hazard to vary with t in a non-monotonic
fashion.
Covariates are brought into the picture by allowing them to govern one of the parameters of the
density, so that the durations are not identically distributed across cases. For example, when using
the log-normal distribution it is natural to make , the expected value of log t, depend on the
covariates, X. This is typically done via a linear index function: = X.
Note that the expressions for the log-normal density and hazard contain the term (log t )/ .
Replacing with X this becomes (log t X)/ . It turns out that this constitutes a useful simplifying change of variables for all of the distributions discussed here. As in Kalbfleisch and Prentice
3 For
241
(2002), we define
wi (log ti xi )/
The interpretation of the scale factor, , in this expression depends on the distribution. For the
log-normal, represents the standard deviation of log t; for the Weibull and the log-logistic it
corresponds to 1/; and for the exponential it is fixed at unity. For distributions other than the
log-normal, X corresponds to log , or in other words = exp(X).
With this change of variables, the density and survivor functions may be written compactly as
follows (the exponential is the same as the Weibull).
density, f (wi )
wi
survivor, S(wi )
exp(ewi )
Weibull
exp (wi e
Log-logistic
ewi (1 + ewi )2
(1 + ewi )1
Log-normal
(wi )
(wi )
In light of the above we may think of the generic parameter vector , as in f (t, X, ), as composed
of the coefficients on the covariates, , plus (in all cases apart from the exponential) the additional
parameter .
A complication in estimation of is posed by incomplete spells. That is, in some cases the state
in question may not have ended at the time the observation is made (e.g. some workers remain
unemployed, some components have not yet failed). If we use ti to denote the time from entering
the state to either (a) exiting the state or (b) the observation window closing, whichever comes first,
then all we know of the right-censored cases (b) is that the duration was at least as long as ti .
This can be handled by rewriting the the log-likelihood (compare 27.14) as
`i =
n
X
i log S (wi ) + (1 i ) log + log f (wi )
(27.15)
i=1
where i equals 1 for censored cases (incomplete spells), and 0 for complete observations. The
rationale for this is that the log-density equals the sum of the log hazard and the log survivor
function, but for the incomplete spells only the survivor function contributes to the likelihood. So
in (27.15) we are adding up the log survivor function alone for the incomplete cases, plus the full
log density for the completed cases.
Implementation in gretl and illustration
The duration command accepts a list of series on the usual pattern: dependent variable followed
by covariates. If right-censoring is present in the data this should be represented by a dummy
variable corresponding to i above, separated from the covariates by a semicolon. For example,
duration durat 0 X ; cens
where durat measures durations, 0 represents the constant (which is required for such models), X
is a named list of regressors, and cens is the censoring dummy.
By default the Weibull distribution is used; you can substitute any of the other three distributions discussed here by appending one of the option flags --exponential, --loglogistic or
--lognormal.
Interpreting the coefficients in a duration model requires some care, and we will work through an
illustrative case. The example comes from section 20.3 of Wooldridge (2002a), and it concerns
criminal recidivism.4 The data (filename recid.gdt) pertain to a sample of 1,445 convicts released
4 Germn Rodrguez of Princeton University has a page disussing this example and displaying estimates from Stata at.
242
from prison between July 1, 1977 and June 30, 1978. The dependent variable is the time in months
until they are again arrested. The information was gathered retrospectively by examining records
in April 1984; the maximum possible length of observation is 81 months. Right-censoring is important: when the date were compiled about 62 percent had not been arrested. The dataset contains
several covariates, which are described in the data file; we will focus below on interpretation of the
married variable, a dummy which equals 1 if the respondent was married when imprisoned.
Example 27.7 shows the gretl commands for a Weibull model along with most of the output. Consider first the scale factor, . The estimate is 1.241 with a standard error of 0.048. (We dont print
a z score and p-value for this term since H0 : = 0 is not of interest.) Recall that corresponds
to 1/; we can be confident that is less than 1, so recidivism displays negative duration dependence. This makes sense: it is plausible that if a past offender manages to stay out of trouble for
an extended period his risk of engaging in crime again diminishes. (The exponential model would
therefore not be appropriate in this case.)
On a priori grounds, however, we may doubt the monotonic decline in hazard that is simplied by
the Weibull specification. Even if a person is liable to return to crime, it seems relatively unlikely
that he would do so straight out of prison. In the data, we find that only 2.6 percent of those
followed were rearrested within 3 months. The log-normal specification, which allows the hazard
to rise and then fall, may be more appropriate. Using the duration command again with the same
covariates but the --lognormal flag, we get a log-likelihood of 1597 as against 1633 for the
Weibull, confirming that the log-normal gives a better fit.
Let us now focus on the married coefficient, which is positive in both specifications but larger and
more sharply estimated in the log-normal variant. The first thing is to get the interpretation of the
sign right. Recall that X enters negatively into the intermediate variable w. The Weibull hazard is
(wi ) = ewi , so being married reduces the hazard of re-offending, or in other words lengthens the
expected duration out of prison. The same qualititive interpretation applies for the log-normal.
To get a better sense of the married effect, it is useful to show its impact on the hazard across time.
We can do this by plotting the hazard for two values of the index function X: in each case the
values of all the covariates other than married are set to their means (or some chosen values) while
married is set first to 0 then to 1. Example 27.8 provides a script that does this, and the resulting
plots are shown in Figure 27.1. Note that when computing the hazards we need to multiply by the
Jacobian of the transformation from ti to wi = log(ti xi )/ , namely 1/t. Note also that the
estimate of is available via the accessior $sigma, but it is also present as the last element in the
coefficient vector obtained via $coeff.
A further difference between the Weibull and log-normal specifications is illustrated in the plots.
The Weibull is an instance of a proportional hazard model. This means that for any sets of values of
the covariates, xi and xj , the ratio of the associated hazards is invariant with respect to duration. In
this example the Weibull hazard for unmarried individuals is always 1.1637 times that for married.
In the log-normal variant, on the other hand, this ratio gradually declines from 1.6703 at one month
to 1.1766 at 100 months.
Alternative representations of the Weibull model
One point to watch out for with the Weibull duration model is that the estimates may be represented
in different ways. The representation given by gretl is sometimes called the accelerated failure-time
(AFT) metric. An alternative that one sometimes sees is the log relative-hazard metric; in fact this is
the metric used in Wooldridges presentation of the recidivism example. To get from AFT estimates
to log relative-hazard form it is necessary to multiply the coefficients by 1 . For example, the
is 1.24090, so the
married coefficient in the Weibull specification as shown here is 0.188104 and
alternative value is 0.152, which is what Wooldridge shows (2002a, Table 20.1).
243
Input:
open recid.gdt
list X = workprg priors tserved felon alcohol drugs \
black married educ age
duration durat 0 X ; cens
duration durat 0 X ; cens --lognormal
Partial output:
Model 1: Duration (Weibull), using observations 1-1445
Dependent variable: durat
coefficient
std. error
z
p-value
-------------------------------------------------------const
4.22167
0.341311
12.37
3.85e-35
workprg
-0.112785
0.112535
-1.002
0.3162
priors
-0.110176
0.0170675
-6.455
1.08e-10
tserved
-0.0168297
0.00213029
-7.900
2.78e-15
felon
0.371623
0.131995
2.815
0.0049
alcohol
-0.555132
0.132243
-4.198
2.69e-05
drugs
-0.349265
0.121880
-2.866
0.0042
black
-0.563016
0.110817
-5.081
3.76e-07
married
0.188104
0.135752
1.386
0.1659
educ
0.0289111
0.0241153
1.199
0.2306
age
0.00462188
0.000664820
6.952
3.60e-12
sigma
1.24090
0.0482896
Chi-square(10)
Log-likelihood
165.4772
-1633.032
p-value
Akaike criterion
***
***
***
***
***
***
***
***
2.39e-30
3290.065
166.7361
-1597.059
p-value
Akaike criterion
***
***
***
***
***
**
***
**
***
1.31e-30
3218.118
open recid.gdt -q
# leave married separate for analysis
list X = workprg priors tserved felon alcohol drugs \
black educ age
# Weibull variant
duration durat 0 X married ; cens
# coefficients on all Xs apart from married
matrix beta_w = $coeff[1:$ncoeff-2]
# married coefficient
scalar mc_w = $coeff[$ncoeff-1]
scalar s_w = $sigma
# Log-normal variant
duration durat 0 X married ; cens --lognormal
matrix beta_n = $coeff[1:$ncoeff-2]
scalar mc_n = $coeff[$ncoeff-1]
scalar s_n = $sigma
list allX = 0 X
# evaluate X\beta at means of all variables except marriage
scalar Xb_w = meanc({allX}) * beta_w
scalar Xb_n = meanc({allX}) * beta_n
# construct two plot matrices
matrix mat_w = zeros(100, 3)
matrix mat_n = zeros(100, 3)
loop t=1..100 -q
# first column, duration
mat_w[t, 1] = t
mat_n[t, 1] = t
wi_w = (log(t) - Xb_w)/s_w
wi_n = (log(t) - Xb_n)/s_n
# second col: hazard with married = 0
mat_w[t, 2] = (1/t) * exp(wi_w)
mat_n[t, 2] = (1/t) * pdf(z, wi_n) / cdf(z, -wi_n)
wi_w = (log(t) - (Xb_w + mc_w))/s_w
wi_n = (log(t) - (Xb_n + mc_n))/s_n
# third col: hazard with married = 1
mat_w[t, 3] = (1/t) * exp(wi_w)
mat_n[t, 3] = (1/t) * pdf(z, wi_n) / cdf(z, -wi_n)
endloop
colnames(mat_w, "months unmarried married")
colnames(mat_n, "months unmarried married")
gnuplot 2 3 1 --with-lines --supp --matrix=mat_w --output=weibull.plt
gnuplot 2 3 1 --with-lines --supp --matrix=mat_n --output=lognorm.plt
244
245
Weibull
0.020
unmarried
married
0.018
0.016
0.014
0.012
0.010
0.008
0.006
0
20
40
60
80
100
months
Log-normal
0.020
unmarried
married
0.018
0.016
0.014
0.012
0.010
0.008
0.006
0
20
40
60
80
100
months
Figure 27.1: Recidivism hazard estimates for married and unmarried ex-convicts
246
Log-logistic
exp(X)
sin( )
Log-normal
exp(X + 2 /2)
The expression given for the log-logistic mean, however, is valid only for < 1; otherwise the
expectation is undefined, a point that is not noted in all software.5
Alternatively, if the --medians option is given, gretls duration command will produce conditional
medians as the content of $yhat. For the Weibull the median is exp(X)(log 2) ; for the log-logistic
and log-normal it is just exp(X).
The values we give for the accessor $uhat are generalized (CoxSnell) residuals, computed as the
integrated hazard function, which equals the negative of the log of the survivor function:
i = (ti , xi , ) = log S(ti , xi , )
u
Under the null of correct specification of the model these generalized residuals should follow the
unit exponential distribution, which has mean and variance both equal to 1 and density e1 . See
Cameron and Trivedi (2005) for further discussion.
5 The predict adjunct to the streg command in Stata 10, for example, gaily produces large negative values for the
log-logistic mean in duration models with > 1.
Chapter 28
Quantile regression
28.1
Introduction
Deviations or LAD. While the OLS problem has a straightforward analytical solution, LAD is a linear
programming problem.
Quantile regression is a generalization of median regression: the regression function predicts the
conditional -quantile of the dependent variable for example the first quartile ( = .25) or the
ninth decile ( = .90).
If the classical conditions for the validity of OLS are satisfied that is, if the error term is independently and identically distributed, conditional on X then quantile regression is redundant:
all the conditional quantiles of the dependent variable will march in lockstep with the conditional
mean. Conversely, if quantile regression reveals that the conditional quantiles behave in a manner
quite distinct from the conditional mean, this suggests that OLS estimation is problematic.
As of version 1.7.5, gretl offers quantile regression functionality (in addition to basic LAD regression, which has been available since early in gretls history via the lad command).1
28.2
Basic syntax
gratefully acknowledge our borrowing from the quantreg package for GNU R (version 4.17). The core of the
quantreg package is composed of Fortran code written by Roger Koenker; this is accompanied by various driver and
auxiliary functions written in the R language by Koenker and Martin Mchler. The latter functions have been re-worked
in C for gretl. We have added some guards against potential numerical problems in small samples.
247
248
By default, standard errors are computed according to the asymptotic formula given by Koenker
and Bassett (1978). Alternatively, if the --robust option is given, we use the sandwich estimator
developed in Koenker and Zhao (1994).2
28.3
Confidence intervals
An option --intervals is available. When this is given we print confidence intervals for the parameter estimates instead of standard errors. These intervals are computed using the rank inversion
method and in general they are asymmetrical about the point estimates that is, they are not
simply plus or minus so many standard errors. The specifics of the calculation are inflected by
the --robust option: without this, the intervals are computed on the assumption of IID errors
(Koenker, 1994); with it, they use the heteroskedasticity-robust estimator developed by Koenker
and Machado (1999).
By default, 90 percent intervals are produced. You can change this by appending a confidence value
(expressed as a decimal fraction) to the intervals option, as in
quantreg tau reglist --intervals=.95
When the confidence intervals option is selected, the parameter estimates are calculated using
the BarrodaleRoberts method. This is simply because the FrischNewton code does not currently
support the calculation of confidence intervals.
Two further details. First, the mechanisms for generating confidence intervals for quantile estimates require that the model has at least two regressors (including the constant). If the --intervals
option is given for a model containing only one regressor, an error is flagged. Second, when a model
is estimated in this mode, you can retrieve the confidence intervals using the accessor $coeff_ci.
This produces a k 2 matrix, where k is the number of regressors. The lower bounds are in the
first column, the upper bounds in the second. See also section 28.5 below.
28.4
Multiple quantiles
As a further option, you can give tau as a matrix either the name of a predefined matrix or in
numerical form, as in {.05, .25, .5, .75, .95}. The given model is estimated for all the
values and the results are printed in a special form, as shown below (in this case the --intervals
option was also given).
Model 1: Quantile estimates using the 235 observations 1-235
Dependent variable: foodexp
With 90 percent confidence intervals
VARIABLE
TAU
COEFFICIENT
LOWER
UPPER
const
0.05
0.25
0.50
0.75
0.95
124.880
95.4835
81.4822
62.3966
64.1040
98.3021
73.7861
53.2592
32.7449
46.2649
130.517
120.098
114.012
107.314
83.5790
income
0.05
0.25
0.50
0.75
0.95
0.343361
0.474103
0.560181
0.644014
0.709069
0.343327
0.420330
0.487022
0.580155
0.673900
0.389750
0.494329
0.601989
0.690413
0.734441
2 These
249
Coefficient on income
0.75
Quantile estimates with 90% band
OLS estimate with 90% band
0.7
0.65
0.6
0.55
0.5
0.45
0.4
0.35
0.3
0
0.2
0.4
0.6
0.8
tau
The gretl GUI has an entry for Quantile Regression (under /Model/Robust estimation), and you can
select multiple quantiles there too. In that context, just give space-separated numerical values (as
per the predefined options, shown in a drop-down list).
When you estimate a model in this way most of the standard menu items in the model window
are disabled, but one extra item is available graphs showing the sequence for a given coefficient in comparison with the OLS coefficient. An example is shown in Figure 28.1. This sort of
graph provides a simple means of judging whether quantile regression is redundant (OLS is fine) or
informative.
In the example shown based on data on household income and food expenditure gathered by
Ernst Engel (18211896) it seems clear that simple OLS regression is potentially misleading. The
crossing of the OLS estimate by the quantile estimates is very marked.
However, it is not always clear what implications should be drawn from this sort of conflict. With
the Engel data there are two issues to consider. First, Engels famous law claims an incomeelasticity of food consumption that is less than one, and talk of elasticities suggests a logarithmic
formulation of the model. Second, there are two apparently anomalous observations in the data
set: household 105 has the third-highest income but unexpectedly low expenditure on food (as
judged from a simple scatter plot), while household 138 (which also has unexpectedly low food
consumption) has much the highest income, almost twice that of the next highest.
With n = 235 it seems reasonable to consider dropping these observations. If we do so, and adopt
a loglog formulation, we get the plot shown in Figure 28.2. The quantile estimates still cross the
OLS estimate, but the evidence against OLS is much less compelling: the 90 percent confidence
bands of the respective estimates overlap at all the quantiles considered.
28.5
Large datasets
As noted above, when you give the --intervals option with the quantreg command, which calls
for estimation of confidence intervals via rank inversion, gretl switches from the default Frisch
Newton algorithm to the BarrodaleRoberts simplex method.
250
Coefficient on log(income)
0.96
0.94
0.92
0.9
0.88
0.86
0.84
0.82
0.8
0.78
Quantile estimates with 90% band
OLS estimate with 90% band
0.76
0
0.2
0.4
0.6
0.8
tau
Figure 28.2: Loglog regression; 2 observations dropped from full Engel data set.
This is OK for moderately large datasets (up to, say, a few thousand observations) but on very large
problems the simplex algorithm may become seriously bogged down. For example, Koenker and
Hallock (2001) present an analysis of the determinants of birth weights, using 198377 observations
and with 15 regressors. Generating confidence intervals via BarrodaleRoberts for a single value of
took about half an hour on a Lenovo Thinkpad T60p with 1.83GHz Intel Core 2 processor.
If you want confidence intervals in such cases, you are advised not to use the --intervals option,
but to compute them using the method of plus or minus so many standard errors. (One Frisch
Newton run took about 8 seconds on the same machine, showing the superiority of the interior
point method.) The script below illustrates:
quantreg .10 y 0 xlist
scalar crit = qnorm(.95)
matrix ci = $coeff - crit * $stderr
ci = ci~($coeff + crit * $stderr)
print ci
The matrix ci will contain the lower and upper bounds of the (symmetrical) 90 percent confidence
intervals.
To avoid a situation where gretl becomes unresponsive for a very long time we have set the maximum number of iterations for the BorrodaleRoberts algorithm to the (somewhat arbitrary) value
of 1000. We will experiment further with this, but for the meantime if you really want to use this
method on a large dataset, and dont mind waiting for the results, you can increase the limit using
the set command with parameter rq_maxiter, as in
set rq_maxiter 5000
Part III
Technical details
251
Chapter 29
Introduction
TEX initially developed by Donald Knuth of Stanford University and since enhanced by hundreds
of contributors around the world is the gold standard of scientific typesetting. Gretl provides
various hooks that enable you to preview and print econometric results using the TEX engine, and
to save output in a form suitable for further processing with TEX.
This chapter explains the finer points of gretls TEX-related functionality. The next section describes
the relevant menu items; section 29.3 discusses ways of fine-tuning TEX output; section 29.4 explains how to handle the encoding of characters not found in English; and section 29.5 gives some
pointers on installing (and learning) TEX if you do not already have it on your computer. (Just to
be clear: TEX is not included with the gretl distribution; it is a separate package, including several
programs and a large number of supporting files.)
Before proceeding, however, it may be useful to set out briefly the stages of production of a final
document using TEX. For the most part you dont have to worry about these details, since, in regard
to previewing at any rate, gretl handles them for you. But having some grasp of what is going on
behind the scences will enable you to understand your options better.
The first step is the creation of a plain text source file, containing the text or mathematics to be
typset, interspersed with mark-up that defines how it should be formatted. The second step is to
run the source through a processing engine that does the actual formatting. Typically this is either:
a program called latex that generates so-called DVI (device-independent) output, or
a program called pdflatex that generates PDF output.1
For previewing, one uses either a DVI viewer (typically xdvi on GNU/Linux systems) or a PDF viewer
(for example, Adobes Acrobat Reader or xpdf), depending on how the source was processed. If
the DVI route is taken, theres then a third step to produce printable output, typically using the
program dvips to generate a PostScript file. If the PDF route is taken, the output is ready for
printing without any further processing.
On the MS Windows and Mac OS X platforms, gretl calls pdflatex to process the source file, and
expects the operating system to be able to find the default viewer for PDF output; DVI is not
supported. On GNU/Linux the default is to take the DVI route, but if you prefer to use PDF you
can do the following: select the menu item Tools, Preferences, General then the Programs tab.
Find the item titled Command to compile TeX files, and set this to pdflatex. Make sure the
Command to view PDF files is set to something appropriate.
29.2
252
253
The first three sub-items have branches titled Tabular and Equation. By Tabular we mean that
the model is represented in the form of a table; this is the fullest and most explicit presentation of
the results. See Table 29.1 for an example; this was pasted into the manual after using the Copy,
Tabular item in gretl (a few lines were edited out for brevity).
Table 29.1: Example of LATEX tabular output
Coefficient
t-statistic
Std. Error
p-value
const
0.241105
0.0660225
3.6519
0.0007
CATHOL
0.223530
0.0459701
4.8625
0.0000
PUPIL
0.00338200
0.00271962
1.2436
0.2198
WHITE
0.152643
0.0407064
3.7499
0.0005
0.0955686
0.0522150
0.0709594
)
Standard error of residuals (
0.0388558
Unadjusted R 2
2
Adjusted R
0.479466
0.446241
F (3, 47)
14.4306
The Equation option is fairly self-explanatory the results are written across the page in equation format, as below:
(0.04597)
(0.0027196)
(0.040706)
= 0.038856
254
fragment while with Save it is written as a complete file. The point is that a well-formed TEX
source file must have a header that defines the documentclass (article, report, book or whatever)
and tags that say \begin{document} and \end{document}. This material is included when you do
Save but not when you do Copy, since in the latter case the expectation is that you will paste
the data into an existing TEX source file that already has the relevant apparatus in place.
The items under Equation options should be self-explanatory: when printing the model in equation form, do you want standard errors or t-ratios displayed in parentheses under the parameter
estimates? The default is to show standard errors; if you want t-ratios, select that item.
Other windows
Several other sorts of output windows also have TEX preview, copy and save enabled. In the case of
windows having a graphical toolbar, look for the TEX button. Figure 29.2 shows this icon (second
from the right on the toolbar) along with the dialog that appears when you press the button.
Figure 29.2: TEX icon and dialog
One aspect of gretls TEX support that is likely to be particularly useful for publication purposes is
the ability to produce a typeset version of the model table (see section 3.4). An example of this is
shown in Table 29.2.
29.3
There are three aspects to this: adjusting the appearance of the output produced by gretl in
LATEX preview mode; adjusting the formatting of gretls tabular output for models when using the
tabprint command; and incorporating gretls output into your own TEX files.
Previewing in the GUI
As regards preview mode, you can control the appearance of gretls output using a file named
gretlpre.tex, which should be placed in your gretl user directory (see the Gretl Command Reference). If such a file is found, its contents will be used as the preamble to the TEX source. The
default value of the preamble is as follows:
\documentclass[11pt]{article}
\usepackage[latin1]{inputenc} %% but see below
\usepackage{amsmath}
\usepackage{dcolumn,longtable}
\begin{document}
\thispagestyle{empty}
255
OLS estimates
Dependent variable: ENROLL
const
CATHOL
PUPIL
WHITE
Model 1
Model 2
Model 3
0.2907
0.2411
0.08557
(0.07853)
(0.06602)
(0.05794)
0.2216
0.2235
0.2065
(0.04584)
(0.04597)
(0.05160)
0.003035
0.003382
0.001697
(0.002727)
(0.002720)
(0.003025)
0.1482
(0.04074)
ADMEXP
0.1526
(0.04071)
0.1551
(0.1342)
n
2
R
`
51
51
51
0.4502
0.4462
0.2956
96.09
95.36
88.69
256
Note that the amsmath and dcolumn packages are required. (For some sorts of output the longtable
package is also needed.) Beyond that you can, for instance, change the type size or the font by altering the documentclass declaration or including an alternative font package.
The line \usepackage[latin1]{inputenc} is automatically changed if gretl finds itself running
on a system where UTF-8 is the default character encoding see section 29.4 below.
In addition, if you should wish to typeset gretl output in more than one language, you can set
up per-language preamble files. A localized preamble file is identified by a name of the form
gretlpre_xx.tex, where xx is replaced by the first two letters of the current setting of the LANG
environment variable. For example, if you are running the program in Polish, using LANG=pl_PL,
then gretl will do the following when writing the preamble for a TEX source file.
1. Look for a file named gretlpre_pl.tex in the gretl user directory. If this is not found, then
2. look for a file named gretlpre.tex in the gretl user directory. If this is not found, then
3. use the default preamble.
Conversely, suppose you usually run gretl in a language other than English, and have a suitable
gretlpre.tex file in place for your native language. If on some occasions you want to produce TEX
output in English, then you could create an additional file gretlpre_en.tex: this file will be used
for the preamble when gretl is run with a language setting of, say, en_US.
Command-line options
After estimating a model via a script or interactively via the gretl console or using the commandline program gretlcli you can use the commands tabprint or eqnprint to print the model to
file in tabular format or equation format respectively. These options are explained in the Gretl
Command Reference.
If you wish alter the appearance of gretls tabular output for models in the context of the tabprint
command, you can specify a custom row format using the --format flag. The format string must
be enclosed in double quotes and must be tied to the flag with an equals sign. The pattern for the
format string is as follows. There are four fields, representing the coefficient, standard error, tratio and p-value respectively. These fields should be separated by vertical bars; they may contain
a printf-type specification for the formatting of the numeric value in question, or may be left
blank to suppress the printing of that column (subject to the constraint that you cant formatting you can use the special variant --format=default.
Further editing
Once you have pasted gretls TEX output into your own document, or saved it to file and opened it
in an editor, you can of course modify the material in any wish you wish. In some cases, machinegenerated TEX is hard to understand, but gretls output is intended to be human-readable and
-editable. In addition, it does not use any non-standard style packages. Besides the standard LATEX
257
document classes, the only files needed are, as noted above, the amsmath, dcolumn and longtable
packages. These should be included in any reasonably full TEX implementation.
29.4
Character encodings
People using gretl in English-speaking locales are unlikely to have a problem with this, but if youre
generating TEX output in a locale where accented characters (not in the ASCII character set) are
employed, you may want to pay attention here.
Gretl generates TEX output using whatever character encoding is standard on the local system. If
the system encoding is in the ISO-8859 family, this will probably be OK wihout any special effort on
the part of the user. Newer GNU/Linux systems, however, typically use Unicode (UTF-8). This is also
OK so long as your TEX system can handle UTF-8 input, which requires use of the latex-ucs package.
So: if you are using gretl to generate TEX in a non-English locale, where the system encoding is UTF8, you will need to ensure that the latex-ucs package is installed. This package may or may not be
installed by default when you install TEX.
For reference, if gretl detects a UTF-8 environment, the following lines are used in the TEX preamble:
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
29.5
This is not the place for a detailed exposition of these matters, but here are a few pointers.
So far as we know, every GNU/Linux distribution has a package or set of packages for TEX, and in
fact these are likely to be installed by default. Check the documentation for your distribution. For
MS Windows, several packaged versions of TEX are available: one of the most popular is MiKTEX at. For Mac OS X a nice implementation is iTEXMac, at.
sourceforge.net/. An essential starting point for online TEX resources is the Comprehensive TEX
Archive Network (CTAN) at.
As for learning TEX, many useful resources are available both online and in print. Among online
guides, Tony Roberts LATEX: from quick and dirty to style and finesse is very helpful, at
An excellent source for advanced material is The LATEX Companion (Goossens et al., 2004).
Chapter 30
Gretl and R
30.1
Introduction
R is, by far, the largest free statistical project.1 Like gretl, it is a GNU project and the two have a
lot in common; however, gretls approach focuses on ease of use much more than R, which instead
aims to encompass the widest possible range of statistical procedures.
As is natural in the free software ecosystem, we dont view ourselves as competitors to R,2 but
rather as projects sharing a common goal who should support each other whenever possible. For
this reason, gretl provides a way to interact with R and thus enable users to pool the capabilities of
the two packages.
In this chapter, we will explain how to exploit Rs power from within gretl. We assume that the
reader has a working installation of R available and a basic grasp of Rs syntax.3
Despite several valiant attempts, no graphical shell has gained wide acceptance in the R community:
by and large, the standard method of working with R is by writing scripts, or by typing commands
at the R prompt, much in the same way as one would write gretl scripts or work with the gretl
console. In this chapter, the focus will be on the methods available to execute R commands without
leaving gretl.
30.2
The easiest way to use R from gretl is in interactive mode. Once you have your data loaded in gretl,
you can select the menu item Tools, Start GNU R and an interactive R session will be started, with
your dataset automatically pre-loaded.
A simple example: OLS on cross-section data
For this example we use Ramanathans dataset data4-1, one of the sample files supplied with gretl.
We first run, in gretl, an OLS regression of price on sqft, bedrms and baths. The basic results are
shown in Table 30.1.
Table 30.1: OLS house price regression via gretl
Variable
const
sqft
Coefficient
129.062
0.154800
Std. Error
88.3033
0.0319404
t-statistic
p-value
1.4616
0.1746
4.8465
0.0007
bedrms
21.587
27.0293
0.7987
0.4430
baths
12.192
43.2500
0.2819
0.7838
1 Rs
homepage is at.
who are we kidding? But its friendly competition!
3 The main reference for R documentation is. In addition, R tutorials
abound on the Net; as always, Google is your friend.
2 OK,
258
259
We will now replicate the above results using R. Select the menu item Tools, Start GNU R. A
window similar to the one shown in figure 30.1 should appear.
The actual look of the R window may be somewhat different from what you see in Figure 30.1
(especially for Windows users), but this is immaterial. The important point is that you have a
window where you can type commands to R. If the above procedure doesnt work and no R window
opens, it means that gretl was unable to launch R. You should ensure that R is installed and working
on your system and that gretl knows where it is. The relevant settings can be found by selecting
the Tools, Preferences, General menu entry, under the Programs tab.
Assuming R was launched successfully, you will see notification that the data from gretl are available. In the background, gretl has arranged for two R commands to be executed, one to load the
gretl dataset in the form of a data frame (one of several forms in which R can store data) and one
to attach the data so that the variable names defined in the gretl workspace are available as valid
identifiers within R.
In order to replicate gretls OLS estimation, go into the R window and type at the prompt
model <- lm(price ~ sqft + bedrms + baths)
summary(model)
You should see something similar to Figure 30.2. Surprise the estimates coincide! To get out,
just close the R window or type q() at the R prompt.
Time series data
We now turn to an example which uses time series data: we will compare gretls and Rs estimates
of Box and Jenkins immortal airline model. The data are contained in the bjg sample dataset.
The following gretl code
open bjg
arima 0 1 1 ; 0 1 1 ; lg --nc
260
Table 30.2: Airline model from Box and Jenkins (1976) selected portion of gretls estimates
Variable
Coefficient
t-statistic
Std. Error
p-value
0.401824
0.0896421
4.4825
0.0000
0.556936
0.0731044
7.6184
0.0000
Variance of innovations
Log-likelihood
Akaike information criterion
0.00134810
244.696
483.39
261
If we now open an R session as described in the previous subsection, the data-passing mechanism
is slightly different. Since our data were defined in gretl as time series, we use an R time-series
object (ts for short) for the transfer. In this way we can retain in R useful information such as the
periodicity of the data and the sample limits. The downside is that the names of individual series,
as defined in gretl, are not valid identifiers. In order to extract the variable lg, one needs to use the
syntax lg <- gretldata[, "lg"].
ARIMA estimation can be carried out by issuing the following two R commands:
lg <- gretldata[, "lg"]
arima(lg, c(0,1,1), seasonal=c(0,1,1))
which yield
Coefficients:
ma1
-0.4018
s.e.
0.0896
sma1
-0.5569
0.0731
aic = -483.4
30.3
Running an R script
Opening an R window and keying in commands is a convenient method when the job is small. In
some cases, however, it would be preferable to have R execute a script prepared in advance. One
way to do this is via the source() command in R. Alternatively, gretl offers the facility to edit an R
script and run it, having the current dataset pre-loaded automatically. This feature can be accessed
via the File, Script Files menu entry. By selecting User file, one can load a pre-existing R script;
if you want to create a new script instead, select the New script, R script menu entry.
In either case, you are presented with a window very similar to the editor window used for ordinary
gretl scripts, as in Figure 30.3.
There are two main differences. First, you get syntax highlighting for Rs syntax instead of gretls.
Second, clicking on the Execute button (the gears icon), launches an instance of R in which your
commands are executed. Before R is actually run, you are asked if you want to run R interactively
or not (see Figure 30.4).
An interactive run opens an R instance similar to the one seen in the previous section: your data
will be pre-loaded (if the pre-load data box is checked) and your commands will be executed.
Once this is done, you will find yourself at the R prompt, where you can enter more commands.
262
A non-interactive run, on the other hand, will execute your script, collect the output from R and
present it to you in an output window; R will be run in the background. If, for example, the script
in Figure 30.3 is run non-interactively, a window similar to Figure 30.5 will appear.
30.4
As regards the passing of data between the two programs, so far we have only considered passing
series from gretl to R. In order to achieve a satisfactory degree of interoperability, more is needed.
In the following sub-sections we see how matrices can be exchanged, and how data can be passed
from R back to gretl.
263
11
4
A=
5
12
13
14
9
10
Although in principle you can give your matrix file any valid filename, a couple of conventions may
prove useful. First, you may want to use an informative file suffix such as .mat, but this is a
matter of taste. More importantly, the exact location of the file created by mwrite could be an
issue. By default, if no path is specified in the file name, gretl stores matrix files in the current
work directory. However, it may be wise for the purpose at hand to use the directory in which gretl
stores all its temporary files, whose name is stored in the built-in string dotdir (see section 12.2).
The value of this string is automatically passed to R as the string variable gretl.dotdir, so the
above example may be rewritten more cleanly as
Gretl side:
matrix A = mshape(seq(3,14),4,3)
err = mwrite(A, "@dotdir/mymatfile.mat")
R side:
fname <- paste(gretl.dotdir, "mymatfile.mat", sep="")
A <- as.matrix(read.table(fname, skip=1))
264
where t is a trend component, t is a seasonal component and t is a noise term. In turn, the
following is assumed to hold:
t
t1 + t
s t
where s is the seasonal differencing operator, (1 Ls ), and t , t and t are mutually uncorrelated white noise processes. The object of the analysis is to estimate the variances of the noise
components (which may be zero) and to recover estimates of the latent processes t (the level),
t (the slope) and t .
Gretl does not provide (yet) a command for estimating this class of models, so we will use Rs
StructTS command and import the results back into gretl. Once the bjg dataset is loaded in gretl,
we pass the data to R and execute the following script:
# extract the log series
y <- gretldata[, "lg"]
# estimate the model
strmod <- StructTS(y)
# save the fitted components (smoothed)
compon <- as.ts(tsSmooth(strmod))
# save the estimated variances
vars <- as.matrix(strmod$coef)
# export into gretls temp dir
gretl.export(compon)
gretl.export(vars)
However, we are now able to pull the results back into gretl by executing the following commands,
either from the console or by creating a small script:4
append @dotdir/compon.csv
vars = mread("@dotdir/vars.mat")
The first command reads the estimated time-series components from a CSV file, which is the format
that the passing mechanism employs for series. The matrix vars is read from the file vars.mat.
After the above commands have been executed, three new series will have appeared in the gretl
workspace, namely the estimates of the three components; by plotting them together with the
original data, you should get a graph similar to Figure 30.6. The estimates of the variances can be
seen by printing the vars matrix, as in
? print vars
vars (4 x 1)
0.00077185
0.0000
0.0013969
0.0000
4 This example will work on Linux and presumably on OSX without modifications. On the Windows platform, you may
have to substitute the / character with \.
265
lg
6.6
6.4
6.2
6
5.8
5.6
5.4
5.2
5
4.8
4.6
1949
level
6.2
6
5.8
5.6
5.4
5.2
5
4.8
1955
1961
4.6
1949
1961
0.3
0.25
0.2
0.15
0.1
0.05
0
-0.05
-0.1
-0.15
-0.2
-0.25
1949
slope
0.0102
0.01015
0.0101
0.01005
1955
1961
sea
0.01025
0.01
1949
1955
1955
1961
That is,
2 = 0.00077185,
2 = 0,
= 0.0013969,
2 = 0
30.5
Up to this point we have spoken only of interaction with R via the GUI program. In order to do the
same from the command line interface, gretl provides the foreign command. This enables you to
embed non-native commands within a gretl script.
A foreign block takes the form
foreign language=R [--send-data] [--quiet]
... R commands ...
end foreign
and achieves the same effect as submitting the enclosed R commands via the GUI in the noninteractive mode (see section 30.3 above). The --send-data option arranges for auto-loading of
the data present in the gretl session. The --quiet option prevents the output from R from being
echoed in the gretl output.
Using this method, replicating the example in the previous subsection is rather easy: basically, all it
takes is encapsulating the content of the R script in a foreign. . . end foreign block; see example
30.1.
The above syntax, despite being already quite useful by itself, shows its full power when it is used
in conjunction with user-written functions. Example 30.2 shows how to define a gretl function that
calls R internally.
open bjg.gdt
foreign language=R --send-data
y <- gretldata[, "lg"]
strmod <- StructTS(y)
compon <- as.ts(tsSmooth(strmod))
vars <- as.matrix(strmod$coef)
gretl.export(compon)
gretl.export(vars)
end foreign
append
rename
rename
rename
@dotdir/compon.csv
level lg_level
slope lg_slope
sea lg_seas
vars = mread("@dotdir/vars.mat")
@dotdir/compon.csv
level @sx_level
slope @sx_slope
sea @sx_seas
266
30.6
267
R is a large and complex program, which takes an appreciable time to initialize itself.5 In interactive
use this not a significant problem, but if you have a gretl script that calls R repeatedly the cumulated
start-up costs can become bothersome. To get around this, gretl calls the R shared library by
preference; in this case the start-up cost is borne only once, on the first invocation of R code from
within gretl.
Support for the R shared library is built into the gretl packages for MS Windows and OS X but
the advantage is realized only if the library is in fact available at run time. If you are building gretl
yourself on Linux and wish to make use of the R library, you should ensure (a) that R has been
built with the shared library enabled (specify --enable-R-shlib when configuring your build of
R), and (b) that the pkg-config program is able to detect your R installation. We do not link to the
R library at build time, rather we open it dynamically on demand. The gretl GUI has an item under
the Tools/Preferences menu which enables you to select the path to the library, if it is not detected
automatically.
If you have the R shared library installed but want to force gretl to call the R executable instead,
you can do
set R_lib off
30.7
Besides improving performance, as noted above, use of the R shared library makes possible a
further refinement. That is, you can define functions in R, within a foreign block, then call those
functions later in your script much as if they were gretl functions. This is illustrated below.
set R_functions on
foreign language=R
plus_one <- function(q) {
z = q+1
invisible(z)
}
end foreign
scalar b=R.plus_one(2)
The R function plus_one is obviously trivial in itself, but the example shows a couple of points.
First, for this mechanism to work you need to enable R_functions via the set command. Second,
to avoid collision with the gretl function namespace, calls to functions defined in this way must be
prefixed with R., as in R.plus_one.
Built-in R functions may also be called in this way, once R_functions is set on. For example one
can invoke Rs choose function, which computes binomial coefficients:
set R_functions on
scalar b=R.choose(10,4)
Note, however, that the possibilities for use of built-in R functions are limited; only functions whose
arguments and return values are sufficiently generic (basically scalars or matrices) will work.
5 About
Chapter 31
Gretl and Ox
31.1
Introduction
Ox, written by Jurgen A. Doornik (see Doornik, 2007), is described by its author as an objectoriented statistical system. At its core is a powerful matrix language, which is complemented by
a comprehensive statistical library. Among the special features of Ox are its speed [and] welldesigned syntax. . . . Ox comes in two versions: Ox Professional and Ox Console. Ox is available for
Windows, Linux, Mac (OS X), and several Unix platforms. ()
Ox is proprietary, closed-source software. The command-line version of the program is, however,
available free of change for academic users. Quoting again from Doorniks website: The Console
(command line) versions may be used freely for academic research and teaching purposes only. . . .
The Ox syntax is public, and, of course, you may do with your own Ox code whatever you wish.
If you wish to use Ox in conjunction with gretl please refer to doornik.com for further details on
licensing.
As the reader will no doubt have noticed, all the other software that we discuss in this Guide is
open-source and freely available for all users. We make an exception for Ox on the grounds that it is
indeed fast and well designed, and that its statistical library along with various add-on packages
that are also available has exceptional coverage of cutting-edge techniques in econometrics.
The gretl authors have used Ox for benchmarking some of gretls more advanced features such as
dynamic panel models and the state space models.1
31.2
Ox support in gretl
The support offered for Ox in gretl is similar to that offered for R, as discussed in chapter 30, but
with a few differences. The first difference to note is that Ox support is not on by default; it must
be enabled explicitly.
+ To enable support for Ox, go to the Tools/Preferences/General menu item and check the box labeled
Enable Ox support. Click OK in the preferences dialog, then quit and restart gretl. You will now find,
under the Programs tab in the Tools/Preferences/General dialog, an entry for specifying the path to the oxl
executable, that is, the program that runs Ox files (on MS Windows it is called oxl.exe). Make sure that path
is right, and youre ready to go.
With support enabled, you can open and edit Ox programs in the gretl GUI. Clicking the execute
icon in the editor window will send your code to Ox for execution. Figures 31.1 and Figure 31.2
show an Ox program and part of its output.
In addition you can embed Ox code within a gretl script using a foreign block, as described in
connection with R. A trivial example, which simply prints the gretl data matrix within Ox, is shown
below:
open data4-1
matrix m = { dataset }
mwrite(m, "@dotdir/gretl.mat")
1 For a review of Ox, see Cribari-Neto and Zarkos (2003) and for a (somewhat dated) comparison of Ox with other
matrix-oriented packages such as GAUSS, see Steinhaus (1999).
268
269
270
foreign language=Ox
#include <oxstd.h>
main()
{
decl gmat = gretl_loadmat("gretl.mat");
print(gmat);
}
end foreign
The above example illustrates how a matrix can be passed from gretl to Ox. We use the mwrite
function to write a matrix into the users dotdir (see section 12.2), then in Ox we use the function
gretl_loadmat to retrieve the matrix.
How does gretl_loadmat come to be defined? When gretl writes out the Ox program corresponding to your foreign block it does two things in addition. First, it writes a small utility file named
gretl_io.ox into your dotdir. This contains a definition for gretl_loadmat and also for the
function gretl_export (see below). Second, gretl interpolates into your Ox code a line which includes this utility file (it is inserted right after the inclusion of oxstd.h, which is needed in all Ox
programs). Note that gretl_loadmat expects to find the named file in the users dotdir.
31.3
Example 31.1 shows a more ambitious case. This script replicates one of the dynamic panel data
models in Arellano and Bond (1991), first using gretl and then using Ox; we then check the relative
differences between the parameter estimates produced by the two programs (which turn out to be
reassuringly small).
Unlike the previous example, in this case we pass the dataset from gretl to Ox as a CSV file in
order to preserve the variable names. Note the use of the internal variable csv_na to get the right
representation of missing values for use with Ox and also note that the --send-data option for
the foreign command is not available in connection with Ox.
We get the parameter estimates back from Ox using gretl_export on the Ox side and mread on
the gretl side. The gretl_export function takes two arguments, a matrix and a file name. The file
is written into the users dotdir, from where it can be picked up using mread. The final portion of
the output from Example 31.1 is shown below:
? matrix oxparm = mread("/home/cottrell/.gretl/oxparm.mat")
Generated matrix oxparm
? eval abs((parm - oxparm) ./ oxparm)
1.4578e-13
3.5642e-13
5.0672e-15
1.6091e-13
8.9808e-15
2.0450e-14
1.0218e-13
2.1048e-13
9.5898e-15
1.8658e-14
2.1852e-14
2.9451e-13
1.9398e-13
Example 31.1: Estimation of dynamic panel data model via gretl and Ox
open abdata.gdt
# Take first differences of the independent variables
genr Dw = diff(w)
genr Dk = diff(k)
genr Dys = diff(ys)
# 1-step GMM estimation
arbond 2 ; n Dw Dw(-1) Dk Dys Dys(-1) 0 --time-dummies
matrix parm = $coeff
# Write CSV file for Ox
set csv_na .NaN
store @dotdir/abdata.csv
# Replicate using the Ox DPD package
foreign language=Ox
#include <oxstd.h>
#import <packages/dpd/dpd>
main ()
{
decl dpd = new DPD();
dpd.Load("@dotdir/abdata.csv");
dpd.SetYear("YEAR");
dpd.Select(Y_VAR, {"n", 0, 2});
dpd.Select(X_VAR, {"w", 0, 1, "k", 0, 0, "ys", 0, 1});
dpd.Select(I_VAR, {"w", 0, 1, "k", 0, 0, "ys", 0, 1});
dpd.Gmm("n", 2, 99); // GMM-type instrument
dpd.SetDummies(D_CONSTANT + D_TIME);
dpd.SetTest(2, 2); // Sargan, AR 1-2 tests
dpd.Estimate();
// 1-step estimation
decl parm = dpd.GetPar();
gretl_export(parm, "oxparm.mat");
delete dpd;
}
end foreign
# Compare the results
matrix oxparm = mread("@dotdir/oxparm.mat")
eval abs((parm - oxparm) ./ oxparm)
271
Chapter 32
Introduction
GNU Octave, written by John W. Eaton and others, is described as a high-level language, primarily intended for numerical computations. The program is oriented towards solving linear and
nonlinear problems numerically and performing other numerical experiments using a language
that is mostly compatible with Matlab. () Octave is available in
source-code form (naturally, for GNU software) and also in the form of binary packages for MS Windows and Mac OS X. Numerous contributed packages that extend Octaves functionality in various
ways can be found at octave.sf.net.
32.2
The support offered for Octave in gretl is similar to that offered for R (chapter 30). For example,
you can open and edit Octave scripts in the gretl GUI. Clicking the execute icon in the editor
window will send your code to Octave for execution. Figures 32.1 and Figure 32.2 show an Octave
script and its output; in this example we use the function logistic_regression to replicate some
results from Greene (2000).
In addition you can embed Octave code within a gretl script using a foreign block, as described
in connection with R. A trivial example, which simply loads and prints the gretl data matrix within
Octave, is shown below. (Note that in Octave, appending ; to a line suppresses verbose output;
leaving off the semicolon results in printing of the object that is produced, if any.)
open data4-1
matrix m = { dataset }
mwrite(m, "@dotdir/gretl.mat")
foreign language=Octave
gmat = gretl_loadmat("gretl.mat")
end foreign
We use the mwrite function to write a matrix into the users dotdir (see section 12.2), then in Octave we use the function gretl_loadmat to retrieve the matrix. The magic behind gretl_loadmat
works in essentially the same way as for Ox (chapter 31).
32.3
We now present a more ambitious example which exploits Octaves handling of the frequency
domain (and also its ability to use code written for MATLAB), namely estimation of the spectral coherence of two time series. For this illustration we require two extra Octave packages
from octave.sf.net, namely those supporting spectral functions (specfun) and signal processing (signal). After downloading the packages you can install them from within Octave as follows
(using version numbers as of March 2010):
pkg install specfun-1.0.8.tar.gz
pkg install signal-1.0.10.tar.gz
272
273
274
In addition we need some specialized MATLAB files made available by Mario Forni of the University of Modena, at. The files
needed are coheren2.m, coheren.m, coher.m, cospec.m, crosscov.m, crosspec.m, crosspe.m
and spec.m. These are in a form appropriate for MS Windows. On Linux you could run the following shell script to get the files and remove the Windows end-of-file character (which prevents the
files from running under Octave):
SITE=
# download files and delete trailing Ctrl-Z
for f in \
coheren2.m \
coheren.m \
coher.m \
cospec.m \
crosscov.m \
crosspec.m \
crosspe.m \
spec.m ; do
wget $SITE/$f && \
cat $f | tr -d \\032 > tmp.m && mv tmp.m $f
done
The Forni files should be placed in some appropriate directory, and you should tell Octave where
to find them by adding that directory to Octaves loadpath. On Linux this can be done via an entry
in ones ~/.octaverc file. For example
addpath("~/stats/octave/forni");
Alternatively, an addpath directive can be written into the Octave script that calls on these files.
With everything set up on the Octave side we now write a gretl script (see Example 32.1) which
opens a time-series dataset, constructs and writes a matrix containing two series, and defines a
foreign block containing the Octave statements needed to produce the spectral coherence matrix.
The matrix is exported via the gretl_export function, which is automatically defined for you; this
function takes two arguments, a matrix and a file name. The file is written into the users dotdir,
from where it can be picked up using mread. Finally, we produce a graph from the matrix in gretl.
In the script this is sent to the screen; Figure 32.3 shows the same graph in PDF format.
275
open data9-7
matrix xy = { PRIME, UNEMP }
mwrite(xy, "@dotdir/xy.mat")
foreign language=Octave
# uncomment and modify the following if necessary
# addpath("~/stats/octave/forni");
xy = gretl_loadmat("xy.mat");
x = xy(:,1);
y = xy(:,2);
# note: the last parameter is the Bartlett window size
h = coher(x, y, 8);
gretl_export(h, "h.mat");
end foreign
h = mread("@dotdir/h.mat")
colnames(h, "coherence")
gnuplot 1 --time-series --with-lines --matrix=h --output=display
0.4
0.3
0.2
coherence
0.1
0
-0.1
-0.2
-0.3
-0.4
-0.5
10
20
30
40
50
60
Chapter 33
Troubleshooting gretl
33.1
Bug reports
Bug reports are welcome. Hopefully, you are unlikely to find bugs in the actual calculations done
by gretl (although this statement does not constitute any sort of warranty). You may, however,
come across bugs or oddities in the behavior of the graphical interface. Please remember that the
usefulness of bug reports is greatly enhanced if you can be as specific as possible: what exactly
went wrong, under what conditions, and on what operating system? If you saw an error message,
what precisely did it say?
33.2
Auxiliary programs
As mentioned above, gretl calls some other programs to accomplish certain tasks (gnuplot for
graphing, LATEX for high-quality typesetting of regression output, GNU R). If something goes wrong
with such external links, it is not always easy for gretl to produce an informative error message.
If such a link fails when accessed from the gretl graphical interface, you may be able to get more
information by starting gretl from the command prompt rather than via a desktop menu entry or
icon. On the X window system, start gretl from the shell prompt in an xterm; on MS Windows, start
the program gretlw32.exe from a console window or DOS box using the -g or --debug option
flag. Additional error messages may be displayed on the terminal window.
Also please note that for most external calls, gretl assumes that the programs in question are
available in your path that is, that they can be invoked simply via the name of the program,
without supplying the programs full location.1 Thus if a given program fails, try the experiment of
typing the program name at the command prompt, as shown below.
Graphing
Typesetting
GNU R
X window system
gnuplot
latex, xdvi
MS Windows
wgnuplot.exe
pdflatex
RGui.exe
If the program fails to start from the prompt, its not a gretl issue but rather that the programs
home directory is not in your path, or the program is not installed (properly). For details on
modifying your path please see the documentation or online help for your operating system or
shell.
1 The
exception to this rule is the invocation of gnuplot under MS Windows, where a full path to the program is given.
276
Chapter 34
Effect
Ctrl-a
go to start of line
Ctrl-e
go to end of line
Ctrl-d
where Ctrl-a means press the a key while the Ctrl key is also depressed. Thus if you want
to change something at the beginning of a command, you dont have to backspace over the whole
line, erasing as you go. Just hop to the start and add or delete characters. If you type the first
letters of a command name then press the Tab key, readline will attempt to complete the command
name for you. If theres a unique completion it will be put in place automatically. If theres more
than one completion, pressing Tab a second time brings up a list.
Probably the most useful mode for heavy-duty work with gretlcli is batch (non-interactive) mode,
in which the program reads and processes a script, and sends the output to file. For example
gretlcli -b scriptfile > outputfile
Note that scriptfile is treated as a program argument; only the output file requires redirection (>).
Dont forget the -b (batch) switch, otherwise the program will wait for user input after executing
the script (and if output is redirected, the program will appear to hang).
1 Actually,
the key bindings shown below are only the defaults; they can be customized. See the readline manual.
277
Part IV
Appendices
278
Appendix A
In gretls native data format, a data set is stored in XML (extensible mark-up language). Data
files correspond to the simple DTD (document type definition) given in gretldata.dtd, which is
supplied with the gretl distribution and is installed in the system data directory (e.g. /usr/share/
gretl/data on Linux.) Data files may be plain text or gzipped. They contain the actual data values
plus additional information such as the names and descriptions of variables, the frequency of the
data, and so on.
Most users will probably not have need to read or write such files other than via gretl itself, but
if you want to manipulate them using other software tools you should examine the DTD and also
take a look at a few of the supplied practice data files: data4-1.gdt gives a simple example;
data4-10.gdt is an example where observation labels are included.
A.2
For backward compatibility, gretl can also handle data files in the traditional format inherited
from Ramanathans ESL program. In this format (which was the default in gretl prior to version
0.98) a data set is represented by two files. One contains the actual data and the other information
on how the data should be read. To be more specific:
1. Actual data: A rectangular matrix of white-space separated numbers. Each column represents
a variable, each row an observation on each of the variables (spreadsheet style). Data columns
can be separated by spaces or tabs. The filename should have the suffix .gdt. By default the
data file is ASCII (plain text). Optionally it can be gzip-compressed to save disk space. You
can insert comments into a data file: if a line begins with the hash mark (#) the entire line is
ignored. This is consistent with gnuplot and octave data files.
2. Header: The data file must be accompanied by a header file which has the same basename as
the data file plus the suffix .hdr. This file contains, in order:
(Optional) comments on the data, set off by the opening string (* and the closing string
*), each of these strings to occur on lines by themselves.
(Required) list of white-space separated names of the variables in the data file. Names
are limited to 8 characters, must start with a letter, and are limited to alphanumeric
characters plus the underscore. The list may continue over more than one line; it is
terminated with a semicolon, ;.
(Required) observations line of the form 1 1 85. The first element gives the data frequency (1 for undated or annual data, 4 for quarterly, 12 for monthly). The second and
third elements give the starting and ending observations. Generally these will be 1 and
the number of observations respectively, for undated data. For time-series data one can
use dates of the form 1959.1 (quarterly, one digit after the point) or 1967.03 (monthly,
two digits after the point). See Chapter 16 for special use of this line in the case of panel
data.
The keyword BYOBS.
279
280
The corresponding data file contains three columns of data, each having 90 entries. Three further
features of the traditional data format may be noted.
1. If the BYOBS keyword is replaced by BYVAR, and followed by the keyword BINARY, this indicates that the corresponding data file is in binary format. Such data files can be written from
gretlcli using the store command with the -s flag (single precision) or the -o flag (double
precision).
2. If BYOBS is followed by the keyword MARKERS, gretl expects a data file in which the first column
contains strings (8 characters maximum) used to identify the observations. This may be handy
in the case of cross-sectional data where the units of observation are identifiable: countries,
states, cities or whatever. It can also be useful for irregular time series data, such as daily
stock price data where some days are not trading days in this case the observations can
be marked with a date string such as 10/01/98. (Remember the 8-character maximum.) Note
that BINARY and MARKERS are mutually exclusive flags. Also note that the markers are not
considered to be a variable: this column does not have a corresponding entry in the list of
variable names in the header file.
3. If a file with the same base name as the data file and header files, but with the suffix .lbl,
is found, it is read to fill out the descriptive labels for the data series. The format of the
label file is simple: each line contains the name of one variable (as found in the header
file), followed by one or more spaces, followed by the descriptive label. Here is an example:
price New car price index, 1982 base year
If you want to save data in traditional format, use the -t flag with the store command, either in
the command-line program or in the console window of the GUI program.
A.3
A gretl database consists of two parts: an ASCII index file (with filename suffix .idx) containing
information on the series, and a binary file (suffix .bin) containing the actual data. Two examples
of the format for an entry in the idx file are shown below:
G0M910 Composite index of 11 leading indicators (1987=100)
M 1948.01 - 1995.11 n = 575
currbal Balance of Payments: Balance on Current Account; SA
Q 1960.1 - 1999.4 n = 160
The first field is the series name. The second is a description of the series (maximum 128 characters). On the second line the first field is a frequency code: M for monthly, Q for quarterly, A for
annual, B for business-daily (daily with five days per week) and D for daily (seven days per week).
No other frequencies are accepted at present. Then comes the starting date (N.B. with two digits
following the point for monthly data, one for quarterly data, none for annual), a space, a hyphen,
281
another space, the ending date, the string n = and the integer number of observations. In the
case of daily data the starting and ending dates should be given in the form YYYY/MM/DD. This
format must be respected exactly.
Optionally, the first line of the index file may contain a short comment (up to 64 characters) on the
source and nature of the data, following a hash mark. For example:
# Federal Reserve Board (interest rates)
The corresponding binary database file holds the data values, represented as floats, that is, singleprecision floating-point numbers, typically taking four bytes apiece. The numbers are packed by
variable, so that the first n numbers are the observations of variable 1, the next m the observations
on variable 2, and so on.
Appendix B
B.1
ODBC support
The piece of software that bridges between gretl and the ODBC system is a dynamically loaded
plugin. This is included in the gretl packages for MS Windows and Mac OS X (on OS X support
was added in gretl 1.9.0). On other unix-type platforms (notably Linux) you will have to build gretl
from source to get ODBC support. This is because the gretl plugin depends on having unixODBC
installed, which we cannot assume to be the case on typical Linux systems. To enable the ODBC
plugin when building gretl, you must pass the option --with-odbc to gretls configure script. In
addition, if unixODBC is installed in a non-standard location you will have to specify its installation
prefix using --with-ODBC-prefix, as in (for example)
./configure --with-odbc --with-ODBC-prefix=/opt/ODBC
B.2
ODBC is short for Open DataBase Connectivity, a group of software methods that enable a client to
interact with a database server. The most common operation is when the client fetches some data
from the server. ODBC acts as an intermediate layer between client and server, so the client talks
to ODBC rather than accessing the server directly (see Figure B.1).
ODBC
query
data
For the above mechanism to work, it is necessary that the relevant ODBC software is installed
and working on the client machine (contact your DB administrator for details). At this point, the
database (or databases) that the server provides will be accessible to the client as a data source
with a specific identifier (a Data Source Name or DSN); in most cases, a username and a password
are required to connect to the data source.
Once the connection is established, the user sends a query to ODBC, which contacts the database
manager, collects the results and sends them back to the user. The query is almost invariably
282
283
formulated in a special language used for the purpose, namely SQL.1 We will not provide here an
SQL tutorial: there are many such tutorials on the Net; besides, each database manager tends to
support its own SQL dialect so the precise form of an SQL query may vary slightly if the DBMS on
the other end is Oracle, MySQL, PostgreSQL or something else.
Suffice it to say that the main statement for retrieving data is the SELECT statement. Within a DBMS,
data are organized in tables, which are roughly equivalent to spreadsheets. The SELECT statement
returns a subset of a table, which is itself a table. For example, imagine that the database holds a
table called NatAccounts, containing the data shown in Table B.1.
year
qtr
gdp
consump
tradebal
1970
584763
344746.9
5891.01
1970
597746
350176.9
7068.71
1970
604270
355249.7
8379.27
1970
609706
361794.7
7917.61
1971
609597
362490
6274.3
1971
617002
368313.6
6658.76
1971
625536
372605
4795.89
1971
630047
377033.9
6498.13
tradebal
gdp
5891.01
584763
7068.71
597746
8379.27
604270
7917.61
609706
Gretl provides a mechanism for forwarding your query to the DBMS via ODBC and including the
results in your currently open dataset.
B.3
Syntax
At present gretl does not offer a graphical interface for ODBC import; this must be done via the
command line interface. The two commands used for fetching data via an ODBC connection are
open and data.
The open command is used for connecting to a DBMS: its syntax is
open dsn=database [user=username] [password=password] --odbc
The user and password items are optional; the effect of this command is to initiate an ODBC
connection. It is assumed that the machine gretl runs on has a working ODBC client installed.
In order to actually retrieve the data, the data command is used. Its syntax is:
1 See.
284
which will store into the gretl variable x the content of the column foo from the table bar. However,
since in a real-life situation the string containing the SQL statement may be rather long, it may be
best to store it in a string variable. For example:
string SqlQry = "SELECT foo1, foo2 FROM bar"
data x y query=SqlQry --odbc
(The series named index is automatically added to a dataset created via the nulldata command.)
The format specifiers available for use with obs-format are as follows:
%d
%s
%g
2 Prior to gretl 1.8.8, the tag query= was not required (or accepted) before the query string, and only one series could
be imported at a time. This variant is still accepted for the sake of backward compatibility.
285
In addition the format can include literal characters to be passed through, such as slashes or colons,
to make the resulting string compatible with gretls observation identifiers.
For example, consider the following fictitious case: we have a 5-days-per-week dataset, to which we
want to add the stock index for the Verdurian market;3 it so happens that in Verduria Saturdays
are working days but Wednesdays are not. We want a column which does not contain data on
Saturdays, because we wouldnt know where to put them, but at the same time we want to place
missing values on all the Wednesdays.
In this case, the following syntax could be used
string QRY="SELECT year,month,day,VerdSE FROM AlmeaIndexes"
data y obs-format="%d/%d/%d" query=QRY --odbc
The column VerdSE holds the data to be fetched, which will go into the gretl series y. The first
three columns are used to construct a string which identifies the day. Daily dates take the form
YYYY/MM/DD in gretl. If a row from the DBMS produces the observation string 2008/04/01 this will
match OK (its a Tuesday), but 2008/04/05 will not match since it is a Saturday; the corresponding
row will therefore be discarded. On the other hand, since no string 2008/04/23 will be found in
the data coming from the DBMS (its a Wednesday), that entry is left blank in our series y.
B.4
Examples
Table Consump
Table DATA
Field
Type
time
decimal(7,2)
income
decimal(16,6)
consump
decimal(16,6)
Field
Type
year
decimal(4,0)
qtr
decimal(1,0)
varname
varchar(16)
xval
decimal(20,10)
Table Consump
Table DATA
1970.00
424278.975500
344746.944000
1970.25
433218.709400
350176.890400
1970.50
440954.219100
355249.672300
1970.75
446278.664700
361794.719900
1971.00
447752.681800
362489.970500
1971.25
453553.860100
368313.558500
1971.50
460115.133100
372605.015300
...
1970
CAN
517.9085000000
1970
CAN
662.5996000000
1970
CAN
1130.4155000000
1970
CAN
467.2508000000
1970
COMPR
18.4000000000
1970
COMPR
18.6341000000
1970
COMPR
18.3000000000
1970
COMPR
18.2663000000
1970
D1
1.0000000000
1970
D1
0.0000000000
...
Table B.4: Example AWM database data
In the following examples, we will assume that access is available to a database known to ODBC
with the data source name AWM, with username Otto and password Bingo. The database
AWM contains quarterly data in two tables (see B.3 and B.4):
3 See.
286
The table Consump is the classic rectangular dataset; that is, its internal organization is the same
as in a spreadsheet or econometrics package: each row is a data point and each column is a variable.
The structure of the DATA table is different: each record is one figure, stored in the column xval,
and the other fields keep track of which variable it belongs to, for which date.
Example B.1: Simple query from a rectangular table
nulldata 160
setobs 4 1970:1 --time
open dsn=AWM user=Otto password=Bingo --odbc
string Qry = "SELECT consump, income FROM Consump"
data cons inc query=Qry --odbc
Example B.1 shows a query for two series: first we set up an empty quarterly dataset. Then we
connect to the database using the open statement. Once the connection is established we retrieve
two columns from the Consump table. No observation string is required because the data already
have a suitable structure; we need only import the relevant columns.
Example B.2: Simple query from a non-rectangular table
In example B.2, by contrast, we make use of the observation string since we are drawing from the
DATA table, which is not rectangular. The SQL statement stored in the string S produces a table with
three columns. The ORDER BY clause ensures that the rows will be in chronological order, although
this is not strictly necessary in this case.
287
Example B.3 shows what happens if the rows in the outcome from the SELECT statement do not
match the observations in the currently open gretl dataset. The query includes a condition which
filters out all the data from the first quarter. The query result (invisible to the user) would be
something like
+------+------+---------------+
| year | qtr | xval
|
+------+------+---------------+
| 1970 |
2 | 7.8705000000 |
| 1970 |
3 | 7.5600000000 |
| 1970 |
4 | 7.1892000000 |
| 1971 |
2 | 5.8679000000 |
| 1971 |
3 | 6.2442000000 |
| 1971 |
4 | 5.9811000000 |
| 1972 |
2 | 4.6883000000 |
| 1972 |
3 | 4.6302000000 |
...
Internally, gretl fills the variable bar with the corresponding value if it finds a match; otherwise, NA
is used. Printing out the variable bar thus produces
Obs
1970:1
1970:2
1970:3
1970:4
1971:1
1971:2
1971:3
1971:4
1972:1
1972:2
1972:3
...
bar
7.8705
7.5600
7.1892
5.8679
6.2442
5.9811
4.6883
4.6302
Appendix C
Building gretl
C.1
Requirements
Gretl is written in the C programming language, abiding as far as possible by the ISO/ANSI C
Standard (C90) although the graphical user interface and some other components necessarily make
use of platform-specific extensions.
The program was developed under Linux. The shared library and command-line client should
compile and run on any platform that supports ISO/ANSI C and has the libraries listed in Table C.1.
If the GNU readline library is found on the host system this will be used for gretcli, providing a
much enhanced editable command line. See the readline homepage.
Library
purpose
website
zlib
data compression
info-zip.org
libxml2
XML manipulation
xmlsoft.org
LAPACK
linear algebra
netlib.org
FFTW3
fftw.org
glib-2.0
Numerous utilities
gtk.org
The graphical client program should compile and run on any system that, in addition to the above
requirements, offers GTK version 2.4.0 or higher (see gtk.org).1
Gretl calls gnuplot for graphing. You can find gnuplot at gnuplot.info. As of this writing the most
recent official release is 4.2.6 (of September, 2009). The gretl packages for MS Windows and Mac OS
X come with current CVS gnuplot (version 4.5), and the gretl website offers information on building
or installing gnuplot 4.5 on Linux.
Some features of gretl make use of portions of Adrian Feguins gtkextra library. The relevant parts
of this package are included (in slightly modified form) with the gretl source distribution.
A binary version of the program is available for the Microsoft Windows platform (Windows 2000
or higher). This version was cross-compiled under Linux using mingw (the GNU C compiler, gcc,
ported for use with win32) and linked against the Microsoft C library, msvcrt.dll. The (free,
open-source) Windows installer program is courtesy of Jordan Russell (jrsoftware.org).
C.2
In this section we give instructions detailed enough to allow a user with only a basic knowledge of
a Unix-type system to build gretl. These steps were tested on a fresh installation of Debian Etch.
For other Linux distributions (especially Debian-based ones, like Ubuntu and its derivatives) little
should change. Other Unix-like operating systems such as MacOSX and BSD would probably require
more substantial adjustments.
In this guided example, we will build gretl complete with documentation. This introduces a few
1 Up
till version 1.5.1, gretl could also be built using GTK 1.2. Support for this was dropped at version 1.6.0 of gretl.
288
289
more requirements, but gives you the ability to modify the documentation files as well, like the
help files or the manuals.
Installing the prerequisites
We assume that the basic GNU utilities are already installed on the system, together with these
other programs:
some TEX/LATEXsystem (texlive will do beautifully)
Gnuplot
ImageMagick
We also assume that the user has administrative privileges and knows how to install packages. The
examples below are carried out using the apt-get shell command, but they can be performed with
menu-based utilities like aptitude, dselect or the GUI-based program synaptic. Users of Linux
distributions which employ rpm packages (e.g. Red Hat/Fedora, Mandriva, SuSE) may want to refer
to the dependencies page on the gretl website.
The first step is installing the C compiler and related basic utilities, if these are not already in
place. On a Debian system, these are contained in a bunch of packages that can be installed via the
command
apt-get install gcc autoconf automake1.9 libtool flex bison gcc-doc \
libc6-dev libc-dev gfortran gettext pkgconfig
Then it is necessary to install the development (dev) packages for the libraries that gretl uses:
Library
command
GLIB
GTK 2.0
PNG
XSLT
LAPACK
FFTW
READLINE
ZLIB
XML
GMP
MPFR
(GMP and MPFR are optional, but recommended.) The dev packages for these libraries are necessary
to compile gretl youll also need the plain, non-dev library packages to run gretl, but most of
these should already be part of a standard installation. In order to enable other optional features,
like audio support, you may need to install more libraries.
+ The above steps can be much simplified on Linux systems that provide deb-based package managers,
such as Debian and its derivatives (Ubuntu, Knoppix and other distributions). The command
apt-get build-dep gretl
will download and install all the necessary packages for building the version of gretl that is currently present
in your APT sources. Techincally, this does not guarantee that all the software necessary to build the CVS
version is included, because the version of gretl on your repository may be quite old and build requirements
may have changed in the meantime. However, the chances of a mismatch are rather remote for a reasonably
up-to-date system, so in most cases the above command should take care of everything correctly.
290
After the first command you will be prompted for a password: just hit the Enter key. After the
second command, cvs should create a subdirectory named gretl and fill it with the current sources.
When you want to update the source, this is very simple: just move into the gretl directory and
type
cvs update -d -P
Assuming youre now in the CVS gretl directory, you can proceed in the same manner as with the
released source package.
Configure the source
The next command you need is ./configure; this is a complex script that detects which tools you
have on your system and sets things up. The configure command accepts many options; you may
want to run
./configure --help
first to see what options are available. One option you way wish to tweak is --prefix. By default
the installation goes under /usr/local but you can change this. For example
./configure --prefix=/usr
291
will put everything under the /usr tree. Another useful option refers to the fact that, by default,
gretl offers support for the gnome desktop. If you want to suppress the gnome-specific features
you can pass the option --without-gnome to configure.
In order to have the documentation built, we need to pass the relevant option to configure, as in
./configure --enable-build-doc
But please note that this option will work only if you are using the CVS source.
You will see a number of checks being run, and if everything goes according to plan, you should
see a summary similar to that displayed in Example C.1.
Example C.1: Output from ./configure --enable-build-doc
Configuration:
Installation path:
Use readline library:
Use gnuplot for graphs:
Use PNG for gnuplot graphs:
Use LaTeX for typesetting output:
Gnu Multiple Precision support:
MPFR support:
LAPACK support:
FFTW3 support:
Build with GTK version:
Script syntax highlighting:
Use installed gtksourceview:
Build with gnome support:
Build gretl documentation:
Build message catalogs:
Gnome installation prefix:
X-12-ARIMA support:
TRAMO/SEATS support:
Experimental audio support:
/usr/local
yes
yes
yes
yes
yes
no
yes
yes
2.0
yes
yes
no
yes
yes
NA
yes
yes
no
+ If youre using CVS, its a good idea to re-run the configure script after doing an update. This is not
always necessary, but sometimes it is, and it never does any harm. For this purpose, you may want to write
a little shell script that calls configure with any options you want to use.
Build and install
We are now ready to undertake the compilation proper: this is done by running the make command,
which takes care of compiling all the necessary source files in the correct order. All you need to do
is type
make
This step will likely take several minutes to complete; a lot of output will be produced on screen.
Once this is done, you can install your freshly baked copy of gretl on your system via
make install
292
On most systems, the make install command requires you to have administrative privileges.
Hence, either you log in as root before launching make install or you may want to use the sudo
utility:
sudo make install
Appendix D
Numerical accuracy
Gretl uses double-precision arithmetic throughout except for the multiple-precision plugin invoked by the menu item Model, Other linear models, High precision OLS which represents floatingpoint values using a number of bits given by the environment variable GRETL_MP_BITS (default
value 256).
The normal equations of Least Squares are by default solved via Cholesky decomposition, which
is highly accurate provided the matrix of cross-products of the regressors, X 0 X, is not very ill
conditioned. If this problem is detected, gretl automatically switches to use QR decomposition.
The program has been tested rather thoroughly on the statistical reference datasets provided by
NIST (the U.S. National Institute of Standards and Technology) and a full account of the results may
be found on the gretl website (follow the link Numerical accuracy).
To date, two published reviews have discussed gretls accuracy: Giovanni Baiocchi and Walter Distaso (2003), and Talha Yalta and Yasemin Yalta (2007). We are grateful to these authors for their
careful examination of the program. Their comments have prompted several modifications including the use of Stephen Moshiers cephes code for computing p-values and other quantities relating
to probability distributions (see netlib.org), changes to the formatting of regression output to ensure that the program displays a consistent number of significant digits, and attention to compiler
issues in producing the MS Windows version of gretl (which at one time was slighly less accurate
than the Linux version).
Gretl now includes a plugin that runs the NIST linear regression test suite. You can find this under
the Tools menu in the main window. When you run this test, the introductory text explains the
expected result. If you run this test and see anything other than the expected result, please send a
bug report to [email protected].
All regression statistics are printed to 6 significant figures in the current version of gretl (except
when the multiple-precision plugin is used, in which case results are given to 12 figures). If you
want to examine a particular value more closely, first save it (for example, using the genr command)
then print it using printf, to as many digits as you like (see the Gretl Command Reference).
293
Appendix E
294
Appendix F
Listing of URLs
Below is a listing of the full URLs of websites mentioned in the text.
Estima (RATS)
FFTW3
Gnome desktop homepage
GNU Multiple Precision (GMP) library
GNU Octave homepage
GNU R homepage
GNU R manual
Gnuplot homepage
Gnuplot manual
Gretl data page
Gretl homepage
GTK+ homepage
GTK+ port for win32
Gtkextra homepage
InfoZip homepage
JMulTi homepage
JRSoftware
Mingw (gcc for win32) homepage
Minpack
Penn World Table
Readline homepage
Readline manual
Xmlsoft homepage
295
Bibliography
Akaike, H. (1974) A new look at the statistical model identification, IEEE Transactions on Automatic Control AC-19: 716723.
Anderson, B. and J. Moore (1979) Optimal Filtering, Upper Saddle River, NJ: Prentice-Hall.
Anderson, T. W. and C. Hsiao (1981) Estimation of dynamic models with error components, Journal of the American Statistical Association 76: 598606.
Andrews, D. W. K. and J. C. Monahan (1992) An improved heteroskedasticity and autocorrelation
consistent covariance matrix estimator, Econometrica 60: 953966.
Arellano, M. (2003) Panel Data Econometrics, Oxford: Oxford University Press.
Arellano, M. and S. Bond (1991) Some tests of specification for panel data: Monte carlo evidence
and an application to employment equations, The Review of Economic Studies 58: 277297.
Baiocchi, G. and W. Distaso (2003) GRETL: Econometric software for the GNU generation, Journal
of Applied Econometrics 18: 105110.
Baltagi, B. H. (1995) Econometric Analysis of Panel Data, New York: Wiley.
Barrodale, I. and F. D. K. Roberts (1974) Solution of an overdetermined system of equations in the
`l norm, Communications of the ACM 17: 319320.
Baxter, M. and R. G. King (1999) Measuring business cycles: Approximate band-pass filters for
economic time series, The Review of Economics and Statistics 81(4): 575593.
Beck, N. and J. N. Katz (1995) What to do (and not to do) with time-series cross-section data, The
American Political Science Review 89: 634647.
Blundell, R. and S. Bond (1998) Initial conditions and moment restrictions in dynamic panel data
models, Journal of Econometrics 87: 115143.
Bond, S., A. Hoeffler and J. Temple (2001) GMM estimation of empirical growth models. Economics
Papers from Economics Group, Nuffield College, University of Oxford, No 2001-W21.
Boswijk, H. P. (1995) Identifiability of cointegrated systems. Tinbergen Institute Discussion Paper
95-78..
Boswijk, H. P. and J. A. Doornik (2004) Identifying, estimating and testing restricted cointegrated
systems: An overview, Statistica Neerlandica 58(4): 440465.
Box, G. E. P. and G. Jenkins (1976) Time Series Analysis: Forecasting and Control, San Franciso:
Holden-Day.
Brand, C. and N. Cassola (2004) A money demand system for euro area M3, Applied Economics
36(8): 817838.
Butterworth, S. (1930) On the theory of filter amplifiers, Experimental Wireless & The Wireless
Engineer 7: 536541.
Byrd, R. H., P. Lu, J. Nocedal and C. Zhu (1995) A limited memory algorithm for bound constrained
optimization, SIAM Journal on Scientific Computing 16: 11901208.
296
Bibliography
297
Bibliography
298
Bibliography
299
Lucchetti, R., L. Papi and A. Zazzaro (2001) Banks inefficiency and economic growth: A micro
macro approach, Scottish Journal of Political Economy 48: 400424.
Ltkepohl, H. (2005) Applied Time Series Econometrics, Springer.
MacKinnon, J. G. (1996) Numerical distribution functions for unit root and cointegration tests,
Journal of Applied Econometrics 11: 601618.
McAleer, M. and L. Oxley (1999) Practical Issues in Cointegration Analysis, Oxford: Blackwell.
McCullough, B. D. and C. G. Renfro (1998) Benchmarks and software standards: A case study of
GARCH procedures, Journal of Economic and Social Measurement 25: 5971.
Mroz, T. (1987) The sensitivity of an empirical model of married womens hours of work to economic and statistical assumptions, Econometrica 5: 765799.
Nash, J. C. (1990) Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, Bristol: Adam Hilger, second edn.
Nerlove, M. (1999) Properties of alternative estimators of dynamic panel models: An empirical
analysis of cross-country data for the study of economic growth. In C. Hsiao, K. Lahiri, L.-F. Lee
and M. H. Pesaran (eds.), Analysis of Panels and Limited Dependent Variable Models. Cambridge:
Cambridge University Press.
Newey, W. K. and K. D. West (1987) A simple, positive semi-definite, heteroskedasticity and autocorrelation consistent covariance matrix, Econometrica 55: 703708.
(1994) Automatic lag selection in covariance matrix estimation, Review of Economic Studies 61: 631653.
Okui, R. (2009) The optimal choice of moments in dynamic panel data models, Journal of Econometrics 151(1): 116.
Pollock, D. S. G. (1997) Trend estimation and de-trending via rational square-wave filters, Journal
of Econometrics 99: 317334.
(1999) A Handbook of Time-Series Analysis, Signal Processing and Dynamics, New York:
Academic Press.
Portnoy, S. and R. Koenker (1997) The Gaussian hare and the Laplacian tortoise: computability of
squared-error versus absolute-error estimators, Statistical Science 12(4): 279300.
Ramanathan, R. (2002) Introductory Econometrics with Applications, Fort Worth: Harcourt, fifth
edn.
Roodman, D. (2006) How to do xtabond2: An introduction to difference and system GMM in
Stata. Center for Global Development, Working Paper Number 103.
Schwarz, G. (1978) Estimating the dimension of a model, Annals of Statistics 6: 461464.
Sephton, P. S. (1995) Response surface estimates of the KPSS stationarity test, Economics Letters
47: 255261.
Sims, C. A. (1980) Macroeconomics and reality, Econometrica 48: 148.
Steinhaus, S. (1999) Comparison of mathematical programs for data analysis (edition 3). University of Frankfurt..
Stock, J. H. and M. W. Watson (2003) Introduction to Econometrics, Boston: Addison-Wesley.
Stokes, H. H. (2004) On the advantage of using two or more econometric software systems to
solve the same problem, Journal of Economic and Social Measurement 29: 307320.
Bibliography
300
Swamy, P. A. V. B. and S. S. Arora (1972) The exact finite sample properties of the estimators of
coefficients in the error components regression models, Econometrica 40: 261275.
Theil, H. (1961) Economic Forecasting and Policy, Amsterdam: North-Holland.
(1966) Applied Economic Forecasting, Amsterdam: North-Holland.
Verbeek, M. (2004) A Guide to Modern Econometrics, New York: Wiley, second edn.
White, H. (1980) A heteroskedasticity-consistent covariance matrix astimator and a direct test for
heteroskedasticity, Econometrica 48: 817838.
Windmeijer, F. (2005) A finite sample correction for the variance of linear efficient two-step GMM
estimators, Journal of Econometrics 126: 2551.
Wooldridge, J. M. (2002a) Econometric Analysis of Cross Section and Panel Data, Cambridge, MA:
MIT Press.
(2002b) Introductory Econometrics, A Modern Approach, Mason, OH: South-Western, second edn.
Yalta, A. T. and A. Y. Yalta (2007) GRETL 1.6.0 and its numerical accuracy, Journal of Applied
Econometrics 22: 849854. | https://fr.scribd.com/document/325008633/148419880-Guia-Gretl-ingles-pdf | CC-MAIN-2019-35 | refinedweb | 96,473 | 59.53 |
1 Jan 02:40 2007
Mailbox namespaces
In researching bug #474, I realized that we currently allow arbitrary mailboxes to begin with #. According to RFC 3501, section 5.1: 5) Two characters, "#" and "&", have meanings by convention, and should be avoided except when used in that convention. and then: 5.1.2.). It occurs to me that we should be preventing such mailboxes from being created. This may have to happen in 2.2. In fact, I may have recently un-disallowed such mailboxes. I'll have to check back on this. I also wonder if there isn't some cleaner abstraction that could be made, so that any mailbox beginning with # is passed through a single set of functions that figure out what to do with it. This is more 2.3 work.(Continue reading) | http://blog.gmane.org/gmane.mail.imap.dbmail.devel/month=20070101 | CC-MAIN-2015-22 | refinedweb | 136 | 67.15 |
gom encrypts your browsing thoroughly with HTTP which vpn is the most secure 2 SSL technology,vPN. Public Wi-Fi networks, are unfortunately also highly convenient for attackers looking to compromise your personal information. Which are ubiquitous and convenient, that which vpn is the most secure attitude to the safety and privacy of personal data creates an enormous risk when it comes to online security.
Which vpn is the most secure
sell your browsing history to basically any corporation which vpn is the most secure or government that wants to buy it. Hijack your searches and share them with third parties. Stuff undetectable, monitor all your traffic by injecting their own malware-filled ads into the websites you visit.cyberGhost VPN Proxy Pro Apk Download CyberGhost VPN Proxy Adfree Premium cracked app for android free, fREE ANDROID APP FOR which vpn is the most secure BETTER ONLINE SECURITY, wIFI PROTECTION,
tap on the shortcut which has been created which vpn is the most secure and uses it as needed! Search for VideoShow Pro and click on the Buy button and the app will be installed set up vpn free once the payment is done. Step #5 Once VideoShow for PC has installed,disconnect from the VPN server location Connect which vpn is the most secure to a different VPN server location. Switch to a different VPN protocol How to reconnect to the server if the app disconnects. VPN app Set up the VPN app Connect to a VPN server location.
Have fun! Advertisement. Download XePlayer Download APK.
Which vpn is the most secure in India:
707.658 2.479 Bew. PS4 Remote Play Port APK - Android-App. GOM Player Englisch Der Freeware-Media-Player "GOM Player" besitzt zahlreiche Audio- und Video-Codecs. 6. 528.485 1.823 Bew. 5. Deutsch Mit dieser which vpn is the most secure inoffiziellen PS4 Remote Play Portierung als APK-Datei,that being said, the Greeks and Egyptians used cryptography thousands of which vpn is the most secure years ago to protect important messages from unwanted eyes. The method of protecting information by encrypting it isnt a recent solution.
2. Last Updated: April 10, launch the application and which vpn is the most secure connect to NJIT network.tente seguir este tutoria e veja se resolve seu problema. Algum j descobriu como the proxy one fazer nesse caso? Obrigado. Boa tarde! Voc tem o link para os clients da CISCO? Obrigado! Fabiano, at mais Data: 16:16. Marcello disse. Data: 10:35 Henrique Corra disse.
even.
the settings may contain oxyRules or a cScript. Proxy settings are defined in a oxyConfig object. Depending on Chrome s proxy settings, a ProxyConfig object s mode attribute determines the overall behavior of Chrome with regards to which vpn is the most secure proxy usage. Proxy modes.which he has said he plans to which vpn is the most secure do. (Again,) not a single non-Republican voted to remove these privacy protections.) All thats left is for the Republican president to sign the resolution, so what kind of messed-up things can ISPs now legally do with our data?
which vpn is the most secure hora de disputar uma vaga de emprego.
13. 14. Zattoo Live TV iPhone- / iPad-App Deutsch Kostenlos which vpn is the most secure fernsehen auf iPhone und iPad: Mit der kostenlosen App Zattoo empfangen Sie dutzende deutsche TV-Sender. Serviio 1.10 Deutsch Serviio ist ein kostenloser DLNA -Server für den PC, 163.811 206 Bew. 169.592 323 Bew.closer is always better, expressVPN maintains a full list of active servers thats constantly updated with which vpn is the most secure new acquisitions.
mais cela require une configuration pralable. Cest possible, et souhaiteriez pouvoir accs votre PC Windows which vpn is the most secure via Internet. Il existe plusieurs solutions applicables ou non suivant votre installation et vos besoins. Vous tes souvent en dplacement,this would mean that which vpn is the most secure remote site can not only get access to networks on Main Site but can also access the internet through this site. This post details how to setup Site to Site VPN with ASA 8.4 and hairpinning enabled.google Chrome is set to use proxies vpn yg ada china you dont need, affecting how which vpn is the most secure you connect to the internet. Sometimes,
Tp link mr3020 vpn client!
dNS leak test, performed which vpn is the most secure speed test, netflix test. We performed a detailed ExpressVPN Review in 22nd November 2018,vPN Server',.,.. Ssh, which vpn is the most secure vPN Server,
install ppp which vpn is the most secure)).sep 08, 2017 Globe Switch offers 3GB free internet for Globe and TM, for android phone, by redeeming its which vpn is the most secure offers and using HTTP Injector or Postern VPN.this new software is compatible with all all SonicWALL firewalls that support SSL-VPN, apple iPad and iPhone VPN Connection to SonicWALL Firewall SonicWALL have now launched an Apple iPhone/iPad/iPod VPN application called which vpn is the most secure Mobile Connect for iOS.a which vpn is the most secure virtual private network (VPN)) extends a private network across a public network,
so customers will be which vpn is the most secure pleased to find they can connect to the Internet anonymously from a number of country locations. South America, oceania, africa and china proxy for chrome Asia, united States, the company offers a variety of worldwide servers with locations in Europe,. Rate this blog which vpn is the most secure entry: 25 aTunes,. Rate this blog entry: 14 T..
just Released December 2018 Reviews. 10 Best VPNs for Android,with over 100 commercial WiMAX deployments worldwide, 101 Global Solutions and Airspans goal is which vpn is the most secure to partner with service providers to help them deliver high-speed data and voice services cost-effectively using the most advanced technology for broadband wireless communications.
import the file with extention.ovpn. Using the profile you just ios add vpn added to connect to the vpn server. Download the vpn configuration file. Finally, android IOS Download Easy installation guide Install OpenVPN Connect app on your android device. | http://cornish-surnames.org.uk/blog/which-vpn-is-the-most-secure.html | CC-MAIN-2019-09 | refinedweb | 1,038 | 62.48 |
Here is another C code snippet question. Consider the following piece of code, and spot if there is a problem in it or not.
#include <stdio.h> int main (void) { int x = 5; +x += 1; printf ("%d\n", +x); return 0; }
The answer is yes, there is a problem in it. The problem is in the line 6. +x += 1;. This is because the +x evaluates to the value stored in x, as in C99 Section 6.5.3.3 Paragraph 2, and the evaluation result is not a modifiable l-value. The += falls inside the assignment operate category. Any assignment operator requires a modifiable l-value as its left operand, clearly stated in C99 Section 6.5.16 Paragraph 2. Therefore the line results in a compilation error. In gcc I get:
test_file.c:6:6: error: lvalue required as left operand of assignment
In the same note, here is another similar piece of code.
#include <stdio.h> int main (void) { int x = 5; int y = 10; (x = y) += 1; printf ("%d\n", x); return 0; }
The problem is in line 8. As per C99 Section 6.5.16 Paragraph 3
An assignment operator stores a value in the object designated by the left operand. An assignment expression has the value of the left operand after the assignment, but is not an lvalue.
Therefore, after first evaluating (due to the braces) of x = y, an assignment operation is attempted to be made on a non l-value, which again results in a compilation error. Remove braces and it compiles fine, as the += executes first and assigns the modified value of y to x . | https://phoxis.org/2013/04/10/c-qa-5-a-question-about-assignment-operation-and-evaluation/ | CC-MAIN-2019-18 | refinedweb | 274 | 65.42 |
Bul. I certainly don't want to multiply my memory requirements by the factor of 12 you mention. It doesn't seem too hard, however to devise tail recursive functions that fit the bill. For example suppose I define a function that repeatedly applies an IO action like this repIO act llist = let repIO' iolact (act) (x0:xl) = do lact <- iolact z <- act x0 repIO' (return (z:lact)) act xl repIO' iolact act [] = iolact nullio = return [] in repIO' nullio (act) llist I can then create a list of random numbers in the IO monad like this main = repIO (\x -> (randomIO :: IO Double)) [1..10] >>= print Of course this one reverses the input list indices. There must be library functions that support a more space efficient way to do these kinds of repetitive sequential IO actions. Ultimately for this little application I want to map the result to an array inside the IO monad. It looks like I have to create the list first. Suppose however I pulled the random value out of the IO monad using unsafePerformIO separately for each index. Lazy evaluation would cause the IO action to occur in an unspecified order. But for the randomIO function I don't really care what order it's called in. Would this have any other unforseen consequences? Are there cases where the IO action would only be partially evaluated, messing up the random number generator? -- View this message in context: Sent from the Haskell - Haskell-Cafe forum at Nabble.com. | http://www.haskell.org/pipermail/haskell-cafe/2006-July/016874.html | CC-MAIN-2014-15 | refinedweb | 250 | 61.16 |
Member
1 Points
Jul 07, 2013 12:15 PM|Edwin Chan|LINK
Hi
I encountered a very strange error. I have compleleted a WCF service feed data to my web form which uses javascript to invoke the web service. The web service is to return a list of object from database and then display in web form. Everything works fine except when the data contain only 1 item. The server side code returns a list exactly with one item (this is verified using breakpoint). However the client side code get null. When the list contains more than 1 item, then the client side can get the correct number of items.
My code is like this
javascript in webform.aspx:
var ws = new projectName.getDateService();
ws.GetData(someParameter, successFunction, null null);
function successFunction(result) {
if (result)
//code here to show data
else
alert('no data is returned'); // result is null when returned list contains 1 item
}
WCF:
[ServiceContract(Namespace =)]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class getDateService
{
[OperationContract]
public ICollection<string> GetData(strng someParameter)
{
//code is written to reproduce the problem
List<string> s = new List<string>();
s.Add("item 1");
//s.Add("item 2"); when this line is uncommented, then client side gets 2 items
return s;
}
}
I must have overlooked something. Hope you can point me the right direction to check.
Cheers
Star
14545 Points
Microsoft
Jul 08, 2013 01:56 AM|Amy Peng - MSFT|LINK
Hi,
It seems very strange, please try to debug all your code.
And enable the wcf tracing to find the cause.
#How to enable the wcf tracing: .
Hope it can help you.
Best Regards,
Amy Peng
Jul 08, 2013 07:29 AM|Illeris|LINK
This is not exactly standard behavior
The error is probably in the way the return value is build (meaning : in the fetching of data). You might want to put a try-catch around this method and catch the error from javascript (see)
If this does not impose a problem: please restart your webserver. I had errors in the past with the VS.NET internal webserver when changing service contract. Restarting might fix this issue.
Furthermore, why using "ICollection<String>" instead of a collection class?
Member
1 Points
3 replies
Last post Jul 09, 2013 10:55 AM by Edwin Chan | https://forums.asp.net/t/1919762.aspx?WCF+service+returns+null+when+List+contains+only+1+item | CC-MAIN-2017-34 | refinedweb | 380 | 65.73 |
Today: parsing, while loop vs. for loop, parse words out of string patterns, boolean precedence, variables
Here's some fun looking data...
$GPGGA,005328.000,3726.1389,N,12210.2515,W,2,07,1.3,22.5,M,-25.7,M,2.0,0000*70 $GPGSA,M,3,09,23,07,16,30,03,27,,,,,,2.3,1.3,1.9*38 $GPRMC,005328.000,A,3726.1389,N,12210.2515,W,0.00,256.18,221217,,,D*78 $GPGGA,005329.000,3726.1389,N,12210.2515,W,2,07,1.3,22.5,M,-25.7,M,2.0,0000*71 $GPGSA,M,3,09,23,07,16,30,03,27,,,,,,2.3,1.3,1.9*38 $GPRMC,005329.000,A,3726.1389,N,12210.2515,W,0.00,256.18,221217,,,D*79 $GPGGA,005330.000,3726.1389,N,12210.2515,W,2,07,1.3,22.5,M,-25.7,M,3.0,0000*78 $GPGSA,M,3,09,23,07,16,30,03,27,,,,,,2.3,1.3,1.9*38 ...
var += 1
endwith an index into string
endis 4, pointing at the
'a'
end += 1.. like moving one to the right
end += 1until get to a space
Start with
end = 4. Advance to space char with
end += 1 in loop
for i/rangevs.
while
The for/i/range form is great for going through numbers which you know ahead of time - a common pattern in real programs. If you need to go through
0..n-1 - use for/i/range, that's exactly what it's for.
for i in range(n): # i is 0, 1, 2, .. n-1
whileLoop - Flexible
But we also have the while loop. The "for" is suited for the case where you know the numbers ahead of time. The while is more flexible. The while can test on each iteration, stop at the right spot. Ultimately you need both forms, but here we will switch to using while.
It's possible to write the equivalent of for/i/range as a while loop instead. This is not a good way to go through
0..n-1, but it does show a way to structure a while loop.
for i in range(n)- go-to solution for that sequence
while.. do steps manually
0..n-1case
Here is the while-equivalent to
for i in range(n)
i = 0 # 1. init while i < n: # 2. test # use i i += 1 # 3. update, loop-bottom # (easy to forget this line)
> while_double() (in parse1 section)
double_char() written as a while. The for-loops is the correct approach here, so here just showing for-while equivalence.
def while_double(s): result = '' i = 0 while i < len(s): result += s[i] + s[i] i += 1 return result
i < length
With zero based indexing, if we are increasing an index variable
i, then
i < length is the easy test that
i is a valid index; that it is not too big.
Look at our old
'Python' str example
If we are increasing an index number,
5 is the last valid index. When we increase it to
6 it's past the end of the string. The length here is
6, so in effect
i < 6 checks that
i is valid if we are increasing
i.
If we are decreasing
i, then
i >= 0 is the valid check, since
0 is the first index.
> at_word() (in parse1 section)
'xx @abcd xyz' -> 'abcd' 'x@ab^xyz' -> 'ab'
at_word(s): We'll say an at-word is an '@' followed by zero or more alphabetic chars. Find and return the alphabetic part of the first at-word in s, or the empty string if there is none. So 'xx @abc xyz' returns 'abc'.
var < len(s)to protect use of
s[var]
First use
s.find() to locate the
'@'. Then start end pointing to the right of the
'@'.
Start of loop:
at = s.find('@') if at == -1: return '' end = at + 1
Use a while loop to advance end over the alphabetic chars. Make a drawing below to sketch out this strategy.
s[end].isalpha()
End of loop:
# Advance end over alpha chars while s[end].isalpha(): end += 1
Once we have at/end computed, pulling out the result word is just a slice.
word = s[at + 1:end] return word
Put those phrases together and it's an excellent first try, and it 90% works. Run it.
def at_word(s): at = s.find('@') if at == -1: return '' end = at + 1 # Advance end over alpha chars while s[end].isalpha(): end += 1 word = s[at + 1:end] return word
That code is pretty good, but there is actually a bug in the while-loop. It has to do with particular form of input case below, where the alphabetic chars go right up to the end of the string. Think about how the loop works when advancing "end" for the case below.
at = s.find('@') end = at + 1 while s[end].isalpha(): end += 1
'xx@woot' 01234567
Problem: keep advancing "end" .. past the end of the string, eventually end is 7. Then the while-test
s[end].isalpha() throws an error since index 7 is past the end of the string.
The loop above translates to: "advance end so long as
s[end] is alphabetic"
To fix the bug, we modify the test to: "advance end so long as
end is valid and
s[end] alphabetic".
In other words, stop advancing if end reaches the end of the string.
Loop end bug:
end < len(s)Guard Test
This "guard" pattern will be a standard part of looping over something.
We cannot access
s[end] when end is too big. Add a "guard" test
end < len(s) before the
s[end]. This stops the loop when end gets to 7. The slice then works as before. This code is correct.
def at_word(s): at = s.find('@') if at == -1: return '' # Advance end over alpha chars end = at + 1 while end < len(s) and s[end].isalpha(): end += 1 word = s[at + 1:end] return word
The "and" evaluates left to right. As soon as it sees a
False it stops. In this way the
< len(s) guard checks that "end" is a valid number, before
s[end] tries to use it. This a standard pattern: the index-is-valid guard is first, then "and", then
s[end] that uses the index. We'll see more examples of this guard pattern.
s[end]
s = 'xx @woot'
<
while end < len(s) and s[end].isalpha():
iis valid in
s?
i < len(s)
s[end]char after checking that
endis valid
Falsein the midst of an
andstops
<guards the
s[end].isalpha()
i < len(s)before trying
s[i]
s[end]vs.
s[at + 1:end]
s[end]off the end of the string is an error
s[at + 1:end]
s[at + 1:end]work fine?
endindex is managed accurately
>>>>> len(s) 6 >>> s[2:5] 'tho' >>> s[2:6] 'thon' >>> s[2:46789] 'thon'
'xx @ xx'
s[at + 1:end]
s[4:4]
'', so the code we have works perfectly for this edge case
> exclamation()
exclamation(s): We'll say an exclamation is zero or more alphabetic chars ending with a '!'. Find and return the first exclamation in s, or the empty string if there is none. So
'xx hi! xx' returns
'hi!'. (Like at_word, but right-to-left).
Will need a guard here, as the loop goes right-to-left. The leftmost valid index is 0, so that will figure in the guard test.
def exclamation(s): exclaim = s.find('!') if exclaim == -1: return '' # Your code here # Move start left over alpha chars # guard: start >= 0 start = exclaim - 1 while start >= 0 and s[start].isalpha(): start -= 1 # start is on the first *non* alpha word = s[start + 1:exclaim + 1] return word
1 + 2 * 3 -> 7
and or not
True or False -> True
True and False -> False
True and Not False -> True
See the guide for details Boolean Expression
and or not
age- int age, say age is good if less than 30
is_raining- boolean, True if raining
is_weekend- boolean, True if it's the weekend
The code below looks reasonable, but doesn't quite work right
def good_day(age, is_weekend, is_raining): if not is_raining and age < 30 or is_weekend: print('good day')
not= highest, (like - in -7)
and= next highest (like *)
or= lowest (like +)
Because and is higher precedence than or as written above, the code above acts like the following (the and going before the or):
if (not is_raining and age < 30) or is_weekend:
What is a set of data that this code will evaluate incorrectly? raining=True, age=anything, weekend=True .. the
or weekend makes the whole thing True, no matter what the other values are. This does not match the good-day definition above, which requires that it not be raining.
The solution we will spell out is not difficult.
Solution
def good_day(age, is_weekend, is_raining): if not is_raining and (age < 30 or is_weekend): print('good day')
> at_word99()
This is operating at a realistic level for parsing data.
at_word99(): Like at-word, but with digits added. We'll say an at-word is an '@' followed by zero or more alphabetic or digit chars. Find and return the alpha-digit part of the first at-word in s, or the empty string if there is none. So 'xx @ab12 xyz' returns 'ab12'.
Like before, but now a word is made of alpha or digit - many real problems will need this sort of code. This may be our most complicated line of code thus far in the quarter! Fortunately, it's a re-usable pattern for any of these "find end of xxx chars" problems.
The most difficult part is the "end" loop to locate where the word ends. What is the while test here? (Bring up at_word99() in other window to work it out). We want to use "or" to allow alpha or digit.
at = s.find('@') end = at + 1 while ??????????: end += 1
# 1. Still have the < guard # 2. Use "or" to allow isalpha() or isdigit() # 3. Need to add parens, since this has and+or # combination while end < len(s) and (s[end].isalpha() or s[end].isdigit()): end += 1
def at_word99(s): at = s.find('@') if at == -1: return '' # Advance end over alpha or digit chars # use "or" + parens end = at + 1 while end < len(s) and (s[end].isalpha() or s[end].isdigit()): end += 1 word = s[at + 1:end] return word
If we have time, we'll do this bit.
With the following code, it's clear that the assignment
= sets the variable to point to a value.
x = 7
It's less obvious, but the for loop just sets a variable too, once for each iteration. The variable name is the word the programmer chooses right after the word "for", in this example the variable is
i which is an idiomatic choice:
for i in range(4): # use i print(i) 0 1 2 3
The Sartre of Coding!
The variable name is just the label applied to the box that hold the pointer.
You might get the feeling in CS106A to this point: it will only work if the variable is named "i", but that's not true. We always name it "i" since that's the idiom programmers use for that context, so you cannot be blamed for thinking it was some Python rule.
We try to choose a sensible label to keep our own thoughts organized. However the computer does not care about the word used, so long as the word chosen is used consistently across lines. The variable name
i is idiomatic for that sort of loop. But in reality we could use any variable name, and the code would work exactly the same. Say we name the variable
meh instead .. same output. All that matters is that the variable on line 1 is the same as on line 2.
for meh in range(4): print(meh)
0 1 2 3
This is a little disturbing. We do try to choose good and/or idiomatic variable names for our own sake. However, the computer does not notice or care about the actual word choice for our variables. The computer does not understand English here; it just recognizes that two words are the same and so must be the same variable. | http://web.stanford.edu/class/cs106a/handouts_w2021/lecture-15.html | CC-MAIN-2022-05 | refinedweb | 2,070 | 82.44 |
Hi,
when we do the checkpoint-restore we need to find out if various kernel
objects
(like mm_struct-s of file_struct-s) are shared between tasks (and restore
them
after).
While at restore time we can use CLONE_XXX flags and unshare syscall there
is
no way to find out sharing structures at checkpoint time. Thus, to chop the
knit, we introduce generic-object-ids helpers which do basically encode
kernel pointers into some form (at moment is's simple XOR operation over
a random cookie value) and provide them back to userspace. So one can test
if two resource are shared between different task.
Since such information is pretty valuable -- it's allowed for CAP_SYS_ADMIN
only since xor encoded values has nothing to do with security but used only
to break an impression that ID means something other than random "number"
which should be used for "sameness" test only and nothing else.
The following objects are shown at the moment
- all namespaces living in /proc/pid/ns/
- open files (shown in /proc/pid/fdinfo/)
- objects, that can be shared with CLONE_XXX flags (except for namespaces)
Any kind of comments and especially complains (!) are very appreciated!
Cyrill | http://article.gmane.org/gmane.linux.kernel/1232537 | CC-MAIN-2016-50 | refinedweb | 196 | 53.14 |
Parsing of text into a primitive value is easy enough using the various kinds of
Parse methods. However, a more complex parsing task often needs to be accomplished. In that case, the BCL’s support for regular expressions enters the picture. Because regular expressions are a language of their own, we just touch on some of the capabilities, deferring a thorough discussion to MSDN once more.
The first thing to make sure when working with regular expression facilities is to have a
using directive to import the
System.Text.RegularExpressions namespace. When this is done, you have unqualified access to the
Regex class, which is the entry point of the API. First, you create a new instance of this class, specifying the regular expression ...
No credit card required | https://www.safaribooksonline.com/library/view/c-50-unleashed/9780133391480/ch26lev2sec23.html | CC-MAIN-2017-17 | refinedweb | 128 | 55.64 |
NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » AVR Simulator IDE - Nerdkit Display
Hey guys,
I am starting some new projects and because they are getting very large(too large for my 168) I bought a atmega328p. But it takes about a week when it will arrive. In the meantime I want to use the AVR Simulator IDE.
Has somebody some experience with that Simulator?
I think I understood everything right, but I don't get an Output on the virtual Display. Any ideas what is going wrong?
I am using the nerdkits library for the lcd Display. Pins connected to PortD.
Special greetings to Noter and Rick. How are you guys doing?
#define F_CPU 14745600
#include <stdio.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <inttypes.h>
#include <inttypes.h>
#include <string.h>
#include <util/delay.h>
#include "../libnerdkits/delay.h"
int main(void) {
//! "));
// busy loop
while(1) {
// do nothing
}
return 0;
}
I'm not familiar with that software, but you might want to change the clock speed to that of the Nerdkit (14.7546MHz) The delay libraries used with the Nerdkit are only accurate at that clock and if the simulated LCD expects proper timings, it may not initialize properly with the software set at the 8MHz clock shown in your photo above.
Hi Rick,
thanks for your reply.
But also with the correct MHz it won't work.
No Problem for me, so I Wait for the arrival of the 328P.
Thanks For Your help.
Please log in to post a reply. | http://www.nerdkits.com/forum/thread/2899/ | CC-MAIN-2021-39 | refinedweb | 271 | 79.36 |
When to use useCallback?
The usage of
useCallback is something very controversial where it exists two groups of person:
- those who memoize everything
- those who only memoize the strict necessary
In this article I expose you my rules which makes me decide to use
useCallback.
useCallback is a native hook provided by React, it permits to give you a memoized callback.
As a quick reminder when developing with functional component, the body of the function is the render.
So if I define a function inside the component (render), this function will be redefined at every render giving you a new references.
function myComponent() { // At each renders I am redefined // I.E. I will have a new references const onClick = () => { console.log("I have been clicked"); }; return <button onClick={onClick}>Click me</button>; }
My answer is simply NO.
Most of the time we don't care. This is not a problem for our javascript engine to do it, it's fast and no memory issue with that.
So when do we care? Let me just a second I want you to show a quick implementation of the hook before :)
The logic is pretty simple when you know how to implement some memoization in JS. If it's not the case you can read my article :)
But in the case of React there is no closure.
Th previous callback and dependencies are stored in the Fiber node of the component. This is stored within the key
memoizedState.
In the next code template, I show you an implementation example:
import shallowEqual from "./shallowEqual"; // Things stored in the React element const memoizedState = { lastCallback: undefined, lastDependencies: undefined, }; // In reality there is multiple implementation of // it behind the hood // But it's a simplified example function useCallback(callback, dependencies) { if ( !shallowEqual( memoizedState.lastDependencies, dependencies ) ) { memoizedState.lastCallback = callback; memoizedState.lastDependencies = dependencies; } return memoizedState.lastCallback; }
As you can see a
shallowEqual is used to compare the dependencies. If you want to know more about the different types of equality, do not hesitate to read my article about it.
In reality React has multiple implementation of the hooks in function of the lifecycle phase:
mount,
update, ...
And now let's see with a quick gif how to see this in a browser:
In a next article I will try to explain more about the structure of a Fiber node but it takes me some time to make a nice post about it :)
Yep, it's memoized inside an array, but I put the data inside an object for simplicity.
As usual, I will begin by told not to do premature optimization. Only do this when you have real performance problem in your application / component library.
For example if you have a component in your code base which has slow renders and that most of the time they can be prevented because it doesn't need to be re-render (no props change in reality).
In this case we will memo the component. And from here it's important that references do not change unnecessarily.
Now imagine that this component is a
Button. Yeah it would probably not happen for a button, I know. But it's just an example ;)
So in this case it will be important that the
onClick callback has a stable reference.
import React, { useCallback } from "react"; function App() { const onClick = useCallback(() => { // Doing some stuff here }, []); return ( <MemoizedButton onClick={onClick}> Click me </MemoizedButton> ); } function Button({ onClick }, children) { // Doing some heavy process here return <button onClick={onClick}>{children}</button>; } const MemoizedButton = React.memo(Button);
If you do not put the
useCallback, then the
React.memowill be totally useless.
And the reciprocal is also true. If you
useCallback but do not
React.memo the
Button then instead you make your performance worse.
Why? Because as we have seen at each render there is 2 callbacks that are in memory. Yep it's not dramatic, but by doing this, I find the codebase less readable.
Another reason which makes me
useCallback is when I need to put the callback in the dependency of
useEffect,
useLayoutEffect or
useCallback.
import { useCallback, useEffect, useState } from "react"; import apiCall from "./apiCall"; function App() { const [data, setData] = useState(); const fetchData = useCallback(() => { apiCall().then(setData); }, []); useEffect(() => { // We fetch the data at mounting fetchData(); }, [fetchData]); return ( <div> <p>The data is: {data}</p> <button onClick={fetchData}>Refetch data</button> </div> ); }
As you can see in the example I use the callback in the
useEffectand in an event handler.
If it was used only in the
useEffect, I would have defined the method directly in it:
useEffect(() => { const fetchData = () => { apiCall().then(setData); }; // We only fetch the data at mounting fetchData(); }, [fetchData]);
Another will be when I do some "public" hook, for example in a library, or a generic hook that could be used in multiple place. Then I will stabilize returned callbacks.
Why do I do this?
The reason is that I don't know where it will be used. It could be:
- in a useEffect/useCallback/useLayoutEffect then it will be required to have a stable reference
- in an event handler, then it's not required at all
So to satisfy both cases, I provide a stable reference :)
import { useCallback } from "react"; export function usePublicHook() { return useCallback(() => { console.log("It's only an example"); }, []); }
But if I do a hook just to extract a specific logic from a component (for testing purpose and to malke the component easier), and it can't be used in another one. Then I will only
useCallback id it's necessary because I know the use case.
And here we go. That's how I use the hook
useCallback, hoping that it can help you to have a better code base, because it makes the code more complicated to read.
To summarize:
- if I have performances issues
- if I used it as dependency of another hook (
useEffect,
useLayoutEffect,
useCallback, ...)
- when I do a public / generic hook
I hope to see React Forget released as soon as possible (yep I'm dreaming), which will help us to stop wondering :) If you don't know what is React Forget, let's check this video.
Do you use
useCallback in another use case? If it's the case do not hesitate to put it in comment. | https://rainbowapps.io/en/posts/when-to-use-usecallback/ | CC-MAIN-2022-21 | refinedweb | 1,042 | 54.12 |
Is there a way to query Incidents that are linked to Problems?kjimenez Nov 6, 2015 3:06 PM
We have a query that displays all Open Problems. We want to be able to report the associated Incident that is linked to that Problem. I tried to add in the Refernce Number in the Problem Incident Collection but it just displays the Reference Id for the problem. That makes sense I think because it is a collection. Is there a way to easily do this? I also thought maybe to add a field in Problem that runs a Windows Calculation to pull in the first Reference Number int he Incident Collection and that is not working either. The calculation I tried was:
import System
static def GetAttributeValue(Problem):
Value = Problem.IncidentProblems.Incident.Id[0]
return Value
When I load the Window it is grayed out though and when I test it, I am just getting a list of all the problems.
1. Re: Is there a way to query Incidents that are linked to Problems?Jenny.Lardh Nov 10, 2015 1:22 AM (in response to kjimenez)
Hi,
Below are a few articles that you might find helpful. They are all on Parent / Child linking, but it would be the same principle with Problem / Incident linking as they are all set up in the same way using a linking Object.
How to create a filter to see Child or Parent IPC as a tab
Create a Query to view only Parent Incidents or Incidents with no Children
How to: Create a Decision to ask if the Incident is a Child of another Incident?
I hope this will help you.
Kind Regards,
Jenny | https://community.ivanti.com/message/121178 | CC-MAIN-2018-26 | refinedweb | 282 | 70.02 |
Are you sure?
This action might not be possible to undo. Are you sure you want to continue?
JONATHAN
GULLIBLE
A Free Market Odyssey
Story by
Ken Schoolland
Commentaries by
Ken Schoolland and Janette Eldridge
Commentary Edition © 2004 Ken Schoolland and Janette Eldridge
Published by
Leap Publishing
Cape Town
ii
Dedicated to my daughter, Kenli
Available in more than thirty.
Text copyright © 1981, 1987, 1995, 2001, 2004 by Ken Schoolland,
[email protected]. Original edition published in 1988. Second
revised edition in 1995, third revised edition 2001. All rights reserved. This
book or parts thereof may not be reproduced in any form or mechanically
stored in any retrieval system without written permission of the author.
[email protected]
This edition published by Leap Publishing
PO Box 36021, Glosderry, 7702, Cape Town, South Africa
Cover design by Barry Kayton
[email protected]
Cover photograph by Noray Babcock
[email protected]
An educational project of Small Business Hawaii, Hawaii Kai Corporate
Plaza, 6600 Kalanianaole Hwy., Suite 212, Honolulu, Hawaii, 96825, USA,
telephone: (808) 396 1724, fax: (808) 396-1726, email: [email protected],
website:.
ISBN: 0-9584573-2-8
Printed by RSA Litho
Cape Town, South Africa
Dedication
iii
About This Book
This book is fun. It challenges readers to think about why some
countries are rich, while others are poor. It explores alternative
thinking about important economic, practical and philosophical
matters. The variety of ideas will challenge readers to ponder,
question, and engage in meaningful discussions. Underlying all this
is the respect for, and tolerance of, the individual.
Since 1980, Ken has been writing economic commentaries for
radio. Straight commentary from an academic economist was dry
and uninteresting. He thought he would spice up these radio spots
with fantasy dialogues. Friends were willing to perform with him,
and so Jonathan Gullible was born.
Immediately, interest among listeners soared! The ideas were
provocative and outlandish, yet they drove home hard-core free
market ideas in a humorous way. Later, he enlisted a dozen friends
as actors to produce the episodes as a dramatic series. Again it was a
hit! Since then The Adventures of Jonathan Gullible: A Free Market
Odyssey has been used for radio broadcasts, discussion groups,
essay contests, skits and theatrical productions around the globe.
Each chapter, except the first, starts with a short “parable” about
Jonathan Gullible and his encounters with the strange laws of an
island and its inhabitants. The story highlights the absurdities of
the laws, the controls imposed on people’s lives, and the economic
drawbacks of these laws. The laws are recognisable as common to
countries throughout the world.
As the story unfolds, the part we play in political decision-making
and personal responsibility is introduced for discussion. There are
many subtle nuances. Sometimes people miss the meaning of a
story, so each “parable” is followed by commentaries and relevant
background information. These commentaries are meant to provide
only the gist of each issue. Books and websites are recommended
for further research. They will be particularly useful for projects
and debates.
Questions following each chapter are guidelines for group
discussions about self-responsibility and life skills that will arouse
an interest in the areas of sociology, macro-economics, philosophy,
political science, and ethics.
iv About the Book
Teachers are warned that the book contains chapters that are
critical of contemporary education systems. We feel that students
should not be shielded from hard questions about schooling. Rather,
we should trust students to take a hard look at the circumstances
that are most familiar to them. Indeed, these chapters are typically
the most popular with students.
Website:
Awards and Reviews
Available in more than 30. A number of further translations
are in the process and due for publication in 2004.
• Awarded the first annual Leonard E. Read Book Award
by the Foundation for Economic Education in 2002.
• Thomas Leavey Award for Excellence in Private
Enterprise Education from the Freedoms Foundation
at Valley Forge 2001.
• Twice awarded the George Washington Honor
Medals for Economics Education & Public
Communication, The Freedoms Foundation at
Valley Forge, Pennsylvania.
• Freedom Book of the Month, Henry Hazlitt Foundation, Chicago,
September 2001.
• Book of the Month, Instituto Liberal, RS, Porto Alegre, Brazil,
November 2001.
• Students in Free Enterprise, top 15 national finalists, Free Market
Economics Month Special Competition, Kansas City 2003.
• Adopted by more than a dozen economics and public policy
institutes for translation and publication.
v About the Author
About the Author
Ken Schoolland is presently an associate professor
of economics and political science at Hawaii
Pacific, Office of the
Special Representative for Trade Negotiations.
Ken left government for the field Board of Directors for the International
Society for Individual Liberty and is a Sam Walton Fellow for
Students in Free Enterprise.
He has travelled extensively observing cultures, traditions and
economies in many countries around the world. Stephen Browne,
Director of the Liberty English Camp in Lithuania, once summed
up Prof. Schoolland’s character by saying, “As soon as Ken sits
down in any given place long enough, a child is going to come up
to him from somewhere and want to sit on his lap, or a teenager is
going to come by and want him for a game of basketball.” Such is
the author of The Adventures of Jonathan Gullible: A Free Market
Odyssey.
Ken Schoolland with his students who
were the top 15 national finalists in
the Free Market Economics Month
Special Competition, 2003.
vi Contents
Contents
Chapter Page
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . About the Book About the Book iii
The Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Author The Author v
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
Jonathan’s Guiding Principles . . . . . . . . . . . . . . . . . . . . . . .x
Prologue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
1 A Great Storm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Jonathan is shipwrecked on a strange island.
2 Troublemakers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Jonathan answers a woman’s cry for help.
3 A Commons Tragedy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
A fisherman shares a story and his meagre catch.
4 The Food Police . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
A woman and her child are driven from their farm.
5 Candles and Coats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
Jonathan learns how to protect industry.
6 The Tall Tax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 The Tall Tax 6 The Tall Tax 27
The tall are brought low by a new code.
7 Best Laid Plans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Jonathan watches the destruction of a good home.
8 Two Zoos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
Twin fenced habitats make Jonathan uneasy about the law.
9 Making Money . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Jonathan is taught to distinguish between two types of printers.
10 The Dream Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
A mysterious machine causes the closing of a factory.
11 Power Sale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55
Lady Bess Tweed encourages Jonathan to enter politics.
12 Opportunity Lost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63
A hobo tells the old story of seen and unseen benefits.
vii
Chapter Page
13 Helter Shelter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Helter Shelter 13 Helter Shelter 67
A young woman explains her worries about housing.
14 Escalating Crimes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73
Jonathan learns a horrible truth about law.
15 Book Battles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
A man and a woman fight over the price of free books.
16 Nothing to It . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Nothing to It 16 Nothing to It 87
A lottery solves an artistic dilemma.
17 The Special Interest Carnival . . . . . . . . . . . . . . . . . . . . . . .91
Jonathan witnesses a game that pleases all players.
18 Uncle Samta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97
Jonathan discovers the replacement for an old tradition.
19 The Tortoise and the Hare Revisited . . . . . . . . . . . . . . . .103
A grandmother’s tale has an unfamiliar twist.
20 Bored of Digestion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Jonathan is warned about the Nutrient Officers.
21 “Give Me Your Past or Your Future!” . . . . . . . . . . . . . . 117
A thief takes Jonathan’s money and offers advice.
22 The Bazaar of Governments . . . . . . . . . . . . . . . . . . . . . . 123
A dairy farmer relates options in selecting governments.
23 The World’s Oldest Profession . . . . . . . . . . . . . . . . . . . . .129
A stranger offers to read Jonathan’s future.
24 Booting Production . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135
An official press conference unveils a new programme.
25 The Applausometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139
A show host interviews an election officer and a party leader.
26 True Believer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147
A devout voter explains her loyalty.
Contents
viii
Chapter Page
27 According to Need . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153
Jonathan watches a school graduation and contest.
28 Wages of Sin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
A chain gang recounts the deeds that brought them woe.
29 New Newcomers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .167
Foreign workers are exposed and deported.
30 Treat or Trick? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .175
The elderly lament the trickery that haunts their retirement.
31 Whose Brilliant Idea . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181
Lawyers explain the path to riches by controlling the use of ideas.
32 The Suit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .189
Jonathan takes a lesson in liability.
33 Doctrinaire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .195
A doctor explains the ownership of life.
34 Vice Versa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203
A policeman lectures Jonathan on immorality.
35 Merryberries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209
Jonathan narrowly avoids a trap.
36 The Grand Inquirer . . . . . . . . . . . . . . . . . . . . . . . . . . . . .217
A revered leader explains the trauma of freedom and virtue.
37 Loser Law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223
Jonathan stumbles across a fight and a gamble.
38 The Democracy Gang . . . . . . . . . . . . . . . . . . . . . . . . . . . .229
A fearful stampede in town causes Jonathan and Alisa to flee.
39 Vultures, Beggars, Con Men, and Kings . . . . . . . . . . . . .237
A despondent Jonathan receives a lesson on virtue.
40 Terra Libertas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245
Jonathan returns home and begins his life’s work.
Contents
ix Contents
Chapter Page
Epilogue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .251
Acknowledgements and Notes . . . . . . . . . . . . . . . . . . . . .253
Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255
Recommended Reading . . . . . . . . . . . . . . . . . . . . . . . . . .256
Recommended Organisations and Websites . . . . . . . . . . .257
Index of Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .258
When elephants fight, it is the grass that suffers.
Kikuyu proverb
x Jonathan’s Guiding Principles
The Individual is Sovereign
Each individual is the sole owner of his or her life, and of the fruits
of his or her efforts.
An individual may not initiate the use of force or fraud against
another, but may strongly resist the use of force.
Every man has freedom to do all that he wills,
provided he infringes not on the equal freedom of others.
Herbert Spencer 1851
Implications
• Freedom of speech, association, contract, and movement.
• Recognition of the supreme rights of the individual.
• Respect for property rights (life/possession/space).
• Love for life, freedom, and the pursuit of happiness.
• Limits on the powers of groups, governments, and gangsters.
• Rights to resist force, theft, and enslavement of any kind.
• Individual responsibility.
The only freedom which deserves the name, is that of pursuing our own good in
our own way, so long as we do not attempt to deprive others of theirs, or impede
their efforts to obtain it.
John Stuart Mill, 1859
For Jonathan Gullible’s philosophy in flash
animation by Kerry Pearson see:
It may be downloaded and sent to those
whom you feel would be interested.
xi Jonathan’s Guiding Principles
Jonathan’s
Guiding Principles
M
y philosophy is based on the principle of self-ownership. You
own your life. No other person, or group of persons, owns
your life nor do you own the lives of others.
The harvest of your life is your property. It is the fruit of your
labour, the product of your time, energy, and talents. Two people
who exchange possessions voluntarily are both better off or they
wouldn’t do it. Only they may rightfully make that decision for
themselves.
You have the right to protect your life, freedom, and justly acquired
possessions. You may rightfully ask others to help protect you. You
do not have a right to initiate force against the life, freedom, or
possessions of others. Thus, you have no right to designate some
person to initiate force against others on your behalf.
You have a right to seek leaders for yourself, but have no right
to impose rulers on others. No matter how officials are selected,
they have no rights or claims that are higher than those of any
other person. You cannot give them any rights that you do not
have yourself. Regardless of the imaginative titles, officials have
no right to murder, to enslave, or to steal.
Since you own your life, you are responsible for your life. You
choose your own goals based on your own values. Success and
failure are both the necessary incentives to learn and to grow.
Your actions on behalf of others, or their actions on behalf of
you, are only virtuous when they come from voluntary, mutual
consent. For virtue can only exist when there is free choice.
This is the basis of a truly free society. It is not only the most
practical and caring foundation for human action, but it is the
most ethical.
Jonathan Gullible
xii Prologue
Prologue
I
n accordance with Mr Gullible’s
wishes, I take up the task of
recounting a bizarre tale that he
related to me in his last years. I have
made every effort to remain true to his
account, despite some literary licence.
This is a firsthand testimony about the
people and incidents of his journey.
Chapter 1
A Great Storm
I
n a sunny seaside town, long before it filled up with movie stars
driving convertibles, there lived a young man named Jonathan
Gullible. He was unremarkable to anyone except his parents, who
thought him clever, sincere, and remarkably athletic – from the top
of his head to the bottom of his oversized feet. They worked hard in
a small chandler’s shop on the main street of a town that was home
to a busy fishing fleet. It had a fair number of hard-working folk,
some good, some bad, and mostly just plain average.
When he wasn’t doing chores or errands for his family’s store,
Jonathan would steer his rough sailboat out the narrow channel
of a small boat harbour in search of adventure. Like many youths
spending their early years in the same place, Jonathan found life
a little dull and thought the people around him unimaginative. He
longed to see a strange ship or sea serpent on his brief voyages
beyond the channel. Maybe he would run into a pirate ship and be
forced to sail the seven seas as part of the crew. Or perhaps, a whaler
on the prowl for oily prey would let him on board for the hunt.
Most sailing trips, however, ended when his stomach pinched with
hunger or his throat parched with thirst and the thought of supper
was the only thing on his mind.
On one of those fine spring days, when the air was as crisp as
a sun-dried sheet, the sea looked so good that Jonathan thought
nothing of packing his lunch and fishing gear into his little boat for
a cruise. As he tacked beyond the rocky point of the lighthouse,
he felt as free-spirited as the great condor that he watched soaring
above the coastal mountains. With his back to the breeze, Jonathan
didn’t notice the dark storm clouds gathering on the horizon.
Jonathan had only recently begun to sail beyond the mouth of
the harbour, but he was getting more confident. When the wind
began to pick up strength he didn’t worry until it was too late. Soon
he was struggling frantically at the rigging as the storm broke over
him with violent force. His boat tossed dizzily among the waves
Chapter 1 • A Great Storm 2
like a cork in a tub. Every effort he made to control his vessel failed,
useless against the tremendous winds. At last, he dropped to the
bottom of the boat, clutching the sides and hoping that he would not
capsize. Night and day blended together in a terrifying swirl.
When the storm finally died down, his boat was a shambles, its
mast broken, sails torn and it tipped in a definite list to starboard.
The sea calmed but a thick fog lingered, shrouding his craft and
cutting off any view. After drifting for days his water ran out and he
could only moisten his lips on the condensation that dripped off the
shreds of canvas. Then the fog lifted and Jonathan spotted the faint
outline of an island. As he drifted closer, he made out unfamiliar
headlands jutting from sandy beaches and steep hillsides covered
by lush vegetation.
The waves carried him onto a shallow reef. Abandoning his craft,
Jonathan swam eagerly to shore. He quickly found and devoured the
pink guavas, ripe bananas and other delicious fruit that flourished
beyond the narrow sandy beach in the humid jungle climate. As
soon as he regained some strength, Jonathan felt desolate but
relieved to be alive. He actually grew excited at his unintended
plunge into adventure. He immediately set off along the white
sandy beach to discover more about this strange new land.
3 Chapter 1 • A Great Storm
Background
Jonathan was first envisioned after browsing
through Gulliver’s Travels and The Little
Prince.
Also, by coincidence, or subconsciously,
“J.G.” are also the initials of John Galt, a character
in Ayn Rand’s Atlas Shrugged – a book that is
also famous for challenging many of society’s
assumptions about ethics, force, economics, and
the proper role of government.
The Little Prince by Antoine de St. Exupery
is a mystical tale about a prince living alone
on a planet, showing independence of mind,
imagination and sensitivity. The film Saint Ex
deals with Antoine de St. Exupery’s life as a
rather “adventurous” pilot during World War II.
Jonathan Swift’s Gulliver’s Travels is often
thought of as stories for children. But his story,
like this book, was written “to vex the world”
and to show the unpleasant aspects of the politics
of the day.
The condor is North America’s largest flying
bird.
You own your life. To
deny this is to imply
that another person
has a higher claim on
your life than you do.
Extract from
Jonathan Gullible’s
Guiding Principles
Chapter 2
Troublemakers
J
onathan walked for several hours without a glimpse of any sign
of life. Suddenly, something moved in the thicket and a small
animal with a yellow-striped tail flashed down a barely visible track.
“A cat,” thought Jonathan. “Maybe it will lead me to some people?”
He dived through the thick foliage.
Just as he lost sight of the beach and was deep in the jungle,
he heard a sharp scream. He stopped, cocked his head, and tried
to locate the source of the sound. Directly ahead, he heard another
shrill cry for help. Pushing up an incline and through a mass of
branches and vines, he clawed his way forward and stumbled onto
a wider path.
As he rounded a sharp bend in the trail, Jonathan ran full tilt into
the side of a burly man. “Out of my way, chump!” bellowed the
man, brushing him aside like a gnat. Dazed, Jonathan looked up and
saw two men dragging a young woman, kicking and yelling, down
the trail. By the time he caught his breath, the trio had disappeared.
Certain that he couldn’t free the woman alone, Jonathan ran back up
the trail looking for help.
A clearing opened and he saw a group of people gathered around
a big tree – beating it with sticks. Jonathan ran up and grabbed the
arm of a man who was obviously the supervisor. “Please sir, help!”
gasped Jonathan. “Two men have captured a woman and she needs
“Don’t be alarmed,” the man said gruffly. “She’s under arrest.
Forget her and move along, we’ve got work to do.”
“Arrest?” said Jonathan, still huffing. .”
Chapter 2 • Troublemakers 6
“She threatened people’s jobs? How did.
He continued, “That Drawbaugh woman came to work this
morning with a sharp piece of metal attached to the end of her stick.
She cut down a tree in less than an hour – all by herself! Think of
it! Such an outrageous threat to our traditional employment had to
be stopped.”
Jonathan’s eyes widened, aghast to hear that this woman was
punished for her creativity. Back home, everyone used axes and
saws for cutting trees. That’s how he got the wood for his own
boat. “But her invention,” exclaimed Jonathan, “allows people of all
sizes and strengths to cut down trees. Won’t that make it faster and
cheaper to get wood and make things?”
“What do you mean?” the man said angrily. “How could anyone
encourage an idea like that? This noble work can’t be done by any
weakling who comes along with some new idea.”
“But sir,” said Jonathan, trying not to offend, “these good tree
workers have talented hands and brains. They could use the time
saved from knocking down trees to do other things. They could
make tables, cabinets, boats, or even houses!”
“Listen, you,” the man said with a menacing look, “the purpose
of work is to have full and secure employment – not new products.”
The tone of his voice turned ugly. “You sound like some kind of
troublemaker. Anyone who supports that infernal woman is trouble.
Where are you from?”
Chapter 2 • Troublemakers 7
Jonathan replied anxiously, “I don’t even know Miss Drawbaugh
and I don’t mean any trouble, sir. I’m sure you’re right. Well, I
must be going.” With that, Jonathan turned back the way he came,
hurrying down the path. His first encounter with the people of the
island left him feeling very nervous.
8 Chapter 2 • Troublemakers
Brainstorming
• What is the purpose of work?
• Are labour-saving innovations good or bad?
• Why?
• Who is affected?
• How can such innovations be stopped?
• What are some examples of this behaviour?
• Is it bad for people to change the kind of
work they do?
• What ethical issues are involved with the use
of force?
Commentary
One of the myths about productivity is that
labour saving machinery, computers, and robots,
cause unemployment and poverty. This theory
appears plausible only because the jobs that are
lost are seen, but those that are created by the
new inventions are not yet seen. Without the
freedom to innovate and earn a profit, there
would have been no progress. Imagine how we
would be living without the innovation of the
wheel, or, as in this chapter, the axe.
The reason for this confusion about labour-
saving automation is that fewer workers are
required when new machinery produces product
X.
People forget that the money saved on
the wages of redundant workers is used by
consumers to purchase more of product X, Y,
and Z at lower prices. Workers who are taught to
use these new machines, and the manufacturers
of the new machines, all have greater incomes to
purchase more products at lower prices.
To begin with, there may be temporary
unemployment in certain sectors as consumers,
producers, and workers adjust to the new demand.
Many more workers are eventually employed in
Among the most
visible of all
economic delusions is
the belief that
machines on net
balance create
unemployment.
Henry Hazlitt
9 Chapter 2 • Troublemakers
a wider range of employment opportunities that
use a greater diversity of talents.
Although some people will be upset by
change, change is the price of progress for
everyone’s higher standard of living.
The only way this process can be slowed to a
near standstill, for it can never be stopped, is for
people to go to government and request laws to
prevent the use of new innovative tools.
Background
The subject of patents is an interesting debate.
Daniel Drawbaugh, the developer of many
intriguing devices from a coin sorter to a clock
with a magnetically controlled pendulum,
claimed to be the inventor of the first telephone
ten years before Alexander Graham Bell. Some
say the patent fees were too expensive for his
meagre income. Bell, however, patented a
telephone device and was thereby able to block
Drawbaugh and 600 others from using similar
devices because of patent infringement lawsuits.
Whether or not Bell was the sole and original
inventor of the telephone, he was an authentic
scientist, unlike George Selden who appears in a
later chapter of this book.
References
Richard B. McKenzie, in The American
Job Machine, says, “Creating jobs is easy
– just outlaw farm machinery. If the health of
an economy is measured by the number of jobs
its citizens have, then China should have the
strongest economy on earth.”
Further articles on this, and related issues,
may be found on the Cato Institute research site:.
Success and failure
are both the
necessary incentives
to learn and to grow.
Extract from
Jonathan’s Guiding
Principles
How did we make the
transition from using
wood to using coal,
from using coal to
using oil, from oil to
natural gas? How in
God’s name did we
make that transition
without a Federal
Energy Agency?
Milton Friedman,
1978
Chapter 3
A Commons Tragedy
T
he trail widened a bit as it cut through the dense jungle. The
midday sun burned hot overhead when Jonathan found a small
lake. As he scooped up some water to refresh himself, Jonathan
heard someone’s voice warning, “I wouldn’t drink the water if I
were you.”
Jonathan looked around and saw an old man kneeling at the
shore, cleaning a few tiny fish on a plank. Beside him was a basket,
a reel, and three poles propped up in the mud, each dangling a line
in the water. “Is the fishing good?” inquired Jonathan politely.
Without bothering to look up, the man replied, somewhat crossly,
“Nope. These little critters were all I got today.” He proceeded to
fillet the fish and to drop them into a hot skillet that was set over
a smouldering fire. The fish sizzling in the pan smelled delicious.
Jonathan spotted the rough yellow-striped cat that he had followed,
already picking at scraps of fish. His mouth watered.
Jonathan, who considered himself an accomplished fisherman,
asked, “What did you use for bait?”
The man looked up at Jonathan thoughtfully. “There’s nothing
wrong with my bait, sonny. I’ve caught the best of what’s left in this
lake.”
Sensing a solitary mood in this fisherman, Jonathan thought he
might learn more by just remaining silent awhile. Eventually, the
old fisherman beckoned him to sit beside the fire to share some fish
and a little bread. Jonathan devoured his meal hungrily, though he
felt guilty about taking a portion of this man’s meagre lunch. After
they finished, Jonathan kept quiet and, sure enough, the old man
began to talk.
“Years ago there were some really big fish to catch here,” the
man said wistfully. “But they’ve all been caught. Now the little ones
are all that’s left.”
Chapter 3 • A Commons Tragedy 12
“But the little ones will grow, won’t they?” asked Jonathan. He
stared at the lush grasses growing in the shallow waters along the
shore where many fish might lurk.
“No. People take all the fish, even the little ones. Not only that,
people dump rubbish into the far end of the lake. See that thick
scum along the far side?”
Jonathan looked perplexed. “Why do others take your fish and
dump rubbish in your lake?”
“Oh, no,” said the fisherman. “this isn’t my lake. It belongs to
everyone – just like the forests and the streams.”
“These fish belong to everyone ...” Jonathan paused, “including
me?” He began to feel a little less guilty about sharing a meal that
he had no part in making.
“Not exactly,” the man replied. “What belongs to everyone really
belongs to no one – that is, until a fish bites my hook. Then it’s
mine.”
“I don’t get it,” said Jonathan, frowning in confusion. Half
speaking to himself, he repeated, “The fish belong to everyone,
which means that they really belong to no one, until one bites your
hook. Then, the fish is yours? But do you do anything to take care
of the fish or to help them grow?”
“Of course not!” the man said with a snort of derision. “Why
should I care for the fish just so someone else can come over here at
any time and catch them? If someone else gets the fish or pollutes
the lake with rubbish, then there goes all my effort!”
With a mournful glance at the water, the old fisherman added
sadly, “I wish I really did own the lake. Then I’d make sure that the
fish were well tended. I’d care for the lake just like the cattleman
who manages the ranch over in the next valley. I’d breed the
strongest, fattest fish and you can bet that no fish rustlers or garbage
dumpers would get past me. I’d make sure of that.”
“Who manages the lake now?” interrupted Jonathan.
The weathered face of the fisherman grew hard. “The lake is run
by the Council of Lords. Every four years, the Lords are elected to
the Council. Then the Council appoints a manager and pays him
from my taxes. The fish manager is supposed to watch out for too
Chapter 3 • A Commons Tragedy 13
much fishing and dumping. The funny thing is, friends of the Lords
get to fish and dump as they please.”
The two sat and watched the wind stir a pattern of ripples across
the silver lake. Jonathan noticed the yellow cat sitting erect, sniffing
and staring at a fish head on his plate. He tossed the head and the
cat caught it neatly with one hooked paw. This feline looked tough,
with one ear torn from some old battle.
Mulling over the old fisherman’s tale, Jonathan asked, “Is the
lake well-managed?”
“See for yourself,” the old fisherman grumbled. “Look at the
size of my puny catch. It seems that the fish get smaller as the
manager’s salary gets bigger.”
14 Chapter 3 • A Commons Tragedy
Brainstorming
• How do people take care of things that
belong to everyone?
• Who really owns the lake and the fish?
• Would the fisherman dump rubbish in the
lake if he owned it?
• How would people’s behaviour change if the
fisherman owned the lake?
• Who benefits by common ownership?
• Examples?
• What ethical issues are involved?
Commentary
This chapter is in reference to the concept of the
“tragedy of the commons”.
Common ownership refers to anything owned
by authorities or the state for the supposed
purpose of the common “benefit” for everyone.
The first part of the tragedy is that everyone is
supposed to benefit from, and feel responsible for,
this common ownership. Frequently, however,
no one benefits because each person has the
desire to grab as much as he or she can before
others do. This means that resources are taken
before they have matured. The second part of the
tragedy is that no one feels responsible for the
consequences.
Governments the world over have contributed
to environmental damage by owning and
controlling vast stretches of land, immense
bodies of water, and extensive coastal areas.
State ownership really means ownership by no
one, so no one has the personal motivation to
protect the resources.
Instead, those with special interests who gain
the favour of politicians, exploit the supposedly
common resources for personal gain.
The tragedy of the
commons is like
children with their
straws in a communal
fizzy-drink bowl
– each sucking “fit to
bust”!
Unknown
One had better be a
poor fisherman than
meddle with the art of
governing men.
Danton
15 Chapter 3 • A Commons Tragedy
Land: The tragedy of the commons is the
reason why people are more inclined to dump
rubbish on public grounds rather than on their
own lawns. It explains why fruit in public areas
is picked before it ripens. When travelling by
plane, one can observe the contrast of high
productivity on privately owned lands with the
overgrazing and waste of “commonly owned”
lands.
Flora and Fauna: The tragedy of the
commons illustrates why the existence of
privately owned cows and garden plants remain
safeguarded from extinction. Yet publicly
“owned” buffaloes and indigenous plant species
are in danger of extinction.
Environment and Pollution: Horrible
examples of pollution and destruction of the
environment have been allowed to happen by
governments on government-owned property,
including the air and waters. It is revealing that
pollution is usually greatest near areas that are
inhabited by people with low income and the
least political power. Courts and regulatory
agencies frequently rationalize and justify this
behaviour.
Background
Countries under communist rule, where
governments controlled everything, had the worst
pollution in the world with almost complete
disregard for their citizens’ health. Even in
“democratic” countries government pollution
control is a failure. In America there is far more
water pollution from sewage plants owned by
local government authorities than from water
pollution from industry.
Making pollution and environmental
protection a matter of state regulation has
meant imposing huge unnecessary costs on the
taxpayer. This could be avoided through greater
respect for private ownership and personal
What is common to
many is taken least
care of, for all men
have greater regard
for what is their own
than for what they
possess in common
with others.
Aristotle
Problems that arise
from the initiation of
force by government
have a solution. The
solution is for people
of the world to stop
asking officials to
initiate force on their
behalf.
Extract from
Jonathan’s Guiding
Principles
16 Chapter 3 • A Commons Tragedy
responsibility. Some avenues to this end could
be achieved by:
• recognising genuine indigenous peoples’
rights to property and the homesteading
or privatisation of other government
properties;
• holding people personally accountable for
injuring the lives and property of others
through all forms of trespass, including
pollution;
• removing subsidies and governmental
privileges to favoured companies or
groups; allowing people to negotiate
mutually agreed upon compensation for
potential injury.
References
In the “Destroying the Environment” chapter
of her book, Healing Our World, Mary Ruwart
shows how, in practical terms, we are more
likely to protect the environment when we
own a piece of it or profit by nurturing it.
You may browse this entire book online at:.
Alan Burris in A Liberty Primer is another
good source.
The Market for Liberty by Linda and Morris
Tannehill is a source in very practical alternative
thinking.
The Cato Institute has more on environmental
regulation:.
A good website that shows how the free
market and property rights are harmonious
with the environment can be found at. This is
run by the Reason Foundation. An intriguing
book on the overall state of the world
environment is The Sceptical Environmentalist
by Bjørn Lomborg.
?
What do you do
when you see an
endangered animal
eating an endangered
plant?
No man ever ruled
other men for their
own good.
George D. Herron
Chapter 4
The Food Police
P
aths converged with the dirt trail as it broadened into a gravel
country road. Instead of jungle, Jonathan passed rolling pas-
tures and fields of ripening crops and rich orchards. The sight of all
that food growing reminded Jonathan of how little he had eaten for
lunch. He detoured toward a neat white farmhouse, hoping to find
his bearings and maybe another meal.
On the front porch, he found a young woman and a small boy
huddled together crying.
“Excuse me,” said Jonathan awkwardly. “Is there any trouble?”
The woman looked up, eyes wet with tears. “It’s my husband.
Oh, my husband!” she wailed. “I knew one day it would come to
this. He’s been arrested,” she sobbed, “by the Food Police!”
“I’m very sorry to hear about that, ma’am. Did you say ‘Food
Police’?” asked Jonathan. He patted the dark head of the boy
sympathetically. “Why did they arrest him?”
The woman gritted her teeth, fighting to hold back tears.
Scornfully, she said, “His crime was that of growing too much
food!”
Jonathan was shocked. This island was truly a strange place!
“It’s a crime to grow too much food?”
The woman continued, “Last year the Food Police issued orders
telling him how much food he could produce and sell to the country
folk. They told us that too much food would lower prices and so
hurt the other farmers.” She bit her lip slightly then blurted out, “My
husband was a better farmer than all the rest of them put together!”
Instantly Jonathan heard a sharp roar of laughter behind him. A
heavyset man strutted up the path from the road to the farmhouse.
“Ha!” he sneered, “I say that the best farmer is the one who gets
the farm. Right?” With a grand sweep of his hand, the man glared
at the woman and her son and commanded, “Now get your things
Chapter 4 • The Food Police 18
packed and out of here! The Council of Lords has awarded this land
to me.”
The man grabbed up a toy dog that was lying on the steps and
thrust it into Jonathan’s hands. “I’m sure she can use the help, boy.
Get moving, this is my place now.”
The woman stood up, her eyes glaring in anger, “My husband
was a better farmer than you’ll ever be.”
“That’s a matter of debate,” the man chuckled rudely. “Oh sure,
he had green fingers. And he was a genius at figuring what to plant
and how to please his customers. Quite a man! But he forgot one
thing – the Council of Lords sets the prices and crops. And the Food
Police enforce the Council rules.”
“You parasite!” yelled the woman. “Your farming methods are
incompetent! You waste good manure and seed on everything you
plant, and no one wants to buy what you grow. You plant in a flood
plain or on parched clay, and it never matters if you lose everything.
You just get the Council of Lords to pay for the rot. They’ve even
paid you to destroy entire crops.”
Jonathan frowned, “There’s no advantage in being a good
farmer?”
“Being a good farmer is a handicap,” answered the woman as
her face reddened. “My husband, unlike this toad, refused to flatter
the Lords and tried to produce honest crops and real sales.”
Shoving the woman and her boy off the porch, the man growled,
“Enough! He refused to follow the annual quotas. No one bucks the
Food Police and gets away with it. Now get off my land!”
Jonathan helped the woman carry her belongings. The woman
and her son walked slowly away from their former home. At a bend
in the road, all turned to take one last look at the neat house and
barn. “What will happen to you now?” asked Jonathan.
The woman sighed, “I can’t afford to pay the high food prices.
Luckily, we’ve got relatives and friends to rely on for help. Otherwise,
I could beg the Council of Lords to take care of Davy and me. They’d
like that,” she muttered bitterly. She took the young boy’s hand and
picked up a large bundle saying, “Come along, Davy.”
Jonathan gripped his stomach – now feeling a little more sick
than hungry.
19 Chapter 4 • The Food Police
Brainstorming
• Why are some farmers paid not to grow
crops?
• What would that do to the price and
availability of food for consumers?
• How does that affect poor people?
• What kinds of dependency arise?
• How does the government benefit?
• Are there real examples of this behaviour?
• Why do we have import duties on food?
• What ethical issues are involved in the use of
force?
Commentary
In many countries efficient farmers who grow an
abundance of food, or sell food at too low a price,
can be fined and imprisoned. This government
meddling in the economy is a violation of
individual rights and, as a practical and humane
matter, is detrimental to consumers.
The reason people are poor is not because
some farmers produce too much. High production
lowers prices and benefits everyone including
the poor. Instead, people are made poorer
because efficient farmers are prevented from
producing. Such intervention is accomplished by
government control boards, tariffs and subsidies.
Even efficient farmers lose the incentive to
produce. Once subsidies are introduced, they
tend to remain in place forever. It would take
unusual courage on the part of a politician to
remove them.
If there is no government interference,
consumer demand will control what and how
much is produced by the prices they are willing
to pay.
Products and
production belong to
the producers. What
is unjust is to enslave
producers by robbing
them of what they
produce with their
labour (work).
Alan Burris, A
Liberty Primer
… And to lose the
product of your life
and freedom is to lose
the portion of your
past that produced it.
Extract from
Jonathan’s Guiding
Principles
20 Chapter 4 • The Food Police
Background
The Economist magazine once reported that
farmers in the U.S. were paid to take as much
as a third of the arable land out of production.
This was about 65 million acres, about the size
of Great Britain.
Currently US farmers are still being paid to
destroy crops such as sugar beets, prunes, and
cranberries. Oddly enough, this information is
not hidden. Newspapers will print front-page
headlines about hurricane or hail damage, but
they report on their back sections about the
far larger destruction of crops by government
officials. Most people accept this, as they
assume their government must be acting with
good intentions for the citizens’ benefit. Japan
and Europe have worse policies, ensuring that
their own farm products won’t be undersold by
cheap foreign imports. All this to the detriment
of the consumers.
References
The Machinery of Freedom – David (“Davy”)
Friedman, Economics in One Lesson – Henry
Hazlitt, and Liberty Primer – Alan Burris, are all
useful references.
There are several books and articles that
tell of awful agricultural policies; notable is
James Bovard’s The Farm Fiasco, a devastating
analysis of the waste, fraud, and corruption in
agricultural policy.
In Healing Our World, the chapter
“Destroying the Environment,” Mary Ruwart
deals with the effect of subsidies on wildlife,
water, and farming habits.
?
“What do you
think is the trouble
with farming?”
“Well, in my day,”
said the farmer,
“when we talked
about what we could
raise on 60 acres, we
meant crops – not
government
loans.”
In 1982 the
American taxpayers
spent $2.3 billion
($2,300,000,000)
to buy up almost
all of the powdered
milk, all of the
cheese, and all of the
butter produced by
American dairymen.
Johanna Neuman
1983
Chapter 5
Candles and Coats
J
onathan accompanied the despairing woman and her boy a
couple of miles down the road to the home of her relatives. They
thanked him warmly and invited him to stay. One look told him
that the house could barely contain the whole family, so he excused
himself and continued on his way.
The road took him to a river where he found a bridge to a walled
town on the other side. The narrow bridge held an imposing divider.
On one side of the bridge, a sign pointed to the town reading,
“ENTER STULTA CITY, ISLE OF CORRUMPO.” On the other
side of the divider, another sign simply read, “EXIT ONLY, DO
NOT ENTER.”
That was not the oddest feature of the bridge. To cross into town,
one had to climb over jagged obstacles. Piles of sharp rocks and
massive boulders blocked the entire entry side of the bridge. Several
travellers had dropped their parcels by the way or into the river
rather than haul them over the craggy barrier. Others, especially the
elderly, simply turned back. Behind one feeble traveller, Jonathan
spied the familiar yellow-striped cat with a ragged right ear, sniffing
and pawing at a bundle that had been discarded. As he watched, the
cat extracted a piece of dried meat from the torn bundle.
In contrast, the exit side of the bridge was smooth and clear.
Merchants carrying goods out of town departed with ease. Jonathan
wondered, “Why do they make it so tough to get into this place
while it is so easy to get out?”
Jonathan clambered over the entrance side of the bridge, slipping
on the uneven footing and hauling himself up on the boulders. He
finally arrived at a pair of thick wooden gates that were thrown wide
open to allow him to pass through the great town wall. People riding
horses, people carrying boxes and bundles and people driving all
manner of wagons and carts traversed the roads inside. Jonathan
straightened his shoulders, dusted off his tattered shirt and pants
and marched through the gateway. The cat slipped in behind him.
Chapter 5 • Candles and Coats 22
Just inside, a woman, holding a rolled parchment, sat behind a
table that was covered with bright little medallions.
“Please,” asked the woman, giving a wide smile and reaching out
to pin one of the medallions onto Jonathan’s shirt pocket, “won’t
you sign my petition?”
“Well, I don’t know,” stammered Jonathan. “But I wonder if you
could direct me toward the centre of town?”
The woman eyed him suspiciously. “You don’t know the
town?”
Jonathan hesitated, noting the chilly tone that had crept into her
voice. Quickly, he said, “And where do I sign your petition?”
The woman smiled again. “Sign just below the last name, right
here. You’re helping so many people with this.”
Jonathan shrugged his shoulders and took up her pen. He
felt sorry for her, sitting all bundled in heavy clothing, sweating
profusely on such a pleasant, sunny day. “What’s this petition for?”
asked Jonathan.
She clasped her hands in front of her as if preparing to sing a
solo. “This is a petition to protect jobs and industry. You are in
favour of jobs and industry, are you not?” she pleaded.
“Of course I am,” said Jonathan, remembering the enterprising
young woman who was arrested for threatening the jobs of tree
workers. The last thing he wanted was to sound uninterested in
people’s work.
“How will this help?” asked Jonathan as he scribbled his name
badly enough so that no one could possibly read it.
“The Council of Lords protects our local industries from products
that come from outside of town. As you can see, we’ve made
progress with our bridge, but there’s so much more to be done. If
enough people sign my petition, the Lords have promised to ban
foreign items that hurt my industry.”
“What is your industry?” asked Jonathan.
The woman declared proudly, “I represent the makers of candles
and coats. This petition calls for a ban on the sun.”
“The sun?” gasped Jonathan. “How, ..uh,.. why ban the sun?”
Chapter 5 • Candles and Coats 23
She eyed Jonathan defensively. “I know it sounds a bit drastic,
but don’t you see – the sun hurts candle makers and coat makers.
People don’t buy candles and coats when they’re warm and have
light. Surely you realise that the sun is a very cheap source of
foreign light and heat. Well, this just cannot be tolerated!”
“But light and heat from the sun are free,” protested Jonathan.
The woman looked hurt and whined, “That’s the problem, don’t
you see?” Taking out a little pad and pencil, she tried to draw a
few notations for him. “According to my calculations, the low-cost
availability of these foreign elements reduces potential employment
and wages by at least fifty percent – that is, in the industries which
I represent. A heavy tax on windows, or maybe an outright ban,
should improve this situation nicely.”
Jonathan put down her petition. “But if people pay for light and
heat, then they will have less money to spend on other things –
things like meat, or drink, or bread.”
“I don’t represent the butchers, or the brewers, or the bakers.”
the woman said brusquely. Sensing a change in Jonathan’s attitude
she snatched away the petition. “Obviously you are more interested
in some selfish consumer whim than in protecting the security of
jobs and sound business investment. Good day to you,” she said,
ending the conversation abruptly.
Jonathan backed away from the table. “Ban the sun?” he thought.
“What crazy ideas! First axes and food, then the sun. What will they
think of next?”
24 Chapter 5 • Candles and Coats
Brainstorming
• Is it good for people to get free light and heat
from the sun?
• Who objects?
• Are the objections to imports similar?
• What groups object to people buying cheap
products from other countries?
• Why?
• Do consumers suffer when imports are
banned?
• How do groups stop imports of low-cost
goods?
• Examples?
• What ethical issues are there?
Commentary
The title of this chapter is in reference to one
of Frederic Bastiat’s famous essays on candle
makers. The candle makers wanted to ban the
light and heat from the sun, and so create
an artificial need in order to “protect” their
country’s industry.
Imports: Governments’ import restrictions
are not aimed at foreigners. These restrictions
penalise consumers by forcing them to buy
higher-priced or lower-quality products than they
would prefer. By raising prices, trade barriers
also deprive us of the savings that we could use
to buy other products that would be generated by
employment in new industries.
Thus, if one has five coins and can pay one
coin for the imported product, then one has four
coins to buy other things. But if the import is not
allowed, then one may have to pay five coins for
the domestic product and there will be nothing
left to buy other goods.
The excuse offered for import restrictions is
that governments are “patriotically” protecting
domestic jobs and companies. However, as
When goods don’t
cross borders,
soldiers will.
Frederic Bastiat, 1850
Sanctions prevent
the peasants from
creating wealth.
Anonymous
Whatever cause
you champion, the
cure does not lie in
protesting against
globalization
itself. I believe the
poor are poor not
because of too much
globalization but
because of too little.
Kofi Annan,
Secretary General of
the United Nations
25 Chapter 5 • Candles and Coats
long as these jobs are protected, they will never
outgrow their need for protection. What makes
companies competitive is competition. If they
can’t compete, it would be better if they shifted
capital and labour into product lines where they
have an advantage over other markets.
Trade barriers in retaliation against another
country only injure the innocent. The home
country gains nothing by inflicting “reciprocal”
injury on their own citizens.
Exports: Why are a nation’s exports
uncompetitive? This is frequently because of
high taxes and burdensome regulations in
the exporting country, not because of strong
competition from abroad.
Protecting local industry slows competitive
innovations. It also leads to dependency on
politicians who hand out the protection.
Protecting “job and industry” by banning
“unfair competition” is very similar to the
argument that the tree-workers made against
“unfair competition” from labour-saving
inventions. When laws are passed to protect the
candle makers, coat makers, and tree workers
from competition, then consumers have to pay
more than what they otherwise would.
This hurts even those who gain from the
protection. In the long-run we all have more
to gain from free trade than from a policy of
protectionism.
Background
There was a time, in the history of Europe, when
there was a tax on windows. To avoid this tax
people boarded up their windows or walled them
up completely.
Quote from Bastiat’s famous Candle Makers’
Petition: “We candle makers are suffering from
the unfair competition of a low-priced foreign
rival. Our Customers desert us and related
industries are also injured.
Two people who
exchange property
voluntarily are both
better off or they
wouldn’t do it.
Extract from
Jonathan’s Guiding
Principles
When our economies
are entwined we will
not fight.
Unknown
26 Chapter 5 • Candles and Coats
“This rival is the sun! Please pass a law
requiring the covering of all windows, skylights,
holes and cracks. Domestic manufacturers will
be stimulated. Agriculture will thrive on the
need for tallow. Whale oil demand will improve
shipping and thus defence. Jobs will be created
and everyone will benefit. We have always
served our country well and gratitude demands
that we be protected.” Frederic Bastiat, 1846.
In Sophisms, Chapter 10, Bastiat writes:
“Once upon a time there were, no matter
where, two cities, Stulta and Puera.” See:.
He goes on to tell the tale of the two cities
building a highway between them, at great
expense. Then employing salaried “Obstructers”,
at great expense, whose function was to set
up obstacles, at great expense, to “prevent the
flooding” of trade.
References
In July 2001 The International Society for
Individual Liberty – –
celebrated the centenary of the birth of Frederic
Bastiat – the French economist, statesman, and
author. Notable is his little (75 pages) thought-
provoking book The Law.
The Incredible Bread Machine by R.W. Grant
discusses the history and power of politics. The
Fair Trade, by James Bovard.
To see a 12-year old girl’s opinions on imports/
export see:
FreeMarketSuger.
What generates war
is the economic
philosophy of
nationalism;
embargos, trade and
foreign exchange
controls, monetary
devaluation, etc. The
philosophy of
protectionism is a
philosophy of war.
Ludwig von Mises
Chapter 6
The Tall Tax
A
s Jonathan strode through the town he immediately noticed a
dignified well-dressed man kneeling in the street, trying pain-
fully to walk. Yet, the man didn’t appear to be crippled – just short.
Jonathan offered a helping hand, but the man brushed him aside.
“No, thank you!” said the man, wincing in pain. “I can walk
okay. Using knees takes some getting used to.”
“You’re okay? But why don’t you get off your knees and walk
on your feet?”
“Ooooh!” moaned the man, squirming in discomfort. “It’s a
minor adjustment to the tax code.”
“The tax code?” repeated Jonathan. “What’s the tax code have
to do with walking?”
“Everything! Ow!” By now the man settled back on his heels,
resting from his torturous ordeal. He pulled a handkerchief from
his shirt pocket and mopped his brow. He shifted his balance to
massage one knee, then the other. Many layers of worn-out patches
had been sewn on at the knees. “The tax code,” he said, “has
recently been amended to level the field for people of different
heights.”
“Level the field?” asked Jonathan.
“Please stoop over so I don’t have to shout,” pleaded the man.
“That’s better. The Council of Lords decided that tall people have
too many advantages.”
“Advantages of tallness?”
“Oh, yes! Tall people are always favoured in hiring, promotion,
sports, entertainment, politics, and even marriage! Ooooh!” He
wrapped the handkerchief around the newest of many rips in his
grey pants. “So the Lords decided to level us with a stiff tallness
tax.”
Chapter 6 • The Tall Tax 28
“Tall people get taxed?” Jonathan glanced sideways and felt his
posture begin to droop.
“We’re taxed in direct proportion to our height.”
“Did anyone object?” asked Jonathan.
“Only those who refused to get on their knees,” the man said.
“Of course, we’ve allowed an exemption for politicians. We usually
vote tall! We like to look up to our leaders.”
Jonathan was dumbfounded. By now, he found himself slouching,
self-consciously trying to shrink. With both hands pointing down at
the man’s knees he questioned incredulously, “You’ll walk on your
knees just for a tax break?”
“Sure!” replied the man in a pained voice. “Our whole lives are
shaped to fit the tax code. There are some who have even started to
crawl.”
“Wow! That must hurt!” Jonathan exclaimed.
“Yeah, but it hurts more not to. Ow! Only fools stand erect and
pay the higher taxes. So, if you want to act smart, get on your knees.
It’ll cost you plenty to stand tall.”
Jonathan looked around to see a handful of people walking on
their knees. One woman across the street was slowly crawling.
Many people scurried about half-crouching, their shoulders hunched
over. Only a few walked proudly erect, ignoring the sanctions
completely. Then Jonathan caught sight of three gentlemen across
the street sitting on a park bench. “Those three men,” indicated
Jonathan. “Why are they covering their eyes, ears, and mouths?”
“Oh, them? They’re practising,” replied the man as he leaned
forward on his knees to shuffle along. “Getting ready for a new
series of tax proposals.”
29 Chapter 6 • The Tall Tax
Brainstorming
• Is it proper to use taxes to manipulate
behaviour?
• Do people shape their lives to reduce taxes?
• Are officials more wise and moral than their
subjects?
• Is it unfair for people to be tall?
• Examples?
• What ethical issues are there in this story?
Commentary
Through taxes governments have the means to
manipulate the behaviour of citizens. This is
in violation of individual rights. When taxes
become severely burdensome, people alter their
lives to guard against the costs, inconvenience,
and indignity of those taxes.
When governments want less of undesirable
behaviour, they tax it. By promoting some taxes
as “sin taxes” the state is saying “these are sins
– things you should not be doing, so we are
going to tax them”. The state tries to discourage
smoking and drinking in this manner. Ironically,
taxes have the same effect on other kinds of
behaviour such as working and saving. Thus
working, saving, and becoming self-sufficient,
are also treated as sinful behaviour.
The more people work – “sin” – the more
they will be taxed. In this way the government
also treats business success as a sin. This happens
even though profitable firms provide goods and
services, jobs and incomes – all of which provide
for more tax revenues.
In other words, the state is discouraging work
and self-responsibility – behaviour that is surely
not sinful and that most people would like to
encourage. Governments tend to tax efficiency
and subsidise inefficiency.
We, and all others
who believe in
freedom as deeply as
we do, would rather
die on our feet than
live on our knees.
And those who defy
the government’s
manipulations stand
proud.
Quote by Franklin
Roosevelt (though he
probably didn’t want
people to reject some
of his government
actions!)
30 Chapter 6 • The Tall Tax
“Silent” or hidden taxes heavily penalise
low-income people who have less influence over
government officials. These types of taxes, in
many disguises, affect our lives as politicians’
wishes seldom coincide with our own.
Control of people through taxes, licences,
and regulations upsets the economy, increases
costs and reduces the demand for labour. This
often leads to hostility and violence between
groups that are on different sides of government
favour.
Background
This chapter is about the idea that equality of
everything should be forced upon people. In this
chapter, politicians try to force everyone to be
the same equal height.
As we saw in the previous chapter, people
in Europe were prepared to alter their lives by
shutting out the sunshine in order to save on
taxes. It is no different today. Governments try
to control our behaviour with taxes. It is amazing
how many people’s lives and conversations are
shaped by the tax code.
References
A very comprehensive book that deals with this
issue is A Liberty Primer by Alan Burris.
In Welcome to the Monkey House by Kurt
Vonnegut, strong people are made to carry
weights to bring them down to the level of the
rest.
An active and successful international
institute for promoting free trade, free markets,
and personal responsibility is the Atlas
Foundation,.
?
A fine is a tax for
doing wrong.
A tax is a fine for
doing well.
Chapter 7
Best Laid Plans
D
ull two- and three-storey wooden row houses lined the streets
of the town. Then Jonathan noticed one grand, elegant home,
standing apart from everything, isolated on an expansive green
lawn. It looked solidly built, adorned with attractive latticework
and freshly painted white walls.
Curious, Jonathan approached the house and found a crew
wielding heavy sticks, attacking the back of the home and trying to
tear it down. They weren’t very enthusiastic and moved very slowly
at the job. Nearby, a dignified, grey-haired woman stood with her
hands clenched, visibly unhappy at the proceedings. She groaned
audibly when a piece of the wall came down.
Jonathan walked over to her and asked “That house looks well
built. Who’s the owner?”
“That’s a good question!” the woman shot back vehemently. “I
thought I owned this house.”
“You thought you owned it? Surely you know if you own a
house,” said Jonathan.
The ground shook as the entire back wall collapsed inside. The
woman stared miserably at the cloud of dust billowing up from
the rubble. “It’s not that simple,” yelled the woman over the noise.
“Ownership is control, right? But who controls this house? The
Lords control everything – so they’re the real owners of this house,
even though I built it and paid for every board and nail.”
Growing more agitated, she walked over and ripped a paper off
a single post left where a whole wall had stood moments before.
“See this notice?” She crumpled it, threw it down and stamped on
it. “The officials tell me what I may build, how I may build, when
I may build, and what I can use it for. Now they tell me they’re
tearing it down. Does that sound like I own the property?”
“Well,” ventured Jonathan sheepishly, “didn’t you live in it?”
Chapter 7 • Best Laid Plans 32
“Only so long as I could keep paying the property taxes. If I
didn’t pay, the officials would have booted me out faster than you
can say ‘next case’ !” The woman grew red with fury and continued
breathlessly, “No one really owns anything. We merely rent from
the Council so long as we pay their taxes.”
“You didn’t pay the tax?” asked Jonathan.
“Of course I paid the cursed tax!” the woman practically shouted.
“But that wasn’t enough for them. This time, the Lords said that
my plan for the house didn’t fit their plan – the master plan of
‘superior owners,’ they told me. They condemned my house – gave
me some money for what they said it was worth. And now they’re
going to clear it away to make a park. The park will have a nice big
monument in the centre – a monument to one of their own.”
“Well, at least they paid you for the house,” said Jonathan. He
thought a moment and asked, “Weren’t you satisfied?”
She gave him a sideways look. “If I was satisfied, they wouldn’t
have needed a policeman to push the deal, now would they? And the
money they paid me? That was taken from my neighbours. Who’ll
compensate them? The Lords won’t pay them!”
Jonathan shook his head in bewilderment. “You said that it was
all part of a master plan?”
“Ha! A master plan!” the woman said sarcastically. “That’s a
plan that belongs to whoever has political power. If I spent my life
in politics, then I’d be able to impose my plans on everyone else.
Then I could steal houses instead of building them. It’s so much
easier!”
“But surely you need a plan in order to have a wisely built town?”
said Jonathan hopefully. He tried to find a logical explanation for
her plight. “Shouldn’t you trust the Council to come up with such a
plan?”
She waved her hand at the row houses. “Go see for yourself. The
worst plans are the few that they actually complete – shoddy, costly,
and ugly.”
Turning to face Jonathan, she looked him straight in the eye.
“Think of this. They built a sports stadium where nine of every ten
spectators can’t see the field of play. Because of their shoddy work,
it cost twice as much to repair as it cost to build in the first place!
Chapter 7 • Best Laid Plans 33
And their great meeting hall is only available to visitors, not for
the taxpayers who paid for it. Who did the planning? The Lords.
They get their names emblazoned in stone and their friends get fat
contracts.”
Jabbing a finger into Jonathan’s chest, she declared, “Only
foolish plans have to be forced on people. Force never earned my
trust!” Fuming, she glared back at her house. “They haven’t heard
the last from me!”
34 Chapter 7 • Best Laid Plans
Brainstorming
• When is it OK for the government to take a
house away from someone?
• What is the problem with superior
ownership, or eminent domain?
• If an official can use, control, take, or
destroy a house that another person builds,
then who really owns the house?
• Can private initiative provide better and
cheaper buildings?
• Is a property tax like rent?
• Examples?
• Ethical issues?
Commentary
Vast stretches of land in all countries are owned
by the state. Yet, the state has the power to take
anyone’s property if it is claimed to be “for the
common good”. State officials set the price
unilaterally. If you resist, the state has the power
to forcefully remove you. So, who really owns
the land?
In theory, your property is any possession
owned by you. This can be your house, your
farm, your toy, your book, or your car. To own
something is to have control over what you
do with it. In fact, you may do what you like
with it as long as you do not harm others. You
may use your property any way you wish. This
includes your right to decide not to sell or to sell
voluntarily at a profit.
If you do not have control over your property,
then it cannot really be yours even though you
built it or paid for it. You are but a “renter” or
a “borrower” from the real master – the higher
authority.
The harvest of your
life is your property.
It is the fruit of your
labour, the product
of your time, energy,
and talents.
Jonathan’s Guiding
Principles
Under the pretence
of organization,
regulation,
protection, or
encouragement, the
law takes property
from one person and
gives it to another;
the law takes the
wealth of all and
gives it to a few.
Frederic Bastiat 1849
35 Chapter 7 • Best Laid Plans
A look at the queues at your local licensing
office will tell you how much your community
is being controlled and forced to conform to
regulations.
A further disadvantage of licenses is that they
are left to the whim of officials. If an official feels
so inclined, he or she has the power to delay an
application until a more “convenient” time. This
power puts him in a good position to consider
a bribe. In Costa Rica there is a saying, which
translates as “where there is a license there is
a sausage (a bribe).” Licences and regulations
stifle progress. It is no accident that countries
with the most restrictions experience the least
economic growth.
The situation is different if a group of people
voluntarily reaches an agreement to mutually
coordinate their property or housing plans.
The difference is that it is voluntary – unlike
government plans where one group imposes its
will upon all others.
Background
Eminent domain, Latin for “superior owner”, the
authority of the state to take private property for
public use.
The 5th Amendment of the US Constitution
requires that just compensation be given,
but is it? How can it be just if it can only be
accomplished by force?
References
Bastiat’s The Law is the best reference on
authorised plunder.
For a New Liberty by Murray Rothbard
gives some great alternatives in tough areas.
Eminent domain is an act of aggression. An
illustration of how this power is abused can
be found at the website, Institute for Justice:.
?
In some cities
they tear down
buildings to save
taxes. They might try
tearing down some
taxes to save
buildings.
Many visitors wonder
why Geneva, one of
the world’s richest
cities, headquarters
of a host of banks
and international
organisations, has no
great architecture in
which to take pride.
But when one needs
to get authorisation
from pen-pushers and
approval by a
referendum of
philistines to build on
one’s own land with
one’s own hands, the
result is architecture
to please philistine
pen-pushers.
Christian Michael
Chapter 8
Two Zoos
C
ontinuing on his way, Jonathan puzzled over the rules of this
troubled island. Surely the people wouldn’t live with laws that
made them so unhappy? There must be a good reason. The land
looked so green and the air was so soft and warm – this should
be paradise. Jonathan relaxed his stride as he passed through the
town.
He reached a stretch of road with formidable iron fences lining
both sides. Behind the fence on his right stood strange animals
of many sizes and shapes – tigers, zebras, monkeys – too many
to count. Behind the other fence on the left paced dozens of men
and women, all wearing black-and-white-striped shirts and pants.
The two groups facing each other across the road looked bizarre.
Spotting a man wearing a black uniform and twirling a truncheon,
Jonathan approached the guard as he marched between the locked
gates.
Jonathan asked politely, “What are these fences for?”
Keeping a steady rhythm with his feet and club, the guard
proudly replied, “One encloses our animal zoo.”
“Oh,” said Jonathan, staring at a group of furry animals with
prehensile tails leaping from the walls of their cage.
The guard, accustomed to giving tours to the local children,
continued to lecture. “See the excellent variety of animals over
there?”
He gestured toward the right side of the road. “They’re brought
to us from all over the world. The fence keeps the animals safely in
a place where people can study them. Can’t have strange animals
wandering around and harming society, you know.”
“Wow!” exclaimed Jonathan. “It must have cost you a fortune
to bring animals from all over the world and to provide for them
here.”
Chapter 8 • Two Zoos 38
The guard smiled at Jonathan, and shook his head slightly. “Oh,
I don’t pay for the zoo myself. Everyone on Corrumpo pays a zoo
tax.”
“Everyone?” asked Jonathan, self-consciously feeling the bottom
of his empty pockets.
“Well, some folks try to avoid their responsibilities. These
reluctant citizens say they have no interest in a zoo. Others refuse
because they believe animals should be studied in their natural
habitat.”
The guard turned to face the fence on the left of the road, rapping
the heavy iron gate with his club. “When citizens refuse to pay the
zoo tax, property tax, tall tax, or window tax, we place them here,
safely behind these bars. Such strange people can then be studied.
They, too, are prevented from wandering around and harming
society.”
Jonathan’s head began to spin from disbelief. Comparing the
two groups behind the fences, he wondered if he would pay for the
maintenance of this guard and two zoos. He gripped the iron bars
and scrutinized the proud faces of the inmates in striped clothing.
Then he studied the haughty expression on the face of the guard
who continued to pace back and forth, twirling his club.
That same old yellow cat was weaving in and out of the bars of
the zoo, always on the prowl for a meal. The guard pounded a bar
loudly with his stick and the cat scampered behind Jonathan’s legs.
He then sat down to lick his forepaw and to scratch the fleas behind
his torn ear.
“I’ll bet you love mice, don’t you, cat? Lots of mice,” said
Jonathan. Patting him on the head, Jonathan named his new
companion saying, “How about ‘Mices’ ? Well, Mices, you’ve been
on both sides of the fence. On which side of the bars are those of
greater harm?”
39 Chapter 8 • Two Zoos
Brainstorming
• Should people be forced to pay for a zoo?
• What reasons could there be for not paying?
• What happens to people who would refuse to
pay such a tax?
• On which side of the fence are the people
who are harming others?
• Examples?
• Ethical issues?
Commentary
Bureaucrats administer laws made by politicians.
In this position they are able to influence
politicians into the making of laws. They are
unelected and unaccountable to the public, yet
they are able to control almost every detail of
public life, often having their own agendas and
their own scores to settle.
All bureaucrats are civil servants but lower
civil servants many not be as involved with
the administration of laws. Civil servants (i.e.
non-military) are un-elected and employed as
servants to the civilian population (that’s you
and me!). They include clerks issuing licences,
traffic officers, municipal employees, public zoo
officials, and prison administrators.
Are you happy that your money is used
for things you do not use? Is it right that we
are fined, penalised, or even put in jail for not
paying for services that are only of pleasure to
someone else?
If one considers the public services provided
by the state or by the municipalities, and one
then considers how many of these are used
by only a small portion of the population,
one can see that private enterprise is a fairer
system. Private enterprise is more motivated to
efficiently serve the people who are willing to
pay for the services. Only those people using the
service would pay. Competition for customers
When law and
morality contradict
each other, the
citizen has the cruel
alternative of either
losing his moral
sense or losing his
respect for the law.
Frederick Bastiat
40 Chapter 8 • Two Zoos
would provide incentives to give competitive
service, prices and customer care. Those who
are not interested in the service would not be
made poorer by having to pay for services they
do not require. These people would keep their
money for services they consider beneficial to
themselves.
Background
This chapter was mostly inspired by local Hawaii
news items and arguments over paying for the
zoo. At issue is how the market might provide.
The cat was included to add a little personality
to whom Jonathan might make occasional
of free-market economist Ludwig von Mises,
but without any deeper meaning intended, just a
“fellow traveller.”
The Ludwig von Mises Institute, founded
in 1982, is a unique educational organisation
dedicated to the work of Ludwig von Mises
and the advancement of Austrian economics.
Ludwig’s wife, the beautiful Margit Serency,
served as chairman of the Mises Institute. On
proposing to her, Mises warned her that while he
would write much about money, he would never
have much of it!
References
Good references on private and public enterprises
are Alan Burris A Liberty Primer, Taney’s book
A Market for Liberty and David Friedman’s The
Machinery of Freedom.
The essential theories of von Mises may be
downloaded:
evm.htm.
For privatisation see: Reason Public Policy
Institute: http//.
Thus, you have no
right to designate
some person to
initiate force against
others on your behalf.
Extract from
Jonathan’s Guiding
Principles
The State represents
violence in a
concentrated and
organised form.
Gandhi
Chapter 9
Making Money
I
n the company of Mices, Jonathan pressed on. The buildings grew
larger and more people filled the street. Pavements made walking
easier, even for the ones on their knees. As he passed a large brick
building, he heard the roar of machinery coming from above. The
rapid clickety-clack sounded like a printing press. “Maybe it’s the
town newspaper,” said Jonathan aloud, as if expecting a reply from
the cat. “Good! Then I can read all about this island.”
Hastily he rounded the corner looking for an entrance and nearly
bumped into a smartly-dressed couple walking arm-in-arm along
the cobblestone street. “Excuse me,” apologized Jonathan, “is this
where they print the town newspaper?”
The lady smiled and the gentleman corrected Jonathan. “I’m
afraid you’re mistaken, young man. This is the Official Bureau of
Money Creation, not the newspaper.”
“Oh,” said Jonathan in disappointment. “I was hoping to find a
printer of some importance.”
“Cheer up,” said the man. “There is no printer of greater
importance than this bureau. Isn’t that right dear?” The man patted
the woman’s gloved hand.
“Yes, that’s true,” said the woman with a giggle. “The Bureau
brings lots of happiness with the money it prints.”
“That sounds wonderful!” said Jonathan excitedly. “Money
would certainly make me happy right now. If I could print some
money then...”
“Oh, no !” said the man in disapproval. He shook a finger in
Jonathan’s face. “That’s out of the question.”
“Of course,” said the woman in agreement. “Money printers who
are not appointed by the Council of Lords are branded ‘counterfeiters’
and thrown behind bars. We don’t tolerate scoundrels.”
The man nodded vigorously. “When counterfeiters print their
fake money and spend it, too much money circulates. Prices
Chapter 9 • Making Money 42
soar; wages, savings, and pensions become worthless. It’s pure
thievery!”
Jonathan frowned. What had he missed? “I thought you said that
printing lots of money makes people happy.”
“Oh, yes, that’s true,” replied the woman. “Provided...”
“...that it’s official money printing,” the man interjected before
she could finish. The couple knew each other so well that they
finished each other’s sentences. The man pulled a large leather
wallet from his coat pocket and took out a piece of paper to show
Jonathan. Pointing to an official seal of the Council of Lords, he
noted, “See here. This says ‘legal tender,’ and that makes it official
money.”
“The printing of official money is called ‘monetary policy’.”
she proceeded, as though reciting from a memorized school text.
“Monetary policy is all part of a master plan.”
Putting his wallet away, the man added, “If it’s official, then
those who issue this ‘legal tender’ are not thieves.”
“Certainly not!” said she. “The Council of Lords spends this
legal tender on our behalf.”
“Yes, and they are very generous,” he said with a wink. “They
spend that official money on projects for their loyal subjects
especially those who help them get elected.”
“One more question, if you don’t mind,” continued Jonathan.
“You said that when counterfeit money is everywhere, prices soar
and wages, savings, and pensions become worthless. Doesn’t this
also happen with that legal tender stuff?”
The couple looked at each other gleefully. The gentlemen said,
“Well, prices do rise, but we’re always happy when the Lords
have more money to spend on us. There are so many needs of the
employed, the unemployed, the exceptional, the unexceptional, the
young, the un-young, the poor, and the un-poor.”
The woman added, “The Lords research the roots of our
pricing problems scrupulously. They’ve identified bad luck and poor
weather as the chief causes. The whims of nature cause rising prices
and a declining standard of living – especially in our woodlands and
farmlands.”
Chapter 9 • Making Money 43
“Indeed!” exclaimed her escort. “Our island is besieged by
catastrophes that ruin our economy with high prices. Surely the
high prices of timber and food will mean our downfall one day.”
“And low prices,” she cried. “Outsiders, with their dog-eat-dog
competition, are always trying to sell us candles and coats at
ruinously low prices. Our wise Council of Lords deals severely
with those monsters as well.” Turning to her companion, she tugged
impatiently at his sleeve.
“Quite right,” he told her. “I hope you will excuse us, young
man. We have an engagement with our investment banker. Must
catch the boom in land and precious metals. Come on, dear.” The
gentleman tipped his hat, the lady bowed politely, and both wished
Jonathan a cheerful farewell.
44 Chapter 9 • Making Money
Brainstorming
• Is it good or bad to print lots of money?
• Who decides?
• How are people affected differently?
• Is there a difference between counterfeiters
and official money printers?
• Would prices that stay roughly the same
down the generations help people to
understand value and to plan their lives?
• Who is blamed for rising prices?
• Examples?
• What are the ethical issues?
Commentary
A potato is valued by the number of potatoes
there are for sale.
Let us say you are a potato farmer and your
neighbour is an apple farmer. You agree to give
him 10 potatoes for 10 of his apples. Then
suddenly a lot of potatoes become available.
Now your potato is not as valuable as a trading
item. Your neighbour may now want 20 of your
potatoes for just 10 of his apples.
And so it is with money. If there is a shortage
of notes, money will be more valuable. You will
be able to buy lots of goods with your 10 notes.
On the other hand, if the market is suddenly
flooded with notes there will be more notes and
therefore each note will be less valuable. As a
consumer, you will have to spend more notes to
get the same number of goods as you did before.
Each note is now worth less than it was.
Does it matter when governments print more
and more money? Yes, it does. Not only because
it devalues the country’s money, but also because
those who are issued with the newly printed
money can buy before prices rise. For awhile
people will say things are getting better because
there is more money around. However, by the
Why is bread less
expensive than
diamonds? Because
diamonds are less
available than bread.
Murray Rothbard
45 Chapter 9 • Making Money
time this money has been traded many times it
arrives in the hands of people with fixed incomes
and savings who earn the same but need more
notes for their goods.
This is called inflation. This role of
governments is often ignored while shopkeepers
and farmers are incorrectly blamed for the
higher prices.
The control of money is one of the main ways
the state can ensure several things; the growth of
the number of government departments; rewards
to favoured groups and companies; and payoffs
to tinker with elections.
Governments, unlike private businesses,
do not obtain the money as voluntary payment
for services. Governments need to find ways
of forcing people to give up their money. This
is taxation. But taxation is unpopular. So an
alternative answer to the state’s problem is to
print more money. With more money circulating
the economy appears to be doing better – for a
while. That is until inflation catches up and all
goods become more expensive. Printing money
just before an election is a clever way to make
people think the ruling party is doing well. Only
after the elections will the effects of inflation
be felt. Then it is too late for the electorate to
react.
The effect of counterfeiting money is like
stealing from the wages, savings, and pensions of
others. Governments don’t like this competition
from independent money printers, so they make
it illegal for others to print money. If people had a
choice, they would not use money that was losing
value and would choose more stable money. But
governments don’t like that competition either.
That’s why they make their money mandatory to
use, i.e., legal tender.
Banks full of newly
printed money are
eager to lend it out.
Alan Burris in A
Liberty Primer
Virtue can only exist
when there is free
choice. This is the
basis of a truly free
society.
Extract from
Jonathan’s Guiding
Principles
46 Chapter 9 • Making Money
Background
Traders need some object which is widely
accepted, durable, and convenient for measuring
comparability of value between products.
Precious metals, such as gold and silver,
have proved superior in serving this purpose.
Goldsmiths and bankers then used paper
receipts for gold and silver in order to enhance
the security and convenience of exchange.
Competition between banks and currencies,
along with strict personal accountability, kept
currencies stable because people would have
refused to use currencies that were losing value
(inflated).
In 1844, Sir Robert Peel arranged the Peel
Act, giving the government’s Bank of England a
monopoly in the issuance of bank notes.
References
Murray Rothbard’s enlightening book What has
the government done to our money? is an enjoyable
read and gives the history of money and banking.
Friedrich Hayek’s Denationalisation of
Money explores the idea of ending legal tender
laws and allowing competition in currencies. A
fun read about counterfeiting is Walter Block’s
Defending the Undefendable.
The Von Mises Institute has called for the
return to a gold standard, while others have
called simply for choice in currency and ending
legal tender laws:.
Sheffield University provides a website
for research into free banking: http:
//.
For monetary and banking policies see:.
The balance sheets or statements of liabilities
of various countries make interesting reading.
These may be found by searching for the name
of your country’s reserve bank.
?
Conferences on
inflation are
customarily attended
by the politicians who
cause it and the
economists who
showed them how.
Richard Needham,
1977
The only way to get
money out of politics
is to get politics out
of money-making.
Richard M. Salsman
Chapter 10
The Dream Machine
H
ow would Jonathan ever get home? He was a hearty, honest
lad, willing to do any kind of work. Perhaps he might find a job
with a ship’s crew. Surely an island had to have a harbour and ships.
As he pondered the problem, a thin man struggled to load a bulky
machine onto a big, horse-drawn wagon. He wore an eye-catch-
ing red suit and a stylish hat with a large feather stuck in the band.
Catching sight of Jonathan, the man yelled, “Hey, kid, I’ll pay you
five kayns to help me load.”
“Kayns?” repeated Jonathan curiously.
“Money, paper payola. You want it or not?”
“Sure,” said Jonathan, having no better idea of what to do. It
wasn’t work on a ship, but he needed to earn his keep. Besides,
the man looked shrewd and could offer some advice. After much
pushing and shoving they managed to heave the unwieldy machine
on board. Wiping his brow, Jonathan stood back panting and looked
at the object of his labour. The machine was large with beautiful
designs painted all over it. On the top was a large horn, such as the
one Jonathan had once seen on a hand-cranked phonograph back
“Such beautiful colours,” said Jonathan, feeling dizzy while
staring at the intricate, pulsating patterns. “And what’s that big horn
on top?”
“Come around to the front and see for yourself.” So Jonathan
climbed up onto the wagon and read the sign painted with elegant
gold letters: “GOLLY GOMPER’S DREAM MACHINE !”
“A dream machine?” repeated Jonathan. “You mean it makes
dreams come true?”
“It sure does,” said the sharp-faced man. He twisted out the last
screw and removed a panel in the back of the machine. Inside were
the works of a simple phonograph. Instead of a hand crank, it had a
spring with a wind-up key. A switch turned on the turntable.
Chapter 10 • The Dream Machine 48
“There’s nothing but an old music box in there!” declared
Jonathan.
“What do you expect,” said the man, “a fairy godmother?”
“I don’t know. I thought it would be a little, ..uh, mysterious.
After all it takes something special to make people’s dreams come
true.”
A sly grin spread across the man’s thin face and he gave Jonathan
a long, hard look. “Words, my curious friend. It just takes words to
make some dreams come true. The problem is you never know just
who will get the dream when you wish for something.”
Seeing Jonathan’s puzzled expression, the man reached into his
pocket and produced a tiny crisp white business card. He introduced
himself in his staccato nasal twang, “Tanstaafl’s the name. P.T.
Tanstaafl.” Just then he noticed that he had given Jonathan the
wrong card, one that read “G. Gomper” instead. He snatched it
back. “Excuse me, son, that’s yesterday’s card.”
Shuffling through his wallet he found another card of a slightly
different size and colour presenting today’s name. He then pulled
out a poster with elegant gold lettering that he pasted over the
original name on his sign. It now read, “DR. TANSTAAFL’S
DREAM MACHINE.”
The man explained smoothly, “People have their dreams, right?
It’s just that they don’t know how to make dreams come true,
right?”
Dr. Tanstaafl nodded his head every time he said “Right?”.
Jonathan began nodding dumbly in unison.
“So you pay money, turn the key, and this old box plays a certain
subtle instruction over and over again, right?” Tanstaafl nodded
again, Jonathan followed with a bob. “It’s always the same message
and there are always plenty of dreamers who love to hear it, right?”
“What’s the message, Mr. Tanstaafl?” asked Jonathan, suddenly
conscious of his head bobbing up and down.
The man corrected Jonathan, “Please! Doctor Tanstaafl. As I
was saying, the Dream Machine tells people to think of whatever
they would like to have, and...”, the man glanced around to see if
anyone else was listening, “…then it explains to the dreamers what
to do – in a very persuasive manner, right?”
Chapter 10 • The Dream Machine 49
“You mean it hypnotizes them?” asked Jonathan, his eyes
widening.
“Oh no, no, no, no, no!” objected the man. “It tells them that
they are good people and that what they wish for is a good thing,
right? It’s so good that they should demand it, right!”
“Is that all?” Jonathan said in awe.
“That’s all.”
After a moment’s hesitation, Jonathan asked, “So what do these
dreamers demand?”
The man pulled out an oil can and proceeded to oil the gears
inside. “Well, it depends a lot on where I put this machine. I
frequently put it in front of a factory like this one – Bastiat
Builders.” He jerked a thumb in the direction of a squat two-story
building across the street. “And sometimes I set it by the Palace of
Lords. Around here, people always want more money. More money
is a good thing, you know, because prices are always going up and
people always need more, right?”
“So I’ve heard,” said Jonathan, rolling his eyes in sympathy. “Do
they get it?”
The man pulled back and wiped his hands on a rag. “Some do –
just like that!” he said with a snap of his fingers. “Those dreamers
stormed down to the Palace and demanded laws that would force
the factory to give them a three-fold increase in pay and benefits.”
“What benefits?” said Jonathan.
“Like security. More security’s a good thing, right? So the
dreamers demanded laws that would force factories to buy insurance
for them; insurance for sickness; insurance for unemployment;
insurance for death, right?”
“That sounds great!” exclaimed Jonathan. “Those dreamers must
have been very happy.” He turned to look back at the factory and
noticed that there didn’t seem to be much going on. Faded paint
made the buildings look tired and no lights shined from the dirty,
broken windows. Pieces of shattered glass lay scattered over the
pavement.
The man finished his oiling, replaced the panel and tightened
the screws back into place. With a final wipe of his rag over the
polished surface of the box, he bounced out of the cart and went to
Chapter 10 • The Dream Machine 50
check the harness. Jonathan jumped down and turned to the man
repeating, “I said they must have been very happy – I mean to get
all that money and security. And grateful, too. Did they give you a
medal or a banquet to celebrate?”
“Nothing of the sort” said Dr. Tanstaafl curtly. “I nearly got
tarred and feathered. They almost destroyed my delicate Dream
Machine last night with rocks, bricks, and just about anything else
they could throw. You see, their factory closed yesterday and the
workers blamed me.”
“Why did the factory close?”
“It seems the factory couldn’t earn enough to pay the workers’
raises and benefits. Now they’ve got to retool and try making
something else.”
“But, then,” said Jonathan, “that means the dreams didn’t come
true after all. If the factory closed, then nobody gets paid. And
nobody gets security, either. Nobody gets anything! Why, you’re
just a swindler. You said that the Dream Machine...”
“Hold on there, chap! The dreams came true. What I said was,”
stressed the man slowly, “that you never know just who will get the
dream when you wish for something. It so happens that every time
an old factory closes here on the isle of Corrumpo, that very dream
comes true across the waters on the Isle of Nie. A new factory
recently opened there, just a week’s sail from here. Plenty of new
jobs and security over there. As for me, well, I collect my money
from the machine no matter what happens.”
Jonathan thought hard about the news of Nie, realizing that there
was another island, one more prosperous than this one. “Where’s
this Isle of Nie?” he asked.
“Far east over the horizon. The people of Nie have a factory just
like this. When factory costs rose here, the factories over there got
a lot more orders. They understand that having more customers is
the best way of getting more of everything – pay and security. The
workers on Corrumpo can’t just demand more from the customers.
There ain’t no such thing as a free lunch, ya know. Everything has
a cost.”
Dr. Tanstaafl chuckled as he tied the machine down with straps.
He paid Jonathan for his help then climbed onto the driver’s seat
and shook out the reins. Jonathan looked at the money he had been
Chapter 10 • The Dream Machine 51
given and suddenly worried that it was soon going to be worthless.
It was the same legal tender the couple had shown him in front of
the Official Bureau of Money Creation. “Hey, Dr. Tanstaafl, wait!”
“Yeah?”
“Could you pay me with some other kind of money? I mean,
something that’s not going to lose value?”
“It’s legal tender, pal. You’ve got to take it. Do you think I’d use
this stuff if I had a choice? Just spend it quickly!”
The man yelled at his horse and he was off.
52 Chapter 10 • The Dream Machine
Brainstorming
• Whose dream really came true?• Why?
• What is the source of pay and security?
• How was that destroyed?
• Have Newly Industrialised Economies (NIE)
benefited by high wage demands in other
places?
• What is an alternative to legal tender?
• What is meant by “There ain’t no such thing
as a free lunch”?
Commentary
As voters have dreams of becoming wealthier
and more secure, it is natural for them to try
to find the easiest way to achieve their dreams.
Working requires time and effort, so voters often
look for easier ways to get wealth and security.
The legal alternative to hard work is politics.
Politicians are eager to please these voters
because by doing so, politicians maintain and
increase their own wealth, security, and power.
So politicians collaborate with voters to pass
laws forcing employers to pay the costs of higher
wages and more benefits: i.e. medical insurance,
funeral expenses, education fees, vacation, etc.
These costs add to the prices that consumers
must pay to local employers. So consumers
start shopping around for lower prices and
consequently buy cheaper products from
employers in other countries. Thus, the attempt
to force higher costs on local employers has the
unintended effect of driving them out of business
or out of the country.
These laws violate the individual’s right to
earn a living by making their own free choices.
And such laws have the overall effect of harming
or ruining a nation’s economic life.
Usually, the higher
the unemployment,
the greater the
demand for more of
the same government
interference in the
economy, which
caused the
unemployment in the
first place.
Alan Burris in A
Liberty Primer.
A truly free society
is not only the most
practical and
humanitarian
foundation for human
action; it is also the
most ethical.
Extract from
Jonathan’s Guiding
Principals
53 Chapter 10 • The Dream Machine
Background
Laws heaped on production in the West during
the late 20th century resulted in producers
moving to the Isles of NIE – Newly Industrialised
Economies – such as Singapore, Hong Kong,
Taiwan, and South Korea.
When a company whose headquarters is in
one country, builds a factory in another country,
that company is said to be making a foreign
investment. This process is sometimes called
globalisation. Many people who protest against
globalisation say that it unfairly exploits the
NIEs by paying lower wages than their country
does. However, the residents of the NIEs do not
see themselves as exploited. For them it means a
great opportunity for them to become wealthier.
“Kayns” is a veiled reference to the British
economist John Maynard Keynes. It is the printing
of money that makes possible his “spend more,
tax less defi cit” fi nancing. Samuel Gompers
was the founder of the Congress of Industrial
Organizations labour unions in the U.S.
References
Tanstaafl – There Ain’t No Such Thing As A
Free Lunch. The novel The Moon is a Harsh
Mistress by Robert Heinlein, is a science fiction
story about a libertarian colony on the moon.
Two of the characters go into a bar where they
see a sign “Free Drinks”. One says to the other,
“If the drinks weren’t free, the food would be
half price! TANSTAAFL!”
I, Pencil: My Family Tree as told to Leonard
E. Read shows the fascinating example of how
voluntary exchange enables millions of people
to co-operate with one another just to make a
pencil.
In Rigoberto Stewart’s Limón Real one can
read how economical dreams are possible.
Most poverty in the
world today is caused
by government laws,
not ignorance.
Mary Ruwart in
Healing Our World
?
There is nothing
new in recession.
Thousands of years
ago Noah managed
to float a limited
company when the
rest of the world was
going into
liquidation.
54 Chapter 10 • The Dream Machine
Ken Schoolland’s article on labour law and
regulations may be seen at:
Gullible.com/DreamMachine.
Chapter 11
Power Sale
A
husky, jolly woman bore down on Jonathan as he stood won-
dering where to go next. Without hesitation, she grabbed his
right hand and began to pump it vigorously. “How do you do? Isn’t
it a fine day?” she said at rapid-fire speed, still working his hand
with her meaty arm. “I’m Lady Bess Tweed, your friendly neigh-
bourhood representative on the Council of Lords, and I would be
most grateful to have your contribution and your vote for my re-
election to office and there you have it; that is the pressing situation
for our fine community.”
“Really?” said Jonathan. The speed and force of her speech
knocked Jonathan back a step. He had never met a person who
could say so many words in one breath.
“Oh yes,” continued Lady Tweed, barely listening to his reply,
“and I am willing to pay you well, oh yes, I am willing to pay you,
you can’t ask for a better deal, and how about that?”
“Pay me for a contribution and a vote?” asked Jonathan with a
puzzled look.
“Of course, I can’t give you cash – that would be illegal, a bribe
– say no more, say no more!” said Lady Tweed, winking slyly at
him and poking him in the ribs with her elbow. She continued, “But
I can give you something just as good as cash and worth many
times the amount of your contribution to me. It’s as easy as priming
a pump. A few bills in my palm right now and you can expect a
gusher of goodies later. That’s what I’ll do and how about that?”
“That would be nice,” replied Jonathan, who could see she
wasn’t listening to him anyway.
“What’s your occupation? I can arrange assistance – loans or
licenses or subsidies or tax breaks. I can ruin your competitors with
rules and regulations and inspections and fees. So you can see, there
is no better investment in the world than a well-placed politician.
Chapter 11 • Power Sale 56
Perhaps you’d like a new road or a park built in your neighbourhood
or maybe a large building or...”
“Wait!” shouted Jonathan, trying to stop the torrent of words.
“How can you give me more than I give you? Are you so very rich
and generous?”
“Me rich? Saints and bullfrogs no!” retorted Lady Tweed. “I’m
not rich. Well, not that I will admit. Generous? You could say so,
but I don’t plan to pay with my own money. Of course, you see,
I’m in charge of the official treasury. And, to be sure, I can be
very generous with those funds, to the right people...” She grinned,
winked twice and nudged him again in the ribs. “Say no more, say
no more!”
Jonathan still did not understand what she meant. “But, if you
buy my contribution and my vote, isn’t that sort of like, well, the
same as bribery?”
Lady Tweed gave him a shrewd look. “I’ll be blunt with you, my
dear friend.” She draped one arm over his shoulder and pulled him
uncomfortably tight against her side. “It is bribery. But it’s legal
when a politician uses money from other people rather than from
his or her own pocket. Likewise, it is illegal for you to give me cash
for specific favours, unless you call it a ‘campaign contribution.’
Then everything is okay. You can buy a hundred copies of my
memoirs and not read a single one. Feel uncomfortable giving cash
to me directly? Just ask a friend or a relative or an associate to offer
permanent loans, stock options, or benefits to me or my kin – now
or later.” She paused expectantly. “Now, do you understand?”
Jonathan shook his head, “I still don’t see the difference, I mean,
bribing people for votes and favours is still bribery no matter who
they are or whose money it is. The label makes no difference if the
deed is the same.”
Lady Tweed smiled indulgently, “My dear, dear friend, you’ve
got to be more flexible. The label is everything.” With her free hand,
she gently grasped his chin and turned Jonathan’s head sideways.
“What’s your name? Did you know you’ve got a nice profile? You
could go a long way if you ran for public office. If you’re flexible,
I’m sure that I could find you a nice post in my bureau after re-
election. Or is there something else you want?”
Chapter 11 • Power Sale 57
Jonathan shook his head free and managed to wriggle out from
under her arm. “What do you get by giving away taxpayers’ money?
Can you keep the money that’s given to you as contributions?”
“Oh, some of it is useful for my expenses and I have a fortune
promised to me should I ever retire, but mostly it buys me recognition
or credibility or popularity or love or admiration or a place in
history. All this and more for me and my progeny!” Lady Tweed
chuckled softly. “Votes are power and there is nothing I enjoy more
than having influence over the life, liberty, and property of every
person on this island. Can you imagine how many people come
to me – me – for big and little favours? Every tax and regulation
presents an opportunity for me to grant a special exception. Every
problem, big or little, gives me more influence. I award free lunches
and free rides to whomever I choose. Why, I have the farmers, the
coat makers, the treeworkers, and all of their hired lobbyists eating
out of the palm of my hand! Ever since I was a child I dreamed of
such importance. You, too, can share the glory!”
Jonathan tried to free his hand. But Lady Tweed kept him firmly
in her eel-like grip. “Sure,” said Jonathan, “you and your friends
have a great deal, but don’t other people get upset when you use
their money to buy votes, favours, and power?”
“Certainly,” she said, lifting up her plump, double-chinned jaw
proudly. “And I hear their concerns. So I’ve become the champion
of reform.” Finally releasing Jonathan’s hand, Lady Tweed thrust
her large, bejewelled fist into the air. “For years I’ve drafted new
rules to take the money out of politics. I always say that campaign
money causes a crisis of major proportions. And I have won a fair
share of votes with promises for reform.” She paused to smirk and
continued, “Fortunately for me, I always know a way around my
rules so long as there are valuable favours to sell.” She winked and
nudged again, “Know what I mean, know what I mean?”
Lady Tweed eyed Jonathan critically, taking in his tattered
appearance. “No one pays you a penny for favours because you, as
yet, have no favours to sell. Don’t you see? But, with your innocent
looks – and the right backing from me, you could go far. Hmm...a
new set of clothes, elevated shoes, a stylish haircut, and the proper
fiancée. Yes, I could definitely triple the beginner’s vote tally for
you. Then, after ten or twenty years of careful guidance – well,
there’s no limit to the possibilities! Look me up at the Palace of
Chapter 11 • Power Sale 58
Lords and I’ll see what I can do.” Lady Tweed spotted a group of
workers that had gathered across the street, looking forlornly at
the shuttered factory. She abruptly lost interest in Jonathan and
marched swiftly away, searching for fresh prey.
“Spending other people’s money sounds like trouble,” mumbled
Jonathan.
With ears keenly tuned to any sound of disagreement, Lady
Tweed stopped and turned quickly, “Did you say ‘trouble’. Ha! It
really is like taking candy from a baby. What the people don’t give
to me out of duty, I borrow from them. You see, I’ll be long gone
and fondly remembered when their yet-unborn-babies get the bill.
What’s your name boy?”
“Uh, Jonathan Gullible, ma’am.”
Lady Tweed’s face turned hard and cold. “I’ll remember you,
Jonathan Gullible. If you’re not with me, you’re against me. I
reward friends and punish enemies. You can’t stand in the middle,
understand me? There you have it, that is the pressing situation for
our fine community. Say no more!” In a blink, her face snapped
back into a broad, beaming smile. Then she vanished down the
street.
59 Chapter 11 • Power Sale
Brainstorming
• What is the difference between legal and
illegal forms of bribery?
• Can politicians legally bribe voters and vice
versa?
• What are problems associated with bribery?
• How can Council debt be likened to “taking
candy from a baby”?
• Examples?
• Ethical issues?
Commentary
When a politician asks you to vote for him, he
is asking you to employ him for the next four
to five years. Once you have employed him –
voted him in – you will pay towards his salary
and expenses. This will come from the various
taxes you pay. It will come from your income
tax, from the GST/VAT you pay on everything
you buy from a cola to a car. It will come from
licences, stamp duties, and other hidden taxes.
In addition to paying towards his salary you
will also pay for his privileges and benefits,
such as his medical expenses, insurance,
accommodations, bodyguards, phone bills, cars,
and travel expenses. At no time during his period
of employment will you be able to get rid of him,
no matter how badly he performs in his duties, or
ignores his promises to you.
When he is no longer employed as a
government official, you will still be paying
to keep him in the comfort to which he has
become accustomed. You will be paying his
large pension, his staff, his special privileges, his
travel expenses and many other things that you
might not even be able to afford for yourself.
From all of this it would appear that by voting
for him you are hiring him to carry out a job. He
Eternal vigilance is
the price of liberty.
Etched over the portal
to the National
Archives in the
Washington D.C.
60 Chapter 11 • Power Sale
is the employee and you are the employer. The
ironic thing is that once you have hired him, he
is considered superior to you. This higher status
will be enforced in subtle ways: you are obliged
to pull over in order to allow his motor cavalcade
to pass; you will be required to address him as Sir
/ Mr Minister / Mr Secretary. After the election,
will he remember anything about you?
Once established in his position he will
have the power to increase his own salary and
privileges without your permission, and you will
be expected to pay. Without your permission
or approval he will be able to hire more staff
whose salaries you will be forced to pay. So
governments grow and grow, their expenses
grow and grow, and your taxes grow and grow
to pay for it all.
Knowing that your taxes go towards all
of this, you might wonder if you would be
better off by keeping your money rather than
paying for such a large government. What if
government was cut back? Would industry really
collapse without the “guidance” of a Minister of
Sport, another Minister for Art and Culture, still
others for Science and Technology, Agriculture,
Forestry, Minerals, and so on?
It would be useless to ask the politician if
he is necessary to the life of society. He is
sure to answer in a way that will preserve his
lucrative position of privilege. For the one thing
that is constant in politics is this: mainstream
politicians always offer solutions that increase,
rather than diminish, their own power.
Background
Boss Tweed was the kingpin in the Tammany
Hall organization of New York City during its
most corrupt period in the 19th century.
Logrolling (the trading of votes and favours
to get a law passed) and pork barrel spending
No matter how
officials are selected,
they are only human
beings and they have
no rights or claims
that are higher than
those of any other
human beings.
Extract from
Jonathan’s Guiding
Principles
The polls are places
where you stand in
line for a chance
to decide who will
spend your money.
Anonymous
61 Chapter 11 • Power Sale
(getting one’s snout in the public trough) are
a sordid part of legislation. “Pork barrel”
originates from the term “bringing home the
bacon”— bacon being the government money
spent on close allies in the home district. Thus,
Parliament is the pork barrel from which this
bacon comes. It means “favours for pals” and
contracts for relatives. Small costs are taken from
a large group of individuals and the benefits are
concentrated on the members of a small group.
Many people have proposed changing the
system of campaign finance to curb the bribery.
However, politicians are usually clever enough
to work their way around such reforms because
it is these very politicians who craft the laws.
People work hard to gain freedom from
oppression, but it takes a great vigilance
to prevent a nation from slipping back into
oppression. Within a short period people might
ask “What, then, was the point of all the years
of struggle?”
References
The Incredible Bread Machine by R.W. Grant,
discusses the history and power of politics.
The Government Racket 2000, by Martin
Gross.
Why Government Doesn’t Work, by Harry
Browne.
Some good links about campaign finance
reform are “Get Politics Out of Money!” by
Robert W. Tracinski at:
/medialink/finance.shtml.
The comparative size of governments around
the world may be viewed at:
?
A candidate came
home to give his wife
the glorious news:
“Darling, I have been
elected.”
She was delighted.
“Honestly?” she
said.
He laughed in an
embarrassed way.
“Oh, why bring that
up?”
Chapter 12
Opportunity Lost
“S
he is the most effective rabble rouser ever elected.”
Jonathan spun around to see a middle-aged man sprawled
over a doorstep, braced on one elbow. His short-brimmed hat was
tipped back and his dark three-piece suit looked filthy and smelled
worse. Patches on the knees of his pants were starting to fray. A
salty grey stubble grew on his face, indicating that he hadn’t shaved
in a couple of days. One hand still clung to a bottle that was dry as a
bone and now served mostly to keep him propped against the wall.
“Tweed’s the best I’ve ever seen,” he continued drowsily, “She
can really stir up a crowd.”
Jonathan moved closer to listen, but wasn’t sure he wanted to
encourage this hobo. True enough, this gentleman hobo didn’t need
encouragement to repeat a story he had probably told a dozen times
to himself. “After her rip-roaring speech, the crowd was mighty
angry.” He said, shaking his head. “Then a kid, little Ricco, hurled
a stone at a window over there. When the glass shattered, the mob
dropped silent. Yes, not a peep at first. They knew it was wrong to
destroy things, but they were excited.”
The hobo sensed that this young man was actually listening. He
hiccuped and continued. “Then Tweed, she was right in the middle
of them, said that Ricco had done the community a great service.
Said they all owed the boy a debt of gratitude. She said it was alright,
because anyone who owned so many windows was selfish anyway.
Then she added that the factory owner would now have to buy new
windows from the glass maker. Everyone in the crowd was really
attentive – just itching for an excuse to throw more stones. Tweed
told them ‘Sure, go ahead! With each ... (hic) ... stone and broken
glass, the glass maker will have a new order for a window, a new
job for a worker, and a new demand for tools. Then each worker
will have more kayns to spend on shoes for his children. So more
jobs for shoemakers and the shoemakers will have more to spend on
leather and stitching’ and so on and on.”
Chapter 12 • Opportunity Lost 64
The man doubled over and wheezed at length like a sickly
beast. Regaining his composure, he took a deep breath and shifted
his weight. Then Mices appeared and rubbed up against his arm,
teasing the man to pet him.
The hobo laughed to himself, stroking the cat. “They raised Ricco
high on their shoulders. They cheered the proud boy and followed
his example by throwing more stones. By morning there wasn’t a
whole window left on the block. They would’ve gone on to the rest
of the town except they wanted to save their strength for the next
rampage.” The man breathed hard, trying to catch his breath.
As the man spoke, he was winding down, barely finishing a
sentence before passing out. With every few words his weary head
would fall back and then bob forward again. He pried his eyes open
with one more ounce of strength, slowly uttering. “They see the
spending, but miss the unseen. What else could have been done .
. . (hic) . . . to create new things . . . instead of replacing all those
broken windows of what used to be my factory?”
65 Chapter 12 • Opportunity Lost
Brainstorming
• Who really benefited by Ricco’s action?
• Will the community as a whole benefit from
Ricco’s action?
• Do people do things in crowds that they
would not normally do?
• Would a person in authority be able to
authorise atrocities he or she would not be
willing to commit?
• If a crowd initiates forceful aggression, is
each member of that crowd guilty?
• Are wars beneficial to an economy?
Commentary
In his St. Crispian day speech, Shakespeare’s
Henry V incited his men to commit murder
with promises of impending heroism. The
same technique is still used today to provoke an
otherwise orderly crowd into destructive action
for “heroism.”
But the initiation of destruction and murder
do not give us freedom. Freedom is gained by
personal responsibility, respect for others, and
the courage to speak out for these.
This is true on both a large and small scale.
To break a window intentionally is a form of
theft, whether it is done by one person or by
many. The broken window could well create
more business for the glassmaker and there
could be a knock-on effect from the profit he
makes.
Those who see this are correct. But there
are the more observant people who can see
the opportunity lost – the more positive result
of not breaking the window. They can see
that the owner of the broken window is out of
pocket. What he has to spend on paying for a
new window, he could have spent on a different
When you make
a choice, your
opportunity cost is
the next best thing
you give up. In this
case, the destruction
forces people to
sacrifice their first
choice for other
alternatives.
Ken Schoolland’s
explanation of the
economic term:
“Opportunity Costs”.
66 Chapter 12 • Opportunity Lost
item that would have created a more positive
knock-on effect. It is more positive because the
window owner not only has his original window,
he would have another new item as well. And all
the people along the line of production of this
new item would be better off. In this positive
way the community has lost nothing and all are
better off.
As an example of opportunity cost (an
economic term), many people think that war
is good for the economy. This is said without
thinking of what people could have produced
with their time, energy, and talents without the
destruction of war.
Background
This chapter is intended as a parody of “The
Broken Glass” tales of Frederic Bastiat and
Henry Hazlitt. In this story a boy breaks a
window. He is then praised for creating jobs
by generating demand for the replacement of
windows. But no-one thinks of the jobs lost
that could have been created doing other things
instead of replacing windows.
This is an answer to the erroneous statement
that war “creates” jobs. It seems especially
relevant today, as there are still people who say
that war is healthy for the economy.
References
Henry Hazlitt expounds further on these points
in his very readable book Economics in One
Lesson.
For reference see the Future of Freedom
Foundation at:.
Frederic Bastiat’s “What Is Seen and What Is
Not Seen,” can be viewed online at:
The initiation of force
to take life is murder,
to take liberty
Chapter 13
Helter Shelter
T
he streets grew quieter as Jonathan trudged down yet another
row of drab houses. He noticed a group of poorly dressed
people gathered in front of three tall buildings labelled BLOCK A,
BLOCK B and BLOCK C. BLOCK A was vacant and in appalling
condition – the brickwork crumbling, the windows broken, and any
remaining panes filthy with grime. Next door at BLOCK B people
huddled on the front steps. Jonathan heard loud voices coming from
inside and the sounds of lively activity from all three floors. Laun-
dry hung untidily from sticks that protruded from every available
window and balcony. It burst at the seams with tenants.
Across the street stood BLOCK C, immaculately maintained
and, like BLOCK A, empty of people. Its scrubbed windows
sparkled in the sunlight, plastered walls were smooth and clean.
As he gazed at the three buildings, Jonathan felt a light tap on his
shoulder. Turning, he faced a young girl with long brown hair. Her
light grey clothes fitted her poorly and she wasn’t especially pretty
at first sight, but Jonathan thought she looked alert and kind.
“Do you know of any apartments for rent?” she asked in a soft,
pleasant voice.
“I’m sorry,” said Jonathan. “I’m not from around here. But why
don’t you check those two vacant buildings.
“It’s no use,” she responded softly.
“But,” said Jonathan, “they look empty to me.”
“They are. My family used to live over there in BLOCK A
before rent control.”
“What’s rent control?” asked Jonathan.
“It’s a law to stop landlords from raising rents.”
“Why?” probed Jonathan.
“Oh, it’s a silly story,” she said. “Back when the Dream Machine
came through our neighbourhood, my dad and other tenants
Chapter 13 • Helter Shelter 68
complained about landlords raising rents. Sure, costs were up and
more people were renting, but my dad said that was no reason for
us to pay more. So the tenants or – former tenants, I should say –
demanded that the Council of Lords prohibit the raising of rents. The
Council did just that and hired a pack of snooping administrators,
inspectors, judges, and guards to enforce the new rules.”
“Were the tenants pleased?”
“At first, sure. My dad felt secure about the cost of a roof over
our heads. But then the landlords stopped building new apartments
and stopped fixing the old ones.”
“What happened?”
“Costs kept going up – repairmen, security guards, managers,
utilities, taxes, and the like – but the landlords couldn’t raise the
rents to pay for it all. So they figured ‘Why build and fix just to lose
money?’”
“Taxes went up, too?” asked Jonathan.
“Sure, to pay for enforcing rent control. Budgets and staff had to
grow,” said the girl. “The Council passed rent control but never tax
control. Well, when repairs and upkeep stopped, everyone started to
hate the landlords.”
“They weren’t always hated?”
“No, before rent control, we had lots of apartments to choose
from. Landlords had to be nice to get us to move in and stay. Most
landlords acted friendly and made things attractive. If there were
any nasty landlords, word got around fast and people avoided them
like the rats they were. Nice landlords attracted steady tenants while
nasty ones suffered a plague of vacancies.”
“What changed?”
“After rent control everyone got nasty,” she said with a look of
despair. “The worst prospered the most.” She sat down on the curb
to scratch Mices behind the ears. Mices rolled over and began to
purr.
Aware of Jonathan staring at her, she continued confidently,
“Costs went up, but not the rents. Even the nicest landlords had
to cut back on repairs. When buildings became uncomfortable
or dangerous, tenants got mad and complained to the inspectors.
The inspectors slapped fines on the landlords. Of course, some
Chapter 13 • Helter Shelter 69
landlords bribed inspectors to look the other way. Finally, the owner
of BLOCK A, a decent man, couldn’t afford the losses or bribes
anymore so he just up and left.”
“Abandoned his own building?” spluttered Jonathan.
“Yes. It happens a lot,” she sighed. “Imagine walking away from
something that took a lifetime to build? Well, fewer and fewer
apartments were available but the number of tenants kept growing.
People had to squeeze into whatever was left. Even mean landlords,
like the one who holds BLOCK B, never had a vacancy again.
Rumour has it that he takes payoffs under the table just to move
applicants higher up the waiting list. Those with enough cash get by
okay. That nasty owner makes out like a bandit.”
“What about BLOCK B?” said Jonathan, wanting to be helpful.
“Can you get in?”
“The waiting line is awful. When Dame Whitmore passed away
you should have seen the brawl in front of the building – everyone
scratching and yelling at each other for position in line. Lady
Tweed’s son finally got that apartment – even though nobody
remembers seeing him in line that day. My family once tried to
share an apartment in BLOCK B, but the building code prohibits
sharing.”
“What’s a building code?” asked Jonathan.
The girl frowned. “It started as a set of rules for safety. But the
Lords now use it to determine our lifestyle. You know, things like
the right number of sinks, stoves, and toilets, the right number and
kind of people; the right amount of space.” With a tinge of sarcasm
she added, “So we ended up in the street where nothing meets the
code – no sinks, stoves, or toilets, no privacy, and far too much
space.”
Jonathan grew depressed thinking about her plight. Then he
remembered the third building – brand new and vacant. It was
the obvious solution to her problems. “Why don’t you move into
BLOCK C, right there across the street.”
She laughed bitterly. “That would be a violation of the zoning
rules.”
“Zoning rules?” he repeated. Sitting on the pavement Jonathan
shook his head, incredulous.
Chapter 13 • Helter Shelter 70
“Those are rules about location. Zoning works like this.” she
said picking up a stick to sketch a little map in the dirt. “The
Council draws lines on a map of the town. People are allowed to
sleep on one side of the line at nights, but they must work on the
other side during the day. BLOCK B is on the sleep side of the line
and BLOCK C is on the work side. Usually work buildings are
located across the town from the sleep buildings so that everyone
needs to travel a lot every morning and evening. They say the long
distances are good for exercise and carriage sales.”
Jonathan stared in bewilderment. A packed apartment building
standing between two empty buildings and a street full of homeless
people. Sympathetically he asked. “What are you going to do?”
“We take one day at a time. My dad wants me to go with him to
the gala ‘Thumbs-up Party’ that Lady Tweed is putting on for the
homeless tomorrow. She promises to lift our spirits with games and
a free lunch.”
“How generous,” remarked Jonathan drily, recalling his
conversation with Lady Tweed. “Maybe she’d let you live in her
house until you find something of your own.”
“Dad actually had the nerve to ask her that once, especially since
Tweed led the Council in putting through rent controls. Lady Tweed
declared, ‘But that would be charity! Charity is demeaning!’ She
explained to him that it is far more respectable to require taxpayers
to give us housing. She told him to be patient and that she’d make
arrangements with the Council.”
The young woman smiled at Jonathan and asked, “By the way,
they call me Alisa. Do you want to join us at Tweed’s free lunch
tomorrow afternoon?”
Jonathan blushed. Maybe he could learn to enjoy this island.
“Sure, I’d love to come along. By the way, I’m Jonathan.”
Alisa jumped up, smiling. “Then Jonathan, we meet here
tomorrow – same time. Bring your cat.”
71 Chapter 13 • Helter Shelter
Brainstorming
• How are different groups of people affected
by rent controls, building codes, and zoning?
• How does market activity punish, or reward,
business practices that are good or bad?
• How are these reversed by rent controls?
• Examples?
• Ethical issues?
Commentary
Even in a “free” society it is illegal to build your
own home, with your own hands and on your
own land, without first getting permission from
the authorities. Ignore these regulations and you
will be fined and your home could be destroyed.
Conforming to every detail of the prescribed
regulations adds to the cost of building. Building
codes prevent innovations. This throttles the
choice of alternatives that can lead to new
building-related industries and employment
opportunities. When officials set these minimum
standards they are often reflecting their own
up-market style. Low income groups often do
not require, and cannot afford, these higher
standards. They are therefore prevented from
enjoying the pride of building and owning their
own homes. At times, outdated ideas are locked
into laws and valuable new ideas are thwarted.
If governments really want their citizens to
have the availability of inexpensive housing,
they would do away with the many factors
that directly contribute to housing shortages.
Among these factors are rent control, codes and
regulations, transfer duties, taxes on building
and building repair, and the high cost of
uncompetitive public municipal services.
Officials often think that rules, logical or not,
are more important than personal achievement
and initiative. Enforcing the rules maintains the
Local governments
raise the prices
of housing by a
multitude of zoning
laws, building codes,
and regulations
that primarily
serve to eliminate
the availability of
housing.
Ken Schoolland
72 Chapter 13 • Helter Shelter
official civil servant’s power and position over
individual civilians.
Proper concerns over safety can more
appropriately be addressed by strict measures of
personal accountability and liability.
Background
Ken: The reference to Dame Whitmore is of no
significance to anyone but me. She was a revered
elderly teacher at the first college at which I
taught. When she passed away, there was some
tussle by the other teachers on who would get
her housing. It was a small school in Alaska.
Alisa Rosenbaum was the original name of
the Russian-born, American philosopher who
would later changed her name to Ayn Rand and
wrote the novel Atlas Shrugged.
References
An excellent reference book on rent controls
is Excluded Americans: Homelessness and
Housing Policies, by William Tucker.
Rent control, zoning restrictions, and building
codes are dealt with in Mary Ruwart’s Healing
Our World, and Alan Burris’ Liberty Primer.
In Economics in One Lesson Henry Hazlitt
deals with the false impression given by
government housing.
Articles on rent controls may be seen at:.
Cities with rent
controls had, on
average, two and a
half times as many
homeless people as
cities without them.
Jens Aage Bjoerkeoe,
Danish social worker,
taken from
Healing Our World
by Mary Ruwart
Chapter 14
Escalating Crimes
H
appy to find a new friend, Jonathan wandered off in a daze.
Then, with a start, he realized that he had better pay closer
attention to his surroundings or he would not find his way back the
next day.
He happened to come across a policeman not much older than
himself, who was sitting on a bench reading a newspaper. Jonathan
tensed at the sight of the crisp black uniform and shiny gun.
But the youthful, open expression on the policeman’s face made
Jonathan relax. The policeman was totally engrossed in a newspaper
and Jonathan glanced over at the headlines: “LORDS APPROVE
DEATH PENALTY FOR OUTLAW BARBERS!”
“The death penalty for barbers?” exclaimed Jonathan in surprise.
The policeman glanced up at Jonathan.
“Excuse me,” said Jonathan. “I didn’t mean to bother you, but
I couldn’t help seeing the headline. Is that a misprint about the
punishment?”
“Well, let’s see.” The officer read aloud, “The Council of Lords has
just authorized the death penalty for anyone found to be cutting hair
without a licence.’ Hmm, no misprint. What’s so unusual about that?”
“Isn’t that quite severe for such a minor offence?” asked Jonathan
cautiously.
“Hardly,” replied the policeman. “The death penalty is the
ultimate threat behind all laws – no matter how minor the offence.”
Jonathan’s eyes widened. “Surely you wouldn’t put someone to
death for cutting hair without a licence?”
“Of course we would,” said the policeman, patting his gun for
emphasis. “Though it seldom comes to that.”
“Why?”
“Well, every crime escalates in severity. That means the penalties
increase the more one resists. For example, if someone wishes to cut
Chapter 14 • Escalating Crimes 74
hair without a licence, then a fine will be levied. If he or she refuses
to pay the fine or continues to cut hair, then the outlaw barber will
be arrested and put behind bars. And,” said the man in a sober tone,
“resisting arrest subjects a criminal to severe penalties.” His face
darkened with a frown. “The outlaw may even be shot. The greater
the resistance, the greater the force used against him.”
Such a grim discussion depressed Jonathan. “So the ultimate
threat behind every law really is death. Surely the authorities would
reserve the death penalty for only the most brutal, criminal acts
– violent acts like murder and rape?”
“No,” said the police officer. “The law regulates the whole
range of personal and commercial life. Hundreds of occupational
guilds protect their members with licences like these. Tree workers,
carpenters, doctors, plumbers, accountants, bricklayers, and lawyers
– you name it, they all hate interlopers.”
“How do licences protect them?” asked Jonathan.
“The number of licences is restricted to the few who pass the
rituals of guild membership. This eliminates the unfair competition
of intruders with peculiar new ideas, overzealous enthusiasm,
backbreaking efficiency, or cutthroat prices. Such unscrupulous
anti-competitive competition threatens the traditions of our most
esteemed professions.”
Jonathan still didn’t understand. “Does licensing protect
customers?”
“Oh, yes. It says so right here.” The policeman turned back to
the newspaper reading, “‘Licences give monopolies to guilds so that
they can protect customers from unwise decisions and too many
choices.’” Tapping his chest proudly, the policeman added, “And I
enforce the monopolies.”
“Monopolies are good?” probed Jonathan.
The policeman frowned, lowering his newspaper. “I don’t know,
really. I just follow orders. Sometimes I enforce monopolies and
sometimes I’m told to break monopolies.”
“So which is right?”
The policeman shrugged. “That’s not for me to figure out. The
Council of Lords decides and tells me where to point my gun.”
Chapter 14 • Escalating Crimes 75
Seeing Jonathan’s look of alarm, the policeman tried to reassure
him. “Don’t worry. We seldom carry out the death penalty itself.
Few dare to resist since we are diligent at teaching obedience to the
Council. It’s so rarely mentioned that my chief, Officer Stuart, calls
it ‘The Invisible Gun’.”
“Have you ever used yours?” said Jonathan, eyeing the pistol
nervously.
“Against an outlaw?” asked the policeman. With a practised
motion, he pulled the revolver smoothly from its leather holster
and stroked the cold-steel muzzle. “Only once.” He opened the
chamber, looked down the barrel, snapped it shut, and admired the
gun. “This is some of the very best technology on the island here.
The Council spares no effort to give us the finest tools for our noble
mission. Yes, this gun and I are sworn to protect the life, liberty, and
property of everyone on the island.”
“When did you use it?” asked Jonathan.
“Strange you should ask,” he said, suddenly downcast. “A whole
year on duty and I never had to use it until just this morning. Some
old woman went crazy and started threatening a demolition crew
with a stick. Said something about taking back her ‘own’ house. Ha!
What a selfish notion.”
Jonathan’s heart skipped a beat. He remembered the elegant
white house and the dignified woman who claimed ownership.
The policeman continued, “I tried to persuade her to give up. The
paperwork was all in order – the house had been condemned to
make way for the Lady Tweed People’s Park.”
Jonathan could barely speak. “What happened?”
“I tried to reason with her. Told her she could probably get off
with a light sentence if she came along with me peacefully. But then
she threatened me, told me to get off her property! Well, it was a
clear case of resisting arrest. Imagine the nerve of that woman!”
“Yes,” sighed Jonathan. “What nerve.”
The conversation died. The policeman read quietly while
Jonathan stood silent, nudging a stone with his foot. Summoning
his nerve, Jonathan asked, “Can anyone buy a gun like yours?”
Turning a page of the newspaper, the policeman replied, “Not on
your life. Someone might get hurt.”
76 Chapter 14 • Escalating Crimes
Brainstorming
• What is meant by an “escalating crime”?
• What can happen to someone who resists
arrest?
• Which is more important to the policeman,
government property or private property?
• Should individuals be required to have a
licence to make a living?
• How are groups of people affected
differently by occupational licensing laws?
• Does enforced licensing lead to corruption?
• Does the law make or break monopolies?
• Why?
• Examples?
• Who should decide whether you own a gun?
• Ethical issues?
Commentary
Companies that succeed are sometimes referred
to as “monopolies” when they gain a very
large share of the market. If they achieve this
market share by voluntary action, then they
have earned it by serving customers with better
innovation, better prices, and better service than
their competitors. Despite their dominance of
a market, they will always feel the pressure to
perform well or else they will lose customers to
rival companies. Unfortunately, many companies,
professionals, and union organisations do not
rely on voluntary action. Instead they rely on
the force of government to give them favours
and to eliminate the free choice of others in the
market.
The way in which our choices are limited
is by government regulations and licences.
Licences keep out competition by creating closed
membership guilds, professional societies,
and labour unions that hate competition. They
protect their members, and restrict the activity
The most foolish
mistake we could
possibly make
would be to allow
the subject races
to possess arms.
History shows that
all conquerors who
have allowed their
subject races to carry
arms have prepared
their own downfall by
doing so.
Adolf Hitler
They have gun
control in Cuba. They
have universal health
care in Cuba. So why
do Cubans want to
come here?
Paul Harvey,
syndicated radio
commentator, USA
77 Chapter 14 • Escalating Crimes
to a few. Licences given to monopolies or
guilds prevent competition. This immediately
raises the prices they may charge, enforces
conformity and prevents service providers from
adapting to changing circumstances. In this way,
governments deny consumers the opportunity
and responsibility to try new, ancient, or
foreign ideas. It prevents trades and professions
from offering consumers a choice in services,
and through competition, cheaper and more
innovative offers.
When consumers cannot afford the high
prices, they often must go without any service at
all and so lose out completely.
The existence of licensing on taxis protects
the established taxi companies and bars new
companies from entering the market. One cannot
start a new taxi business – even if you have only
one taxi – unless one can purchase a taxi license.
This becomes so enormously expensive that it
shuts out small entrepreneurs, and opens itself
to corruption.
Members of a profession who do not
conform are denied membership. In this manner,
the non-conformists are deprived of the right to
make a living in the manner of their choice, even
though people may desire their services. Some
say that this protects consumers. However, by
taking away consumer choice, it shows a lack of
confidence in the consumers’ ability to assess the
benefits in open competition.
There is no guarantee that the decision
makers would be wiser than we are. Do we need
the state to remove choices from our lives?
Background
Ken: “Officer” Stuart K. Hayashi, one of my
former students and a very good friend, gave
meticulous editorial assistance and many
Commentary Edition. Though he does not plan
You have the right to
protect your own life,
freedom, and justly
acquired property
from the forceful
aggression of others
From Jonathan’s
Principles
?
[L]et
78 Chapter 14 • Escalating Crimes
on patenting it, Stuart coined the term “Invisible
Gun”. This refers to the threat of physical
force, to be used against those who refuse to
comply with every law that the government
enforces. Since people seldom resist the law to
the very end, very few individuals realise that
the final punishment for every enforced law is
imprisonment or death. That is why the “gun”
behind the law is “invisible”.
References
In Healing Our World, Mary Ruwart:
• deals with the effect of licensing laws on
the marketplace ecosystem;
• and under the section “Leaving the
Poor Defenceless” (Chapter 16, Policing
Aggression) she has insightful details on
gun laws.
Alan Burris’ book A Liberty Primer also has
good references.
Henry David Thoreau’s On the Duty of Civil
Disobedience is philosophical about the tyranny
of power, taxes, and war.
Stuart K. Hayashi’s “Invisible Gun” essay
may be seen at:
articles/other/invgun.html
?
The original point
and click interface
was a Smith &
Wesson.
Anonymous
Chapter 15
Book Battles
A
ctivity on the streets increased as Jonathan continued toward
the centre of town. Mices followed him at a distance. Here was
a cat with a purpose – to catch every rat or uncover any food pos-
sible. He covered three times the distance that Jonathan did, explor-
ing back alleys, garbage cans, and crawl spaces. The cat’s yellow
hair grew dusty and shabby, despite his constant grooming.
Well-dressed individuals with preoccupied expressions marched
or knee-shuffled briskly along the pavements. Crossing a large open
square, Jonathan encountered an elderly man and a young woman
having a vicious shouting match. They cursed and shouted, waving
their arms violently in the air. Jonathan joined a small gathering of
bystanders to see what the fight was all about.
Just as the police arrived to pull them apart, Jonathan tapped the
shoulder of a frail old woman leaning on a cane and inquired, “Why
are they so angry with each other?”
The woman had deep wrinkles and creases across her face and
hands. She regarded young Jonathan carefully before replying in a
thin quavering voice. “These two rowdies have been screaming at
each other for years about the books in the Council library. The man
always complains that many of the books are full of trashy sex and
immorality. He wants those books taken out and burned, while she
reacts by calling him a ‘pompous puritan’ ”
“She wants to read those books?” asked Jonathan.
“Well, not exactly,” snickered a tall man, kneeling nearby. A
little girl stood at his side. “She complains about different books.
She claims that many of the books in the library have a sexist and
racist bias.”
“Daddy, Daddy, what is ‘bias’?” pleaded the little girl while
tugging at his shoulder.
Chapter 15 • Book Battles 80
“Later, dear. As I was saying,” continued the man, “the woman
demands that those sexist and racist books be thrown out and that
the library purchase her list of books instead.”
By now the police had handcuffed both of the fighters and were
dragging them down the street. Jonathan shook his head and sighed.
“I suppose the police arrested them for this brawl?”
“Not at all,” laughed the old woman. “The police arrested both
of them for refusing to pay the library tax. According to the law,
everyone must pay for all the books whether they like them or not.”
“Really?” said Jonathan. “Why don’t the police just let the
people keep their money and let them pay for what they like?”
“But then my daughter couldn’t afford to go to a library,” said
the kneeling man. He peeled the wrapping from a big red-and-white
spiral candy sweet and handed it to his daughter.
“Hold on, mister,” said the old woman as she shot a look of
disapproval at the candy. “Isn’t food for your daughter’s mind just
as important as food for her stomach?”
“What are you getting at?” responded the man defensively. His
daughter had already managed to smear the candy across her dress.
The woman replied firmly, “Long ago we had a great variety of
subscription libraries – known then as ‘scriptlibs’. It cost a small
membership fee every year and no one complained because they
only paid for the scriptlibs that they liked. Scriptlibs even competed
for members, trying to have the best books and staff, the most
convenient hours and locations. Some even went door-to-door to
pick up and deliver books. People paid for their choices because
library membership was important to them.” She added, “A higher
priority than candy!”
Turning directly to Jonathan, she explained, “Then the Council
of Lords decided that a library was too important to be left to the
individual’s liking. At taxpayer expense, the Council created the
GLIB, a large government library. The GLIB became popular
because it was free – people never had to pay to use the books. To
do the work of each scriptlib librarian, the Counsel hired three GLIB
librarians at top salaries. Shortly after that, the scriptlibs closed.”
“The Lords provided a library for free?” repeated Jonathan. “But
I thought you said that everyone had to pay a library tax?”
Chapter 15 • Book Battles 81
“That’s true. But it’s customary to call Council facilities ‘free’
even though people are forced to pay. It’s much more civilized,” she
said in a voice heavy with irony.
The tall man objected strenuously, “Subscription libraries? I
never heard of such a thing!”
“Of course not,” retorted the old woman. “The GLIB has been
around so long that you can’t imagine anything else.”
“Now, hold on there!” cried the man, hobbling forward on his
knees. “Are you criticizing the library tax? If the Lords provide a
valued service, then people must pay.”
“How valued is it if they have to use force?” said the old woman.
She stood glaring eye-to-eye at the tall man on his knees.
“Not everyone knows what’s good for them! And some can’t
afford it,” declared the man. “Intelligent people know that free
books build a free society. And taxes spread the burden so that
everyone has to pay their fair share. Otherwise freeloaders might
ride on the backs of others!”
“There are more freeloaders now than ever,” replied the old
woman. “Frequent users and those with tax exemptions ride on
the backs of everyone else. How fair is that? Who do you think
has more influence with the Council of Lords? A well-connected
supporter or some poor guy who gets off work after GLIB closing
hours?”
Pushing his little girl behind him and edging forward, the man
retorted hotly. “Just what kind of a library choice do you want? Do
you want to choose a subscription library that may be biased against
some group in society?”
“You can’t avoid bias!” the woman screamed, leaning close to
his face. “Do you want buffoons in the Council to choose your bias
for you?”
“Who’s the buffoon?” countered the man, shoving the old
woman slightly off balance. “If you don’t like it, then why don’t
you just leave Corrumpo!”
“You insolent rascal!” replied the woman, popping him on the
head with her cane. “I’ve been paying for your GLIB since before
you were born!”
Chapter 15 • Book Battles 82
By now the two were yelling at each other, the little girl was
crying, and someone shuffled off to summon the police – again.
Jonathan edged past them and fled the square for the peace and
quiet of the nearby GLIB.
83 Chapter 15 • Book Battles
Brainstorming
• How can the selection of books be an act of
propaganda or censorship?
• Should people be forced to pay for library
books they don’t like?
• Can libraries exist without tax funding?
• How are incentives different for government
and private libraries?
Commentary
As soon as a government declares that a service
is “free” we know the true meaning is this: We
are all going to be forced to pay for this service
and the government will get the glory for being
benevolent. These services are used by some
people, but are paid for by all.
We also know that because it is “free” and
under government control, there will be far
less competition in this service. Eliminating
competition in this manner leads to higher prices
and a lower standard of service. As a whole, the
economy is one notch lower and everyone is the
poorer.
The more “free” services there are, the
lower the eventual economic level of that
country. Consider this example. What if the state
undertook to make something free that we now
generally accept as open to individual choice –
let us say film going. Would we continue to be
allowed our own choices, or would the choices
be restricted to the preferences of the majority or
of a ruling party? Would the film industry have
the incentive to please the diverse consumers
or the decision-making officials? What motive
would there be for improvement? Would this be
a free society?
Libraries are a subtle form of thought control
– controlled by the bias of the governing party.
When there is a change in government the new
selection of books will be the ones preferred by
Any alleged “right”
of one man which
necessitates the
violation of the right
of another, is not, and
cannot be a right.
Ayn Rand, 1964
84 Chapter 15 • Book Battles
the new people in power – what they consider
“good” for the citizens. The longer a party
is in power, the longer it will take to receive
the requested books that are disfavoured.
Censorship of information is censorship of
choice. The taxpayer has no choice but to pay
for this censorship.
Background
Ken: A girlfriend of mine at the time I wrote the
original story was a librarian at a private, college
library. She observed that there were always
three times as many librarians at government
libraries with much less work to do, and much
more pay. Yet she couldn’t envision how society
would function without government libraries.
My research revealed that there were many
private libraries and book services before the
government became involved in the early 1800s
and drove most of the private services out of
existence with their “free service”.
Libraries in Hawaii typically close at five
p.m. and close on weekends and holidays. Not
much use to readers. Recently one public library
was built in a new neighbourhood, but was not
funded to buy books or to hire staff. Citizens
offered to contribute books and to volunteer
their time so that it could be used, but the library
officials refused to open the facility because this
was “unprofessional.” What they really feared
was the notion that their expensive, tax-funded
services weren’t necessary.
Interestingly, one of the prominent figures
pushing for government to take over libraries
in the 1800s was multimillionaire businessman
Andrew Carnegie. He donated the construction
fees for government libraries across the country,
but expected taxpayers to foot the bill for their
upkeep.
Your action on behalf
of others, or their
action on behalf of
you, is only virtuous
when it is derived
from voluntary,
mutual consent.
Extract from
Jonathan’s Guiding
Principles
85 Chapter 15 • Book Battles
References
David Friedman’s book The Machinery of
Freedom is excellent on the private provision of
public services.
Also Bob Poole’s Cutting Back on City Hall
shows how local government services can be
privatised. James Bovard’s books Lost Rights
and the shorter Shakedown: How the Government
Screws You from A to Z tell of amazing and
horrifying tales of government run-amok. “If it
wasn’t so scary you’d laugh.”
For library privatisation see Reason Public
Policy Institute at:.
?
Someone has
tabulated that we
have put 35 million
laws on the books
to enforce the Ten
Commandments.
Anonymous
Free-market.net Freedom Network
Chapter 16
Nothing to It
T
he GLIB structure stood two storeys high with an impressive
stone façade. A well-dressed crowd clustered at the entrance,
waiting to enter. They pretended not to notice the mounting quarrel
that flared behind them in the square. As Jonathan joined the group,
he read with interest the heavy bronze letters above the doorway,
“LADY BESS TWEED PEOPLE’S LIBRARY.”
Visitors at the back of the crowd craned to look over those
standing in front. They exclaimed aloud at what they saw.
“Marvellous,” whispered some. “Stunning,” said others. Try as he
might, Jonathan couldn’t see what caught their attention.
Deft and slim, Jonathan squeezed around the crowd and
approached a librarian’s desk inside the entrance. “What does this
group find so marvellous and stunning?” he asked of the man sitting
behind the desk.
“Shhhh!” reprimanded the librarian sternly. “Please lower your
voice.” The man tapped the corners of a pile of note cards and laid
them down neatly in front of him. He bent forward and looked
at Jonathan over his half-framed glasses. “These are members of
the Council’s Commission on the Arts. They have just opened an
exhibit of the latest acquisition for our collection of fine art.”
“How nice,” whispered Jonathan. Stretching his neck to catch a
glimpse, he said, “I love good art, but where is it? It must be very
small.”
“That depends,” sniffed the librarian. “Some would say it is
very expansive. That’s the beauty of this piece. It’s titled ‘Void in
Flight’.”
“But I don’t see anything,” said Jonathan, frowning as he scanned
the great white space in the passage that was visible just outside the
entrance.
“That’s the point. Impressive, isn’t it?” The librarian stared
at the vacant space with a dreamy expression. “Nothing captures
Chapter 16 • Nothing To It 88
the full essence of the spirit of human struggle for that exalted
sense of awareness that one only feels when contrasting the fuller
warmth of the finer hues with the tactile awareness of our inner
nature. Nothing allows everyone to fully experience the best of the
collective imagination.”
Befuddled, Jonathan shook his head and asked in puzzlement,
“So it’s really nothing? How can nothing be art?”
“That’s precisely what makes it the most egalitarian expression
of art. The Council’s Commission on the Arts holds a tastefully
executed lottery to make the selection,” said the librarian.
“A lottery to select art?” asked Jonathan in astonishment. “Why
a lottery?”
“In more backward days an appointed Board of Fine Art made
the selections,” replied the man. “At first, critics accused the Board
of favouring their own tastes. They censored art that they disliked.
Since the ordinary citizen paid for the preferences of the Board
through taxes, people objected to the elitism.”
“What about trying a different Board?” suggested Jonathan.
“Oh, yes we tried that many times. But people sitting on the
Board could never agree with those who were not on the Board.
So they finally scrapped the whole Board idea – replacing it with
our new Commission and lottery. Everyone agreed that a lottery
was the only objectively subjective method. Anyone could enter the
competition and nearly everyone did! The Council of Lords made
the prize as generous as possible and any piece qualified. ‘Void in
Flight’ won the drawing just this morning.”
Jonathan interjected, “But why not let everyone buy their own
art instead of taxing them to buy a lottery selection? Then everyone
could pick what they like.”
“What!” the librarian exclaimed. “Some selfish individuals might
not buy anything and others might have bad taste. No, indeed, the
Lords must show their support for the arts!” Concentrating on “Void
in Flight”, the librarian crossed his arms, and a vague expression
covered his face. “Nice selection, don’t you agree? Emptiness has
the advantage of keeping the library entrance uncluttered while
simultaneously preserving the environment. Moreover,” he continued
happily, “no one can object to the artistic quality or to the aesthetic
style of this masterpiece. Who could possibly be offended?”
89 Chapter 16 • Nothing To It
Brainstorming
• What problems arise when art is financed by
taxes?
• Is the selection of art elitist?
• Can officials be objective in funding art?
• Can art exist without tax funding?
• How does the type of funding affect
behaviour?
• Examples?
• What ethical issues are involved?
Commentary
Elitism is the paternalist belief that only those
people “at the top” have the knowledge to make
decisions.
The authorities say that government funding
of art is good for the education and culture of
a nation. These officials presume that people
won’t support art voluntarily. Yes, art is
good for a nation, but freedom is even more
important. From freedom will come the kind
of art, education, and culture that people truly
value. Every individual has his or her own taste,
depending on individual priorities and values in
life. It is immoral for officials to use the force
of government to substitute their elitist values
for the values and choices of free people. Art,
music, cultural events, dance, exhibitions, and
sporting events can all be successfully provided
privately and voluntarily.
The State Theatre in Pretoria provides an
excellent example. The theatre was closed when
it was deemed too elitist and expensive to run.
The building stood empty until a group of ballet
dancers met and decided to take an adventure into
the world of entrepreneurial economics. They
opened the building and turned it into a viable
Having confidence in
a free society is to
focus on the process
of discovery in the
marketplace of values
rather than to focus
on some imposed
vision or goal.
Extract from
Jonathan’s Guiding
Principles
90 Chapter 16 • Nothing To It
ballet school and theatre. It is now a successful
enterprise run without any taxpayer subsidies.
Background
Ken: During a radio debate I once had with the
head of the state art academy, he confessed that
the vast bulk of the state owned art was buried
away in warehouses and no one was allowed to
see it. Nevertheless, favoured artists made quite
a living from the sales to the state.
This chapter was derived from the debates
over public funding of art, specifically the “Piss
Christ” art that was a crucifix in a flask of the
artist’s urine. This artist, Andres Serrano, caused
an uproar from taxpayers who were forced to
fund his exhibit.
References
Irving Wallace, in his delightful The Square
Pegs, writes of a book called Nothing, written in
the 17th century by a Frenchman called Mathel.
The book comprised 200 blank pages.
A more informative book is The Incredible
Bread Machine by R.W. Grant.
For more information on the ballet company
see:.
There is absolutely
no ground for saying
that the market
economy fosters
either material or
immaterial goods;
it simply leaves every
man free to choose
his own pattern of
spending.
Murray Rothbard
Chapter 17
The Special Interest Carnival
The sun was setting as Jonathan returned to the steps of the
library. To his delight, the town came to life after dark; people began
milling about in the square. More and more people streamed toward
a magnificent carnival tent standing near the GLIB.
Gawking at the lights, sights, and sounds, Jonathan wandered
over to the spectacular tent. A colourful sign overhead read:
“CARNIVAL OF SPECIAL INTERESTS.”
A striking woman wearing a tight, garishly-coloured costume
sprang out of the crowd and shouted to all: “Hear ye, hear ye!
For the thrill of a lifetime, step right up to the Carnival of Special
Interests.” She spotted Jonathan, whose eyes opened wide with
surprise, and grabbed his arm. “Everyone is a winner, young man.”
“What’s it cost?” asked Jonathan.
“Bring in ten kayns and walk out with a fabulous prize!” she
replied. The woman gestured widely to the crowd, “Hear ye, hear
ye! The Carnival of Special Interests will make you rich!”
Not having enough money, Jonathan waited until the woman
was busy with others and then crept around to the back of the tent.
He lifted the edge of the canvas to peer inside. People sat on stands
along the sides of the tent. In the middle, ushers in uniform directed
participants to chairs arranged in a large circle. Ten participants
stood or kneeled behind their chairs expectantly. Then, half the
candles were snuffed, a drum rolled, and hidden trumpets blared
a fanfare. A brilliant lamp flashed on a handsome man wearing a
shiny black suit and silk top hat. He bowed low to the circle of ten.
“Good evening,” said the man, flashing a gleaming white-toothed
smile. “I am the Circle Master! Tonight, you fortunate ten will be
the lucky winners in our remarkable game. All of you will win. All
of you will leave happier than when you entered. Please be seated.”
With that and a swift flourish of his white-gloved hand, the Circle
Master collected one kayn from each participant. No one hesitated.
Chapter 17 • The Special Interest Carnival 92
Then the Circle Master smiled again and announced, “Now you
will see how you are rewarded.” And he suddenly dropped five
kayns into the lap of one participant. The lucky recipient screamed
with glee.
“You won’t be the only winner,” declared the Circle Master. And
so it was. Ten times he went around the group, collecting one kayn
from each person. After each round, he dropped five kayns into the
lap of one of the participants, and each time the recipient jumped
for joy.
When the shouting stopped and the participants began to file out,
Jonathan ran around to the front of the tent to see if everyone was
really satisfied. The woman at the entrance held the tent flap open.
She stopped one of the participants as he shuffled out on his knees
and asked: “Did you have fun?”
“Oh sure!” the man said, grinning happily. “It was terrific!”
“I can’t wait to tell my friends,” said another. “I may come back
again later.”
Then another excited participant added, “Yes, oh yes. Everyone
won a prize of five kayns!”
Jonathan thoughtfully watched the group as they dispersed. The
woman turned to the Circle Master, who waved his good-bye to the
crowd, and commented quietly, “Yes, we’re especially happy. We
won fifty kayns and these suckers all feel happy about it! I think that
next year we ought to ask the Council of Lords to pass a law that
will require everyone to play!”
Just then an usher sneaked behind Jonathan and grabbed him
by the collar. “Hold on there, you scamp. I saw you peeking in the
back. You thought you could get a free show, did you?”
“I’m sorry,” said Jonathan, struggling to get out of the usher’s
grasp. “I didn’t realize you had to pay just to watch. That pretty
lady made it sound so interesting – and I didn’t have enough money,
please...”
The Circle Master scowled at Jonathan and the usher, “No
money?”
But the woman smiled at Jonathan’s compliment. “Wait, turn
him loose,” she smoothly said to the usher. “He’s just a kid. So you
liked the show, did you?”
Chapter 17 • The Special Interest Carnival 93
“Oh yes, ma’am!” said Jonathan, nodding hard.
“Well, how would you like to earn some easy money? It’s
either that or?” her voice turned threatening, “I’ll turn you in to the
carnival guard.”
“Oh, great,” said Jonathan, uncertainly. “What do you want me
to do?”
“It’s simple,” she smiled, all sweetness again. “Just walk around
the town this evening, hand out these flyers, and tell everyone how
much fun they’ll have in our Carnival. Here’s a kayn now and you’ll
earn another with each participant that comes in the door carrying
one of these flyers. Now go to it and don’t disappoint me.”
As Jonathan slung the bag of flyers over his shoulder, she
cautioned, “One more thing. At the end of the show tonight, I’ll turn
in a report of your earnings. First thing in the morning, you must
turn over half of your pay at the town hall for your tax.”
“Tax?” repeated Jonathan. “Why?”
“The Lords require a share of your wages.”
Jonathan didn’t like the idea. He added hopefully, “If you don’t
report my earnings, I might work harder. Maybe twice as hard.”
“The Lords are wise to that, kid. They have spies everywhere,
watching us closely. If they see us hide your earnings, it could mean
big trouble – might even shut us down,” said the woman. “So don’t
complain. We must all pay for our sins.”
“Sins?” repeated Jonathan.
“Oh, yes. Taxes punish the sinful. The tobacco tax punishes
smoking, the alcohol tax punishes drinking, the interest tax punishes
saving, and the income tax punishes working. The ideal of the
Council,” chuckled the woman as she winked at the Circle Master
standing at her side, “is to be healthy, sober, dependent, and idle.
Now get a move on, kid!”
94 Chapter 17 • The Special Interest Carnival
Brainstorming
• Are the game participants winners?
• Why are the pavilion operators happy?
• Should people be required to participate in
carnivals like this?
• How can political “logrolling” be compared
to this game?
• Examples?
• Ethical issues?
Commentary
When politicians seek election, they need
money to promote themselves. They raise this
money by promising to help groups in return for
contributions. The politician and the contributors
trade favours. The politician will receive funds
and in return might promote laws which will
help the contributors’ special interests. These
contributors may even be groups or companies
outside the country. This would give them
control of particular policies and laws in the
politician’s country. Many of the contributions
to politicians can be interpreted as bribes and
are, therefore, often veiled as gifts, interest free
loans, or foreign policy deals. If they are bribes,
the most common reasons that businesses,
unions, or even individuals have for making
contributions is either: (1) to gain a special
unfair advantage over their competition; or (2)
to defend themselves from further government
encroachment. From this one can see that the
enormous power of politicians is very rarely for
‘the good of the people’.
The cost to individual citizens of each
government favour appears too small to warrant
an effort to oppose it. Upon closer examination,
the sums of money collected from each taxpayer
and consumer adds up to a great amount and
provides great wealth for the politically-favoured
few.
The exercise of
choice over life
and liberty is your
prosperity.
Extract from
Jonathan’s Guiding
Principles
Only when
Congressmen have no
special favours to sell
will lobbyists stop
trying to buy their
votes – and
their souls.
Edwin A. Locke,
University of
Maryland
95 Chapter 17 • The Special Interest Carnival
One can now appreciate that many
businessmen oppose a market free from
government intervention! They are often
advocates of government helping them by
preventing competition or by providing low
interest loans, sales assistance, and even
diplomatic or military intervention to protect
their investments or to secure favourable terms
in foreign countries.
The bigger the government, the bigger the
favours they are able to bestow. The horrible
effects on people of Nazism, Communism,
Apartheid, and the dreadful effects on the
environment, would never take place if
individuals were free to make their own choices
in a free-market system.
Background
Logrolling is an American term for the practice of
politicians trading votes to support each other’s
special interest laws. Thus, the farm subsidy law
usually combines many crop subsidies together,
guaranteeing the support of many politicians.
The cost to taxpayers and consumers is spread
among millions of people, while the benefits are
concentrated only amongst the farmers.
References
The original idea for this chapter is derived
from David Friedman’s book The Machinery of
Freedom.
For a New Liberty by Murray Rothbard,
gives some great alternatives in tough and
philosophical areas.
The free market
promotes harmony
and cooperation to
increase the standard
of living. On the other
hand, if government
controls the economy,
there will always be
“special interest”
groups competing to
plunder others and
avoid being
plundered.
Alan Burris.
?
Limophilia: the
burning desire of
politicians to ride in
limousines.
Blase Harris
Chapter 18
Uncle Samta
By the time Jonathan returned to the carnival tent, he had earned
more than fifty kayns. The woman was so pleased to find someone
who took work seriously that she asked him to come back the next
night. Jonathan agreed to return if he could, then he left the carnival
to look for a bed for the night. He had no idea what to do, so he just
wandered aimlessly through the town. As he paused in the dim glow
of a street lamp, a short, elderly man in a nightshirt stepped out onto
the front porch of a nearby house. He squinted and peered over the
rooftops of the row of houses bordering the street.
Curious, Jonathan asked, “What are you looking at?”
“The roof of that house,” whispered the man, pointing into the
dark. “See that fat guy dressed in red, white, and blue? His bag of
loot gets bigger with every house he visits.”
Jonathan looked in the direction the man pointed. A vague
shadowy shape scrambled over the roof of one of the houses. “Why,
yes, I see him! Why don’t you sound the alarm and warn the people
living there?”
“Oh, I’d never do that,” shuddered the man. “Uncle Samta has
a vicious temper and deals harshly with anyone who gets in his
way.”
“You know him?” protested Jonathan. “But...”
“Shhhh! Not so loud,” said the old man, holding a finger to
his lips. “Uncle Samta makes extra visits to those who make too
much noise. Most people pretend to sleep through this awful night
– though it’s impossible to ignore such an invasion of privacy.”
Trying to speak softly, Jonathan leaned close to the man’s ear. “I
don’t get it. Why does everyone close their eyes when they’re being
robbed?”
“People keep silent on this particular night in April,” the old man
explained. “Otherwise it might spoil the thrill they get on Xmas
98
Eve when Uncle Samta returns to sprinkle some toys and trinkets in
every house.”
“Oh,” said Jonathan, with a look of relief. “So Uncle Samta
gives everything back again?”
“Hardly! But people like to imagine that he does. I try to stay
awake in order to keep track of what he takes and what he returns.
It’s a kind of a hobby of mine, you might say. By my calculation,
Uncle Samta keeps most for himself and a few favoured households
around town. But,” said the old man, pounding his palm against a
railing in frustration, “Uncle Samta is careful to give everyone a
little bit to keep them happy. That makes everyone stay asleep the
following April when he comes back again to take what he wants.”
“I don’t understand,” said Jonathan “Why don’t people stay
awake, report the thief, and keep their own belongings? Then they
could buy whatever trinkets they want and give them to whomever
they please.”
The old man chuckled and shook his head at Jonathan’s naiveté.
“Uncle Samta is really everyone’s childhood fantasy. Parents have
always taught their children that Uncle Samta’s toys and trinkets,
like the Dream Machine’s free lunches, come magically out of the
sky and at no cost to anyone.”
Seeing Jonathan’s haggard appearance the old man said, “Looks
like you’ve had a rough day, young fella.”
“I was looking for a place to spend the night,” Jonathan said,
shyly.
“Well, you look like a nice lad,” said the man, “Why don’t you
stay with us. Rose and I enjoy company.”
Jonathan welcomed the old man’s offer. Inside Jonathan met
Rose, the old man’s plump wife; she cheerily brought him a cup
of hot chocolate and a plate of freshly baked cookies. After the
last crumb disappeared, Jonathan stretched out on a divan that the
couple had made up with some blankets and a pillow. The old man
lit a long pipe and leaned back into the cushions of his rocking
chair.
Their home was not large, not richly furnished, and definitely
not new. But, to the tired young stranger, it was the perfect refuge. A
small fire in the fireplace warmed and lit the wood-panelled room.
Chapter 18 • Uncle Samta • Uncle Samta
99 Chapter 18 • Uncle Samta • Uncle Samta
Over the mantle hung two frames, one holding a family portrait
and another displaying a family tree. On the simple plank floor was
a well-worn, oval rug. Settling in, Jonathan asked, “How did this
April tradition start?”
“We used to have a holiday called ‘Christmas,’ a wonderful
time of year. It was a religious holiday marked by gift-giving
and merriment. Everyone enjoyed it so much that the Council
of Lords decided that it was too important to be left to unbridled
spontaneity and chaotic celebration. They took it over so that it
could be run ‘correctly’.” His sarcastic tone revealed disapproval.
“First, inappropriate religious symbolism had to go. The Lords
officially changed the name of the holiday to ‘Xmas’. And the
popular mythical gift-giver was renamed ‘Uncle Samta,’ with the
tax collector dressed up in the costume.”
The old man paused to take a couple of deep puffs and to tamp
down the tobacco. He continued, “Xmas tax forms must now be
submitted in triplicate to the Bureau of Good Will. The Bureau of
Good Will determines the generosity required of every taxpayer
based on a formula set by the Lords. You’ve just witnessed the
annual collection.”
“Next comes the Bureau of Naughty and Nice. With the
assistance of an official Accountant for Morals, everyone files a
form explaining in detail good and bad behaviour throughout the
year. The Bureau of Naughty and Nice employs an army of clerks
and investigators to examine the worthiness of those who petition to
receive gifts in December”.
“Finally, the Commission on Correct Taste standardizes the
sizes, colours, and styles of permissible gift selections, issuing non-
bid contracts to pre-selected manufacturers with the proper political
affiliation. Everyone, without discrimination, receives exactly the
same government-issued holiday ornaments for use in decorating
their homes. On Xmas eve, the militia is called out to sing the
appropriate festive songs.”
By now, the weary young adventurer had fallen fast asleep. As
the old man pulled up the blanket over Jonathan’s shoulders, a cat’s
meow could be heard outside the window. Rose whispered, “Merry
Xmas!”
100 Chapter 18 • Uncle Samta
Brainstorming
• Does Uncle Samta give back as much as he
takes?
• Why don’t people complain when he takes
things from their homes?
• Why did officials take over Christmas
rituals?
• How would Christmas behaviour be
affected?
• Examples?
• Ethical issues?
Commentary
When you fill out your tax form, you are
filling out the pay slip for your contribution
to the politicians’ salaries and all government
expenses.
Although you are made to feel that there is
a moral obligation to do so, there is only a legal
obligation. Why not a moral obligation? Because
you do not have a moral obligation to people
who threaten to initiate force against you. Why
a legal obligation? If you do not fill out your
tax form, the full wrath of government will rain
down upon you. At the very least, you can be
sure of many unfriendly visits.
As with everyone else, you send off your
carefully accumulated money to an unknown
person in a government department. Some of
this money is taken for the expense of taking
your money in the first place. The rest will be
added to all the money collected from others.
This tax is not just from your income, but also
from the sales taxes on everything you buy.
Money is nibbled from your savings by a whole
range of “invisible” taxes that raise the price
of everything you buy: taxes on insurance,
pensions, travel, inheritance, property transfers,
The product of your
life and freedom
is your property.
Property is the fruit
of your labour, the
product of your time,
energy, and talents.
Extract from
Jonathan’s Guiding
Principles
?
We’ve got what
it takes to take what
you’ve got.
Internal Revenue
Services
101 Chapter 18 • Uncle Samta
stamps, registrations, sports affiliation, licenses,
etc, etc, etc.
A further portion of your money is used
for the expenses of people who try to work out
how to equalise everyone’s income and wealth.
The many departments of governments, each
taking a bit, will only be able to return a much
smaller portion to the citizens than they take.
The portion “returned” will be in the form of
inefficient public services implemented by
unwieldy government departments.
Sometimes a huge slice of this tax money is
spent on showcase projects (i.e. bridges, dams, or
recreational facilities) for the people in one area
at the expense of those in another area. While
the government proudly shows pictures of happy
recipients on TV and in newspapers, the officials
fail to mention the harm done to people in other
areas. These people are now poorer as they have
been forced to “donate” the money they would
have spent on stoves, shoes, and stews. To them,
the result is falling sales and lost jobs.
Before every election, political parties will
promise not to increase taxes, but no matter
which party is elected, they make more laws and
raise taxes to implement them. Even when they
say they are cutting taxes, they are only reducing
the rate of increase. The more they increase taxes
the more they undermine the economy. When
taxes increase, unemployment increases.
Simple taxes, such as the flat tax, are less
complicated, and discourage bureaucrats from
manipulation and corruption. The best tax for
the reduction of bureaucratic controls is no tax.
Voluntary alternatives can be sought to achieve
this, e.g., cutting expenses, open competition,
privatisation, user fees, lotteries, voluntary
contributions, etc.
If the government spent less, we would all
pay less in taxes. A government consisting of
a minimum number of departments would cost
each citizen so little that citizens would likely
It is the highest
impertinence and
presumption in kings
and ministers, to
pretend to watch
over the economy
of private people ...
They are themselves,
always and without
any exception, the
greatest spendthrifts
in society ... If their
own extravagance
does not ruin the
state, that of their
subjects never will.
Adam Smith, Wealth
of Nations
When taxes are too
high, people go
hungry.
Lao-tsu, Tao Te Ching
102 Chapter 18 • Uncle Samta
be willing to pay without coercion. The result
would be citizens who were more honest and
healthy, more wealthy and happy.
Background
Americans refer to their government as “Uncle
Sam” because the nickname shares the same
initials as the country – US. This is why Uncle
Samta is dressed in red, white, and blue.
Americans pay their income tax in April,
hence the reference to April in the story.
Quoting from Dr Madsen Pirie, President of
the Adam Smith Institute:
“Each year the Adam Smith Institute
calculates and publishes Tax Freedom Day. If
you have to work from January 1st to pay off
your taxes, then Tax Freedom Day comes when
you have done so, and can start working for
yourself. If government takes 40% on average,
Tax Freedom Day will come 40% of the way
into the year. It is well into June before we have
any freedom to allocate our earnings to our
own resources. Until then it is the government
which decides how to spend our money.” See:
A 1992 Dutch survey of self-rated happiness
by country correlates well with the Fraser
Institute’s economic-freedom/growth/prosperity
survey.
References
Recommended books: Alan Burris’ A Liberty
Primer, Mary Ruwart’s Healing Our World, and
Milton and Rose Friedman’s Free to Choose.
In Chapter 1 of Economics in One Lesson,
Henry Hazlitt points out how policies can benefit
one group at the expense of all other groups.
?
A new word:
Intaxication – The
euphoria of getting
a tax refund, which
lasts until you realise
it was your money to
start with.
Every tax is a dagger
in our hearts.
Andrei Illarionov, top
economic advisor to
Russian president
Vladimir Putin
Chapter 19
The Tortoise and the Hare
Revisited
J
onathan dreamt of the woman from the Carnival of Special Inter-
ests. She kept handing him money and then grabbing it away
again. Again and again, she paid him and then proceeded to snatch
it back. Suddenly Jonathan woke with a jolt, remembering that he
had to report his earnings to the tax officials, lest he become an
occupant of the people zoo himself.
The delicious smell of freshly toasted bread filled his nose. The
old man stood at the table, dishing out thick slices of toast and jam
for breakfast. Jonathan noticed a sad-faced little boy sitting at the
table. The old man introduced the boy as their grandson, Davy, who
would be staying with them for a while.
“I remember you,” chirped Davy. “Grandpa, he helped me and
mama when we had to leave the farm.” This news made Jonathan
all the more welcome. As Jonathan bit into a thickly buttered slice
of toast, the little boy fidgeted restlessly, trying to pull up his
mismatched socks. “Grandma, please read me the story again,” he
begged.
“Which one, sweetie?” She heaped hot scrambled eggs on
Jonathan’s plate.
“My favourite, the one about the tortoise and the hare. The
pictures are so funny,” beamed Davy.
“Well, all right,” said Rose, taking a book from the kitchen
cabinet. She sat down next to tiny Davy and began. ‘Once upon a
time...’”
“No, no, Grandma, ‘a long time ago’...” interrupted the boy.
Rose laughed. “As I was saying... a long time ago there lived
a tortoise named Frank and a hare named Lysander. Both of the
animals worked delivering letters to all who lived in their small
village. One day Frank, whose sharp ears were far more efficient
Chapter 19 • The Tortoise and the Hare Revisited 104
than his short legs, overheard a few of the animals praise Lysander
for being so quick at his deliveries. The fleet-footed hare could
deliver in a few hours what others required days to do. Annoyed,
Frank crawled over and butted into the conversation.
“‘Hare,’ said Frank almost as slowly as he walked, ‘in one
week, I’ll bet I can get more customers than you can. I’ll stake my
reputation on it.’
“The challenge startled Lysander. ‘Your reputation? Ha!
What everyone thinks of you isn’t yours to bet,’ exclaimed the
rambunctious hare. ‘No matter, I’ll take you on anyway!’ The
neighbours scoffed, saying the sluggish tortoise didn’t stand a
chance. To prove it, they all agreed to judge the winner at this
very spot in one week’s time. As Lysander dashed off to make his
preparations, Frank just sat still for a long time. Finally he ambled
away.
“Lysander posted notices all over the countryside that he
was cutting prices to less than half the price that Frank charged.
Deliveries would be twice a day from now on, even on weekends
and holidays. The hare passed through each neighbourhood ringing
a bell, handing out letters, selling stamps and supplies, and even
weighing and wrapping parcels on the spot. For a small extra fee,
he promised to deliver anytime, day or night. And he always gave a
sincere, friendly smile at no extra charge. Being efficient, creative,
and pleasant, the hare saw his customer list grow rapidly.”
Davy was glued to the pictures and helped Grandma turn the
pages as she continued reading aloud. “No one had seen any sign
of the tortoise. By the end of the week, certain of victory, Lysander
scurried up to meet the neighbourhood judges. To his surprise
he found the tortoise already there waiting for him. ‘So sorry,
Lysander,’ said the tortoise in his surly drawl. ‘While you’ve been
racing from house to house, I only have this one letter to deliver.’
Frank handed Lysander a document and a pen adding, ‘Please sign
here on the dotted line.’
“‘What’s this?’ asked Lysander.
“‘Our king has appointed me, tortoise, Postmaster General and
has authorized me to deliver all letters in the land. Sorry, hare, but
you must discontinue your deliveries.’
Chapter 19 • The Tortoise and the Hare Revisited 105
“‘But that’s not possible!’ said Lysander, drumming his feet in a
rage. ‘It’s not fair!’
“‘That’s what the king said, too,’ answered the tortoise. ‘It’s not
fair that some of his subjects should have better mail service than
others. So he gave me an exclusive monopoly to insure the same
quality of service for all.’
“Angrily, Lysander scolded the tortoise saying, ‘How did you
get him to do this? What did you offer him?’
“A tortoise cannot smile easily, but he managed to curl up a
scale at the side of his mouth. ‘I have assured the king that he
will be able to send all of his messages for free. And, of course, I
reminded him that having all correspondence of the realm in loyal
hands would make it easier for him to oversee the behaviour of
rebellious subjects. If I should lose a letter here or there, well, who’s
to complain?’
“‘But you always lost money delivering the mail!’ declared the
hare irritably. ‘Who’ll pay for that?’
“‘The king will set a price assuring my profits. If people stop
mailing letters, taxes will cover my losses. After awhile no one will
remember that I ever had a rival.’” Grandma looked up adding,
“THE END.”
“The moral of this story,” read Rose, “is that you can always turn
to authority when you have special problems.”
Little Davy repeated, “You can always turn to authority when
you have special problems. I’ll remember to do that, Grandma.”
“No, dear, that’s only what it says in the book. It may be better
for you to find your own moral.”
“Grandma?”
“Yes, dear?”
“Can animals talk?”
“Only birds talk, child. This is just a fairy tale, not the Great
Bard.”
“Tell me about the Great Bard, Grandma.”
She chuckled. “How many times have you heard it already? Bard
is the wise condor who roams the seven seas, from the icy peaks of
Chapter 19 • The Tortoise and the Hare Revisited 106
High Yek to the steamy shores of Roth. No, no, you won’t trick me
into another story. We’ll save that for tomorrow.”
Jonathan finished his meal and thanked the old couple for their
gracious hospitality. As they all stepped out on the front porch to
say farewell, the old man told him, “Just think of us as your own
grandpa and grandma if you ever need anything.”
107 Chapter 19 • The Tortoise and the Hare Revisited
Brainstorming
• What are the differences between
government and private mail delivery?
• Who receives benefits from the granting of
monopoly privileges?
• Can control over mail delivery allow for
control over citizens?
• Ethical issues?
Commentary
A successful enterprise is achieved with
innovation, good products and services, and
competitive prices. This results in repeat
business and referrals by happy customers. It
enables the enterprise to advertise more and
cut prices further, which in turn brings in more
happy customers. So the momentum of success
continues.
All of it is hard work. None of it is undertaken
without competition.
For those firms that cannot compete, they
often spend time badgering the government to
control the “unfair” situation or “standardise
services for all”. With government intervention,
monopolies are created for inefficient
companies. When these monopolies close down
the competition, services and prices suffer. Take
a look at state monopolies and note the decrease
in the number of hours and days of service,
the decrease in customer care, the decrease in
general efficiency, and the increase in “patriotic”
advertising. Even with the lack of competition,
state monopolies frequently lose interest in
profits because they know their losses will be
paid for with taxes that others are compelled
to pay.
One of the reasons the state creates
monopolies is to satisfy favoured interest groups.
By controlling monopolies, government officials
also control the citizenry. With the control of
Wealth is comprised
of choices. When
government takes
away choices, it takes
away wealth, even
from the poor.
Rockne Johnson
108 Chapter 19 • The Tortoise and the Hare Revisited
methods of Internet connection, it is very easy
to direct the minds of voters. With control over
travel, the state also controls the movement of
citizens. Voters pay for this suffocating control.
Eventually most people become so used to these
monopolies that they forget to ask if their lives
would improve without them.
Background
High Yek – Friedrich Hayek – just having fun.
Friedrich Hayek, economist, social philosopher,
Nobel prize laureate in economics, and author of
The Road to Serfdom, started the Mont Pélerin
Society in 1947. The 39 founding members
included Milton Friedman, Karl Popper,
Michael Poyany and Ludwig von Mises. See:.
Great Bard, the shores of Roth – The late
Murray Rothbard was a famous free-market
economist, and a member of a group known as
the Cercle Frederic Bastiat.
Lysander Spooner was a 19th century
philosopher. In 1840, the U.S. Post Office was
secure from competition. It was illegal for
individuals to deliver letters or packages. After
a judge ruled that the law had not forbidden
passengers from carrying mail, companies
responded to this entrepreneurial opportunity.
Among these was Lysander Spooner’s
“American Letter Mail Company”. He went
about his business more openly than others,
arguing that people had “a natural right” to
work. The government’s attack on Spooner
was vigorous. They made little effort to answer
Spooner’s legal arguments and, hoping to drive
Spooner out of business, the Postmaster General
resorted to some additional legal measures.
Transport companies were told they would lose
their government contracts unless they stopped
carrying mail of Spooner’s American Letter Mail
Two people who
exchange property
voluntarily are both
better off or they
wouldn’t do it. Only
they may rightfully
make that decision
for themselves.
Extract from
Jonathan’s Guiding
Principles.
109 Chapter 19 • The Tortoise and the Hare Revisited
Company. Under this barrage of harassing legal
actions, Spooner’s company could not survive.
During the 18th century the term “frank” was
used for the signature of a person who was given
permission to send free post. In exchange for
passing the federal express statutes guaranteeing
a postal monopoly to the government, all
congressmen received, and stll receive, franking
privileges allowing them to send letters to their
constituents for free. Quite a payoff!
The condor is a type of vulture with a huge
wingspan measuring up to 91⁄2 feet (2.9 m), and
can weigh up to 23 pounds (10.4 kgs). They have
tremendous flying ability, gliding and riding for
miles on the air thermals without moving their
wings.
References
In Free to Choose Milton and Rose Friedman
give the example of Pat Brennan who, in 1978,
also went into competition with the U.S. Post
Office.
The Machinery of Freedom by David
Friedman.
For a New Liberty by Murray Rothbard.
For further information: CATO Privatizing
the Post Office or:
policy_report/xviiin3-3.html.
The Foundation for Economic Education
Time for the Mail Monopoly to Go, February
2002:.
?
The ghastly thing
about postal strikes
is that after they are
over, the service
returns to normal.
Richard Needham
The state shall make
no laws curtailing the
freedom of sellers of
goods or labour to
price their products
or services.
Proposed by Rose
and Milton Friedman
Chapter 20
Bored of Digestion
B
efore he walked away, Jonathan asked for directions to the
town hall. Rose looked worried and placed a hand on his arm,
“Please, Jonathan, don’t tell anyone about the meals that we served
you. We don’t have a permit.”
“What?” said Jonathan. “You need a permit to serve meals?”
“In town, yes,” she replied. “And it can be quite a problem for us
if the authorities get word of our serving meals without a permit.”
“What’s the permit for?”
“It’s to guarantee a certain standard of food for all. Years ago,
townsfolk used to buy their food from street vendors, corner cafes,
fancy restaurants, or they would get food at stores and cook in their
own homes. Then the Council of Lords argued that it was unfair
that some people should eat better than others and that people had
to be protected from their own poor judgement. So they created
political cafeterias where everyone in town could eat standard food
for free.”
“Not exactly free, of course,” said Grandpa, pulling out his
wallet and waving it slowly in front of Jonathan’s nose. “The cost
of each meal is much more than ever before, but nobody pays at the
door. Uncle Samta paid with our taxes. Since meals at the political
cafeterias, or ‘politicafes,’ were already paid for, a lot of people
stopped going to private providers where they had to pay extra.
With fewer customers, the private restaurants raised prices to cover
expenses. Some survived with a handful of wealthy clients or with
people on special religious diets, but most went out of business.”
“Why would anyone pay for meals if they could go to politicafes
for free?” wondered Jonathan aloud.
Rose laughed. “Because the politicafes became awful – the
cooks, the food, the atmosphere – you name it! Bad cooks never
get fired from politicafes. Their guild is too strong. And really good
cooks are seldom rewarded because the bad cooks get jealous.
Chapter 20 • Bored of Digestion 112
The buildings are falling apart – filth and graffiti are everywhere.
Morale is low, the food is bland, and the Board of Digestion decides
the menu.”
“That’s the worst part,” exclaimed Grandpa. “They try to please
their friends and nobody’s ever satisfied. You should have seen the
fight over noodles and rice. Noodles and rice, day in and day out for
decades. Then the spud lobby organized their campaign for bread
and potatoes. Remember that?” he said, nodding to his wife. “When
potato lovers finally got their people on the Board that was the last
we ever heard of noodles and rice.”
Davy made a choking sound. Peeking out from behind his
grandmother’s skirt, Davy’s nose crinkled in disgust. “I hate
potatoes, Grandma.”
“Better eat them, dear, or the Nutrient Officers will get you.”
“Nutrient Officers?” asked Jonathan.
“Shhh!” said Grandpa placing a finger to his lips. He looked
over his shoulder and then down the street to see if anyone was
watching. “Those who avoid politically approved foods usually
fall into the hands of the Nutrient Officers. Kids call them ‘nutes’
for short. Nutes closely monitor attendance at meals and they hunt
for anyone who fails to show up. Nutrient delinquents are taken to
special detention cafeterias for forced feeding.”
Davy shuddered, “But couldn’t we just eat at home? Grandma’s
cooking is the best!”
“It’s not allowed, dear,” said Rose patting Davy on the head.
“A few people have special permits, but Grandpa Milton and I
don’t have the specified training. And we can’t afford the elaborate
kitchen facilities that would meet their requirements. You see, Davy,
the Lords believe that they care more for your needs than Grandpa
and I do.”
“Besides,” added Grandpa, “We both have to work in order to
pay the taxes for all of this.” Grandpa Milton paced around the
porch, half talking to himself and grumbling. “They tell us that we
now have a lower digester-to-cook ratio than at any time in history,
though half of the population is functionally malnourished. The
original plan to give better nutrition to the poor has ended with
poor nutrition for all. Some misfits have refused to eat and seem on
the verge of starvation, even though their food is free. Worse yet,
Chapter 20 • Bored of Digestion 113
vandals and gangsters roam the political cafeterias and no one feels
safe there anymore.”
“Please stop!” said Rose to her husband, seeing the shocked
look on Jonathan’s face. “He’ll be scared to death when he goes
to a politicafe.” Turning to Jonathan she warned, “Just have your
identity card ready when you show up at the door. You’ll be all
right.”
“Thank you for your concern, Grandma Rose,” said Jonathan,
wondering what an identity card looked like and how he’d ever get
food without one. “Would you mind if I pocketed a couple of extra
slices of bread before leaving?”
“Why sure, dear. Have as many as you like.” She went back into
the kitchen and returned with several slices neatly wrapped in a
napkin. She looked stealthily in both directions to see if any of her
neighbours were watching, then proudly handed them to Jonathan
saying, “Take good care of these. My son-in-law used to grow extra
wheat for our flour, but the Food Police just...”
“I know,” said Jonathan. “I’ll be careful not to show this bread
to anyone. Thank you for everything.” With a good-bye wave,
Jonathan stepped out on the street feeling warmed by the thought
that, if necessary, he had a home in this forbidding island.
114 Chapter 20 • Bored of Digestion
Brainstorming
• Are customers satisfied with the politicafes?
• How is the menu decided?
• Are truants and cooks treated properly?
• What would happen if food for the mind
were treated as this island treats food for the
stomach?
• Examples?
• Ethical issues?
Commentary
This chapter refers to government interference
in education systems. What if we treated food
for the stomach in the same way we are currently
treating food for the mind?
Children are treated as a standardised whole
instead of as personalities with individual
minds. Standardised compulsory schooling
stunts those children, who would blossom in an
entrepreneurial environment. As they lose interest
in school, the most adventurous youths may
disrupt the classroom. Many children are confined
to drab subjects with very limited opportunity for
expression.
We are told that compulsory schooling is
necessary as children have to be protected from
the poor judgement of their parents. This promotes
the idea that people cannot look after themselves,
that they must be dependent on the state, and that
they should fear personal responsibility.
So what we have is a huge government
department trying to find one method to fit
everyone; a large number of thwarted teachers;
and a mass of stifled children. This whole
unhappy situation is funded by unhappy taxpayers
who are falsely told that education is “free”! For
those people who pay for private schooling, taxes
for education are a double payment, and for those
with no children, an unnecessary expense. They
are told that they must still pay for the education
Make me the master
of education, and
I will undertake to
change the world.
Baron Gottfried vol
Leibnitz 1646 – 1716
Let our pupil be
taught that he does
not belong to himself,
but that he is public
property.
Benjamin Rush
115 Chapter 20 • Bored of Digestion
of others because an educated society benefits all
– even when government schools fail to educate
students.
The government could use taxes to pay for
private school tuition, but doesn’t. Why? Could
it be that the primary reason for government
intrusion is not to educate, but rather to control
the minds of its citizens?
Is this why they teach admiration for rulers
such as Napoleon – omitting that he sacrificed the
lives of hundreds of thousands to meet his own
ambitions? Is this why they do not teach children
about rational thinkers such as Frederic Bastiat,
the Frenchman who championed freedom?
Background
Ken taught at Hakodate University in Japan
where he wrote Shogun’s Ghost: The Dark
Side of Japanese Education. His article Should
We Shogunize the Schools? May be viewed at.
Another astonishing article of Ken’s derived
from a longer and annotated article that is
now available on-line at
gullible.com/REBELS.
References
Rose and Milton Friedman’s Free to Choose.
Mary Ruwart’s Healing Our World.
Education in a Free Society by Benjamin A
Rogge and Pierre F. Goodrich.
What the perfect world could look like:.
The Alliance for the Separation of School
and State movement organised by Marshall
Fritz:.
Education and child policies may be viewed at:.
... public schooling
often ends up to be
little more than
majoritarian
domination of
minority viewpoints
Robert B. Everhart,
Professor of
Education, University
of California, Santa
Barbara
The law pretends
that education can
only occur in an
approved classroom,
completely ignoring
the kind of incentives
that are expected to
motivate adults.
From Ken
Schoolland’s The
State, Obedience
Training, and Young
Rebels: In Defence of
Youth Rights.
Chapter 21
“Give Me Your Past or Your
Future!”
T
he town hall lay in the general direction of the square. Jonathan
thought he could take a shortcut down an alley that was piled
high with boxes and littered with trash. He hurried down the shaded
alley, trying to ignore his feelings of unease after leaving the bright
and busy street.
Suddenly Jonathan felt an arm at his throat and the cold metal of
a pistol stuck between his ribs. “Give me your past or your future!”
snarled the robber fiercely.
“What?” said Jonathan, shaking all over. “What do you mean?”
“You heard me – your money or your life,” repeated the thief,
shoving the pistol deeper into his side. Jonathan needed no further
encouragement. He reached into his pocket for his hard-earned
money.
“This is all I have and I need half of the money to pay the tax
collector,” pleaded Jonathan, carefully hiding the slices of bread
that Grandma Rose had given him. “Please leave me half.”
The thief relaxed her grip on Jonathan. He could barely make
out her face behind the scarf. In a low, harsh voice she laughed and
said: “If you must part with your money, you’re better off giving it
all to me and none to the tax collector.”
“Why?” he asked, placing the money in her dexterous, efficient
hands.
“If you give the money to me,” said the thief, stuffing the paper
kayns into a leather pouch tied at her waist, “then at least I’ll go away
and leave you alone. But, until the day you die, the tax collector will
take your money, the product of your past, and he’ll use it to control
everything about your future as well. Ha! He’ll throw away more
of your earnings in a year than all of us freelance robbers will take
from you in a lifetime!”
Chapter 21 • “Give Me Your Past or Your Future!” 118
Jonathan looked bewildered. “But doesn’t the Council of Lords
do good things for people with the tax money?”
“Oh, sure,” she said dryly. “Some people become rich. But if
paying taxes is so good, then why doesn’t the tax collector just
persuade you of the benefits and let you contribute voluntarily?”
Jonathan pondered this idea. “Maybe persuasion would take a
great deal of time and effort?”
“That’s right,” said the thief. “That is my problem, too. We both
conserve time and effort with a gun!” She spun Jonathan around with
one hand and tied his wrists together with a thin cord, then pushed
him to the ground and gagged him with his own handkerchief.
“There. I’m afraid the tax collector will have to wait.”
She sat down next to Jonathan, who wriggled but was unable to
move. “You know what?” said the thief as she counted the money.
“Politics is a kind of purification ritual. Most folks think it’s wrong
to envy, to lie, to steal, or to kill. It’s just not neighbourly – unless
they can get a politician to do the dirty work for them. Yeah, politics
allows everyone, even the best among us, to envy, to lie, to steal,
and even to kill occasionally. And we can all still feel good about
it.”
Jonathan twisted his face and made some noises. The thief
laughed, “So you’d like to yell, huh?”
Jonathan shook his head vigorously and, to her amusement, he
looked up with mournful eyes. “Okay,” she said, “Let’s hear you
whimper. But don’t get too loud,” she warned tapping the end of her
pistol firmly against his nose. “I can make you very uncomfortable.”
She crouched at his side and jerked the handkerchief below his
chin.
Stretching his jaw painfully Jonathan challenged her, “But it’s
wrong to steal!”
“Maybe. The important thing is to do it in a really big way so
that no one will notice that it’s wrong.”
“Steal a lot and no one will notice that it’s wrong?”
“Sure. Little lies are bad. Children are taught not to be little liars.
But really big liars can get streets named after them. If you steal a
little bit you might go to the people zoo. But if you steal a whole lot,
Chapter 21 • “Give Me Your Past or Your Future!” 119
I mean the whole countryside, then you get your name engraved on
buildings. Same with killing.”
“Killing, too?” recoiled Jonathan.
“Where have you been?” snapped the thief. “Killing one or two
people gets you time in the zoo or even executed. But killing a few
thousand makes you a heroic conqueror worthy of songs, statues,
and celebrations. Children are taught to admire and imitate big
killers. Act small and you’ll be scorned or forgotten. Act big and
you’ll be a legend in school books.”
“The oldest story of robbery that I can remember,” said Jonathan,
“was of Robin Hood. He was a hero because he robbed from the
rich and gave to the poor.”
“Whom did he rob – in particular?” she asked.
“The Sheriff of Nottingham and his friends,” recounted Jonathan.
“You see the Sheriff and Prince John taxed everyone into poverty.
The authorities took from both the rich and the poor. So Robin tried
to return the plunder to the victims.”
The thief laughed, “Then Robin wasn’t a robber. How can you
rob a thief?” She frowned and concentrated a moment. “That gives
me an idea,” she said. “I think I’ll pay a visit to Tweed.”
She abruptly replaced Jonathan’s gag, adjusting it to be especially
tight, and disappeared down the alley.
Jonathan lay helpless in the alley. He thought about the young
policeman that he had met the day before. Where was that guy when
he really needed him? How did the robber get a gun?
The thought of going back to the carnival in order to earn
the money all over again angered Jonathan. He kicked his heels
helplessly at the thought. One of the cords cut into the skin
on his wrist and Jonathan relaxed a moment to contemplate his
predicament. He thought, “I never knew how good it felt to have my
hands free – until now.”
120 Chapter 21 • “Give Me Your Past or Your Future!”
Brainstorming
• Does your life, liberty, and property,
correspond to your future, present, and past?
• In what way is a thief the same or different
from a tax collector?
• Why?
• How will the government use the product of
your labour, and your past labour to control
your future?
• Are small scale and large scale immorality
treated differently?
• Examples?
• Ethical issues?
Commentary
Your past is a part of the product of your time,
energy, and talent. Your present is your current
freedom of choice. Your future is your life to
come.
What does a thief steal from you? If you
labour in exchange for money, that money
belongs to you, and someone who initiates force
to take it from you is a thief. This is true whether
it is one thief acting alone or a large gang of
elected thieves acting together. Gangs may
implement laws to take from you, but this does
not make it morally right.
Do people in distress need our forced help?
You and I are able to decide for ourselves whom
we should help. Likewise, we should allow our
fellow citizens to make the same decision. So
who is promoting this offensive idea that we are
too unfeeling to help our neighbours when they
are in distress? These are the same officials who
are bound to special interest groups.
If money is not forcefully collected from
everyone, how are people in distress to be
helped? Our chosen religious organisations or
charities are particularly capable of distributing
The present-day
delusion is an attempt
to enrich everyone
at the expense of
everyone else;
to make plunder
universal under
the pretence of
organizing it.
Frederic Bastiat,
1850
You exist in time;
future, present, and
past. To lose your
life is to lose your
future. To lose your
freedom is to lose
your present. And to
lose the harvest of
your life is to lose the
portion of your past
that produced it.
Extract from
Jonathan’s Guiding
Principles.
121 Chapter 21 • “Give Me Your Past or Your Future!”
our voluntary contributions. Having our money
taken by governments to help others is inefficient
and ineffective. Out of every 100 kayns we are
forced to give, and after deducting expenses
for collection, committees, negotiations, and
distribution, only about 20 kayns will reach
the needy. Perhaps some of this will even go to
people who are not genuinely in need, but who
depend indefinitely on a guaranteed source of
welfare. Would you prefer to send 100 kayns to a
government agency to disperse for you or would
you prefer to give it directly to the people you
wish to help?
Background
Ken: We have a Kamehameha Day in Hawaii
celebrating the first king who killed thousands
to “unite” all eight Hawaiian islands under
his control. By that same token William the
Conqueror, and Genghis Khan are considered
exciting historical figures, despite their main
“accomplishments” – as mass murderers and
dictators.
References
Lugwig von Mises’s Human Action has
reference to crimes on a grand scale getting
praised.
Milton and Rose Friedman Free to Choose.
Mary Ruwart’s Healing Our World shows
how the poor could be made wealthier.
One murder makes
a villain; millions a
hero.
Bp. Porteus
?
In some ways, I
think that a criminal
is far more moral
than Congress. That
is, a thief will take
your money and
then be on his way.
Congress will take
your money and then
bore you with reasons
about why you should
be happy about it.
Walter E. Williams,
George Mason
University
“The most fascinating,
entertaining and readable
history I have ever seen.”
– Ken Schoolland
“How can we get such a
sensible book in every
Economics 101 course
around the country?”
– Stephen Moore, Club
for Growth
“One of the most original
books ever published in
economics.”
– Richard Swedberg,
University of Stockholm
“Lively and accurate, a sure bestseller.” – Milton Friedman
“I couldnt put it down! Humor permeates the book and makes
it accessible like no other history. It will set the standard.”
– Steven Kates, chief economist, Australian Chamber of
Commerce
“Unputdownable!” – Mark Blaug, University of Amsterdam
“Both fascinating and infuriating ... engaging, readable,
colorful.” – Foreign Affairs
Chapter 22
The Bazaar of Governments
J
onathan lay still in frustration. Mices reappeared, exploring gar-
bage cans in the alley. He sniffed at the bread in Jonathan’s pock-
ets. But a noise at the end of the alley drove him back into hiding
among the piles of junk.
A large brown cow wandered toward Jonathan. “Moo-o-o,”
lowed the cow. The bell on her neck clanged slowly as she moved.
Suddenly another cow appeared at the end of the alley, followed
by a rugged old man with a stick. “Get back here, you silly beast,”
grumbled the herdsman.
Jonathan wriggled and used his shoulder to nudge over a box
next to him.
The old man peered into the gloom. “Who’s there?” Seeing
Jonathan tied and bound, he rushed over to pull off the gag.
Jonathan breathed relief. “I’ve been robbed. Untie me!” The old
man reached into his pocket for a knife and cut the cords. “Thank
you,” said Jonathan, rubbing his sore wrists. He eagerly told the
man what had happened.
“Yeah,” said the rugged farmer, shaking his head. “You have to
watch everyone these days. I would never have come to town except
that I was told I could get help from the government.”
“Do you think the government will help recover my money?”
asked Jonathan.
“Not likely, but maybe you’ll have better luck at the Bazaar
of Governments than I did,” replied the old herder. His face had
more wrinkles than a prune and he wore rough clothes and goatskin
sandals. Jonathan felt reassured by his calm manner and direct
speech.
“What’s the Bazaar of Governments? Is it a place to sell cattle?”
asked Jonathan.
The old man frowned and contemplated his two placid beasts.
“That’s what I came to find out,” said the herdsman. “Actually, it’s a
Chapter 22 • The Bazaar of Governments 124
kind of variety show. The building is fancier than a bank and bigger
than anything I’ve ever seen. Inside are men pushing all sorts of
governments to handle a citizen’s affairs.”
“Oh?” said Jonathan. “What kind of governments are they trying
to sell?”
The herdsman scratched his sunburned neck and said, “There
was this one feller calling himself a ‘socialist’. He told me that his
form of government would take one of my cows and give it to my
neighbour. I didn’t care much for him. I don’t need any help giving
my cow away to a neighbour – when it’s necessary.”
“Then there was this ‘communist’ in a bright red shirt. He had a
booth next to the first peddler. He wore a big smile and kept shaking
my hand, really friendly like, saying how much he liked me and
cared for me. He seemed all right until he said that his government
would take both of my cows. It’d be okay, he claimed, because
everyone would own all the cows equally and I’d get some milk
if he thought I needed it. And then he insisted that I sing his party
song.”
“Must be some song!” exclaimed Jonathan.
“Didn’t have much use for him after that. I reckon he was going
to skim most of the cream for himself. Then I wandered across the
big hall and met a ‘fascist’ all dressed in black. Looked like he was
on his way to a funeral.” The old man paused long enough to shoo
one of his cows away from a rancid mound of rubbish.
“That fascist also had a load of sweet talk up front and a lot of
brazen ideas just like the other guys. Said he’d take both of my cows
and sell me part of the milk. I said, ‘What? Pay you for my own
cow’s milk?!’ Then he threatened to shoot me if I didn’t salute his
flag right then and there.”
“Wow!” said Jonathan. “I bet you got out of that place in a
hurry.”
“Before I could shake a leg, there’s this ‘progressive’ feller
sidling up to me and offering a new deal. He told me that his
government wanted to pay me to shoot one of my cows to reduce
the supply. He’d milk the other, then pour some of the milk down
the drain. Said he’d help me buy what was left at a nice high price.
Now what crazy fool would go and do a thing like that?”
Chapter 22 • The Bazaar of Governments 125
“Sure seems strange,” said Jonathan, shaking his head. “Did you
choose one of those governments?”
“Not on your life, sonny,” declared the herdsman. “Who needs
them? Instead of having them manage my affairs I’ve decided to
take my cows to the country market. I’ll trade one of them for a
bull.”
126 Chapter 22 • The Bazaar of Governments
Brainstorming
• Why does the herdsman trade one of his
cows to buy a bull?
• What are the similarities in the governments
that are offered?
• Are there examples of this behaviour in the
world?
• What ethical issues are involved in the use of
force?
Commentary
Government officials would like you to believe
they are able to manage your affairs better than
you can. One of the ways they subtly put this
across is with tall imposing buildings, statues,
and posters of politicians, thus suggesting that
the “little man-in-the-street” is inferior and his
problems are small by comparison.
Globally, governments are the largest receivers
and spenders of people’s money. Ostensibly this
is done for the “common good” of the people,
but one wonders if people wouldn’t be better off
if they spent this money themselves.
Socialism promises to look after you from
the cradle to the grave. That sounds good – no
more worries! However, this “nanny” never lets
you grow up and makes all decisions for you.
These states control when and how you work,
then they take a large amount of your earnings
to look after you. You don’t even have to worry
about charity, as government forces you to pay
for charities of their choice. The government
would kind-heartedly use your earnings to make
sure that even the laziest citizen has exactly the
same food, clothing, books, and toys as you have.
This nanny considers any criticism unpatriotic
and ungrateful.
Apartheid was a variation of socialism –
national socialism, to be precise. The Apartheid
state was an orgy of social engineering. It
So long as we admit
that the property of
individuals lies at the
mercy of the largest
number of votes, we
are intellectually and
morally committed to
state socialism.
Auberon Herbert,
1897
127 Chapter 22 • The Bazaar of Governments
exercised massive state intervention in the
personal and economic lives of millions. It
declared war on free markets by dictating prices
and wages.
The communist doctrine teaches that
everything must be communal. “Share, share, and
share alike!” sounds good. You are encouraged
to work hard because whatever you produce
belongs to your neighbour and everyone else.
Except that in reality it doesn’t belong to you or
anyone in particular. It belongs to the state and to
state officials who have the power to decide how
much to keep for themselves, and how much you
and your work-shy neighbours “need”. Need, in
this case, means having just enough to be sure
everyone shares the same low basic standard of
living – except for state officials who will assert
that their “needs” are higher than everyone else’s.
Of course, you will be dealt with brutally if you
are unpatriotic enough to criticize the system
and do not sing the praises of the state.
The fascist government does not pretend to be
working for the good of the individual citizen. It
forces each citizen to work patriotically for those
in power. Thus, it collectively treats individuals
as a mass and controls the whole.
Interventionist governments imagine the
individual is incapable of working out his own future
and production. These governments intervene in
the economy by working in conjunction with their
favoured business “partners” to control supply and
demand in the economy. As with the ‘New Deal’ it
keeps prices high – even if this means they have to
destroy animals or crops.
Self responsibility. Thankfully, there is a
growing realisation that people prosper best
when they are left to take responsibility for
their own outcome without state and foreign
intervention. Not only will they prosper, but
there will be greater satisfaction, happiness and
international peace.
It was only one life.
What is one life in the
affairs of a state?
Fascist Dictator
Benito Mussolini
What is the best
government? – That
which teaches us to
govern ourselves.
Goethe
The theory of
Communism may be
summed up in one
sentence: Abolish all
private property.
Karl Marx and
Friedrich Engels
The history of the
great events of this
world is scarcely
more than the history
of crimes.
Voltaire
128 Chapter 22 • The Bazaar of Governments
Background
This chapter originated from an anonymous
office memo: Farmer sells one cow to buy a bull
to produce more cows.
The idea of buying farm products to keep
them off the market and so raise prices, originated
with President Hoover’s Farm Stabilisation Act.
This was expanded to most major crops under the
“progressive” New Deal program of President
F. Roosevelt. While millions of consumers
went hungry during the Great Depression, the
Agricultural Adjustment Act began a programme
to pay farmers to destroy millions of acres of
food crops and cotton, and to destroy millions of
pigs and cattle. Officials eventually paid farmers
not to produce food, which had the same effect
as destroying it, but the effect was less visible.
Skilful use of the media portrayed President F.
Roosevelt as a man who cared about the poor
and downtrodden, despite making their condition
much worse with higher prices and less food
and cotton. In the 1950s, thousands of farmers
were fined for the “crime” of growing too much
food. These programmes have expanded in
various forms up to the present under both major
political parties.
References
Murray Rothbard’s For a New Liberty gives
some great alternatives and philosophy.
The Making of Modern Economics: The
Lives and Ideas of the Great Thinkers, by Mark
Skousen, is a provocative and humorous analysis
of the many schools of economic thought. He
reveals many surprising things about these not-
so-dismal characters, who shaped economic
policy over the past two and a half centuries.
To find out where you stand in your political
opinion, download “The World’s Smallest Political
Quiz”:.
If government
consistently
chose policies
that supported
entrepreneurial effort
and greater consumer
choice, they would
make their countries
inconceivably rich.
Jim Harris
?
In the ideal
socialist state, power
will not attract power
freaks. People who
make decisions will
show not the slightest
bias towards their
own interests. There
will be no way for a
clever man to bend
the institutions to
serve his own ends.
And the rivers will
run uphill.
David Friedman 1973
Chapter 23
The World’s Oldest Profession
T
he old herdsman’s tale left Jonathan more perplexed than ever.
The Bazaar of Governments sounded intriguing, so he decided
to go and see if anyone could help him get his money back.
“You can’t miss it,” said the old herdsman, preparing to lead his
cows away. “It’s in the Palace, the biggest thing on the square. You
take the main portal – that’s for you – flanked by two enormous
windows. The window on the right is where people line up to pay
their tax money in. The window on the left is where people line up
to take tax money out.”
“I can guess which line is more popular,” joked Jonathan.
“That’s for sure. Every month, one line gets a bit shorter and the
other gets a bit longer.” The old man tightened the hitches and gave
a tug on the lead. “Eventually, when one line disappears, the other
will too.”
Sure enough, all streets led to the Town Square. On the square
stood a magnificent palace. Words carved in stone over the huge
entrance read: “PALACE OF LORDS.” Mices, his tail standing
straight up, had followed close to Jonathan’s heels until he started
up the broad steps leading into the building. The cat’s back arched
slightly and his hair bristled. This was as far as he would go.
Jonathan trotted up the steps until he stood before the grand
entrance. Spread out before him was a gloomy hall with ceilings
so high that the lamps could not light the interior completely. Just
as the old herdsman described it, several booths lined the hall,
displaying different banners and flags. People paced before the
booths calling to every passerby and pressing pamphlets on them.
On the far side of the hall stood a great bronze door, flanked by
large marble statues and fluted columns. Jonathan started to walk
through the hall, hoping to avoid the sellers of governments. He had
not moved two steps before a mature woman with gold bangles on
her wrists and large earrings accosted him.
Chapter 23 • The World’s Oldest Profession 130
“Would you like to know your future, young sir?” she asked,
approaching him.
Jonathan looked suspiciously at this voluptuous woman wearing
vividly coloured scarves and heavy jewellery. He quickly checked
his pockets, though he had nothing more to lose.
She continued aggressively, “I have the gift of foresight. Perhaps
you’d like a glimpse of tomorrow to calm your fears of the
future?”
“Can you really see into the future?” asked Jonathan backing off
as far as he could without offending her. He regarded this brazen
woman with deep suspicion.
“Well,” she replied, her eyes flashed with confidence, “I study
the signs and then I declare, affirm, and profess whatever I see to be
true. Oh yes, mine is surely the world’s oldest profession.”
“Fortune-teller?” remarked Jonathan, surprised at the claim. “Do
you use a crystal ball or tea leaves or ........”
“Beelzebub, no!” snorted the woman with disgust. “I’ve become
much more sophisticated. Nowadays I use charts and calculations.”
With a deep bow she added, “Economist at your service.”
“How impressive. E-con-o-mist,” he repeated slowly, rolling the
long word over his tongue. “I’m sorry, I’ve just been robbed and I
don’t have any money to pay you.”
She looked annoyed and turned away to look for other
prospective clients.
“Please ma’am, could you tell me one thing,” pleaded Jonathan,
“even though I don’t have anything to pay you?”
“Well?” said the woman, irritably.
“When do people usually come to you for advice?”
She looked around to see if anyone might overhear them. Then
she whispered, “Because you have no money to pay me, I can let
you in on a little secret. Clients come whenever they need to feel
secure about the future. Whether the forecast is bright or gloomy –
especially when it’s gloomy – it makes people feel better when they
can cling to someone else’s prediction.”
“And who pays for your predictions?” asked Jonathan.
Chapter 23 • The World’s Oldest Profession 131
“The Council of Lords is my best customer,” she replied proudly.
“The Lords pay me well – with other people’s money, of course.
Then they use my predictions in their speeches to justify the taking
of more money to prepare for the murky future. It really works out
well for both of us.”
“That must be quite a responsibility,” said Jonathan. “How
accurate have your predictions been?”
“You’d be surprised at how few people ask me that,” chuckled
the economist. She hesitated and looked him carefully in the eye.
“To be perfectly truthful, you might get a better prediction with the
flip of a coin. The flip of a coin is something that anyone can do
with ease, but it never does anyone any good. It will never make
fearful people happy, it will never make me rich, nor will it ever
make the Lords powerful. So you can see, it’s important that I
conjure impressive and complicated forecasts to suit them or they
find someone else who will.”
“Hmm,” thought Jonathan. “It is the world’s oldest profession!”
132 Chapter 23 • The World’s Oldest Profession
Brainstorming
• Are there similarities between some fortune-
tellers and some economists?
• What percentage of these can accurately
predict the future?
• How can you tell?
• How could presumed knowledge about the
future make people rich or powerful?
• Do professionals ever put their talents to
unworthy use?
Commentary
Each of us is our own economist. We can’t ever
be perfectly “well-informed” about our economic
life. We might take guidance as we choose, no
matter how “silly” it may seem to others. We can
do this because we take responsibility for our
own judgement with our own money.
Likewise, when a private company commits
itself to a forecast, it is punished or rewarded
by the market. However, government forecasts
are imposed on all of us, using our money.
Official forecasters are rarely punished for poor
judgement, but taxpayers are always punished.
It is misleading to suggest that officials have
the ability to correctly forecast the government’s
financial situation. They study “the signs” and
devise convoluted calculations together with
sophisticated rules of prediction and mystifying
charts. They then use all of this to befuddle most
of the public and justify what the government
wishes. However, it is impossible to forecast
a country’s financial future when politicians
control the treasury and the government bank
manipulates the money supply and inflation.
It is usually in times of uncertainty that we
mistakenly turn to government forecasters for
comfort. Yet these officials are the very people
who seduce us into a false sense of security.
They are not paid to reveal the behind-the-scenes
Profits,
not prophets, foretell
the future.
Anonymous
133 Chapter 23 • The World’s Oldest Profession
“little secrets” – those secrets which could ruin a
lifetime of savings and leave us destitute. In the
marketplace you can sue people for fraud, but
not in politics. Politicians seem to be rewarded
for fraudulent behaviour.
An economy free of political interventions
would be less vulnerable to fluctuation and,
perhaps, easier to predict. Thus, we could make
timely adjustments.
Background
Ken: My original thought was that economists
(e-con-o-mist, frauds and obfuscation) sell
their virtue, “prostitute themselves”, to those in
government to get a paycheck and prestige. Also,
Austrian economists often scorn predictions as
fortune-telling.
Beelzebub – heathen oracle – Bible (Kings);
also used in John Milton’s Paradise Lost.
References
Two books by Mark Skousen, The Making of
Modern Economics: The Lives and Ideas of the
Great Thinkers, and Economics on Trial: Lies,
Myths, and Realities. In the latter book, Skousen
takes the ten top selling economics textbooks in
America and reveals their flaws. He argues that
almost all of the economics taught in American
universities carries a strong bias in favour of
government interventionism. Debunking this
notion is his particular talent.
Parliament of Whores: A Lone Humorist
Attempts to Explain the Entire U.S. Government
by P. J. O’ Rourke.
It’s Getting Better All The Time – 100 Greatest
Trends of the Last 100 Years by Julian Simon.
?
Economist: a
person who can tell
you what is going
to happen next month
and explain later why
it didn’t.
Using governmental
force to impose a
vision on others is
intellectual sloth and
typically results in
unintended, perverse
consequences.
Extract from
Jonathan’s Guiding
Principles
Chapter 24
Booting Production
“T
his must be the seat of power,” said Jonathan to himself,
staring in awe at the splendid marble statues and columns.
“Why, they must have spent a fortune building this place!”
One great bronze door stood wide open and Jonathan could see a
cavernous auditorium filled with people. Slipping in unobtrusively
and standing at the back, Jonathan could see a platform in the centre.
A group of dishevelled and noisy men and women surrounded the
platform waving their hands. In front of them stood a distinguished
looking man who wore an expensive suit and drew occasional puffs
on a fat cigar. He gestured with his cigar at one of the people in the
crowd milling before him.
Jonathan crept closer to hear. One man, waving a pen in one
hand and a pad of paper in the other, shouted over the others, “Your
Honour, sir! Most esteemed High Lord Ponzi, sir! Is it true that
you have just signed legislation to pay shoemakers not to produce
shoes?”
“Ah-h-h, yes, it most certainly is true,” answered Lord Ponzi,
with a superior nod. He spoke so slowly that he appeared to be
waking from a deep sleep.
“Isn’t this something of a path breaker, a precedent?” asked the
man, scribbling furiously on his pad.
The High Lord solemnly nodded again in slow motion. “Uh, yes,
this is a path break...”
A woman standing to the right of the first questioner interrupted
before he could finish, “Is this the first time in the history of
Corrumpo that shoemakers have been paid not to produce?”
“Yes,” said Ponzi, “I do believe that is correct.”
From the back, someone shouted, “Would you say that this
programme will help raise the prices of all kinds of footwear –
shoes, boots, sandals, and so on?”
“Uh, yes, well – would you repeat your question?”
Chapter 24 • Booting Production 136
Another voice called out, “Will it raise shoe prices?”
“It will raise the income of shoemakers,” replied the Lord, who
nodded ponderously. “We certainly hope to do all we can to help the
shoemakers in pursuit of a reasonable standard of living.”
Jonathan thought of Davy and his mom. “How much harder it’ll
be to buy shoes from now on!”
Then a reporter, kneeling and mostly hidden by the throng,
shouted from the very front of the platform, “Can you say what your
programme will be next year?”
Ponzi mumbled, “Uh, hmm, what did you say?”
“Your programme. What’s your plan for next year?” asked the
reporter impatiently.
“Of course,” said the High Lord, pausing to draw deeply from
his cigar. “Uh huh. Ahem. Well, I believe that it is appropriate for
me – to take the opportunity of this special press conference – to
announce that next year we plan to pay everyone on the great island
of Corrumpo not to produce anything.”
There was a collective gasp from the audience. “Everyone?”
“No kidding?” “Wow! That’ll cost a fortune!” “But will it work?”
“Work?” said Lord Ponzi, shaking himself out of his stupor.
“Will it stop people from producing?”
“Oh sure,” he barely concealing a yawn. “We’ve had a pilot
project in our front agency for years, and,” said the Lord, a
note of sleepy pride crept into his voice, “We’ve never produced
anything.”
At that moment, someone came up beside High Lord Ponzi
and announced the end of the conference. The group of reporters
surrounding the platform dissolved, abandoning the crowd seated
in the auditorium. Jonathan blinked hard twice when he noted
an almost imperceptible, sudden droop in Ponzi’s posture – as if
someone had snipped a string overhead that was holding him erect.
The house lights dimmed as Ponzi was led off stage to a smoke-
filled, back room.
137 Chapter 24 • Booting Production
Brainstorming
• Why are people paid not to produce?
• Would you take a job that paid you to do
nothing?
• Would you pay others to do nothing?
• Would you take welfare that paid you to do
nothing?
• Are there examples in the world?
• Ethical issues?
Commentary
By convincing people they have a right to get
“something for nothing” governments are able
to interfere with production.
Subsidies, minimum wage laws, restrictions
on hours of work, affirmative action, licensing
laws, government monopolies, etc., all increase
prices, reduce employment opportunities, and
interfere with production.
To see if all this would really “boot-out”
production, we just need to extrapolate the
situation by applying it to all areas of industry.
If all production were subsidised; if everyone
were restricted to confined working hours; if all
firms were restricted to employ equal numbers
of people of each skin colour group, of each
religious group, of each mental and physical
group; if all jobs required licenses; or, if all
sectors were under government monopolies –
would there be more production?
By asking governments to introduce more
restrictions and more laws, we are harming our
fellow citizens and ourselves. More restrictions,
and more laws, we are supporting the slothful
and encourage the grabbers-for-nothing, remove
incentives, and dampen initiative. If we pay
people because they are unemployed, we will
have an increasing number of people who are
out of work.
We have a system that
increasingly taxes
work and subsidizes
non-work.
Milton Friedman,
1977
... In Poland
permission from the
Labour Ministry
is needed to be
employed.
Polish government
spokesman, Jerzy
Urban, 1983
138 Chapter 24 • Booting Production
Freeing production from interference would
encourage the employers and the employees to
help each other toward beneficial production.
The result would be better quality products,
better consumer satisfaction, more job creation,
more job satisfaction, and more wealth for all.
Background
In the early 1900s, Charles Ponzi “operated”
the first fraudulent “pyramid” investment con
in which money from new investors is directly
and immediately used to “pay off” the original
investors. This goes on until no new “investors”
are found and there is no money to pay earlier
investors in the “pyramid”. The American
Congress made these fraudulent con games
illegal, except the government’s own “Social
Security” game. If the laws of fraud were applied
to the people in government, they would all be
in jail.
References
When we use laws to increase the wealth of
disadvantaged workers, we succeed only in
making them poorer, explains Mary Ruwart in
Healing Our World – Chapter 3.
Also see:
#domestic_issues.
?
Government
officials have had
non-production on
their agenda for
years. It is they
who are paid not to
produce!
Government can
neither guarantee
useful and profitable
work, nor provide it,
nor compel it.
Henry Hazlitt, 1971
Chapter 25
The Applausometer
A
lone spotlight cast a circle of light on the empty platform and
the audience began to murmur. Someone began to clap rhyth-
mically and soon the crowd joined in. The whole place reverber-
ated with excitement and noise. At last, a robust figure with slick,
jet-black hair, leaped onto the platform. He wore a glittering gold
sequined suit and the silliest smile that Jonathan had ever seen. The
man bounded back and forth like a cat across the stage as he greeted
the excited crowd.
“Welcome, welcome, welcome! I’m Showman Phil and I’m
thrilled to have you wonderful people here with me today on our
show. And what a show we have for you, too. Later we’ll be talking
to – you guessed it – the Candidate!” Scantily clad women standing
on both sides of the stage started waving their hands wildly, and the
whole crowd broke into thunderous applause.
“Thank you, thank you, thank you very much. First, I have a
very, very, very special treat for you. We have none other than the
Chairperson of the Corrumpo Election Commission here with us
to explain the revolutionary new election procedures that we’ve all
been hearing about.” At this point, the host turned and, with a grand
sweep of his arm up stage, yelled, “Will you all please welcome
Doctor Julia Pavlov!”
The stagehands and the crowd again clapped wildly, cheering
and whistling their excitement. Showman Phil shook Dr. Pavlov’s
hand and signalled for silence. “Well, well, Dr. Pavlov, you certainly
seem to have built quite a following over the years.”
“Thank you Phil,” she said. Dr. Pavlov wore thick spectacles, a
stiff grey suit, and a look of calm assurance on her squarish face.
“I’d say it’s about 5.3 enthusiasm.”
“Hey, hey, you’ve got me there,” said the host. The stage
assistants flashed a sign to the audience and they all let out a slight
Chapter 25 • The Applausometer 140
burst of laughter. “What do you mean ‘5.3 enthusiasm’?” asked
Phil.
“Well,” said Dr. Pavlov, “I have here an official applausometer.
I always carry one around with me. It tells me just how much
enthusiasm is shown by crowds of people.”
“That’s incredible, isn’t it folks?” On cue, the crowd again
eagerly applauded.
As soon as the noise subsided, Dr. Pavlov continued, “That’s
about 2.6.”
“Amazing!” said the hosts. “What are you going to do with the
applausometer? Are you using it in the next election?”
“That’s right, Phil. We at the Corrumpo Election Commission
have decided that counting votes is not enough. It’s not just numbers
that are important in deciding morality, power, wealth, and rights.
We also feel that enthusiasm should count too.”
“That’s incredible!” shouted Showman Phil. Everyone broke
into applause.
“4.3,” said Dr. Pavlov passively.
“How are you going to do this, Doctor?”
Her thick eyebrows rose above her glasses and the first glimmer
of a smile crossed her stern face. “This will be the first year of using
applausometers at the election polls in the city. Instead of filling out
ballots, voters will just stand in booths and applaud when a light
comes on next to the name of the candidate of their choice.”
“What do the candidates think of this new balloting procedure?”
asked Phil.
“Oh, they love it, Phil. It seems that they have already been
getting their supporters ready for the changeover. They spend
long sessions promising to spend other people’s money on their
supporters and the promises always bring down the house.”
“Well, thank you very much for being with us today and giving
us a preview of a better tomorrow. Join us again, won’t you? Ladies
and gentlemen, let’s hear it for Doctor Julia Pavlov!”
When the applause finally died down again, the host made
another sweep of his hand toward the back of the stage. “Now for
Chapter 25 • The Applausometer 141
the moment you’ve all been waiting for. Yes, right off the busy,
busy campaign trail – here’s Joe Candidate! Let’s hear it!”
Joe Candidate bounded athletically across the stage with both
arms wide, beaming incandescently at the crowd. The candidate
wore a stark black-and-white chequered suit. Jonathan thought
he had the blackest hair and whitest teeth ever to shine under a
spotlight. “Thank you, Phil. This is a really great moment for me to
be here with all you fine people.”
“Now Joe, you’ve just got to tell us the story behind the big
story. You surprised everyone and hit the headlines with the hottest
news on the island in over a decade. So what’s the story?”
“Right to the point, huh, Phil? I like that about you and your
show! You see, I became alarmed at the tremendously high cost of
political campaigns in recent years. So I decided to do something
about it. I firmly believe that the voters of this great island deserve
a bargain price for more of the same. That’s when I started the
Generic Party.”
“The Generic Party! What a brilliant idea! And you even changed
your own name, didn’t you?”
“That’s right, Phil. With my real name, Elihu Root, I could
never really be the true people’s candidate. You’ve got to cover your
roots...” The impromptu pun drew a roar of laughter from everyone,
including Phil and Joe. “But seriously, Phil,” continued Joe, “you
must have broad appeal if you’re going to be credible.”
“What are you doing to get the word out, Joe?”
“The Generic Party will soon have its basic black-and-white
flyers, buttons, and posters available at all local outlets. We hope to
cut the typical campaign budget in half with our ideas.”
Showman Phil interrupted, “But do you have a stand on the
issues?”
“Sure, just like all the other parties,” said Joe. He reached inside
his checkered coat and pulled out a sheaf of papers. “Here’s our
White Paper on Crime and here’s our White Paper on Poverty.”
“But, Joe, there’s nothing on these white papers,” said Phil, with
an incredulous look. The White Papers were simply plain sheets of
white paper.
Chapter 25 • The Applausometer 142
“That’s the beauty of it, Phil. Don’t you see? Why waste time
promising everything to everyone? Why not let voters fill in the
papers themselves? Promises and performance will be just as before
– only we save the cost of printing.”
“How ingenious! While other candidates talk about cutting
campaign costs, you really do something about it. Well, our time is
running out. Can you sum up what your party is all about?”
“Sure, Phil. It’s already catching on all across the island. Our
slogan for the Generic Party is, ‘We Believe What You Believe!’ “
“Thank you very much, Joe. Ladies and gentlemen, can we have
a really great round of applause, a high 5.5, for that genius of the
campaign trail, Joe Candidate!”
143 Chapter 25 • The Applausometer
Brainstorming
• Why would a political party say, “We believe
what you believe”?
• Is it logical to decide morality, power,
wealth, and rights by the enthusiasm of
applause?
• Is it logical to decide these things by the
numbers of votes?
• What is the best basis for determining these?
• Examples?
• Ethical issues?
Commentary
A voter’s only power over a ruling party is the
vote he or she gets once every four or five years.
Even at that time, the ruling party still has the
upper hand as it will adapt the voting methods
to suit itself. The stronger the party the more
it can manipulate voting regulations. Election
commissions are often set up to organise the
voting. Although these commissions are meant
to be independent, they have to contend with a
great deal of pressure from those in power.
There are a variety of ways voting can be
structured. Many variables may be shifted
to benefit those in power. The commission
determines who is allowed to vote. For instance,
they might, or might not, allow citizens
temporarily staying outside the country to
vote. The physical boundaries of the voting
constituencies may be re-drawn or combined to
include more voters of the favoured party into an
area known to be less supportive.
The result of the voting leads to various
interpretations. A 51% majority means that 49%
do not want to be represented by that person or
party. Should the 51% be allowed to implement
laws over the beliefs, morals, ethics, family,
and property of the remaining 49%? At times
fewer than half the population go to cast their
You have a right
to seek leaders for
yourself, but you have
no right to impose
rulers on others.
Extract from
Jonathan’s Guiding
Principles
Too often, in recent
times, the name of
democracy has been
misused to describe
situations where a
vote is taken without
free and fair debate
beforehand, and
where those who have
won 51% of the vote
claim the right to ride
rough-shod over the
other 49%
Kofi Annan at
the closing of the
Organisation of
African Unity in
Durban, July 2002
144 Chapter 25 • The Applausometer
vote because they do not have confidence in the
system. This means there are even fewer people
wanting that person or party to make decisions
for them.
It is obvious that the percentage game will
not create respect, harmony, and prosperity.
Respect, harmony, and prosperity are far more
likely to occur if there is individual freedom
– freedom of speech, freedom of association,
freedom of beliefs, freedom of choice over one’s
life, body and property. Removing the laws that
prevent these free choices will result in the need
for only a small administrative government. And,
like those governments in Switzerland, Hong
Kong and New Zealand, only a few government
departments would be needed for police, courts,
and defence. Fewer departments mean fewer
civil servants. Fewer civil servants mean less
corruption, fewer taxes, more wealth for the
citizens, and a more energetic economy.
Candidates from every political party might
read this with horror. They would lose their
privileges, their tax-paid cars, tax-paid housing,
tax-paid overseas trips, and tax-paid dinners.
No wonder they rush around on “busy, busy”
campaign trails before the election. No wonder
candidates from all parties tell the voters what
fine people they are. No wonder that they all
say voters are well qualified to make decisions.
And yet, after the election, candidates will treat
the voters like imbeciles who cannot make their
own moral decisions or make financial choices
for their own good.
Whatever degree of democracy we live in,
we have one chance to use our vote to ensure
that we restrain the strongest and most powerful
party from turning towards a dictatorship.
Once cast, there is no way for the voter to
change his or her mind until the next election and
they have no way of enforcing election promises.
Just like a generic tablet, each party promises the
same thing. Just like the generic tablet, once you
If the natural
tendencies of
mankind are so bad
that it is not safe to
permit people to be
free, how is it that the
tendencies of these
organisers are always
good? Or do they
believe they are made
of finer clay?
Frederic Bastiat,
The Law
?
Politicians are
the same all over.
They promise to build
bridges even when
there are no rivers.
Attributed to Nikita
Khrushchev, Soviet
Union Premier,
1958 – 1964
145 Chapter 25 • The Applausometer
have swallowed it, it is in the system, and there
is no control over what happens after that.
Background
Ken: There was no particular reason for using
“Elihu Root” here, except the pun (getting back
to one’s roots). I was looking for the name of a
person in US history who was a power behind
a politician, in this case President Theodore
Roosevelt.
Ivan Pavlov conducted experiments which
dealt with conditioning dogs’ behaviour to
salivate at the sound of a ringing bell and thus
the expectation of food. The use of sound can
also train humans – an angry or kindly voice,
loud noises, music, etc. Pavlov’s ideas played a
large role in the Behaviourist theory of human
psychology.
References
In The Law, Frederic Bastiat eloquently dealt
with the subject of voting. The full text of this
book may be seen at:
the_law.html.
?
A politician gets
money from the rich
and he gets votes
from the poor with
the argument that he
is protecting each
from the other.
Chapter 26
True Believer
A
s the applause began to fade, Joe Candidate just stood there
motionless. Eager to keep the action rolling, Showman Phil
tapped Joe on the arm and nudged him toward the exit. Joe just
smiled and wouldn’t budge. So Phil raised his arms to silence the
audience.
Joe spoke up. “I have someone I want you to meet.”
“Sure, Joe, of course, but we don’t have much time.”
“It’ll only take a minute. I have to tell you about one of our
generic voters – our number one generic voter.” Joe turned to the
side and motioned to someone offstage. No one appeared but Joe
continued to gesture gently, as if coaxing a shy toddler. Finally, a
pale, elderly woman appeared, at first gripping a fold of the curtain,
then tentatively stepping forward.
Phil immediately dashed over to welcome this small figure and
pull her forward. “Ladies and gentlemen,” said Phil nervously, the
shyness of the woman showing up his false enthusiasm, “aren’t we
lucky to have a bonus today? And who have we here?”
The old woman, wearing a simple black-and-white checkered
dress, made Joe look like a caricature. Her pale face was nearly
expressionless, her eyes blank and empty. Her salt-and-pepper grey
hair was neatly combed over her ears. She gripped a little black-
and-white bag tightly as if it held her most valuable treasures.
When she reached Joe, he began to speak evenly. “As you know,
Phil, the island’s voting record has been dismal for years, but that
hasn’t discouraged our guest, Phoebe. Phoebe just happens to be the
record-breaking voter in Corrumpo!”
Phil’s eyes widened in astonishment. “Oh, I know about you!
I’ve heard so much about you, ma’am. This is none other than
the reigning voter of all time; the record holder of balloting; the
champion of island mandates. Ladies and gentleman, we are truly
blessed with the presence of none other than, Phoebe Simon!”
Chapter 26 • True Believer 148
Again, the crowd responded to its handlers with generous
applause, though some were sneaking out the back door. Others
covered their yawns behind their programmes.
“Phoebe,” said Showman Phil, “I have a question that I’m sure
is on everyone’s mind?” And he paused. Stillness descended on the
auditorium. Projecting his voice so that everyone would hear, he
said, “Why do you vote so consistently?”
With a look of pure innocence, Phoebe replied in a soft, sweet
voice, “Well, sir, it’s my duty to vote – this is what the Council tells
me. They say it doesn’t matter who I vote for, so long as I vote. So,
I vote. I have voted in every single election since I was first eligible
fifty years ago today.”
“Wow!” replied Phil. “Fifty years! Isn’t that incredible, folk!”
Once again the audience clapped. “But let me ask you the ultimate
voter question, Phoebe. There’s a saying: ‘The lesser of two evils
is still evil’. Now tell me truthfully, Miss Simon, do you vote even
when you don’t like any of the candidates?”
“All the time, sir. My daddy once told me that if I didn’t vote,
then I’d have no right to complain about elected officials. I vote to
protect my right to complain.”
“How about that, folks! Now tell me honestly, Miss Simon, do
you believe Joe’s promises?”
“Of course, I believe. I always believe. If I didn’t believe, why
would I vote for him?”
“Do you know what the pundits are saying about you? They
claim that you are the last true believer on Corrumpo?”
“Yes, sir, I’ve heard about them.” Phoebe replied almost too
softly to be heard. “I believe them, too. I believe you. I believe
everyone.”
Turning to the crowd, Phil placed a hand over his heart and
exclaimed, “Ladies and gentlemen, have you ever heard anything
so tender, so childlike. Isn’t it wonderful that innocence can still be
found on our all-too-cynical island?” Then returning to his guest
he asked, “And, Phoebe Simon, did your representative ever fail
you?”
“Oh sure,” shuddered Phoebe. “He always fails. Time and
time again. He has hurt me so many times. But I stand by my
Chapter 26 • True Believer 149
representative, no matter what.” She seized Joe’s arm and pressed
tightly to him. “And I will forever. I can’t imagine life without Joe
and all my ex-reps before him!”
Then someone from the audience shouted, “Why believe after so
much heartache?”
She looked at Joe painfully and replied, “I believe that he is good
at heart. He means well. I believe he can change – I can help him
change. I believe that deep down he really cares about me. He just
doesn’t understand me.”
“Aaah!” sighed the audience in unison.
“Folks, this brings tears to my eyes. But, Phoebe, these are tears
of concern as much as of joy. Some in your family have tried to get
you to join Voters Anonymous.”
“Oh no, sir!” she said shrinking. “Voters Anonymous is for
people with a problem. I don’t have a problem. Do you think I have
a problem?”
“Phoebe, some experts declare that abused voters always keep
returning to their reps no matter how much they suffer.”
Looking up at Joe trustingly she asked, “Do I have a problem,
Joe? I don’t think so.” Seeing him smile, she gushed, “I stand by my
rep.”
A bell rang off stage alerting Phil that they were out of time. Phil
shouted for all to hear, “Where would we be without true believers
like Phoebe Simon? Well, ladies and gentlemen, that’s all the time
we have. Thank you so much for joining us. Let’s all show Phoebe
Simon and Joe Candidate how much we love them both!”
The crowd broke into an enthusiastic cheer, happy that the real
show was about to begin.
150 Chapter 26 • True Believer
Brainstorming
• Why do voters usually vote for incumbents?
• Are politicians trustworthy?
• Does one have a right to complain about
politics if one does not vote?
• Is there any parallel between the behaviour
of abused spouses and abused voters?
• Ethical issues?
Commentary
Confusion can occur between “the right to vote”
and “a duty to vote”. Every citizen has the right
to be allowed to vote, but there is not a duty to
do so.
Why do people vote for the same candidate
or party at each election? Sometimes it is
because their parents did (traditional), or
because “everyone” in that community does
(fashionable). Some people are just too busy
trying to keep their lives together to “be
bothered” about politics (uninterested).
Sometimes a party becomes frighteningly
powerful and people are fearful. Those people
who do not enjoy making their own decisions or
who dislike change (even if it is an improvement)
will vote for the strongest party in order to
keep the established order. In some societies
conflict is distasteful, so it is felt that voting for
the strongest party is a way of keeping society
amicable.
Voting or not voting is a personal choice.
There is no duty to vote. Voters who feel limited
or unhappy about their choices, or feel voting
has become meaningless, may decide not to
vote. However, even if you do not vote, you still
have the right to make a complaint. Intentionally
not voting is also a valid statement to make.
However, it could be a protest or apathy, for
which rulers sometimes hope.
Democracy becomes
a government of
bullies tempered by
editors.
Ralph Waldo
Emerson
We go by the major
vote, and if the
majority are insane,
the sane must go to
the hospital.
H. Mann
151 Chapter 26 • True Believer
In desperation, others show their disapproval
by making the effort to vote and spoil their ballot
paper on purpose. However, politicians could
construe this as being the voters’ ignorance of
voting procedure.
Some people vote because it is the only means
of self-defence they have against the impositions
of the state. Few of these people believe that the
person or party for whom they are voting will
actually carry out their promises. Thinking back
to the poster promises from the previous election
would make it clear that promises were not kept.
Despite the harmful lies, some abused voters, like
abused spouses, often keep returning to vote for
the biggest, strongest party.
Most people prefer to make up their own
minds, but this can be difficult when governments
use their power of control and intimidation
to influence reports, radio, television, and
universities. People in the government-owned
or subsidised media often promote government
propaganda because government provides their
bread and butter.
Some voters choose to prevent a certain
amount of future abuse by voting for a party other
than the strongest party (or parties). Increasing the
influence of smaller parties can upset the collusion
tactics between powerful politicians and special
interest groups. This prevents the established
“old order” from becoming entrenched. With this
option, voters might prevent a dictatorship of one
person or one party. Political competition might
result in less corruption, fewer restrictive laws,
and more individual freedom.
Background
Simon from the game “Simon Says”.
References
For the psychology of voting, see A Liberty
Primer by Alan Burris.
You do not rent your
life from others who
demand your
obedience.
Extract from
Jonathan’s Guiding
Principles.
Chapter 27
According to Need
A
great fanfare from trumpets and a resounding drum roll
silenced the crowd. Showman Phil lifted his arms toward the
audience, “You parents out there have been waiting long enough.
Here’s our finale. Your child’s twelve-year trek is about to end. It’s
the Graduation Game!”
Organ music filled the great hall and side doors suddenly opened
along the aisles. Through them marched students in mortarboards
and long black gowns. The crowd broke into another raucous round
of applause occasionally interspersed with whoops and yells.
Jonathan whispered to a woman who was standing next to him,
“What’s the Graduation Game?”
She half-turned her head toward him and replied, “This is a
contest among the youth of our Council schools.” She paused
briefly to listen to the announcements and then continued, straining
to be heard over the noise. “It’s the culmination of one’s formal
education. Until now, the purpose of a formal education has been to
demonstrate the importance of hard work and diligent performance
in the pursuit of knowledge. Tonight we honour the top students
for their competitive success and outstanding achievements. But the
ultimate prize, not yet awarded, is the Valedictory Trophy that goes
to the winner of the Graduation Game.”
Squinting at the stage, Jonathan saw a thick figure that looked
familiar. “Who’s that greeting the students as they step forward?”
“Why, that’s Lady Bess Tweed. Don’t you recognize her from
the newspapers? She’s our distinguished speaker. As a member of
the Council of Lords and the queen of politicians, she’s the guest
of honour, as always, and she loves the publicity. Her profession
is simultaneously the most revered and the least respected in the
island. So, she’s perfect for the Graduation Game.”
“How’s the game played?” asked Jonathan.
Chapter 27 • According to Need 154
“It works like this.” said the woman, pressing close to Jonathan’s
ear. “Lady Tweed gives one of her usual prepared political speeches.
The students write down all the phrases that directly contradict
what they have practised or learned in school. The one who finds
the most contradictions is declared the winner of the prestigious
Valedictory Trophy. Shhhh, Lady Tweed has begun. Listen.”
“...thus, we have learned about the virtues of freedom,” bellowed
Lady Tweed. “We know how free will and personal responsibility
lead to maturity and growth. There you have it and that is the
pressing situation for our fine community. People throughout
history have always sought liberty. How wonderful it is that we
now live on a free island ....”
The woman pointed to the students behind Lady Tweed on the
stage. “See how they are writing furiously. Oh, so many points to
rack up!”
“Did Lady Tweed contradict what the students were taught in
school?” asked Jonathan.
The woman snickered, “Free will? Nonsense. School is
compulsory. Kids are forced to attend and everyone is forced to pay
for it. Now hush!”
“ ..... and we are fortunate to have the . . . finest schools
imaginable, especially as we face the harsh times that are forecast
by our best economists,” said Lady Tweed in ringing tones. “Our
teachers are the model of exemplary behaviour for our students,
shining a path to democracy and prosperity with the light of truth
and knowledge ...”
The woman standing next to Jonathan grabbed his sleeve in
excitement. She squealed, “My daughter is the third student from
the right in the second row. She’s writing; she’s got all those points,
I’m sure.”
“I don’t understand,” asked Jonathan. “What points?”
“Finest schools? Impossible to compare without choice. Lady
Tweed privately sent her own children to the countryside for lessons,
but authorities assigned our kids to the nearest Council school.
Model teachers? Ha! Students must sit quietly and take orders for
twelve years. In return, they get letter grades and paper stars. If a
teacher got paper stars instead of a pay-cheque, he’d call it slavery
Chapter 27 • According to Need 155
and go on strike! ‘Shining a path to democracy’? No way! What
they practice in class is autocracy.”
Lady Tweed bowed her head humbly, “.... you have arrived at
this milestone in your life. Each of us realizes that ours is but
one small voice in the great human chorus. We know that fierce
competition and a ruthless, greedy struggle to reach the top is
unsuitable in today’s world. For us, the noblest virtue is sacrifice.
Sacrifice to the needs of others, to the multitudes who are less
fortunate ...”
The women almost shrieked with delight. “Look at those students
go! What a gold mine of contradictions! ‘Great human chorus’?
‘Sacrifice’? In school, they were always taught to excel, to be
their own personal best. And Tweed, herself, is no slouch. She’s
the loudest, most demanding and unscrupulous of the lot. She has
succeeded in clawing her way into the leadership by every cunning
trick imaginable. These students know that they didn’t get to this
stage today by sacrificing their grades to the incompetent students
around them.”
Jonathan just could not figure this out. “You mean, in school
the students are told to excel personally. And yet, upon graduation,
Lady Tweed tells them to sacrifice themselves to others?”
“Now you’ve got it,” replied the woman. “Lady Tweed preaches
a changed world for graduates. From each according to ability and
to each according to need. That’s their future.”
“Couldn’t they try to be consistent and teach the same thing
before and after graduation?” asked Jonathan.
“The authorities are working on that,” said the woman. “The
schools function on an old-fashioned tradition that awards high
grades for the best performance. Next year they plan to reverse the
grading system. They plan to use incentives and rewards to prepare
students for the new reality. Grades will be awarded on the basis of
need rather than achievement. The worst students will get A’s and
the best student will get F’s. They say the worst students have more
need of good grades than the best students.”
Shaking his head, Jonathan repeated her words to make sure he
had heard them correctly, “The worst students will get A’s and the
best students will get F’s?”
“That’s right,” she nodded.
Chapter 27 • According to Need 156
“But what will happen to performance? Won’t everyone try to
become more needy and less able?”
“What matters, according to Tweed, is that this will be a bold,
humanitarian act. The best students will learn the virtue of human
sacrifice and the worst students will be instructed in the virtue of
assertiveness. School officials have also been urged to adopt the
same plan for teacher promotions.”
“How did the teachers like that?” asked Jonathan.
“Some loved it and some hated it. My daughter tells me that
the better teachers threatened to quit if the plan is adopted. Unlike
the students, the teachers still have the luxury of that choice – for
now.”
157 Chapter 27 • According to Need
Brainstorming
• Would students’ performance change if
bad scores were given high grades and vice
versa?
• Can economic systems operate like this?
• Is a teacher the best model for students to
imitate as they grow up?
• Should all citizens be forced to pay the
salaries of teachers?
• Do schools contradict life in the real world?
• Would teachers accept the incentives offered
to students?
• What happens when the most needy are
given the most rewards?
• What ethical issues are raised in this
chapter?
Commentary
Why are people invited to speak at graduation
ceremonies? Sometimes these guests are
very accomplished individuals, models of
achievement in business, the arts, sports, or
science. But frequently politicians are invited to
address ceremonies. This is an odd choice since
surveys of public opinion frequently indicate a
very low respect for the honesty and integrity
of politicians. Yet, politicians are also much
admired for their celebrity status and for their
ability to provide tax funds or political favours
for educational institutions.
Politicians are models of contradiction
because their words so often conflict with
their actions or with the system they represent.
Politicians say that they are preparing young
people for democracy, yet this is in sharp
contrast to the authoritarian environment of the
classroom. They say that education is preparing
young people for life in a society dedicated to
freedom and independence of thought. Yet the
funding and attendance are both compulsory.
From each according
to ability; to each
according to need.
Karl Marx
158 Chapter 27 • According to Need
Politicians boast of their devotion to quality
education, yet there is no way of knowing or
achieving quality without comparison and
freedom of choice. Young people are scolded for
their lack of motivation, but “letter grades and
paper stars” give little reason to be motivated.
Meaningful incentives are absent from the one-
size-fits-all government monopoly school. Letter
grades and paper stars would not be sufficient to
motivate teachers and politicians to go to work
every day.
It is dangerous to have only one source of
schooling – where the government is master and
the parents and students are treated like servants.
The consumers of education services need to be
allowed freedom of choice concerning education.
If tolerance is the acceptance of diversity, then
tolerance of variety is important in education.
In a voluntary education system, people
only pay for schools, teachers, and books that
provide value. Competitive incentives between
schools would ensure that a variety of education
is offered at competitive prices with the best
customer service and innovation. This would lay
the foundation for learning that would be well
suited to the learner’s interests.
What is the life that awaits young people
when they graduate from school? The political
system forcibly taxes the earnings of productive
people in order to give wealth to unproductive
people. This follows the Marxist dictum, “From
each according to ability; to each according to
need.”
Learning does not need to be expensive to
be effective. However, with a lack of choice and
with perpetual state indoctrination, all students,
including the poor, lose.
It is odd that nearly
everyone still entrusts
the decisions on
education of children
to the government
instead of to the
family.
Ken Schoolland in
his book review of
Separating School
and State by Sheldon
Richman
159 Chapter 27 • According to Need
Remarks
These chapters about the educational system
are frequently ranked among the students’
favourites!
References
One of the best books on the history of education
in America is Sheldon Richman’s Separating
School and State. It reveals the ulterior motive
behind the adoption of compulsory government
schools.
In the classic novel Atlas Shrugged, Ayn
Rand tells the story of the Twentieth Century
Motor Company, and of what happens when
it tries to apply the principle, “From each
according to ability, to each according to need!”,
to the payment of workers. Rand’s philosophy
of Objectivism asserts that each individual has
the right to pursue his or her own dreams. This
pursuit of personal interest improves the lives of
everyone in the market.
Mary Ruwart shows how the poor can be
educated in Healing Our World in an Age of
Aggression.
In South Africa – The Solution, Nobel prize
nominees Leon Louw and Frances Kendall
put forward the idea of a voucher system for
education.
Doug Thorburn’s book, Drunks, Drugs
& Debits: How to Recognize Addicts and
Avoid Financial Abuse, deals with personal
responsibility. It reveals the folly of sacrificing
responsible personal behaviour to irresponsible
personal behaviour.
Shogun’s Ghost: The Dark Side of Japanese
Education, by Ken Schoolland, focuses on
education as does his article:
gullible.com/Shogunize.
For education and child policy see: http://.
?
We don’t want no
education, we don’t
want no thought
control, teacher leave
them kids alone.
Pink Floyd
Chapter 28
Wages of Sin
J
onathan left the cheering mob in the Palace auditorium and wan-
dered down a long corridor. At the far end, rows of people sat on
benches, all chained together with leg irons. Were these criminals
awaiting trial? Perhaps the officials here might be able to recover
his stolen money.
To the left of one bench was a door with the title, “Bureau of
Hard Labour.” At the far side of the bench uniformed guards stood
talking quietly, ignoring their passive prisoners. The sturdy chains
on these captives ensured that there was little hope of escape.
Jonathan approached the nearest prisoner, a boy of about ten
who looked not at all like a criminal. “Why are you here?” asked
Jonathan innocently.
The boy looked up at Jonathan and glanced sneakily at the
guards before answering, “I was caught working.”
“What kind of work could get you into trouble like this?” asked
Jonathan, his eyes wide with surprise.
“I stocked shelves at Jack’s General Merchandise Store,” replied
the boy. He was about to say more, then he hesitated and looked up
at the grey-haired man sitting next to him.
“I hired him,” said Jack, a sturdy middle-aged man with a deep
voice. The merchant still wore the stained apron of his trade – and
leg irons attached to one of the boy’s legs as well. “The kid said
he wanted to grow up and be like his dad, a manager at the factory
warehouse. Nothing more natural than that, you might say. When
the factory closed, his dad had trouble finding a job. So I thought
a job for the boy might do his family some good. I have to admit
it was good for me, too. The big stores were driving me into the
ground and I needed some cheap help. Well, it’s all over now.” A
look of resignation crept over his face.
The young boy piped up, “At school they never paid me to read
and to do arithmetic. Jack does. I handled inventory and the books
Chapter 28 • Wages of Sin 162
– and Jack promised if I did well he’d let me place orders. So I
started reading the trade journals and notices. And I got to meet
folks, not just the kids at school. Jack promoted me and I helped my
dad pay the rent – even earned enough to buy a bicycle. If I was paid
nothing, I would’ve been praised for volunteering. But I got paid
so now I’m busted,” his voice trailed off as he stared at the ground,
“and I’ve got to go back to make-believe.”
“Make-believe isn’t so bad, sonny, when you consider the
alternative,” declared a hefty, jovial man with a basket full of
drooping white gardenias. He wore chains attached to the other leg
of the boy. “It’s tough to make a living. I’ve never liked working
for anyone else. Finally, I thought I had it made with my flower
cart. I did pretty well selling bunches of flowers in the Town
Square. People liked my flowers – the customers, that is. But the
shopkeepers didn’t much like the competition. They got the Council
of Lords to outlaw ‘hawkers’. A hawker! Yes, that’s what they call
me because I can’t afford a shop. Otherwise I’d be a ‘shopkeeper’ or
a ‘merchant.’ I don’t mean any offense, Jack, but my kind of selling
existed long before your shop. Anyway, they called me a nuisance,
an ugly eyesore, a bum, and now an outlaw! Can you figure me and
my flowers being all that? At least I wasn’t living off charity.”
“But you sold right on the pavement,” responded Jack. “You’ve
got to leave it open for my customers.”
“Your customers? You own the customers, Jack? Yes, sure, I
was on Council property. It’s supposed to belong to everyone, but
it doesn’t, right Jack? It really belongs to those favoured by the
Lords.”
Jack scoffed, “But you don’t pay the steep property taxes that we
have to pay as shopkeepers!”
“So who’s to blame for that? Not me!” retorted the peddler
irritably.
Jonathan intervened with a question, hoping to cool the debate.
“So they arrested you on the spot?”
“Oh, I got a few warnings first. But I didn’t care to dance to
their tune. Who do they think they are – my masters? I’m trying to
work for myself, not some nosey boss. Anyway, the zoo’s okay. I
don’t have to work and I get three squares a day and a room at the
shopkeepers’ expense. Oddly enough, the warden thinks he’s doing
Chapter 28 • Wages of Sin 163
me a favour. He says he’s going to rehabilitate me so I can make a
contribution to society. He’s talking taxes, not flowers.”
The young boy began to whimper. “Do you think they’ll send me
to the zoo, too?”
“Don’t worry, kid,” soothed the flower seller. “If they do, you’re
sure to learn a really practical trade.”
Jonathan turned to a group of women wearing overalls who sat
next in line. “Why are you here?”
“We have a small fishing boat. Some official stopped me as I
lifted some heavy crates down at the dock,” said a wiry, rugged
woman with piercing blue eyes. “He told me I violated the safety
regulations for women.” Motioning to her companions, she added,
“The regulations supposedly protect us from abuse in the work
place. The officials shut us down twice, but we sneaked back to the
docks to get the rigging ready for the coming season. They caught
us, again, and said that this time they’re going to protect us really
good – behind bars.”
She wondered aloud, “What will they do with my son? He’s only
three and he weighs more than those crates that I lifted. Nobody
complained when I carried him around!” Fighting back her tears
she added, “Now they’ll have to find someone else to carry him.”
“Finding someone else is not so easy,” said a man whose full
beard barely concealed a pockmarked face. Elbowing the youth
next to him on the bench, he said, “George has been working part-
time for me two winters in a row, a sort of apprentice. He helps to
keep my barbershop clean and gets the customers ready. When I
tried to teach him the trade, we got into trouble because he’s not yet
a member of the union.” He threw up his hands in exasperation.
Young George, with a mournful look on his face, lamented, “At
this rate, and now with a court record, I’ll never get my licence.”
164 Chapter 28 • Wages of Sin
Brainstorming
• For what reasons are people arrested?
• Why are people helped or hurt by this?
• When is it wrong to want to work?
• Do volunteers violate minimum wage laws?
• Are schools or prisons better for people than
the workplace?
• Ethical issues?
Commentary
Who owns our lives? Are we able to make
decisions for our lives or must others make these
decisions for us?
Usually we hear politicians praising the
virtues of work, but in many ways they pass laws
that prevent people from working. It is natural for
young people to imitate their elders. While some
youths may learn well in the classroom, others are
best motivated by the same monetary rewards that
motivate their teachers and parents. Why, then, do
politicians tell young people that work is harmful
and illegal for them throughout their youth, then,
at some “magical age,” work suddenly turns from
being a crime to being a virtue?
At about this same age some countries force
young people to work “patriotically” for their
country for a certain period of time. Conscription,
either in the medical field or in industry,
insinuates that people are the property of the state.
Even worse is military conscription that requires
young people to do the fighting that is decided by
politicians. Young people are told that obedience
to authority is good preparation for democratic
life. Nothing could be further from the truth.
Laws to criminalize work are the creation
of influential special interest groups, which use
the pretext of caring to eliminate competition in
the workplace. This was the origin of laws that
claimed to “protect” women, thus excluding them
from competition with men. This was also,
1859
165 Chapter 28 • Wages of Sin
origin of laws to exclude street traders from the
pavements in front of shops. In addition, it is the
origin of licensing laws that exclude specialised
workers who are not members of exclusive
unions or guilds.
Freedom of choice is the best protection of the
workers. Willing employers and willing workers
rightfully make the best decisions for themselves.
Remarks
Economist Walter Williams said that minimum
wage laws had the same effect as the Jim Crow
laws: harming economic opportunities for blacks
in South Africa. He said this was why the white’s
only unions used to call for higher minimum
wages for blacks – because it made blacks less
competitive in the market and ensured jobs
for whites. Minimum wage laws serve to take
the bottom rungs off the economic ladder, so
employees must pay for training schools instead
of employers paying workers to be trained on the
job.
Is someone really better off unemployed,
than having a job at below the minimum wage?
References
Mary Ruwart, in her book Healing Our World,
deals with how we create poverty in a world
of plenty by destroying jobs. We do this when
we use aggression. The misguided attempt at
increasing the wealth of disadvantaged workers
by law usually succeeds in making them poorer.
Alan Burris’ A Liberty Primer is a great
reference.
Milton and Rose Friedman’s Free to Choose
also has material on this.
Articles by Ken on this subject include:
When faced with the
problem of poverty,
most people ask what
the government can
do about it. Instead
it is more appropriate
to ask what the
government did to
create the problem in
the first place.
Ken Schoolland in
his paper The State,
Obedience Training,
and Young Rebels:
In Defence of Youth
Rights
Chapter 29
New Newcomers
“Y
ou think you have problems?” said a haughty looking
woman, clearly distressed that she was chained to people
she considered her inferiors. On the verge of tears, she pressed a
fine lace handkerchief to her eyes and said, “When the press finds
out that I, Madam Ins, am under arrest, my husband’s career will
be finished. I never thought I was doing anything so wrong. What
would you have done?”
Embracing a young couple chained next to her, Madam Ins
continued, “Years ago, I had a big home, three growing kids, and I
wanted to get back to my career. My neighbour travelled a lot so I
asked him to keep an eye out for people who might help with my
household. He highly recommended Jiyo and Shar, so I hired them
immediately. Shar is wonderful with the garden and carriage. She
can fix anything around the house and does endless errands.”
“And Jiyo, such a dear, has been my lifesaver. He’s so good with
the children. He’s always there when I need him. He cooks, cleans,
cuts hair – does a thousand and one chores better than I ever could.
My boys are crazy about his cookies. When I get home I can relax
with my husband and play with the children.”
“Sounds like help that everyone would love to have,” said
Jonathan. “What went wrong?”
“Everything was just fine at first. Then my husband got a new
appointment to head the Bureau of Good Will. His opponents
investigated our finances and found that we had never paid the
retirement taxes for Jiyo and Shar.”
“Why not?” asked Jonathan.
“With taxes high and my earnings low, we couldn’t afford to at
the time. And they’re not allowed to collect the retirement benefits
anyway.”
Jiyo spoke up saying, “Report is very trouble for us.”
Shar poked Jiyo and whispered, “Careful, Jiyo. Much risk.”
Chapter 29 • New Newcomers 168
To his wife, Jiyo replied bravely, “Madam help us. We help her
now.” Then to Madam Ins he said, “You save our lives. We come
from home island of El Saddamadore. Very bad hunger and very
bad war. We no choice – leave, hunger or be killed. So we come
Corrumpo. Madam no help us, we die.”
“This true,” said Shar, in a mild voice. “Now sorry we give
Madam trouble.”
Madam Ins heaved a great sigh and said, “My husband will lose
his promotion to the Bureau of Good Will and maybe his old job, as
well. He has been the head of the Us First Commission, promoting
national pride. His enemies will accuse him of hypocrisy.”
“Hypocrisy?” asked Jonathan.
“Yes. The Us First Commission discourages new newcomers.”
“New newcomers?” repeated Jonathan. “Who are the old
newcomers?”
“Old newcomers? That’s the rest of us,” said Madame Ins.
“This is an island. Over the years, all of our ancestors came from
somewhere else as newcomers, either fleeing oppression or trying
to improve life. But new newcomers are recent arrivals. They’re
banned by the Pulluptheladder Law.”
Jonathan swallowed uneasily. He dared not think of what would
happen if the authorities discovered that he was a new newcomer as
well. Trying to sound only mildly interested, he asked, “Why don’t
they want new newcomers?”
The fisher woman interrupted, “New newcomers are allowed
if they spend money and leave right away. They’re tourists or
businessmen. But the Council of Lords worries about poor new
newcomers, ones who might stay. Many work harder, longer,
cheaper, smarter, or at greater risk than the locals. They’ll do chores
that Madam Ins wouldn’t touch.”
“Hold on just a minute!” said Jack. “There are plenty of
legitimate complaints against new newcomers. New newcomers
don’t always know the language, the culture, or the manners and
customs of our island. I admire their spirit – they’re gutsy to risk
their lives to come here as strangers – but it takes time to learn
everything and there’s not enough space. It’s more complicated
than when our ancestors fled the far islands.”
Chapter 29 • New Newcomers 169
Jonathan thought about all the space he had seen on Corrumpo,
all the uninhabited forests and open fields. Most people avoided the
wilderness and preferred the crowds and activity of city life.
Then Madam Ins answered Jack, “My husband made those very
same arguments against new newcomers. He always said that new
newcomers must first learn our language and customs before they
can be allowed to stay. They must also have money, skills, self-
sufficiency, and they shouldn’t take up any space. My husband
drafted a new law to identify and deport people that didn’t qualify,
but there was a glitch. The description of illegal new newcomers
applied more to our own kids than to talented people like Jiyo and
Shar.”
Two men in stiff uniforms barged through the doors, each man
being tugged by a ferocious black dog on a leash. They marched
directly up to Madam Ins, who shrank in fright from the dog’s
heavy panting and drooling fangs. One of the men motioned for the
guard to unlock her leg irons. In a deep monotone, he read from a
document, “Dear Madame Ins, We wish to axtend ...” He paused
to show the letter to the other man, whispered, then started again.
“Dear Madame Ins, We wish to extend our sincere apologies for this
unfortunate misunderstanding. Madame Ins, you can be assured
that this whole matter is being taken care of at the highest levels.”
Visibly relieved, she hastily followed her escorts down the long
hall without daring to look back at Jiyo or Shar. The rest watched in
dead silence that was broken only by the clank of a restless chain.
Once Madam Ins was out of sight, the guards turned on Jiyo and
Shar, unlocking and separating them from the group and from each
other. Roughly shoving them in the opposite direction, the guards
yelled, “Off you go, scum. Back to where you came from.”
“We no harm!” pleaded Shar. “We die!”
“That’s none of my doing,” grumbled the guard.
The fisher woman waited until they turned down the stairwell
and the door slammed behind them, then she mumbled under her
breath,
“Yes it is.”
Jonathan trembled slightly, thinking of the fate that lay ahead for
the couple and maybe even for himself. He looked up and asked the
Chapter 29 • New Newcomers 170
woman, “So everyone on this chain is here because they weren’t
allowed to work?”
Pointing down the row to one young man whose face was buried
in his hands, the woman responded, “If you look at it that way, he’s
the exception. The authorities insisted that he sign up to work as a
soldier. He refused – so he got locked on this chain with the rest of
us.”
Jonathan couldn’t quite see the face of the young man, yet he
wondered why the town elders would require one so young to do
their fighting for them. “Why do they force him to be a soldier?”
The fisher woman answered Jonathan, “They say it’s the only
way to protect our free society.” Her words echoed in Jonathan’s
ears, amidst the metallic noise of the chains.
“Protect from whom?” asked Jonathan.
The woman glowered, “From those who would put us in
chains.”
171 Chapter 29 • New Newcomers
Brainstorming
• Are border guards responsible for what
happens to refugees who are turned away?
• What is the difference between newcomers
and new newcomers?
• Why?
• Should young men be required to work for
the military?
• Are there other examples?
• What ethical issues are involved?
Commentary
People move. Whenever they move to a new
place they are referred to as “newcomers” until,
over time, they have become established. When
others come they are the “new” newcomers. It
is a pattern that people around the world have
experienced. Indeed, all of us have ancestors
who have moved from one place to another
because of fear or in order to take advantage of
some opportunity.
Since this experience belongs to all of us, it is
sad and tragic that people who are moving today
are hated so much by those who are already
established. Insightful people empathise and
welcome newcomers. Fearful people shun and
revile newcomers.
Not all newcomers are unacceptable. Wealthy
tourists and businessmen are welcomed because
it is hoped they will leave their money when they
depart. Powerful people are always welcomed,
even though they may have gained their wealth
by very brutal and sordid means.
Newborn babies are always welcomed as
citizens, even though they will be dependents
for many years and have yet to learn skills,
language, and customs. Newborns are not
rejected even though some of them might one
day turn to crime or might one day be in trouble,
or “take” another citizen’s job. No, the potential
To lose your freedom
is to lose your
present.
Extract from
Jonathan’s Guiding
Principles
172 Chapter 29 • New Newcomers
problems are considered far less significant than
the potential gains. Besides, newborn citizens
are “just like us”.
People fear newcomers because of
insecurities. They fear that employers might
prefer to hire the newcomers. They fear that
their children might prefer the newcomers as
friends, associates, and mates. They fear the
changes that newcomers might bring. These fears
are considerable, but not as considerable, or as
justified, as the fears that newcomers have about
the place from which they are fleeing.
People usually move from areas of high
tyranny to areas of relatively lower tyranny.
Among those who move, it is the most courageous
who leave everything that is familiar to go to
a place where the language and customs are
unfamiliar and the people potentially hostile.
When slavery existed, those who helped them
escape to freedom were violating the law. The
law required that these slaves be returned to their
masters. Today people commonly accept that
in the 19th century it was inhumane to return
the people to cruel masters. Today there are
many tyrannical nations. Isn’t it still inhumane
to return these people to government masters?
The humane way to help people under
oppressive rule is to welcome them to our
country and to restrict the entry of their
oppressive rulers.
Background
Part of the inscription on the American “Statue
of Liberty”, the first sight for immigrants to the
United States, reads:
“... And her name Mother of Exiles. ...
Give me your tired, your poor,
Your huddled masses yearning to breathe free,
The wretched refuse of your teeming shore.
Send these, the homeless, tempest-tossed to me:
I lift my lamp beside the golden door.”
Can we assume that
a thing is right if it
is legal? But slavery
was once legal;
Nazism was legal.
Well, can we assume
a thing is right if it is
endorsed by majority
rule? But a lynch
mob is majority rule.
R. W. Grant, The
Incredible Bread
Machine
173 Chapter 29 • New Newcomers
“The tiny country of Switzerland took in
more Jewish refugees than the United States
took in refugees of all kinds,” said Dr Stephen
P. Halbrook at the signing of his book, Target
Switzerland: Swiss Armed Neutrality in World
War II.
In the US, the Department of Immigration
is known as Immigration and Naturalization
Service, (INS).
References
Mary Ruwart’s Healing Our World, Chapter
4, “Eliminating Small Businesses”: “...only in
America could penniless immigrants become
affluent by starting their own businesses. Today
our aggression keeps the disadvantaged from
following in their footsteps.”
In “Why Open Immigration?” a presentation
at the International Society of Individual
Liberty World Conference, Mexico 2002, Ken
Schoolland argued: “Opponents of immigration
express the fear that people will give up
everything that is familiar to them, take all the
risks of the journey, and face all the hostility of
a new culture, because they are too lazy to work.
There are some high profile exceptions, but most
migration results from a desire for opportunity,
not for welfare. People who are too lazy to work
are also lazy to leave everything that is familiar
to them to go to a place that is unfamiliar and
potentially hostile.”
Ken Schoolland’s talks on immigration/
migration given at world conferences of ISIL
may be read at:
Love thy neighbour.
Jesus
(A sentiment
common to many
religions)
c
We can laugh
at many things, but
there is nothing funny
about being beaten
up at home, going to
your neighbour’s for
shelter, only to have
them send you back
for more punishment.
International Society
for Individual Liberty
W
e at ISIL are proud to be the primary
sponsor of the Adventures of Jonathan
Gullible project, which has seen this prize-
winning book/fable translated into over 30 dif-
ferent languages around the world.
ISIL and its network of members in over 90
countries pursue the goal of individual liberty
through educational and networking activities.
ISIL literature & activities include:
� Freedom Network News newsletter/magazine.
� Educational Pamphlet Series. 40+ titles on a
wide variety of current topics – includes 18
translations into Spanish.
� World-class websites. – a rich
source of research materials, and www.
Free-Market.net – the #1 libertarian portal
to the Internet.
� World Conferences. Since 1982, ISIL has or-
ganized annual world conferences which
have served as a catalyst for the develop-
ment of the world libertarian movement.
Join ISIL today for $35US a year & receive a
subscription to the Freedom Network News
and a full set of educational pamphlets (or send
$5US for an information package).
836-B Southampton Rd. #299, Benicia, California 94510-1960 USA
Tel: +(707) 746-8796 Fax: +(707) 746-8797 E-mail: [email protected]
World Wide Web: �
Chapter 30
Treat or Trick?
T
he Palace of Lords had more rooms and halls than a labyrinth.
Jonathan began to smell something delicious – coffee and fresh
baked bread! He followed his nose down a corridor and into a great
meeting hall where several elderly men and women stood arguing
and angrily shaking their fists. Some held the hands of others who
wept quietly.
“What’s the matter?” asked Jonathan, who noticed a huge basket
sitting in the centre of the hall. It reached almost to the ceiling.
“Why are you so upset?”
Most of the old folks ignored him and continued moaning and
complaining to each other. But one serious fellow stood up slowly
and approached Jonathan. “That uppity Lord,” he grumbled, “he’s
done it again! He fooled us!”
“What did he do?” asked Jonathan.
“Years ago,” the old man remarked sarcastically, “High Lord
Ponzi told us of a grand scheme to prevent anyone from ever going
hungry in their old age. Sounds good, huh?”
Jonathan nodded in agreement.
“Yeah, that’s what we all thought, too. Humph!” he snorted with
exasperation. “Upon pain of death, everyone, except that high and
mighty Carlo Ponzi and his Council, received the order to contribute
loaves of bread into this gigantic basket every week. They call it
the Security Trust Basket. Those who reached sixty-five years of
age and retired could start taking bread out of the Security Trust
Basket.”
“Everyone except Lord Ponzi and his Council contributed?”
repeated Jonathan.
“Yeah, they got special treatment,” responded the old man. “We
had to put more of our own bread in a separate basket exclusively
reserved for them. Now I know why they wanted their own kept
separate.”
Chapter 30 • Treat or Trick? 176
“It must be nice to have bread for your old age,” said Jonathan.
“That’s what we thought, too. It seemed such a marvellous idea
because there would always be bread to feed the elderly. Since
we could all count on the great Security Trust basket, most of us
stopped saving any bread of our own for the future. Figured we
didn’t have to help our family and neighbours either, since the
Council would take care of us all.”
His shoulders slumped as if weighed down by the burden of a
lifetime. The old man scanned the frail and aged group. He pointed
to another elderly gentleman who was seated on a bench nearby.
“One day my friend, Alan, watched people put bread in and take
bread out of the big basket. Alan calculated that the Security Trust
Basket would soon be empty. He used to be a bookkeeper, you
know. Well, Alan raised the alarm.” Alan began to nod shakily.
“We went straight to that basket and climbed up the side. It
took some doing, but we’re not as weak and blind as some of those
young Lords think. Anyway, we looked in and discovered that the
food basket was almost empty. The news caused an uproar. We
told that High Lord Ponzi right then and there that he’d better do
something quick or we’d have his hide at the next election!”
“Whew, I bet he was scared,” said Jonathan.
“Scared? I never saw anybody so fidgety. He knows we have
a lot of clout when we get riled up. First he proposed to give the
elderly even more bread, beginning just before the next election.
Then he’d take more bread from the young workers, beginning right
after the election. But the workers saw through his scheme and they
got mad, too. Those young workers said they wanted to have bread
now. They said their own pantries protected bread against mould
and rats better than the Council’s big basket. And they don’t trust
the Lords to leave the bread alone until they retire.”
“What did he do then?” asked Jonathan.
“That Ponzi always has a new angle. He then said that everyone
should wait five years longer, until seventy years old, before they
could start taking bread out of the basket. Well, this angered those
close to retirement, those who expected to collect bread at sixty-five
as promised. Finally, Ponzi came up with a brilliant new idea.”
“Just in time!” exclaimed Jonathan.
Chapter 30 • Treat or Trick? 177
“Just in time for Election Day. Ponzi promised everybody
everything! He’d give more to the elderly and take less from the
young. Perfect! Promise more for less and everyone’s happy!” The
old man paused to see if Jonathan could see what was happening.
“The catch is that the loaves will be smaller every year. Yup. The
loaves of bread will be so small that we’ll be able to eat a meal of a
hundred loaves – and still feel hungry.”
“Darn crooks!” burst Alan. “When those loaves are gone they’ll
have us eating pictures of bread!”
178 Chapter 30 • Treat or Trick?
Brainstorming
• Why is bread put into the big basket?
• Why is the bread supply running low?
• What solutions are offered to fix the
shortage?
• What is a better solution?
• How does this affect human behaviour?
• Are there examples in the world?
• Ethical issues?
Commentary
There is nothing unusual in having a group of
people voluntarily agree to invest in a fund for
future benefits. Mutual aid societies, pension
associations, insurance and investment funds,
have done this for centuries. The benefits are
sometimes paid unequally to its members,
depending on the agreement. Other groups such
as families, religious organisations, and fraternity
groups also agreed to pay out various amounts
for education, medicine, and emergencies. These
groups often form charities for the benefit of
non-members. This has always been a natural
part of society.
However, is it morally correct for people to be
compelled to pay into such funds? Unfortunately,
this has become the norm as many countries
have adopted state run savings systems for
retirement, unemployment, and health care, over
which those paying in have no personal choice
or control. Politicians decide who qualifies and
how. Politicians siphon funds to their own pet
projects, and they frequently establish privileged
payment systems for themselves.
Generally, people comply with such illogical
schemes because of government force. These
schemes come under a variety of names such
as “the National Pension Scheme”, “the Social
Security System”, “the National Health Scheme”,
“the Unemployment Fund”, or “the Government
The state is the great
fictitious entity by
which everyone seeks
to live at the expense
of everyone else.
Frederic Bastiat
179 Chapter 30 • Treat or Trick?
Medical Aid Scheme”. It is appropriate that
these plans are sometimes called “schemes”.
Another meaning of the word “scheme” is to
connive, to enter into a conspiracy, to intrigue,
or to encourage illegality.
These schemes are a financial “tragedy of the
commons” and are self-destructive.
Logic tells us that systems like these cannot
last. The only way they can survive is either for
people to be forced to put in more, or for the
“needy” to be given less. Social welfare is not
like free manna from heaven – someone has to
pay for it.
When money is forcibly taken from producers
and given to non-producers, production falls
and there is less for everyone. If money is left
with the rightful owners, that is producers and
earners, then it would be used in a manner that
creates more prosperity and jobs.
When people save for their own future needs,
they become independent. However, when
governments pretend to do this for them, people
become dependent on governments – which is a
condition politicians greatly prefer.
People free to choose are more capable of
taking care of themselves and of others, than
people who are not free.
Your action on behalf
of others, or their
action on behalf of
you, is only virtuous
when it is derived
from voluntary,
mutual consent.
Extract from
Jonathan’s Guiding
Principles
180 Chapter 30 • Treat or Trick?
Background
“Bread” is the American slang for money.
This chapter is about the politicians’ version
of Trick or Treat. At Halloween, children in
America dress up in scary costumes and go from
door to door demanding a treat. If they don’t get
a treat they threaten to play a “violent” trick on
the household that denied them.
Certain “Social Security” schemes are
compared with the Ponzi Pyramid Scheme. (See
the Charles K. Ponzi website at:.
mark-knutson.com.)
Alan Greenspan is head of the US Federal
Reserve Bank – some bookkeeper! Greenspan
was once a friend of philosopher Ayn Rand,
author of Atlas Shrugged, but he later abandoned
the principles of sound money that they had
both espoused. By creating an enormous
amount of new government money, Greenspan
contributed to a bubble economy that went bust.
In this manner, and by inflating the currency, he
devalued the money that people put into savings.
This is comparable to the smaller loaves of bread
in the Great Bread Basket.
Since the late 20th century Ireland spends
less on social welfare than any other country
in the European Union. Spending more would
have reduced Ireland’s dramatic growth. Growth
benefits all Irish citizens – the “rising tide raises
all boats”.
References
Capitalism: the Unknown Ideal by Ayn Rand,
with additional articles by Nathaniel Branden,
Alan Greenspan, and Robert Hessen (1966).
Social Security (forced government pension)
research may be seen at Cato Institute:.
?
Our
grandchildren are
going to have a hard
time paying for the
good times we didn’t
have.
The idea of a
“trust fund”, in
which money is
accumulated for
retirement, is a
deliberate hoax used
to disguise the true
nature of “Social
Security”. It bears no
relation to a private
pension, annuity or
insurance plan.
Alan Burris,
A liberty Primer
Chapter 31
Whose Brilliant Idea?
“H
ooray? Hooray!” shouted a man at the top of his lungs.
Startled, the elderly men and women stared in amazement
at this loud disruption. The intruder was perfectly groomed, sport-
ing a finely trimmed moustache and wearing the latest gentleman’s
fashion. He charged into the room, heading an entourage of men
dressed in sleek dark suits, all carrying briefcases. They fawned
over him as if their lives depended on him. Their leader strode over
to the table for a cup of coffee, impatiently brushing off his follow-
ers with a haughty wave of his hand. Sheep-like, they withdrew to
a corner of the room to await his summons.
“Congratulations,” said Jonathan, “for whatever you’re
celebrating.” Jonathan felt compelled to pour coffee for this dandy,
while studying the sharp lines and precision of his clothing. “Do
you mind my asking why you’re so happy?”
“Not at all,” the gentleman said proudly. “Thanks for the coffee.
Ow! It’s hot! Take a note of that, Number Two,” he said to a
follower who rushed up and pulled a notepad from his pocket.
Setting the coffee back down, the gentleman stuck his hand out to
Jonathan saying, “My name’s George Selden. What’s yours?”
“Jonathan. Jonathan Gullible. Pleased to meet you.”
George shook Jonathan’s hand firmly. “Jonathan, today my
riches are assured. I just won a decisive vote.”
“What vote?”
“By a vote of three to two, the High Court confirmed my letter
patent for sharpmetalonastick.”
“What’s a letter patent?” asked Jonathan.
Thrusting his chest out proudly George declared, “It’s only the
most valuable piece of paper on Corrumpo. The Council issued
a letter giving me exclusive use of a revolutionary new idea for
cutting timber. No one may use sharpmetalonastick without my
permission. I’ll be filthy rich!”
Chapter 31 • Whose Brilliant Idea? 182
“When did you invent this?”
“Oh, I didn’t come up with the idea. Charlie Goodyear, rest his
soul, put the whole thing together and filed papers with the Bureau
of Idea Control. He died before it came through and I paid Charlie’s
widow a pittance for the rights to his claim. It’ll soon pay off!”
Nodding over his shoulder at the flock of men huddled in the corner,
George added, “Charlie couldn’t afford to hire that crew of lawyers
on his own.”
“So, who lost the vote?” asked Jonathan.
“Lots!” George squinted at the ceiling, counting in his head.
“Must be, well, at least thirty-four others claimed that they had
thought of this thing before me, uh, before Charlie, that is. Some
argued that it was the next logical discovery after stoneonastick.
Ha! Charlie’s grandmother even filed a counterclaim, saying she
made his discoveries possible. And some science fiction writer tried
to horn in saying that Charlie stole ideas from him.”
George stopped long enough to blow on his coffee. “But this last
court challenge was the toughest. The plaintiff claimed her father
put metal to wood first. Can’t even remember her name now.”
Jonathan gulped, recalling his encounter with the tree workers.
“Was the woman named Drawbaugh?” He remembered the first
incident on the island with the woman tree worker.
“Doesn’t matter, really. What’s-her-name had more than twenty
phoney witnesses testify that she had the idea long ago. Said her
father was a born tinkerer. Said she and her father were simply
trying to make her work a little easier. Then she played on the
sympathies of the judges by arguing that, as a poor tree worker, she
didn’t have money for patent fees and lawyers. But I spoiled it for
her by revealing her recent arrest record. Shattered her credibility
with the judges. Tough luck, huh?”
“Luck?” responded Jonathan.
“I suppose she wanted a place in the history books. Now, no one
will ever hear of her.” Putting his cup down again, George leaned
against the wall and studied the perfectly manicured nails of his
right hand, clearly relishing his moment of triumph. “Each of these
challenges has a different twist,” continued George. “Some say I
can’t own the use of an idea – that it deprives others of freedom. But
Chapter 31 • Whose Brilliant Idea? 183
the court says I can, because Charlie was the first to file and there’s
no place for latecomers. I own it for seventeen years.”
“Seventeen years? Why seventeen years?” asked Jonathan.
“Who knows?” he chuckled. “Magic number, I guess.”
“But if you own the use of an idea, then why does it end after
seventeen years? Do you lose all your property after seventeen
years?”
“Hmmm.” George paused and took up his coffee again. He began
to stir it pensively. “Good question. There’s usually no time limit on
property ownership, unless the Council takes it for a higher social
purpose. Maybe there’s a higher social purpose. Wait a moment.”
He raised his hand and Number Two promptly came running from
his corner of the room. This puppy of a man practically bounced to
George’s side.
“What can I do for you, sir?”
“Number Two, tell this young friend of mine why I can’t own a
letter patent for more than seventeen years.”
“Yes, sir. Well, it’s like this. In ancient times the letter patent
simply gave royal monopolies to friends of the monarch. Today,
however, the function of a letter patent,” said Number Two in
a droning monotone “is to motivate inventors who, otherwise,
wouldn’t have any reason to invent useful things or to reveal
their secrets. A century ago, a superstitious inventor persuaded the
Council of Lords that six months less than two and a half seven-year
apprenticeships allowed sufficient monopoly privileges to motivate
inventors.”
“Please correct me if I’m mistaken,” said Jonathan, straining to
understand. “You say that inventors are motivated solely by a desire
to get rich by stopping others from using ideas?”
George and Number Two looked blankly at each other. George
replied, “What other motive could there be?”
Jonathan found their lack of imagination a little depressing. “So
every maker of sharpmetalonastick must pay you?”
“Either that or I produce them myself – a few at a time and at
great expense,” said George.
Number Two laughed nervously, glancing sideways at George.
“Ahem, well that’s still uncertain, sir. We have staff looking
Chapter 31 • Whose Brilliant Idea? 184
into this already. You recall that we first have to deal with the
bothersome Tree Workers Law prohibiting the use of new tools.
Another meeting with Lady Tweed is scheduled later today. If
we are successful at obtaining an exemption from the law, then
perhaps the tree workers will make us an offer to sit on the idea for
seventeen years.”
Returning to Jonathan, Number Two explained, “The tree
workers have a quaint, but archaic notion that their use of an old
idea should be protected from our use of a new idea. As they see it,
we’re the latecomers.”
George was lost in thought. Speaking absent-mindedly he
commented, “That Tree Workers Law is downright anti-progressive,
don’t you think Number Two? I know I can count on you. You’re
always ahead of the game.”
“But, sir,” persisted Jonathan, “what if you hadn’t won your
patent in court today?”
In a grand embrace, George hugged both Number Two and
Jonathan around the shoulders, marching, them toward the door.
“Young man, without a patent, you can bet that I wouldn’t be
wasting time jabbering with you. I’d race for the best factory to
turn out the best sharpmetalonastick faster than anyone else. And
Number Two would be looking for another job. Right, Number
Two? Maybe production, marketing, or research, instead of law.
Every new sharpmetalonastick would have to carry the slightest
innovation just to keep one step ahead of the pack!”
“Ugh! Sounds dreadful!” snickered Number Two.
“No. I’d find opportunity in another area of law – contracts or
fraud, perhaps.”
185 Chapter 31 • Whose Brilliant Idea?
Brainstorming
• Can one own the use of an idea?
• Do patents assure that inventors reap rewards?
• What rewards motivate inventors?
• Can patents obstruct innovation or liberty?
• Without patents, how would behaviour
change?
• Can you think of up-to-date examples?
• Ethical issues?
Commentary
When a person invents a useful “1st-gadget”
people will want to buy it and the inventor will
profit. Inevitably someone else will make a
cheaper or an improved “gadget mark 2”. Now
everyone will want to buy the “mark 2” version
and the person who invented the “1st-gadget”
will lose a portion of his expected profits unless
he makes a more attractive gadget. Of course
there is nothing to stop “1st-gadget” inventor
from improving on “gadget mark 2” and start
selling “gadget mark 3”. In this way the world
progresses and life gets better and easier for us
all. Progress depends on what happens after the
“1st-gadget” is invented.
The “1st-gadget” inventor is not obliged to
share this invention to “improve the world”. No
one can force him/her to share the idea. He could
rightfully keep it to himself. However, if he
reveals this knowledge to the world, then others
may act upon that knowledge.
Will people be willing to share knowledge if
others are able to make a bigger profit from an
invention than they made? That depends on the
motives of the inventor. People innovate for a
variety of reasons, only one of which is financial
reward. Any motive is satisfactory for a free
person. Curiosity, hobby, generosity, fame,
wealth, etc. are all valid motives.
If I have seen further,
it is by standing on
the shoulders of
giants.
Isaac Newton
Ownership comes
from production. It
cannot come from
discovery.
Henry George
186 Chapter 31 • Whose Brilliant Idea?
Do the rewards of invention only go to the
inventor? If “1st-gadget” inventor cannot stall its
development, each new increment of innovation
will be rushed to the consumer without delay. That
may result in a far greater impetus for invention
than the current monopolising patent system.
The “1st-gadget” inventor might wish to
call on the government to use the law to prevent
anyone else from copying or improving on his
“1st-gadget”. He then has a patent on “1st-gadget”
and nobody else may sell it or make improvements
to it without paying him.
One problem is that it is impossible to invent
something without using ideas of others who
came before. Every inventor is building on ideas
that came from an idea, sight, book, or invention
that touched him. If this is so, how can the “1st-
gadget” inventor be permitted to restrict other
people’s freedom to use his invention for further
inventions?
What about intellectual rights – the right to
own the use of ideas? Do the rules for inventing
“1st-gadget” apply to “1st-song”, “1st-film” and
“1st-computer program”? Haven’t these originated
from other people’s ideas and inventions of music,
musical instruments, photography, computers,
and programs?
Would there be more harmony and less
aggression, more co-operative spirit and fewer
disputes, without patents?
Remarks
Ken: This is an excellent and healthy debate. I
am open to all the arguments and eager to find
free market solutions.
This chapter was included largely to challenge
the readers to new perspectives about government
granted monopolies that may actually be
infringements on individual freedom. In the
absence of government enforced copyrights and
patents, there could be sufficient guarantee of
It has often happened
in the history of
human invention that
similar discoveries
are made at the
same time purely
independently
by people widely
separated in space
and conditions.
Ludwig von Mises
187 Chapter 31 • Whose Brilliant Idea?
rights and rewards by the enforcement of laws
concerning contract and fraud.
Background
George Selden was a patent lawyer who bought
up patents on horseless carriages (cars) and then
threatened lawsuits against anyone who tried
to produce these without getting a license from
him. Finally, Henry Ford challenged him, lost
the first case but in the end won against Selden
in the appellate courts.
Patents do not guarantee profits for inventors.
Charles Goodyear, after numerous experiments,
discovered the benefits of vulcanised rubber.
However, people dismissed his ideas as those of a
crackpot and actively sought to destroy him. His
patents were sold to others and he died a pauper.
Leonardo de Vinci wrote down many of his
inventions in such a manner that the authorities of
the day could not read them.
References
Alan Burris has a section in A Liberty Primer
proposing free market protection of ideas.
Another good book on patents in
communications is Monopoly, by Joseph
Goulden. This book gives examples of how the
legal system was used by those with power to
gain the profits of patents.
In “Liberty on Copyrights,” an article in The
Agorist Quarterly, Fall 1995, Wendy McElroy,
discusses the pros and cons of this issue as
debated over the years in that publication.
Intellectual property:.
Ken’s article on this subject: “An Open
Marketplace of Ideas is the Best Mechanism
for Reaching the Truth: Exercising the Mind”
at
bizcol.html.
Individuals benefit
from others’
inventions and
endeavours. As they
improve on them
they are raising the
standard of living for
themselves and the
rest of us. To prevent
this happening is
to slow the rate of
the solutions to the
betterment of life.
Ludwig von Mises
The Mission Of Libertarian International
O
ur mission is to coordinate various initiatives in the
defence of individual liberty throughout the world.
Among other benefits, you or your organization can:
• profit from international (European) contacts,
• send/receive internationally interesting information,
• contact Libertarian International about information/
speakers/participants for international meetings and
conferences.
Chapter 32
The Suit
S
eeing their leader, George, head for the door, the other men in
the corner picked up their briefcases and followed close behind.
“Number Two,” said George, “explain that problem of liability to
me again, would you?” George wanted to show Jonathan how well
his lawyers performed.
The whole bunch marched rapidly down the hall with George’s
arms still slung around the necks of both Number Two and Jonathan.
“You see,” said Number Two, “the metal piece may fly off the stick
and hit some bystander. So we have to protect you and the other
investors.”
“Protect me if the metal piece hits someone else? Whatever do
you mean?” said George, feeding questions to the lawyer.
“The injured person might sue you in court, trying to get you
to pay for damages – lost income, trauma, legal fees, etcetera,
etcetera.” The group practically stepped on Jonathan’s heels as they
tried to stick close to George. For the knee-walkers in the group,
the pace was especially difficult, but they muffled their groans and
consoled themselves with the thought of year-end tax returns.
“A lawsuit could ruin me!” said George, pretending to be
alarmed and watching Jonathan’s reaction out of the corner of his
eye.
Number Two continued, unaware that he was performing on cue.
“So an ingenious new idea has been enacted by the Council of
Lords to absolve you of personal responsibility for losses suffered
by others.”
“Another new idea? Who owns the letter patent on that?” said
Jonathan innocently.
Number Two raised an eyebrow, then proceeded, ignoring
Jonathan’s question. “We file these forms and put the letters ‘Lpr.’
after your company name.” Without missing a step, Number Two
Chapter 32 • The Suit 190
struggled to unbutton a folder to withdraw a stack of papers. “That
reminds me, Mr. Selden, please sign on the line at the bottom.”
Jonathan was fascinated. “What is ‘Lpr.’ ?” he asked, stumbling
a little to keep up.
“ ‘Lpr.’ means ‘Limited personal responsibility’,” said Number
Two. “If Mr. Selden registers his company, the most he can lose to a
lawsuit is the money he invested. The rest of his wealth is safe from
victims. It’s a kind of insurance the Council sells for an additional
tax. Since the Council limits the risk of financial loss, more people
will invest in our company. And they’ll pay less attention to what
we do.”
“At the worst,” commented George, “we can shut down the
company and walk away. Then we start another one under a new
name. Pretty clever, eh?”
In that instant, George’s eye caught sight of a stunning young
woman coming down the hall. She had more curves than some
thought should be legally allowed on a public street. As he turned to
watch her pass, George tripped and tumbled pell-mell, jamming his
perfectly groomed fingers into the wall. “Ow!” he cried in agony,
his arms and legs sprawling in every direction. He tried to raise
himself up from the floor and complained of a sharp pain in his
hand and lower back. His lawyers swarmed over him in a frenzy,
exchanging words frantically. A few helped gather items that had
fallen out of George’s pockets while others busily jotted notes and
drew diagrams of the scene.
“I’ll sue!” yelled George, holding his bruised and bloody fingers
in a silk handkerchief. “I’ll crush the stinking lout who’s responsible
for this obstruction in the floor! And you, young lady, I’ll see you in
court for causing my distraction!” Quick as a flash, several lawyers
darted over to the woman, calling for her name and address.
Shocked, the young lady purred haughtily, “Sue me? Do you
know who I am?”
“I don’t care,” said George, glaring. “‘The bigger the better. I’ll
sue!”
Trembling and fighting to control her anger, she countered, “You
can’t do that! My boyfriend, Carlo, that’s Carlo Ponzi,” she repeated
for emphasis, “says my beauty benefits everyone – that it’s a public
good. He declared it so – he told me last night!” Instinctively, she
Chapter 32 • The Suit 191
reached into her purse to find a mirror. What she saw displeased
her. Her eye makeup looked smeared. “Now look what you’ve done
to a public good! Carlo says that everybody should pay for public
goods. He always puts my cosmetics on his expense account. Well,
you’ll be sorry! Your taxes will go up because of this!” She stuffed
the mirror back into her purse and stormed away in search of a
powder room.
Feeling some sympathy for the woman, Jonathan asked, “Are
you really going to sue her? How can she be blamed?”
Ignoring Jonathan, George crawled along the floor looking
intently for a protrusion, evidence of negligence on someone else’s
part. He stopped at an indentation and screamed, “That’s the cause,
Number Two! Find out who’s responsible. I’ll have his job and
every penny he owns. And what’s that female’s name?”
“Calm down, George,” said Number Two. “That’s Ponzi’s girl.
Forget her if you want to repeal the Tree Workers Law. However,
this building is Palace property. With the Lords’ permission, we can
sue the taxpayers.”
George smiled broadly and exclaimed, “Number Two, you’re a
genius. Put it on the agenda for Tweed! Of course, the Lords don’t
care if we sue the Palace. The settlement money won’t come out of
their pockets. We’ll even see that they get a share.” He wondered
how much Lady Tweed would extract from him for this favour.
George’s pain was fading rapidly. “This gives me a chance at the
deepest pockets of all.”
“You’ll ask the Lords to pay for your injury?” asked Jonathan.
“No, you idiot,” retorted George. “The Lords have the ultimate
Lpr. No, they’ll hand the innocent taxpayers to me on a silver
platter. I’m going to collect big time!”
192 Chapter 32 • The Suit
Brainstorming
• What is liability?
• Is it ethical to limit liability?
• How does behaviour change if liability is
limited?
• What is a public good and who decides?
• Can “public goods” be bad for the public?
• Does government subsidize free riders?
• Ethical issues?
Commentary
The judicial system is supposed to hold people
personally responsible for their actions which
are harmful to others. Unfortunately, this is not
always the way the law works.
It is obvious to all that political connections
influence the justice system. It would take a
gutsy person to bring a court action against a
politician or his girlfriend. Can you imagine
a traffic officer stopping a politician and his
cavalcade to give them a speeding ticket! Even if
a politician is given a ticket, he is likely to have
insiders who can clear his record.
Increasingly, the law has ignored personal
responsibility and has allowed people to be
compensated for injuries simply because of
sympathy or perceptions of wealth.
A woman ordered hot coffee at McDonalds.
When she received it, she spilt it on her lap. The
court ordered McDonald’s to pay her $2 million
because the coffee was too hot. In such cases,
people are not accepting self-responsibility,
nor encouraged to take responsibility for their
own actions. Instead, institutions perceived as
wealthy are exploited.
People who want to make a great deal
of money can look for an opportunity to sue
those whom they think can most afford to pay.
These victims are mostly large companies or
Since you own your
life, you are
responsible for your
life.
Extract from
Jonathan’s Guiding
Principes
193 Chapter 32 • The Suit
the state. When suing a company on frivolous
charges, people do not think of the harm they
are causing the employees, the customers, or
the shareholders. Likewise, when suing the
state it is not the officials who pay out of their
pockets. The state pays this money out of the
pockets of innocent taxpayers. The people suing
on frivolous charges are really stealing from
their fellow taxpayers and the politicians are left
unaffected.
Each of us has a personal responsibility for
the consequences of our own actions.
Background
“The Suit” is a play on the word “suit”, which is
the legal term for the act of suing in a court of
law. Also, a businessperson or a lawyer, such as
George Selden or Number Two, is called a “suit”
in American slang.
References
Books that deal with libel and liability are those
of Murray Rothbard, The Ethics of Liberty, and
Alan Burris, A Liberty Primer.
To be amazed at some of the frivolous
court cases look up “Stella Awards” including
the “coffee in her lap” case at http://.
For video tapes The Blame Game and
Greed see John Stossel in the Classroom:.
Also The Palmer R. Chitester Fund:.
?
99% of lawyers
give the rest a bad
name.
Why do the worst get to the top?
In 1947, Friedrich von Hayek posed this question. While he
explained the economics, he omitted the psychology of those
driven to wield power. Shortly after, Ayn Rand suggested that
producers stop playing host to parasites, but also missed
identifying the motive force behind the parasitic need to
control.
The psychology can be explained by a megalomania usually
rooted in alcohol or other drug addiction. Stalin, Hitler, Mao
Zedong, Sadam Hussein and Kim Jong Il have all been such
addicts. Coincidence? Hardly.
Most consider alcoholism to be a “loss of control over
drinking.” Yet, this is but one symptom of the disease in its
terminal stages. The early stage is characterized by a differential
brain chemistry leading the afflicted to develop a god-like sense
of self. Resulting misbehaviors include unethical or criminal
conduct, ranging from the relatively innocuous (verbal abuse
and serial adultery) to the extraordinarily destructive (mass
murder).
Understanding addiction is essential for our well-being, both
personally and on a geopolitical scale. The addict is capable
of anything. Seemingly innocuous misbehaviors can escalate
into tragic ones when addiction is allowed to run unchecked.
Early identification can help minimize the effect it has on our
personal and professional lives and, with the right treatment,
may get the addict sober far earlier than is common—maybe
even before tragedy occurs.
In his latest book, How to Spot Hidden Alcoholics: Using
Behavioral Clues to Recognize Addiction in its Early Stages,
libertarian author and addiction expert Doug Thorburn redefines
alcoholism as a brain dysfunction that, when combined with use,
causes erratically destructive behaviors. Over 70 behavioral
clues allow you to protect yourself from alcoholic misbehaviors
as well as provide a better understanding of history, current
events and the psychological needs driving those in positions
of power. He also details the most effective ways of dealing
with the addicts in your life.
Chapter 33
Doctrinaire
J
onathan followed George’s entourage out of the Palace of Lords
in search of medical help. Across from the Palace, a long white
building occupied most of the block. The group entered the near-
est door. Suddenly screams of agony came from an open window
halfway down the block. Dashing along the pavement, Jonathan
reached the window just as the shutters were closing. He grabbed
one of the shutters, holding it open.
“Get away,” shouted a large matronly woman from inside. Her
angry red face contrasted sharply with the white uniform that
covered her from head to toe.
“What’s going on in there?” insisted Jonathan. “What’s the
screaming about?”
“That’s none of your affair. Now let go!”
In desperation, Jonathan tightened his grip. “Not until you let me
know what you’re doing! You’re hurting someone!”
“Of course we’re hurting someone,” said the woman. “How else
can we cure them? Trust me, I’m a doctor.” Sure enough, Jonathan
saw the woman’s name and title embroidered on her uniform – Dr.
Abigail Flexner.
Jonathan gasped, “You hurt people to cure them? Why don’t you
just let them alone?”
“We must kill the demons. Sometimes, we can’t help it if
the patient is hurt as well,” declared the doctor matter-of-factly.
Frustrated with Jonathan’s stubbornness, she looked around for
help in dealing with this impertinent youngster. “Oh, all right,” she
said resignedly. “I’ll prove that we’re helping people. Go around by
the side door and I’ll give you a little instructional tour.”
Hesitant, Jonathan finally let go of the shutter and went where
he was told. George and the others had passed through the same
door, but Jonathan saw no sign of them inside. He had entered a
room filled with people of all ages, sitting or standing shoulder-
Chapter 33 • Doctrinaire 196
to-shoulder along the walls. Some moaned loudly and held out
arms and legs wrapped with bandages and tied with splints. Others
muttered, paced anxiously, or comforted loved ones. Many people
had bedding and cooking utensils piled next to them, signs of a long
occupation. Jonathan wondered how long these people had to wait.
Dr. Flexner opened an interior door and beckoned to Jonathan.
The crowd immediately stopped all activity and grew hushed. The
occupants stared enviously at Jonathan as he passed by in front of
them. The doctor admitted him to a windowless room filled with
desks, clerks, and piles of paper stacked to the ceiling. She guided
him to another door, which led to a small amphitheatre stage, ringed
by a balcony with seats. The powerful odour of chemicals and
decay assaulted Jonathan’s senses.
Scores of observers leaned on the railing of the balcony. Below,
several men and women in white, apparently doctors and nurses,
huddled intently over a bulky patient strapped to a low table.
“To heal this patient,” whispered the doctor sombrely, “orthodox
practitioners cut open veins to let the demons flow out with the
blood. On occasion, we apply blood leeches.” She pointed to a table
next to the patient, which held an array of knives, saws, candles,
and bottles of various sizes and shapes. Oozing over the side of a
large metal bowl, slimy leeches, the size of a man’s thumb, writhed.
Jonathan felt his stomach turn.
“Failing that, our men and women of science poison the demons
with chemicals. We prefer to use arsenic, antimony, and compounds
of mercury. What great progress we have made in medical science!
Mark my words, a century from now physicians will marvel at our
achievements.”
“Aren’t those poisons deadly?” said Jonathan. He recalled that
his uncle sold mixtures like these compounds to kill rats back
home. He vaguely remembered hearing old-timers tell of such
dangerous substances used medically in the old days. But hadn’t
those practices ended long ago?
“Can’t be helped,” she said reassuringly. “Cut, draw, and poison
are the only safe and effective treatments.”
“How often does it work?”
Chapter 33 • Doctrinaire 197
“The treatment succeeds in destroying demons one hundred
percent of the time! And,” she beamed, “our patients experience a
stunning twenty-seven percent survival rate.”
Jonathan stared. One of the doctors slit the patient’s belly and
jets of blood spurted out. “What’s his ailment?”
“Opsonin rot of the nuciform sac,” answered Dr. Flexner. “We’re
certain.”
“Isn’t there any other way to treat him?”
“Ha!” she snorted. “Some claim otherwise. Thank God those
quacks aren’t licensed to administer cures. It isn’t enough just to
certify the quality of our own physicians for people to choose.
We must outlaw charlatans who pretend to heal with unauthorized
medicines, silly diets, moulds, plants, pins, touch, prayers, fresh
air, exercise, and sometimes even, can you believe it,” she scowled,
“laughter! When we catch them, we toss them in the zoo and throw
away the key!”
“Do those cures ever work?” asked Jonathan softly.
“Pff! Mere coincidence if they do,” she replied. Jonathan noticed
her puffy and bloated face. Her blotched red nose provided the only
colour in her grey complexion, the colour of an overcast sky. Her
breath could kill.
“But what if a patient chooses those remedies?” prodded
Jonathan. “Whose life is it?”
“Precisely!” she exclaimed. Jonathan had raised a favourite
topic. The doctor drew Jonathan away from the railing and crossed
her thick arms in front of her, one hand to her chin. Speaking
fervently she said, “Whose life is it? Some of these selfish patients
actually think that life is their own! They forget that each life
belongs to all. All of us form an unbroken line from ancestors
to descendants, all connected to the great whole. For the good
of society, trained professionals must protect patients from their
own poor judgement. Imagine! Some patients actually want to kill
themselves! We’re much better prepared to decide when and how
they are to be treated.”
She paused to reflect, then continued, “Besides, the Council
of Lords generously pays all medical bills on the island. Healthy
workers stand duty in the tax line, ranked by the Council’s
Chapter 33 • Doctrinaire 198
judgement of ability. Patients stand duty in the wait line, ranked by
our judgement of need. The two lines must one day match, so we
cannot afford to let patients make costly errors with the people’s
money.”
A moan of pain resounded through the room and more blood
squirted into a basin on the floor. Attendants relayed commands.
The attending surgeon received more instruments and sponges.
A concerned look clouded the doctor’s face as she stood next to
Jonathan. “I feel his pain,” she murmured.
“How do you get a licence,” asked Jonathan, “so that you can
make these life and death decisions for people?”
“It takes many, many years of preparation. One must undertake
orthodox medical schooling, pass numerous tests. As authorized by
our friends in the Council of Lords, we closed one of the two medical
schools of Corrumpo in order to maintain high orthodox standards.
Years of scholarly research and hallowed traditions provide these
standards. The Benevolent Protective Guild of Orthodox Medicine
awards licences and assures practitioners of remuneration proper to
their standing in society.”
“High pay?” said Jonathan.
“That’s all for now.” The doctor gave an impatient look and
ushered Jonathan out. But Jonathan refused to stop asking questions.
“How do you know which doctor is good and which is bad?”
“There’s no such thing as a bad doctor,” she asserted. “Licensed
doctors are all equally qualified. Of course there are rumours – we
can’t stop gossip about good and bad. But our control over the
reports assures that any such gossip is baseless.”
Quick as a flash she pushed him out the back door and slammed
it with a bolt.
199 Chapter 33 • Doctrinaire
Brainstorming
• Who owns your life?
• Does it matter who decides on, or pays for, a
doctor?
• What is the difference between licensing and
certification?
• Who should decide whether or not you use a
risky medical treatment?
• Is competition and information valuable to
good medicine?
• Examples?
• Ethical issues?
Commentary
In this 21st century the medical community
is moving slowly away from a narrow view
of the medical guild and is exploring both
new and ancient fields of medicine with
beneficial effect. Unfortunately, national and
international governments still promote the idea
that governments own people’s lives and must,
therefore, make decisions for them.
If people own their lives, then they must be
free to choose their own advisors on all matters
concerning health.
Isn’t this the way it is today? No. Government
officials have outlawed many kinds of healers
that are not approved by the orthodox medical
establishment. Politically influential members
of this establishment hope to restrict options
and thus channel people towards their member
practitioners. So they have obtained laws to
prohibit philosophies of medical education and
practice of which they disapprove.
Don’t people need to be protected from
charlatans? Yes, but the best way to protect
against medical charlatans is through competition
and choice, not through monopoly and the force
of political charlatans. After all, there are honest
Can I have the
freedom to buy
medicine I need, even
though government
has not approved it?
Alan Burris
200 Chapter 33 • Doctrinaire
and dishonest healers both inside and outside the
ranks of orthodox medicine.
When one brand of medicine has a
monopoly over the kinds of medical practice
that may occur, orthodox practitioners have
less incentive to innovate and a greater ability
to cover their faults. When facing competition
there is greater incentive to innovate, to prove
successful treatments, and to reveal the faults of
competitors.
While it is true that the average patient
doesn’t know much about sophisticated and
technical professions, he or she can seek the
advice of certifying agents who will do the
investigations for them. But the final decision is
still in the hands of the patient, not politicians.
What if a patient makes a wrong decision? It
is possible. However, wrong decisions will also
be made by politicians, especially as they do not
have the same interest in a person’s life that is
not their own. Even if a patient, or the advisor of
his choosing, makes an unwise decision, it is his
right to decide because it is his own life.
Won’t a person become a burden on society
by making an unwise health decision? A burden
only occurs when the government forces people
to pay the health costs of others. If force is not
used to pay health costs, then individuals must:
1) pay their own costs; or 2) persuade others to
pay voluntarily through mutual aid societies,
charities, or insurance. Either way, voluntarism
provides a greater incentive for personal
responsibility in caring for one’s own health.
Isn’t the cost of health care too high for
an individual to pay by himself? The cost of
health care is high because of the monopoly
favours that politicians have been handing to
the very powerful medical lobbies for more than
a hundred years. The surest road to dramatic
cost reduction is through competition in a free
market. As always, competition lowers prices
while improving both innovation and service.
It is probable that
more people die
because medicines
are too long withheld
from them by
regulators than are
killed by premature
approval of new
medicines.
From The Economist
January 8, 1983
201 Chapter 33 • Doctrinaire
Background
Hippocrates is known as the Father of Medicine.
He was keen to share and exchange his
knowledge with anyone who was interested in
medicine. His famous medical school attracted
many physicians and fee paying students. This
exchange of knowledge resulted in the spread of
new insights and observations.
It is usually thought that Hippocrates wrote
The Hippocratic Oath, but it was written twenty
years after his death. It was after his death that
some physicians began to feel threatened by
competition for patients. They decided to take
choice away from the patients by devising a
professional code of conduct that they claimed
was for the protection of patients.
Although the Hippocratic Oath contains
some noble sentiments, the oath calls for doctors
not to associate with physicians outside of an
officially approved circle. It slyly included the
phrase, “...
other according to the law of medicine, but to
none others. ...” . It is unlikely that Hippocrates
would have subscribed to this idea of confining
the exchange of knowledge.
This was the beginning of efforts throughout
history to limit the study and practice of medicine,
such as was done by the guilds in Europe. When
America gained independence from Europe,
it broke away from the guild system and the
market generated nearly twice as many doctors
per capita as in any country of Europe. To the
benefit of consumers, this was accompanied by
great diversity, innovation, and low prices.
By the beginning of the 20th century, the
American Medical Association had become
Since you own
your life, you are
responsible for your
life.
Extract from
Jonathan’s Principles
202 Chapter 33 • Doctrinaire
politically powerful and began to imitate the
medical guilds of Europe again. It was able to
outlaw competitive medical practices, to close
medical schools, and to greatly reduce the
number of physicians by the use of restrictive
licensing. Medical prices began to soar and
the choice available to patients was severely
restricted. Patients who could not afford the high
prices resorted to self-treatment.
The present Canadian politicians are so wary
of their own national health system that they
have established a special clinic for themselves.
In 1743, Dr. Robert James published his book
which recommended bleeding of patients with
leeches, (as depicted in Jane Austin’s Pride and
Prejudice). François Quesnay (1696 – 1774),
recommended “laissez faire” to let alone, as a
preferable treatment and was very successful.
He then applied the same idea, “laissez faire”, to
the health of the economy.
References
Good references are John Goodman’s book
Patient Power and Milton Friedman’s book Free
to Choose. Dr. Mary Ruwart is a Senior Scientist
at a major pharmaceutical firm and a former
Assistant Professor of Surgery at St. Louis
University Medical School. Her book Healing
Our World in an Age of Aggression covers the
topic of medical drug development. It may be
viewed at:.
?
Isn’t it a bit
unnerving that
doctors call what
they do “practice”?
Chapter 34
Vice Versa
No sooner had he exited the building than he nearly tripped over
Mices, lying in wait outside with a dead rat at his feet. Eyeing the
revolting sight, Jonathan mused, “I can imagine where this came
from, Mices. Thanks, but no thanks.” The yellow cat scratched his
torn ear, unconcerned by Jonathan’s rejection of the juicy morsel.
Across the street, Jonathan noticed a woman wearing heavy
makeup and a tight fitting, bright red dress. As a gentleman passed
her on the street, she smiled and tried to engage him in conversation.
She didn’t appear to be begging. No, Jonathan thought she was
trying to sell something. When unsuccessful in her efforts with
the man, she abruptly turned to find another customer. Jonathan
wondered if Lord Ponzi had declared this gaudy woman a public
good, too.
Then, coming towards him, he saw another outrageously dressed
woman. She, too, wore vivid lip paint and a low-cut black blouse
that showed off her ample cleavage. Her short skirt revealed lithe
legs that gave no hint of ever doing knee walking. When she stopped
and gazed boldly at Jonathan, he practically stopped breathing.
She was on the verge of speaking, when a police wagon barrelled
around the corner and jerked to a stop between the two women.
Several men dressed in black jumped out, grabbed both women,
leering and pinching as they hauled the women, shrieking and
kicking, into the wagon. The policemen slammed the doors shut,
the driver cracked his whip, and off they went. One of the officers
remained behind, writing some notes in a little black book that he
pulled from his pocket.
“Excuse me, sir,” said Jonathan, “I’d like to report a robbery.”
“That’s not my department,” replied the policeman, without even
glancing up from his notebook.
Chapter 34 • Vice Versa 204
Jonathan was stymied. Glancing at the name tag under the
man’s badge, Jonathan asked, “What’s your department, ah, Officer
Stuart?”
“Immorals,” said the man.
“Beg your pardon?”
“Immorals Department. At our Department we’re concerned
with immoral behaviour.”
“Surely robbery is immoral.” Getting no further response,
Jonathan asked, “Why were those women arrested?”
Officer Stuart finally looked up from his note-taking and saw
Jonathan’s perplexed look. “Couldn’t you tell by their clothes?
Those women were guilty of giving men sexual favours in
exchange for cash. It would have been much better for them if they
had bartered for those favours instead.”
“Barter? What do you mean by ‘barter’?” asked Jonathan, who
was less concerned about his own troubles at the moment and
increasingly curious about those women.
“I mean,” said the policeman, emphasizing every single word,
“those women should have entertained their associates after
receiving dinner, drinks, dancing, and a theatre ticket instead of
cash. It’s better for community business and perfectly legal.”
This confused Jonathan even more. “So cash must never be used
for sexual favours?”
“There are exceptions, of course. For example, cash may be
paid for the activity if it is filmed and shown to all the people in
town. Then it’s a public, not private, event and permitted. Instead of
getting arrested, the participants may even become celebrities and
earn a fortune from a sellout audience.”
“So it’s the trading of cash for purely private sexual activity
that’s immoral?” asked Jonathan.
“There are exceptions for private cash transactions, too, especially
when the women wear nicer clothing than those streetwalkers,”
said Officer Stuart with disdain. “Short-term deals, for an hour
or overnight, are illegal. But for a permanent, lifetime contract
between a couple, cash may be used. In fact, parents sometimes
encourage their children to make such deals. Aspirants to nobility
have often been revered for this kind of behaviour. Properly done,
Chapter 34 • Vice Versa 205
such contracts provide legitimate means for improving social status
and security.”
The policeman finished making his notes and reached into a bag.
He pulled out a stoneonastick and some nails. “Mind giving me a
hand over here?”
“Sure,” said Jonathan uncomfortably. He tried to reconcile these
strange moral standards.
Officer Stuart turned and walked to a store nearby. He took
hold of some loose boards piled on the sidewalk and motioned to
Jonathan. “Here, hold this end up. I need to board up the windows
of this shop.”
“Why are you boarding up this shop?”
“The shop is closed,” he said in a voice muffled from holding the
nails in his mouth. “The owner was found guilty of selling obscene
pictures and got sent to the zoo.”
“What’s an obscene picture?” asked Jonathan, naively.
“Well, an obscene picture is of some foul and disgusting
activity.”
“Was the shopkeeper doing this ‘disgusting’ activity?”
“No, he was just selling the pictures.”
Jonathan thought about this carefully as the man finished nailing
the top board across the door. “So selling pictures of an obscene act
makes one guilty of the act?”
Now it was the policeman’s turn to stop and deliberate. “Well,
in a way, yes. People who sell such pictures are guilty of promoting
the activity. Consumers are easily influenced, you know.”
Jonathan struck his palm against his forehead. “I get it! This
must have been the newspaper office. You have arrested the news
photographers for taking pictures of warfare and killing! But are
your newspapers guilty of promoting warfare and killing just
because they print and sell the pictures?”
“No, no. Ouch!” exclaimed the officer, shaking his thumb in pain
and letting fly a string of violent curses. He had missed a nail and
struck his thumb by mistake. Officer Stuart glanced around self-
consciously to see who might have heard him swearing. Picking
up his tools, he started again. “Obscenity is sexual activity – only
Chapter 34 • Vice Versa 206
performed by perverts! Decent folk condemn such behaviour. On
the other hand,” said the man, “warfare and killing are things that
decent people and perverts may all read about and do together.
In fact, graphic reporting of these things can earn journalistic
awards.”
“People condemn sexual activity?” said Jonathan.
Officer Stuart grunted, “Of course! If there is to be any such
activity, then it must remain strictly private. None of this public
display. All pictures of nudity are forbidden.”
“All pictures of nudity are forbidden?” repeated Jonathan.
“Yes,” said Officer Stuart, still hammering away, “though very
old paintings and sculptures are required. In that case we compel
taxpayers to pay for a public display of nudity.”
As soon as the last board had been securely hammered in place,
Officer Stuart picked up his tools and walked away. Jonathan looked
down at his cat Mices. “I guess he’s too busy with immorality to
help me with a mere robbery.”
207 Chapter 34 • Vice Versa
Brainstorming
• Are people being harmed in this episode?
• Who and why?
• Is the law contradictory concerning these
activities? Why?
• What is the difference between disapproving
of behaviour and outlawing it?
• Should the state control radio, TV, or the
• What ethical issues are involved in the use of
force?
Commentary
An activity should only be declared a crime
when the action would harm others. If the law
declares an activity to be a crime, then it should
apply to everyone.
Crimes that do not hurt anybody are called
“victimless crimes”. It’s a crime in most societies
to hit another person on the head. However, it is
a victimless crime if you chose to hit yourself
on the head. It would also be a victimless crime
if I gave or sold you permission to hit me on the
head. In such a case, as with a boxing match,
neither of us (neither the buyer nor the seller) is
an unwilling victim.
A boxing match might horrify some
observers and they might even consider such an
activity immoral. If those observers demanded
a law to be passed against boxing, then the
participants, both the buyer and the seller are
equal participants.
Religious laws on moral behaviour are
different from state laws. Religious laws only
apply to people who choose to practise that
particular religion. These religious laws are
beyond the sphere of state laws. Frequently,
however, people feel that their religious morality
ought to apply to everyone in the state. They have
two ways to accomplish this: 1) by persuasion and
The state shall not
make or impose
any law which shall
abridge the right of
any citizen to follow
any occupation or
profession of his or
her choice.
Proposed by Rose
and Milton Friedman
You own your life.
Extract from
Jonathan’s Principles
208 Chapter 34 • Vice Versa
2) by force. To enlist the state to force religious
values on other people is a violation of the rights
of individuals to live as they see fit. The basis of
freedom of religion is to allow everyone to choose
his or her own moral guide.
There is only one legitimate basis of law for
the state: preventing people from using force or
fraud against others. Beyond this, people should
be free to choose their own moral guide. This is
the basis of freedom of religion.
People who voluntarily exchange sexual
favours are not harming others. Therefore,
the state should not interfere in their decision.
However, they may be considered to be breaking
the moral code of some religion, but they have
not committed a crime against a victim. In this
case, other people may choose to shun them or
persuade them, but they do not have the right to
use the state to forcibly change their behaviour.
If people agree to have sex, does the amount
paid determine whether they are breaking the
law? Is selling sex for a loaf of bread a crime?
Is selling sex for a meal at a fancy restaurant a
crime? In each case, are both the seller and the
buyer arrested for dealing in prostitution?
Studies have shown that the police spend by
far the greatest amount of their time, and a huge
amount of tax money, dealing with the victimless
crime of prostitution. This time and money could
be used more constructively in dealing with
rapists, where there is a victim and, therefore, a
real crime.
References
Defending the Undefendable by Walter Block, as
well as being an entertaining book, deals with the
economic aspects of the “morally unacceptable”.
Web sites on this subject are: The Sex Workers
Education and Advocacy Task-force’s:.
?
Reformer – one
who insists on his
conscience being
your guide.
?
Puritanism – the
haunting fear that
someone somewhere
may be happy.
H.L. Mencken
Chapter 35
Merryberries
A
s Jonathan wondered where to go next, a rotund, sloppily
dressed woman approached him cautiously. The woman’s
greasy unkempt hair repulsed him, and she smelled like a putrid
swamp. Mices darted away. “Psst! Do you want to feel good?”
whispered the woman nervously. Jonathan recoiled in disgust. She
repeated in a strained voice, “Do you want to feel good?”
After the policeman’s description of immorality, Jonathan felt
unsure of what to say. However, he thought that this repulsive
woman could not be trying to sell sexual favours. So Jonathan, being
an honest, sensible chap, answered truthfully, “Doesn’t everyone
want to feel good?”
“Come with me,” said the woman, gripping his arm firmly. She
led him down an alley and through a dingy, darkened doorway.
Jonathan remembered the robbery and tried to hang back – holding
his breath to shield himself from her stench. Before he could
protest, the woman closed the door behind him and locked it. She
motioned to Jonathan to sit at the table. From her bag, she pulled
out a small case of thick cigars. Selecting one, she bit the end, lit the
other end with a match, and drew a long, satisfying puff.
Jonathan shifted uncomfortably in his seat and asked, “What do
you want?”
She exhaled a plume of smoke explosively and said gruffly,
“You want – merryberries?”
“What are merryberries?” asked Jonathan.
The woman’s eyes narrowed suspiciously. “You don’t know
what merryberries are?”
“No” said Jonathan, starting to get up from his chair, “and I
really don’t think I’m interested, thank you.”
The woman ordered him to sit down and he reluctantly complied.
After puffing on her cigar and scrutinizing him closely, she said,
“Say, you’re not from around here, are you?
Chapter 35 • Merryberries 210
Jonathan paused, worrying that she guessed he was a new
newcomer. But before he could reply, the woman yelled, “False
alarm! Come on out, Doobie.”
A hidden door suddenly opened behind a tall, narrow mirror
and a uniformed police officer came bounding through. “How do
you do?” said the policeman, thrusting his hand out for Jonathan
to shake. “I’m Doobie and this is my partner, Mary Jane. Sorry
to inconvenience you but we’re undercover agents rooting out the
merryberry trade.” Turning to Mary Jane he added, “I’m starved.
Let’s make it up to this young fella with a little refreshment.”
From the cupboards in the room, they began pulling boxes,
packages, bottles, and jars of every size and shape. Food! Jonathan
breathed a sigh of relief and his mouth watered at the sight of a
feast. The two began to help themselves to the goodies scattered
on the table. There were pastries of all types – fresh bread, butter
and jam, slices of cheese, chocolate confections, and other tasty
delights. Doobie grabbed a hunk of biscuit and dabbed butter and
jam thickly on top with his fingers. “Dig in, young fella,” he said
through mouthfuls of food. He waved his hand over the table, “No
politicafes for the Merryberry Squad, right Mary Jane?” She could
only nod, her fat cheeks bulging from the chocolate sweet in her
mouth.
Jonathan took a slice of bread with jam and ate hungrily. Pausing
to make conversation, he asked again, “What are merryberries?”
Mary Jane poured a cup of coffee and heaped three spoonfuls
of sugar into it. As she stirred some thick cream into the cup, she
replied, “You really don’t know? Well, merryberries are an illegal
fruit. If you had tried to buy merryberries from me, then you would
have gone to the zoo for ten or twenty years.”
Jonathan’s loud gulp could be heard across the room. He had
narrowly escaped the zoo! Mary Jane and Doobie caught a look at
his face for a moment and instantly burst out laughing.
“But what’s so bad about merryberries?” demanded Jonathan.
“Does it make people sick? Or violent?”
“Worse than that,” said Doobie as he used his sleeve to wipe
the smears of jam and butter from his cheeks. “Merryberries make
people feel good. They just sit quietly and dream.”
Chapter 35 • Merryberries 211
“Disgusting,” added Mary Jane as she lit up a thick long cigar
and handed it to Doobie. Taking a buttery biscuit and spreading
generous layers of cream cheese on top, she muttered, “It’s an
escape from reality.”
“Yeah,” said Doobie, adjusting his gun belt more comfortably
and mumbling through another mouthful of biscuit. Jonathan had
never seen anyone cram food into his mouth so fast. “Young people
nowadays just don’t take responsibility for their lives. So when they
turn to merryberries as an escape, we bring them back to reality. We
arrest them and lock them behind bars.”
“Is that better for them?” asked Jonathan discreetly offering
Doobie a serviette.
“Sure” responded Mary Jane. “Want a shot of whiskey, Doobie?”
Doobie grinned and thrust a greasy glass toward her. She filled it
to the brim with brown fluid from an unlabelled jug. Returning to
Jonathan’s original question, she replied, “You see, merryberries
are addictive.”
“What do you mean?”
“It means you always want to have more. You feel like you must
have it to continue living.”
Jonathan considered this. “You mean like food?” he said, barely
audible over the huge burp that exploded from Doobie.
Doobie chuckled contentedly as he downed his second shot
of booze and puffed deeply on his cigar. “No, no. Merryberries
have no nutritional value and may even be unhealthy. Hand me the
ashtray will you, Mary Jane?”
“And if merryberries are unhealthy,” said Mary Jane, as she
stirred her coffee with a stick of candy, “then we’d all have to pay
for the treatment of those sorry derelicts no matter how foolish their
behaviour and habits. Uncontrolled merryberry eaters would be a
burden on all of us.”
Jonathan blurted out “If people harm themselves, why should
you pay for their folly?”
“It’s the only humane thing to do,” said Doobie, now a bit tipsy.
His hands were swinging and jabbing in the air with every thought
that came to mind. “We solve human problems. The Lords got to
pay for a lot of problems, you know, like our salaries and the big
Chapter 35 • Merryberries 212
zoos. And don’t forget, last year, the Council of Lords had to help
the tobacco and sugar farmers get through a bad year. Got to feed
the people, don’t you know? Taxes solve these problems and plenty
more. Taxes care for people who become ill. It’s the only decent,
civilized thing to do. Pass the whiskey, Mary Jane.”
Mary Jane passed him the jug and nodded in agreement. She lit
a new cigar from her packet by holding it to the stub of her previous
smoke. Doobie was on a roll. “Because we gotta help everyone, we
gotta control what everyone does.”
“We?” questioned Jonathan.
“Eek!” belched Doobie. “Excuse me!” He took a pill bottle
from his shirt pocket. “When I say ‘we’ I don’t mean you and
me personally. I mean that the Lords decide for us what is good
behaviour and who must pay for bad behaviour. In fact, it’s good
behaviour to pay for bad behaviour. Does that make sense, Mary
Jane? Anyway, the Lords don’t make mistakes on these decisions
like the rest of us would.” Doobie stopped to down a couple of little
red pills. His words were beginning to slur. “Funny how I always
say ‘we’ when talking about them. Mary Jane, would you like a
couple of these to calm your nerves?”
“Thanks, but no thanks,” she said graciously. She slipped a
delicate metal box across to him adding, “My pretty pink pacifiers
work a lot faster. I can hardly start the day without my coffee and
one of these. Here, try one if you like. It’s the latest in prescribed
chemistry.”
Jonathan reflected on the politicians he had met so far. “Are the
Lords wise enough to show people correct behaviour?”
“Somebody has to!” bellowed Doobie, as he wobbled slightly in
his chair. He took another slug of whiskey to wash down a mouth
filled with cakes and pink pills and glared at Jonathan. “If people
don’t behave correctly, we’ll certainly teach the bums responsibility
when they get to the zoo!” Doobie began to plead with the others to
join him in a round of drinks.
“No, thank you,” said Jonathan. “What do you mean by
‘responsibility’?”
Mary Jane moved to pour a little whiskey into her coffee before
adding still more sugar and cream. “I don’t know how to...well,
Doobie, you explain it.”
Chapter 35 • Merryberries 213
“Hmmm. Let me think.” Doobie tilted his chair back and puffed
on his cigar. He might have looked wise except that he almost lost his
balance. Recovering, he said, “Responsibility must be accepting the
consequences of your own actions. Yes, that’s it! It’s the only way
to grow, you know, to learn.” The smoke around Doobie thickened
as he puffed faster, trying to think hard about responsibility.
“No, no,” interrupted Mary Jane. “That’s too selfish.
Responsibility is taking charge of others. You know – when we keep
them from harm, when we protect them from themselves.”
Jonathan asked, “Which is more selfish? To take care of yourself
or to take charge of others?”
“There’s only one way to figure this out,” declared Doobie. He
stood bolt upright from his chair, knocking it to the floor. “Let’s take
him to the Grand Inquirer. If anyone can explain responsibility, he
can!”
214 Chapter 35 • Merryberries
Brainstorming
• Is it okay to do things that are unhealthy or
risky?
• Should people be required to pay for
mistakes of others?
• When do people learn, or not learn, from
mistakes?
• Are officials wiser than their subjects?
• Examples?
• Why would governments want to keep
alcohol legal but marijuana illegal?
• Ethical issues?
Commentary
Governments often treat citizens as if they are too
immature to manage their own lives. Politicians
decide what is good for citizens and what is
not. They get so caught up believing in the
superiority of their judgement that they pass law
after law without any consistency.
Governments promise to provide clean water,
then require us to drink water containing fluoride.
They say that gambling is bad, but gambling at
state owned or licensed casinos and horce races
is okay. Governments prevent us from smoking
marijuana, but encourage us to drink alcohol by
using tax money to subsidize vineyards.
The odd thing is that marijuana makes
people placid whereas alcohol often makes
them aggressive. Military personnel are often
provided with low cost alcohol and tobacco on
military bases. When people become sick from
government subsidised tobacco or alcohol,
taxpayers are often required to pay for their
medical treatment.
If wine and alcohol production is profitable,
creates jobs, and lifts the standard of living for the
whole community, then surely the production of
marijuana cigarettes, creams and lotions would
The more prohibitions
you have, the less
virtuous people
will be. Try to
make people moral,
and you lay the
groundwork for vice.
Lao-tsu, Tao Te Ching
Good laws make it
easier to do right and
harder to do wrong.
William E. Gladstone
215 Chapter 35 • Merryberries
have the same financial effect? By banning the
use of marijuana, thousands of non-aggressive
people are put in jail all over the world. This
places a financial strain on the economy as these
people are made non-productive but still have to
be fed and clothed by the rest of society. By the
time these marijuana users come out of jail they
have been schooled in the methods of aggressive
crimes.
Governments say they want to create job
opportunities. Surely allowing the farming
of marijuana hemp and the manufacture of its
many by-products would help alleviate the job
shortages and raise living standards? In countries
where research in marijuana has been allowed, it
has been found to help with glaucoma and with
the pain and constant vomiting caused by certain
anti-cancer therapies.
So instead of governments helping the poor
and sick, and instead of allowing individuals to
relax quietly at home without disturbing others,
politicians create victims by throwing innocent
people into jail and making hardened criminals
out of them.
All the time and money spent on easy-going
marijuana users could be more constructively
used to deal with the real crimes of violence.
Background
Canada reformed its medical marijuana laws in
1999. Those who suffer cancer across the border
in America still have to flee to Canada to get this
form of medical help from Canadian doctors.
The citizens of Canada can reduce their medical
bills by growing their own marijuana.
In Belgium it has been made legal for people
over the age of 18 to smoke marijuana in private,
as long as they do not disturb public order.
For years doctors in the Netherlands have
recommended marijuana to cancer patients, to
stimulate appetite and to battle pain and nausea.
It will be found an
unjust and unwise
jealousy to deprive
a man of his natural
liberty upon a
supposition that he
may abuse it.
Oliver Cromwell,
1599-1658
You choose your own
goals based on your
own values.
Extract from
Jonathan’s Guiding
Principles
216 Chapter 35 • Merryberries
Patients have usually bought marijuana at one of
the hundreds of Dutch “coffee shops” where it is
sold openly. Dutch law now allows pharmacies
to fill prescriptions for marijuana for medical
use. The Dutch Ministry of Health says the law
is intended to standardize medical marijuana
and to encourage the development of marijuana
as medicine. The Dutch government plans to
license several growers to provide marijuana to
pharmacies.
Mary Jane is a common term for marijuana
in the US and a doobie is a marijuana cigarette.
References
In Mary Ruwart’s Healing Our World the chapter
“Dealing in Death”, has interesting statistics on
drugs, choice, and enforcement.
Another excellent book about freedom is On
the Duty of Civil Disobedience by Henry David
Thoreau. One act of his civil disobedience was
to go to jail rather than to pay a tax that he felt
supported war with Mexico and the enforcement
of plantation slavery. How many people today
would go ahead and pay the tax instead of
running the risk of going to jail for immoral
actions of government?
Doug Thorburn’s book, Drunks, Drugs &
Debits: How to Recognize Addicts and Avoid
Financial Abuse, explains how addicts exploit
the conscience and personal wealth of those who
care for them.
Mark Emery’s website on putting an end
to marijuana prohibition may be seen at:.
For drug policy reform organizations see:.
Those readers lucky enough to be living under
governments that allow inexpensive connection to
the Internet will enjoy A Drug War Carol, a comic
strip by Susan Wells and Scott Bieser, available at:.
Every friend of
freedom... must be
as revolted as I am
by the prospect of
turning the United
States into an armed
camp, by the vision of
jails filled with casual
drug users and an
army of enforcers
empowered to invade
the liberty of citizens
on slight evidence.
Milton Friedman,
Nobel Prize-
winning free market
economist, Wall
Street Journal,
September 7th, 1989
Chapter 36
The Grand Inquirer
T
he shadows had lengthened into late afternoon. Jonathan and
his two acquaintances, Mary Jane and Doobie, emerged from
the alley. Somewhere on the street, Mices rejoined him as they
walked to a grassy park. People entered the park from all directions,
some on foot and some on knees, and gathered around a hillock in
the centre.
“Good,” said Mary Jane, “we’re early. Soon this place will be
filled with followers who have come to hear the Grand Inquirer’s
truth. All your questions will be answered.” They sat down on a
mound of grass. Doobie, overcome by food and whiskey, promptly
fell back and passed out. Mary Jane grew quiet. Families settled
under the trees and all waited expectantly.
Jonathan overheard a man behind him say, “Wonderful! I didn’t
expect the Grand Inquirer today.”
His companion replied, “Nobody expects the Grand Inquirer,
whose chief elements of proof are...”
At that instant a tall, gaunt figure clad completely in black, strode
rapidly into the middle of the gathering. His eyes slowly swept the
faces gazing up at him. The murmuring of the crowd stopped and
all grew silent.
The man’s hard voice seemed to rise from the very ground
and penetrate Jonathan’s whole body. “Peace is war! Wisdom is
ignorance! Freedom is slavery!”
Jonathan glanced around at the silent awestruck crowd. The
Grand Inquirer had mesmerized his audience. But young Jonathan
blurted, “Why do you say freedom is slavery?”
Stunned by Jonathan’s brashness, Mary Jane chided him in a
whisper, “I said you’ll have your questions answered – I didn’t say
you could ask him questions.”
The Grand Inquirer fixed a piercing look on his young examiner.
No one before had ever had the nerve to challenge him. The light
Chapter 36 • The Grand Inquirer 218
rustle of wind in the leaves made the only sound in that park.
Then the Grand Inquirer growled, half at Jonathan, half at the
crowd, “Freedom is the greatest of all burdens that mankind can
bear.” Roaring at the top of his voice, the man raised his arms and
crossed his wrists high above his head, “Freedom is the heaviest of
chains!”
“Why?” persisted Jonathan, finally feeling the courage of an
outsider who doesn’t worry much about what others might think of
him.
The Grand Inquirer moved directly in front of Jonathan and
spoke gravely, “Freedom is a monumental weight on the shoulders
of men and women because it requires the use of mind and will.”
With a roar of pain and horror, the Grand Inquirer warned, “Free-
will would make you all fully responsible for your own actions!”
The crowd shuddered at his words; some clapped their hands over
their ears in fright.
“What do you mean ‘responsible’?” asked Jonathan in an
unwavering voice.
The Inquirer retreated a step and his face softened in a kindly
expression. He reached down to pluck a sprig growing near his foot.
“My beloved brothers and sisters, you may not realize the dangers
of which I speak. Close your eyes and imagine the life of this tiny
plant.” His voice grew soft and caressed the crowd.
Everyone, except Jonathan, pressed his or her eyes tightly
closed and concentrated. Hypnotically, the Grand Inquirer began to
describe a picture to the assembly. “This little plant is but a frail
bit of shrubbery, rooted in soil and fixed upon the earth. It is not
responsible for its actions. All of its actions are pre-set. Ah, the bliss
of a shrub!”
“Now, beloved, imagine an animal. A cute, busy little mouse
scurrying to find its food among the plants. This furry creature is not
responsible for its actions. All that a mouse does is predetermined
by nature. Ah, nature. Happy animal! Neither plant nor animal
suffers any burden of the will because neither faces choice. They
can never be wrong!”
A few in the crowd murmured, “Yes, Grand Inquirer, yes, yes,
so it is.”
Chapter 36 • The Grand Inquirer 219
This charismatic leader straightened, suddenly taller, and
continued, “Open your eyes and look around you! A human being,
one who succumbs to values and choices, can be wrong, I tell
you! Wrong values and choices can hurt you and others! Even
the knowledge of choice will cause suffering. That suffering is
responsibility.”
The people shuddered and huddled closer together. A boy seated
next to Jonathan cried out suddenly, “Oh please, master. How can
we avoid this fate?”
“Tell us how to rid ourselves of this terrible burden,” pleaded
another.
“It will not be easy, but together we can conquer this terrifying
threat.” Then he spoke in a voice so soft that Jonathan had to lean
forward to catch his words. “Trust me. I will make the decisions
for you. You are then relieved of all the guilt and responsibility that
freedom brings. As decision maker, I will take all the suffering upon
myself.”
Then the Inquirer flung his arms high and shouted, “Now go
forth, every one of you. Comb the streets and alleys, knock on every
door. Get out the voter as I have instructed you! Victory is at hand
for me, your decision maker on the Council of Lords!” And the
crowd shouted their approval, rose as one and scrambled away in all
directions. They pushed and shoved, eager to be the first to hit the
streets.
Only Jonathan and the Grand Inquirer were left – and Doobie,
gently snoring in the grass. Jonathan sat in disbelief. He watched
the mad dash of the group, then he peered at the face of the man in
black. The Inquirer looked past Jonathan, as if seeing some distant
vision. Jonathan broke the eerie silence with one more question.
“What virtue is there in turning all decisions over to you?”
“None,” replied the Inquirer with a contemptuous sneer. “Virtue
can only exist if there is freedom of choice. My flock prefers
serenity to virtue. As for you, little one with too many questions,
what do you prefer? Let me make your choices, too. Then your
questions won’t matter.”
Speechless, Jonathan walked away from the empty park. The
Grand Inquirer’s laughter rang out behind him.
220 Chapter 36 • The Grand Inquirer
Brainstorming
• What is responsibility?
• Do people want responsibility?
• Do people want leaders to make decisions
for them?
• Is there a danger in letting politicians make
decisions for you?
• Should adults have to accept rulings with
which they disagree?
• Is choice necessary in order to achieve
virtue?
• Are choice and virtue important to society?
• Why?
• Examples?
• What ethical issues are involved?
Commentary
It is a burden to have the freedom to make one’s
own choices and to decide one’s own values.
Free will entails using one’s mind. It entails
thinking for oneself and taking responsibility for
the outcome.
The freedom to choose is a weight some
people find too heavy to bear – especially if
they have never been given the chance to do
so. They prefer to abdicate the burden of this
responsibility. They prefer to have decisions
made for them, to trust other people’s decisions
and to believe that everything will be provided
for them. In this way they will have someone
to blame when things go wrong. When things
go right, it further entrenches their indebtedness
to the decision makers. Surely, they think, they
could never have made those clever decisions for
themselves. These people are usually comfortable
with making only one decision – to live under a
system where all decisions are made for them –
from the cradle to the grave.
Political language is
designed to make lies
sound truthful and
murder respectable,
and to give an
appearance of
solidity to pure wind.
George Orwell
When the freedom
they wished for most
was freedom from
responsibility, then
Athens ceased to be
free.
Edward Gibbon,
1737 – 1794
221 Chapter 36 • The Grand Inquirer
Charismatic personalities play on this
vulnerability. They seduce personal freedoms
by delivering carefully honed speeches with
mysterious reasoning. They imply that if their
reasoning is not understood, then it is others who
must be inferior, uninformed, and unqualified to
decide what is good for themselves. Therefore,
they imply, all decisions for our care and welfare
should be left in their capable hands.
When questioned, these charismatic people
respond that others either do not know all the
“sensitive” issues involved, or they are uncaring,
unpatriotic, or biased. To persist in questioning
these eager rulers, one would need the courage
of a daring pressman.
With befuddling arguments and evasions,
charismatic politicians erode our personal
freedom “with our permission”. A lost freedom
is rarely returned. Losing our freedom to choose
reduces us to the role of puppets under a ruler’s
power and command. With the stroke of a pen,
rulers command our lives: when to work (number
of hours on permissible days), when to rejoice
(prescribed public holidays), what we may do in
the privacy of our homes, what may go into our
bodies, when we may protest, and when we must
sacrifice our lives in their wars. In return they
offer us the feeling of being “good”, “loyal”, and
“patriotic” citizens.
One who genuinely cares about people does
not take away freedom. The one who really cares
for his neighbours allows freedom – freedom to
fail and to succeed, freedom to question and to
find independent solutions. In this way, each
will better himself for his own purpose. Each
will become self-sufficient and will find his own
dignity.
We have an answer
for all. And they will
be glad to believe
our answer, for it
will save them from
the great anxiety
and terrible agony
they endure that
present in making
a free decision for
themselves.
Fyodor Dostoyevski’s
“The Grand
Inquisitor” in The
Brothers Karamazov.
It’s very difficult to
live in a free society
after having all
decisions made for
you by ‘the bosses’.
Elbegdorj Tsakhia,
former prime minister
of Mongolia, 1998
222 Chapter 36 • The Grand Inquirer
Background
Dostoyevski’s Grand Inquisitor in The Brother’s
Karamozov is a riveting dialogue between
a returning Jesus and the Grand Inquisitor
who will have him imprisoned. They discuss
whether or not people want to have personal
responsibility, choices, and decisions.
George Orwell’s 1984 contains the words
“War is peace, freedom is slavery, ignorance is
strength.”
References
Milton and Rose Friedman Free to Choose.
In The Law, Frederic Bastiat.
Doug Thorburn’s book, Drunks, Drugs
& Debits: How to Recognize Addicts and
Avoid Financial Abuse, shows how personal
responsibility is inextricably connected with
choices in life.
To find out what system you prefer to live
under see “The World’s Smallest Political
Quiz” at the web site of The Advocates for
Self Government:.
html.
I am freeing man
from the restraints
of an intelligence
that has taken
charge, from the
dirty and degrading
self-mortifications
of a chimera called
conscience and
morality, and from
the demands of a
freedom and personal
independence which
only a few can bear.
Adolf Hitler
Chapter 37
Loser Law
J
onathan hoped it was time to rendezvous with Alisa. He fre-
quently thought of her. Moreover, he looked forward to telling
her about his experiences. In anticipation, his footsteps quickened
on the pavement.
As he retraced his path, Jonathan heard shouting and whooping
from a great throng of people. In a vacant lot across from BLOCK
A, BLOCK B, and BLOCK C, a raised, square platform had been
erected and was surrounded by ropes. An excited, shouting crowd
pressed close to the perimeter. He noticed that everyone in the
crowd was wearing a wide strap or brace on their backs.
In the middle of the platform, a man was yelling at the top of
his lungs. “In this corner – weighing 256 pounds – five months the
undefeated champion of the Workers’ International Competition –
the Terrible Tiger – Karl ‘the Masher’ Marlow!” The crowd went
wild.
Off to one side, a man with a scar on his face sat at a rickety
table, deftly shuffling through a pile of papers and stacks of money.
The man looked up at Jonathan and barked, “Place your bet, sonny.
Only a few seconds before the next round.”
An eager old woman, elbowed Jonathan aside and slapped a
handful of bills on the table. “Fifty on the champ, quick!” she
demanded.
“Okay, lady,” said the clerk. He stamped a ticket, tore the stub
from a ledger, and handed it to her.
The announcer crossed the platform calling out, “And in the far
corner – the challenger – weighing in at 270 pounds of pure muscle
– the knuckle-crunching stevedore...”
Turning to the man at the table, Jonathan asked, “Some trouble
going on? Is there going to be a fight?”
“A fight for sure, but hardly any trouble,” said the man with a
grin. “Never had it so good.” The bell clanged and the man shouted
Chapter 37 • Loser Law 224
to the crowd, “Bets closed!” Both men leaped forward, swinging
punches and ducking each other’s blows.
“Listen, sonny, there’s nothing to get nervous about,” consoled
the clerk. “The winner and the loser both take home a bundle of
cash.”
One of the fighters suddenly hit the floor, knocked on his back
by a solid punch. The crowd roared with enthusiasm while the clerk
counted money into an iron box.
“Both win a prize?” asked Jonathan.
“...five hundred, six hundred... sure,” said the man, stopping the
count momentarily. “This is the most popular fight on the island.
Sometimes the loser makes out better than the winner... seven
hundred, ... eight hundred...”
Jonathan’s eyes widened. “Anyone can get rich by losing?”
“Not everyone. You’ve got to have a good job to lose before you
can take on the champ.”
“I don’t get it,” said Jonathan. “Why would a worker risk his job
to get smashed by the champ?” The bell ended another round and
the crowd quieted down.
“...nine hundred, a thousand. That’s the whole idea. Haven’t you
ever heard of the Loser Law?” asked the man, tapping the money
into neat stacks. “The Loser Law eliminates the risk. The loser
doesn’t worry about a thing – pay cheques, doctor bills, nothing.”
“Why not?” asked Jonathan.
“After a fight, the loser never works again and his employer pays
everything.”
Jonathan craned his neck over the crowd and saw one man
slumped in the corner getting his face mopped by a ring assistant.
“What’s the employer have to do with this fight?”
“Nothing, really,” said the man. “The worker claims he got
injured on the job and can’t go back to work, right?”
“Okay,” replied Jonathan, trying hard to follow. “You mean the
loser might lie in order to get the money?”
“It’s been known to happen,” said the man with a sly wink.
“Don’t get me wrong, not all workers will lie to get a free ride. But
the Loser Law rewards those who do. So every day we’re getting
Chapter 37 • Loser Law 225
more players. It’s an attractive arrangement. No one has disproved
a claim in forty years.”
Jonathan finally understood why everyone was wearing those
special straps and back braces. “What does the Council do about
it?”
The man chuckled, “They’ll support us on anything – and we’re
loyal on Election Day.”
“Police!” shouted someone in the crowd. Dozens dropped to
their knees. The clerk quickly clapped his moneybox shut, folded
up the table, and whistled nonchalantly.
Jonathan scanned the street for signs of the police. Seeing
Officer Stuart and other policemen approach the ring, Jonathan
asked, “What’s the matter? Is the fight illegal?”
“Heavens no,” replied the man coolly. “The police enjoy a good
match as much as the next guy. It’s freelance gambling that’s illegal.
The Council of Lords says that games of chance are immoral –
except at the Special Interest Carnival where they take a cut of the
winnings. As for Tweed, well, she thinks it’s better if we save our
bets for the election.”
Just then the bell rang out and the crowd cheered. Jonathan felt
a tap on his shoulder and turned. It was Alisa. She smiled and said,
“Where’s your cat?”
226 Chapter 37 • Loser Law
Brainstorming
• If innocent people must pay for the
misfortune of others, how does this affect the
behaviour of all?
• Would people become more reckless or less
reckless if they knew that others would have
to pay for their injuries and loss of income?
• Why might people be motivated to fake
injury?
• Does it matter?
• When is gambling allowed or not allowed?
• Why?
• Examples?
• Ethical issues?
Commentary
Crimes committed using paperwork are known
as “white-collar” crimes because they are
usually committed in offices by people wearing
suits and white shirts. Since white-collar crimes
are not physically violent, they are often thought
of as not being “really” bad. Besides, the unseen
victims seem to be able to afford the losses.
White-collar criminals, who would not dream of
stealing 10 kayns from a hard-up friend, convince
themselves they are guiltless in stealing 10 kayns
from an unfamiliar millionaire or from a group
of unknown people. Both of whom might have
worked just as hard as, or harder, than the hard-
up friend. Fraud committed against any person,
or group of people, is still fraud.
Taking fraudulent advantage of an insurance
scheme is stealing a little bit from a great many
people. The thief is stealing not only from the
stockholder, but also from each participant who
is meant to benefit from the programme. This
makes each participant poorer. The participants
are poorer not only by the amount defrauded,
but also by the extra amount everyone has to
pay in order to keep the benefit programme
The initiation of force
to take life is murder,
to take freedom
227 Chapter 37 • Loser Law
going. When people see someone benefiting
from this fraud, many others want their slice
of “this commons” too. The more money taken
fraudulently, the more the premiums have to be
raised to keep the benefit fund going. Everyone
becomes a loser.
Likewise, when organisations are centralised
in bureaucracies, officials become so far removed
from the membership that the members become
distant “unseen non-people”. The money with
which they are dealing does not appear to belong
to anyone in particular. Thus, taking a few
thousand kayns here or there appears, to these
criminals, as a lesser crime than stealing a loaf
of bread.
Both of these types of fraud are more likely
to occur in large centralised organisations. The
nearer the money is kept to the people, the less
likely it is that fraud will be committed.
This is one of the many reasons why it is
important for governments to remain small
and lean. Government officials should be easily
reachable by people paying any sort of tax,
licence, or government fee.
The most important fact is that “social benefit”
schemes run by governments often experience a
financial “tragedy of the commons”. They appear
to belong to everyone, yet they belong to no one
and so people think “I better get my slice before
someone else does – by fair means or foul”.
Background
In a free market, choice is the greatest benefit of
the workers. When benefits are not assigned and
operated by government, there are more options
from which to choose. Employers have more
choice of insurance benefits and providers, or
they may provide no benefits. Workers will have
the choice of selecting to work for companies
that have generous benefits and lower pay, or for
companies that pay them more and allow them
Liberty (individual
freedom) is the prize,
responsibility the
price.
Dick Randolph
228 Chapter 37 • Loser Law
to select self-insurance through personal savings
or independent policies.
Remarks
In Hawaii, employers must pay hefty sums
to a workers’ compensation system run by
the state. Yet it seems that many people have
taken advantage of this system by claiming
fake injuries in order to stop working and to
live off the mandated insurance scheme. The
easiest claim is for a bad back, which is virtually
impossible to disprove. While the state orders
that every employer must pay into the system,
the courts block efforts to screen phoney claims,
even when there is an abundance of evidence of
fraud. And so the taxes soar.
References
David Friedman The Machinery of Freedom.
Milton and Rose Friedman Free to Choose.
R.W. Grant The Incredible Bread Machine.
Cato Institute:.
?
Compensation...
Man, to the small
son of a workman
who had an accident:
“When will your
father be fit to work
again?”
Boy: “Can’t say for
certain, but it will be
a long time.”
Man: “What makes
you think that?”
Boy: “Because
compensation
has set in.”
Chapter 38
The Democracy Gang
J
onathan didn’t have time to say hello. Someone screamed, “It’s
them! The Democracy Gang! Run for cover!”
“Run, run,” shouted a kid, who sprinted past Jonathan.
Alisa’s face lost its colour. “We’ve got to get out of here – fast!”
First to disappear were the police. The crowd scattered in all
directions – many of them shedding their back braces to run faster.
Three whole families, with children in tow, raced down the stairs
of BLOCK B, while some tossed belongings out flames. Frozen with fear, Jonathan grabbed
Alisa’s arm demanding, “What’s going on? Why’s everyone so
scared?”
Tugging wildly against his grip, Alisa yanked Jonathan to his
feet and cried out, “It’s the Democracy Gang! We’ve got to get out
of here quick!”
“Why?”
“No time for questions, let’s go!” she shouted. But Jonathan
refused to budge. Scared to death she cried, “Let’s go or they’ll get
us!”
“Who?”
“The Democracy Gang! They surround anyone they find and
then they vote on what to do with them. They take their money, lock
them in a cage, or force them to join their gang. There’s nothing
anyone can do to stop them!”
Jonathan’s head was spinning. Where were those ubiquitous
police now? “Can’t the law protect us from the gang?”
Chapter 38 • The Democracy Gang 230
“Look,” said Alisa, still wriggling to escape Jonathan’s hand,
“run now and talk later.”
“There’s time. Tell me, quickly.”
She looked over his shoulder. She swallowed hard and spoke
frantically. “When the gang first attacked people, the police hauled
them into court for their crimes. The gang argued that they were
following majority rule, just like the law. Votes decide everything –
legality, morality, everything!”
“Were they convicted?” asked Jonathan. By now, the street was
completely deserted.
“Would I be running now if they had been? No, the judges ruled
three to two in the gang’s favour. ‘Divine Right of Majorities’ they
called it. Ever since then the gang has been free to go after anyone
they could outnumber.”
The senseless rules and ways of the island finally got to Jonathan.
“How can people live in a place like this? There must be a way to
defend yourself!”
“Without weapons, you can only flee or join another gang with
more members.”
Jonathan loosened his hold and they both ran. On and on they
went, up alleys, through gates, around corners, across plazas. Alisa
knew the town as well as she knew the back of her hand.
The two kept running until they were exhausted. Finally, well
beyond the streets and houses, they climbed a steep cliff hoping
to reach safety high above the town. The last rays of sun died in
the west and Jonathan saw fires breaking out in the town below.
The sounds of distant screams and shouts occasionally floated up to
their perch.
“I can’t go any further,” gasped Alisa, her long brown hair draped
over her shoulders in a tangle. She leant against a tree, panting to
regain her breath. Jonathan sat down exhausted and braced himself
against a rock. In her mad run, she had torn her frock and lost her
shoes. “I wonder what happened to my family,” she worried.
Jonathan worried, too. He thought about the old couple who
had taken such good care of him the night before – and their little
grandson, Davy. Every individual seemed helpless in this strange
Chapter 38 • The Democracy Gang 231
world. “Alisa, too bad you don’t have a good Council to keep the
peace.”
Alisa stared at Jonathan and sat down next to him. “You’ve got
it mixed up,” she said. Still trying to catch her breath, she pointed
in the direction of the riots. “For as long as anyone can remember,
people have learned to take from each other by force. Who do you
suppose taught them?”
Jonathan frowned and answered. “You mean someone taught
them to use force against each other?”
“Most of us learned it by example every day.”
“Why didn’t the Council of Lords stop them?” said Jonathan.
“The Council is force,” said Alisa, emphatically, “and most of
the time it’s used against people instead of protecting people.” She
saw Jonathan’s blank look. He obviously didn’t have the slightest
idea of what she was talking about. She pushed her forefinger into
his shoulder and said, “Listen, when you want something from
another person, how could you get it?”
Still feeling his bruise from the robber, Jonathan responded,
“You mean, without a gun?”
“Yes.”
“Well, I could try to persuade them,” answered Jonathan.
“Right. Or?”
“Or – or, I could pay them?”
“Yes, that’s a kind of persuasion. How else?”
“Hmmm. Go to the Council of Lords for a law?”
“Exactly,” said Alisa. “With government you don’t have to
persuade people. If you get the Council of Lords on your side, either
by votes or bribery, then you can force others to do what you want.
When someone else offers the Council more, then he can force you
to do whatever he wants. And the Lords are always winners.”
“But I thought government encouraged co-operation,” said
Jonathan.
“Hardly! Who needs co-operation when you can use force?”
responded Alisa. “Anyone with power can win whatever they want
– and the rest have to put up with it. It’s legal, but the losers remain
unconvinced, bitter, and hostile.”
Chapter 38 • The Democracy Gang 232
Alisa directed Jonathan’s gaze to the fires below. “Look at the
riot down there,” she said. “Society is torn apart by this constant
struggle for power. All over the island, groups that lose too many
votes eventually explode in frustration.”
She sat still for a long time. A tear began to trickle down her
cheek. “My dad and I have arranged a special place to meet when
this happens. But I’ll wait until the fires die down.”
Jonathan sat quietly a long time, bewildered by these two long
days since the storm. By the time he looked back at Alisa, she
had fallen into a deep sleep. He was very impressed with her –
everything about her. As he made himself comfortable, he thought,
“She’s no simple Phoebe Simon.”
233 Chapter 38 • The Democracy Gang
Brainstorming
• Is it okay for one person to take from another
person by force?
• Is it better to use persuasion or force to solve
social problems?
• Is it okay for majorities to take property, or
life, or freedom, from minorities by force?
• What may majorities do that individuals are
not allowed to do?
• How can politics lead to riots?
• Examples?
• What are the ethical issues involved?
Commentary
Freedom and democracy are not the same.
Democracy has come to mean the rule of leaders
who are favoured by a majority of the citizens.
In other words, it is the majority leader who
rules all, even over those who did not vote for
him. In a country where people are disenchanted
with an electoral system that is dominated by
an influential elite, voter participation may fall
dramatically and a very small number of people
may select the rulers for everyone.
Even countries that are ruled by dictatorships
usually claim to be “democratic” if they go
through the motions of a sham election where
opposition is not allowed. A country is said to
be democratic if it has had an election. However,
an election does not give freedom to individuals.
Individual freedom occurs when people have
a right to make their own choices, even when
99% disagree. As soon as a voter casts his vote,
power is shifted to rulers who presume to be
“superior”human beings.
Once in power, the removal of the elected
“gang” from office is extremely difficult as they
establish the rules for the next election to favour
themselves.
Government of
the people, by the
people, for the
people, usually ends
up as government
of the people, by the
government, for the
government.
Richard Needham
1977
Government is not
reason; it is not
eloquence; it is
force. Like fire, it is
a dangerous servant
and a fearful master.
George Washington
234 Chapter 38 • The Democracy Gang
Democracy makes actions by rulers legal; it
does not make these actions just. A group has no
right to initiate the use of force against anyone
they can outnumber.
A glance at certain factors in society may
give a good indication of a country’s degree of
freedom:
The leaders: How many bodyguards surround
them? How do they deal with the people who did
not vote for them? Do they grant favours to those
who do support them? How much corruption is
allowed? What privileges do they have which
the ordinary citizen does not have? Is there
movement towards centralized government that
is isolated from the people? How many people
are in prison? How crowded are the prisons?
How many government programmes would
survive if the public could vote directly on the
money to pay for each of these?
Personal freedom: How much freedom
is there to decide on the education of one’s
children? Are people allowed to marry without
a licence? Are they allowed to earn a living as
they wish? Are they allowed to trade (export,
import and domestic) without government
interference?
Culture of freedom: How free is the media
to criticise the government? Is there freedom
to broadcast without government licensing or
interference?
Attitudes of the people: Do citizens take
responsibility for their own lives, their health
care, and their retirement? Do people believe that
competition is better than government monopoly
and central planning? Are people pleased at the
economic success of others?
Personal freedom and responsibility are
essential for a blossoming of civilization.
What is beyond democracy?
Whenever you find
yourself on the side of
the majority, it’s time
to pause and reflect.
Mark Twain
The smallest minority
on earth is the
individual. Those
who deny individual
rights cannot claim
to be defenders of
minorities.
Ayn Rand, 1962
What is the ballot?
It is neither more
nor less than a paper
representative of the
bayonet and the
bullet. It is a labour
saving device for
ascertaining on
which side force lies.
Benjamin Tucker
235 Chapter 38 • The Democracy Gang
Background
In the Middle Ages, people were told that God
anointed one person, the King, to rule them
– “The Divine Right of Kings”. John Locke
challenged this, saying all individuals have
the same rights – “Natural Rights”. However,
over the years individual rights continue to be
challenged by rulers (ruling parties), who act on
behalf of a majority vote. This could be called
“The Divine Right of Majorities”.
References
Ayn Rand’s novel Atlas Shrugged shows what
happens when the majority vote forces its will
upon the minority at the Twentieth Century
Motor Company.
A Liberty Primer by Alan Burris is packed
with information on “freeing the people”.
On the Duty of Civil Disobedience, by Henry
David Thoreau, gives an excellent case for
individual rights against the majority.
The Fraser Institute’s Index of Economic
Freedom is the result of a yearly in-depth study.
To find out how much economic freedom exists
in your country click on it at:. freetheworld. com/cgi-bin/
freetheworld/getinfo2002.cgi
On going beyond democracy see Christian
Michel’s thought provoking article Why I Am
Not A Democrat (I Prefer Freedom) at:
democrat.htm
For inspiration on the plan for a region totally
free from restrictions in Costa Rica see:
?
Democracy: Two
wolves and one sheep
voting on what to
have for breakfast.
H.L. Mencken
A democracy is
nothing more than
mob rule, where
fifty-one percent of
the people may take
away the rights of the
other forty-nine.
Thomas Jefferson
Chapter 39
Vultures, Beggars, Con Men,
and Kings
N
ext morning, the first rays of light awakened Jonathan. He
heard purring; Mices was enjoying a long stretch – digging
his claws in the soil. Jonathan rubbed his eyes and looked wearily
around. Aside from a few columns of smoke, the town seemed
quiet again. Hungrily he searched his pockets and found a couple of
remaining slices of bread. He ate one and, trying not to wake Alisa,
gently placed a slice under her hand. But she stirred and sat up.
“I want to take a look from the top of this mountain,” he told
her. She agreed and they began heading up the steep slope together.
Soon the path gave way to rocks that required hand over hand
climbing and hauling, using any protruding branch or root. Well
ahead of Alisa, but behind Mices, Jonathan arrived at an outcrop
near the top. He surveyed the town far below. The summit was near,
so he continued up an incline and through a cluster of stunted and
twisted trees.
“People!” he said to himself, exasperated. “Constantly pushing
each other around. Threatening each other. Arresting each other.
Robbing and harming each other.”
Eventually, the trees thinned out to a few bushes, and then, a
pile of large boulders. A faint, full moon could still be seen fading
in the dawn, slipping closer to the horizon. The air was cool and
pleasant as he trudged along. On the peak was a single scraggly tree
with a big, ugly vulture perched on a bare branch. “Oh no,” groaned
Jonathan, who had hoped for a more lonely spot. “Just my luck. I
leave behind a valley of vultures in order to find peace and what do
I find? A real vulture!”
“I am a condor!” echoed a deep, gruff voice.
Jonathan froze. Mices jumped, then arched his back and began
to hiss. Jonathan’s eyes, wider than the moon, moved slowly,
Chapter 39 • Vultures, Beggars, Con Men, and Kings 238
surveying the area. His heart pounded fast in his ears. Lips
trembling, he asked, “Who said that?”
“Who said that?” repeated the voice. It seemed to come from
that isolated tree.
Jonathan eyed the vulture-like bird. Neither moved. He spoke,
“You talk? Birds can’t talk!”
Mustering his courage and taking a deep breath, Jonathan
slowly approached the tree. The bird didn’t move a feather, though
Jonathan had the distinct feeling of being under its gaze.
Again Jonathan spoke, trying to keep his voice steady, “You
talk?”
“Of course!” replied the condor arrogantly. “I am a condor,
the largest member of the proud vulture family.” Jonathan’s knees
buckled and he nearly fell. He caught himself in time and lowered
in a crouch before the tree. “You – you, can speak?”
“Ahem,” puffed the bird. “Can you? You don’t seem to know
what you’re saying half the time. Just mimicking, I suppose.” The
bird swivelled his head slightly and said, in an accusing tone, “What
did you mean when you said you left a valley of vultures?”
“I – I – I’m sorry. I didn’t mean to insult you,” sputtered
Jonathan, feeling a little silly to be talking with a bird. “All those
people down there were so cruel and brutal to each other. It’s just a
figure of speech about vultures and such. The people reminded me
of, well, of...”
“Vultures?” The bird expanded the ruff of feathers below his
bald head and neck. Jonathan nodded meekly.
Alisa emerged from the trees and the sight of the exchange
took her breath away. “He exists!” she exclaimed. She hastened to
Jonathan’s side and grasped his arm whispering, “The great Bard
really exists! I thought it was only a myth. I never imagined – and
so big and ugly!”
The condor grunted and flapped his great wings before settling
back on his branch. “Thank you for the kind introduction, Alisa.”
Seeing her surprise at hearing her name, the Bard responded,
“You knew of me. Why shouldn’t I know of you and your friend,
Jonathan?”
Alisa and Jonathan looked at the condor, awestruck.
Chapter 39 • Vultures, Beggars, Con Men, and Kings 239
“I’ve watched you both for some time now, especially Jonathan’s
harrowing trial at sea,” said the Bard. “You’re brave and clever,
young man, but easily fooled. Alisa is more insightful, more likely
to trust actions than words.”
“I don’t understand,” said Jonathan.
“To you, this land is all vultures. Hmph! If that was true, then
this would be a far better island than it is.” The bird raised its
ugly, naked head proudly. “You have come to an island of many
creatures – vultures, beggars, con men, and kings. But you don’t
recognize who is worthy because titles and words deceive you. You
have fallen for the oldest of tricks and hold evil in high esteem.”
Jonathan defended himself. “There’s no trick. Vultures, beggars,
and so forth are easy to understand. Where I come from, vultures
pick the bones of the dead. That’s disgusting!” Jonathan’s nose
wrinkled in emphasis. “Beggars are simple and innocent. Con men
are clever and funny – sort of mischievous.”
“As for kings and royalty,” added Jonathan quickly, his eyes
dancing with a glint of excitement, “well, I’ve never met any in
real life, but I’ve read that they live in beautiful palaces and wear
gorgeous clothes. Everyone wants to be like them. Kings and their
ministers rule the land and serve to protect all their subjects. That’s
no trick.”
“No trick?” repeated the Bard, amused. “Consider the vulture.
Of the four, the vulture is the only one of true nobility. Only the
vulture does anything worthwhile.”
The great bird stretched its scrawny neck again and glared at
Jonathan. “Whenever a mouse dies behind the barn, I clean up.
Whenever a horse dies in the field, I clean up. Whenever a poor man
dies in the woods, I clean up. I get a meal and everyone is better off.
No one ever used a gun or a cage to get me to do my job. Do I get
any thanks? No. My services are considered dirty and foul. So the
‘ugly’ vulture must live with verbal abuse and no appreciation.”
“Then there are the beggars,” continued the condor. “They don’t
produce. They don’t help anyone, except themselves. But they do
no harm either. They keep themselves from dying in the woods, of
course. And it can be said that they provide a sense of well-being to
their benefactors. So they are tolerated.”
Chapter 39 • Vultures, Beggars, Con Men, and Kings 240
“Con men are the most cunning and have earned a high place in
poetry and legend. They practice deceit and cheat others with the
words they weave. Con men perform no useful service, except to
teach distrust and the art of fraud.”
Rearing up and throwing his huge wings open, the condor sighed
deeply. A faint smell of rotten meat drifted down in the morning
air.
“The lowest are royalty. Kings need not beg nor deceive; though
they often do both. Like robbers, they steal the product of others
with the brute force at their command. They produce nothing,
yet they control everything. And you, my naive traveller, revere
this ‘royalty’ while you scorn the vulture? If you saw an ancient
monument,” observed the Bard, “you would say that the king was
great because his name was inscribed at the top. Yet, you give no
thought to all the carcasses that my kind had to clean up while the
monument was being built.”
Jonathan spoke up, “True, in the past some kings were villains.
But now voters elect their leaders to a Council of Lords. They’re
different because – well, because they’re elected.”
“Elected Lords different? Ha!” cried the condor harshly.
“Children are still raised on fantasies about royalty and, when they
grow up, royalty is still what they expect. Your elected Lords are
nothing more than four-year kings and two-year princes. Indeed,
they combine beggars, con men, and royalty all rolled into one!
They beg or scheme for contributions and votes; they flatter and
deceive at every opportunity; they prance around the island as
rulers. And, when they succeed in their exploits, those of us who
truly produce and serve get less and less.”
Jonathan fell silent. He gazed back down to the valley and
nodded his head in resignation. “I’d like to see a place where it isn’t
like that. Could there be such a place?”
Lifting his great wings, the condor sprang from the tree and
landed with a resounding thud next to Jonathan and Alisa. They
jumped back, surprised at the great size of the bird. The Bard leaned
over them, almost twice their height, with a gigantic wingspan.
“You would like to see a place where people are free? Where
force is used only for protection? You would like to visit a land
Chapter 39 • Vultures, Beggars, Con Men, and Kings 241
where officials are governed by the same rules of behaviour as
everyone else?”
“Oh yes!” said Jonathan eagerly.
The Bard studied them both carefully. The bird’s huge eyes bore
right through Jonathan, reading him for signs of sincerity. Then he
declared, “Jonathan, climb on my back.” The bird turned slightly
and lowered his broad stiff tail feathers to the ground.
Jonathan’s curiosity overcame his fear. He stepped on a notch
in the tree and carefully reached out to pull himself up to the soft
hollow between the bird’s wings. Then he looked expectantly to
Alisa.
“I can’t leave,” she said to them both. “My family is looking for
me. I want to go with you sometime, but not now.”
Jonathan blushed. With a big smile, he quipped, “I still haven’t
had that free lunch.”
No sooner had Jonathan put his arms around the bird’s powerful
neck than he felt tension in the muscles. The condor leaped
awkwardly along the ground in great strides. Jonathan felt a lurch
and they floated into the rising breeze. Looking back, he could see
Alisa waving, with Mices at her feet.
Sailing high above the island, with the wind beating against his
face, Jonathan felt exuberant. Except for missing a few friends,
he left the island gladly. The mountains disappeared beneath the
clouds and the condor soared straight toward the brilliant rays of the
rising sun. A vast ocean of clouds and water stretched ahead and
Jonathan wondered, “Where?”
242 Chapter 39 • Vultures, Beggars, Con Men, and Kings
Brainstorming
• What people are symbolized by these:
vultures, beggars, con men, and kings?
• What valuable services do they provide?
• Which are the least helpful to society?
• Is it more important to trust actions or words?
• Why?
• Should authorities be held to the same rules
of behaviour as everyone else?
Commentary
Kings: People should all be viewed as having the
same rights and responsibilities. This does not
change with one’s title. Is it okay if human being
“kings” lie, steal, or kill other human beings?
No. They should be held accountable, in the
same way as all other human beings.
Consider for a moment, Alexander the Great.
What was so great about this Alexander? Did
the killing of thousands of people make him
“great”? Did he protect or exploit his subjects?
Did his conquests provide lasting peace and
understanding? Without Alexander, perhaps the
people living in these lands would have come to
know and understand each other better through
commerce and trade, correspondence, study,
love and marriage. Might this have resulted
in more peace, understanding and acceptance
in that part of the world today? Did Alexander
leave the people more healthy, wealthy and wise,
or more disfigured, impoverished, and ignorant?
Alexander the Great? Who started this praise of
a killer? Why does it persist?
Are people as subservient today as they were
in ancient times? Are rulers any different today
because they are elected for jobs as two or five
year “kings” and “princes”? Are new “greats”
conning us into fighting their wars? Today,
a few government officials decide whether a
nation will go to war. These officials are often
The shaft of the
arrow had been
feathered with one
of the eagle’s own
plumes. We often
give our enemies the
means of our own
destruction.
Aesop 550 BC
One murder makes
a villain; millions a
hero.
Bp. Porteus
243 Chapter 39 • Vultures, Beggars, Con Men, and Kings
beholden to special interest groups who profit
from the fighting. They would choose war
when the average person might choose peace.
Governments in the 20th century killed more
citizens (170 million) than in all of history before.
How many officials who decided to wage war,
died in those wars? Do heads of state deserve
more protection than the ordinary citizen?
Beggars: Who benefits from the political
donation – the giver or the beggar? Is the
head of the donating country giving away
his countryman’s hard earned money to buy
support for himself? Do donations make the
citizens of the donating country feel superior?
Do the citizens of the begging country feel
inferior? Are the people of these countries made
powerless by wealth that is given to the ruling
party? Is the donating country perpetuating
poverty by encouraging corrupt and oppressive
governments? Are the rulers of these begging
countries directly responsible for their subjects’
poor conditions?
Con men: As with con artists, officials
flatter the voters with words carefully crafted
by their public relations professionals. As with
con artists, they even begin to believe what they
say. Could this be the reason why they strut so
arrogantly as masters instead of humbly as the
public’s servants?
Is there a perfect system? Could there be such
a place where people use force only to defend
themselves against aggressors? Could there
be a place where people respect each other’s
freedom?
What is the answer?
Remarks
The condor adult eats up to three pounds of meat
a day, so people and other animals are kept safer
with the removal of carcases. It amazes many
people that it is important for condors to keep
The Swiss proved that
diverse peoples and
language groups can
live peacefully
together by surviving
the dark days of
1940-41.
Walter Lippmann
244 Chapter 39 • Vultures, Beggars, Con Men, and Kings
themselves very clean. Meat must be cleaned
from their feathers to reduce the risk of illness.
After eating, they find water in which to bathe,
washing away debris, then spend much time
preening and arranging their feathers.
Condors look after their own health and
welfare and the offshoot of this is that society
is better off. The businessperson is in much the
same position. Although also often scorned,
he looks after his own needs. He does this by
earning enough money to take care of himself.
In achieving this, he provides society with
valuable services. He does not force his services
on anyone, yet the services he provides benefit
us all. The businessperson gets his meal and
everyone is better off.
References
Rudy Rummel’s Death by Government is a
thorough account of murders by governments
in the 20th century. See:
powerkills/20TH.HTM.
Murray Rothbard’s For a New Liberty.
Lord Peter Bauer demonstrated, in his books
From Subsistence to Exchange and Reality and
Rhetoric, that the so-called Third World was
capable of prosperity with a free market and that
foreign aid, restrictive immigration, and trade
barriers hinder economic growth. See books at:.
Ken Schoolland’s article, “Time Bomb
in the Middle East: A Long Time Ticking,”
may be viewed under Guest Commentary at:.
Evil does not arise
only from evil people,
but also from good
people who tolerate
the initiation of force
as a means to their
own ends. In this
manner, good people
have empowered evil
throughout history.
Extract from
Jonathan’s Guiding
Principles
?
Revolutionary:
An oppressed
person waiting for
the opportunity to
become an oppressor.
Anonymous
Chapter 40
Terra Libertas
A
slight headwind blew steadily across Jonathan’s face. Time
stretched into hours and the rhythmic motion of the condor’s
flight made Jonathan drowsy. He dreamed that he was running
down a narrow street, chased by the shadowy figures of guards and
their unleashed dogs. “Stop you scalawag – you new newcomer!”
they shouted. Terror gripped him, as he desperately pumped his
legs harder and harder. One figure loomed out in front of the others
– Lady Tweed. He heard her breathing down his neck as she lunged
with fat fingers to grab him.
A sharp bump woke Jonathan with a start. “What?” murmured
Jonathan still clutching handfuls of the bird’s thick feathers.
They had landed on a beach that looked familiar. The Bard
issued instructions. “Follow this beach along the shoreline.
Continue a mile or so north and you’ll find your bearings.” Thick
clumps of salt grass waved gently over long golden sand dunes. The
ocean looked grey and cold where it lapped the shore. He climbed
gingerly off the back of the bird.
Suddenly Jonathan realized where he was. “I’m home!” he
shouted with joy. He started to run up the sandy slopes of the beach
then halted and turned again to the condor. “But you said you were
taking me to a place where things are done right,” said Jonathan.
“I have,” said the Bard.
“That’s not the way it is here,” argued Jonathan.
“Not yet maybe, but it will be when you make it so. Anywhere,
even Corrumpo, can be a paradise when the inhabitants are truly
free.”
“Corrumpo?” gasped Jonathan. “Most believe they’re free
enough. Lady Tweed told them as much. And the rest are afraid
of freedom, so eager are they to give themselves to the Grand
Inquirer.”
Chapter 40 • Terra Libertas 246
“Mere words!” said the Bard. “The test of freedom comes with
action.”
Jonathan felt very young. He pulled a reed from the ground and
started poking the sand thoughtfully. “What should things be like?
I’ve seen many problems – but what are the solutions?”
The condor let Jonathan’s question hover between them while
preening his feathers. When the feathers lay clean and smooth, the
condor looked out to sea saying, “You’re looking for a vision of the
future?”
“I suppose so.” said Jonathan.
“That’s a problem. Rulers always have a vision and force others
into it. Remember, rulers have no right to do anything that you have
no right to do on your own. If you shouldn’t do it, you shouldn’t ask
others to do it for you.”
“But isn’t a vision good for knowing where you’re headed?”
“For yourself, but not to impose on others.” The Bard turned to
face Jonathan again, his talons clenching and digging the sand. “In
a free land you place confidence in virtue and discovery. Thousands
of creatures seeking their own goals, each striving, will create a far
better world than you can possibly imagine for them. Look to the
means first, noble ends will follow. Free people find unexpected
solutions and those who are not free find unexpected problems.”
Despairingly Jonathan groaned, “But no one will listen to me.”
“Whether others listen or not, you gain strength by speaking and
acting. Those who listen will take courage from you.” The condor
turned towards the sea readying to leave.
Jonathan yelled, “Wait! Will I see my friends again?”
“When you have prepared your paradise, I’ll bring her to see
it.”
Jonathan watched the great bird gather himself and launch his
huge body into the wind. Moments later he disappeared among the
clouds.
Jonathan began walking. He did not remember much about that
walk except the steady crunch of sand beneath his feet and the
gusts of wind on his body. Jonathan recognised a rocky channel that
marked the entrance to his village. Soon, he was nearing a house
and store at the harbour’s edge – his home.
Chapter 40 • Terra Libertas 247
Jonathan’s lean and sad-faced father stood coiling rope on the
front porch. His eyes widened when he saw his son coming up the
path. “Jon,” cried his father. “Jon – boy, where have you been?”
His voice breaking, he shouted to his wife who was busy cleaning
inside. “Rita, look – Jon’s back!”
“What’s all the rumpus about?” asked Jonathan’s mother, looking
a little more careworn than he remembered. She came out on the
porch and screamed with delight at the sight of her son. Instantly
she gathered Jonathan into her arms and hugged him a long time.
Then, pushing him back and looking him over at arms’ length, she
brushed her sleeve across her eyes to stop a flood of joyful tears.
“Just where have you been young man? Are you hungry?” Then she
said to her husband excitedly, “Stoke the fire Hubert, and put on the
kettle!”
They shared a festive reunion and Jonathan recounted his
adventure, occasionally making rough drawings to describe what
had transpired. His parents smiled and shook their heads in a
mixture of disbelief and happiness. After he had eaten one last slice
of his mother’s warm pie, he sighed and sat back in his chair. The
old store and their living quarters in the back room glowed in the
light of the fireplace. “Son, you seem older,” said his father. He
looked hard at Jonathan and added jokingly. “Are you sailing again
soon?”
“No, Dad,” said Jonathan, “I’m here to stay. There’s plenty of
work to do.”
248 Chapter 40 • Terra Libertas
Brainstorming
• Should officials live by the same standards
as everyone else?
• Is it desirable or possible to have a society
that is free of force and fraud?
• Can a vision of utopia be forced upon
people?
• What is the process of discovery in a free
society?
• Can the end justify the means?
• Examples?
• Ethical issues?
Commentary
What alternative political, economic, and social
systems are achievable? What are the possibilities
to which we can now strive?
Your country is unlikely to be everything
you would like it to be. Yet, wherever you live
it could become a land where people are free
to choose goals that make it far better than can
presently be conceived.
This land is beyond the political system of
majority rule. It is a system that maximizes
individual freedom, allows self-respect, and
promotes respect for others. What would this
be like? How would it be run? We can only
speculate on the paths that might be taken
by millions of free people who discover new
solutions on a daily basis.
Such a land might have a small administrative
body without power, one that is restrained from
meddling in personal choices. There may still
be a desire for representative administrators
(not rulers) who are limited in the scope of
their duties. Small communities might select
administrators to carry out community wishes,
leaving individuals to get on with the business
of making a living and seeing to their family
I am the master of my
fate;
I am the captain of
my soul.
William Ernest
Henley, 1875
249 Chapter 40 • Terra Libertas
life. These administrators might be paid at
the discretion of those they represent. Or they
might work voluntarily. Voluntary groups make
better decisions concerning the community in
which they live and are the most committed.
The administrators could be sacked at anytime
for non-performance. Does this sound familiar?
Yes, it is the same way commerce works. It is
the way many charities, religious organizations,
and clubs work.
A land beyond democracy might have an
economic system of freedom that is based
on healthy entrepreneurial competition. This
produces low prices, good services, good
quality, and inspired innovation. It is a system
where people make deals without restraints
imposed on trade, negotiations, or contracts.
Such unrestricted trade has the power to break
down barriers of race, religion, territory, and
prejudice. Under such freedom we reap the
rewards of improving ourselves and of co-
operating voluntarily with others. Individual
freedom gives the poor the best opportunity to
improve their living standards. A system based
on individual freedom rewards economic risks,
eliminates waste, and ensures the best use of
human and material resources. The choices of
individuals are respected and each person might
prefer, in his or her own best interests, to accept
responsibility for his or her own behaviour.
People would delight at the success of others,
for they would know that this success brings
benefits to themselves as well. From this would
come the greatest measure of prosperity.
The land beyond democracy allows each
individual to make his or her own religious and
moral choices. The decisions of charitable and
personal sacrifice would be matters of personal
choice.
People would be afforded the respect to do
anything that does not interfere with the equal
right of any other person. In such a land, force
They listened,
trying to understand
Jonathan Livingston
Seagull. He spoke of
very simple things
– that it is right
for a gull to fly,.”
From Jonathan
Livingston Seagull,
by Richard Bach,
1970
250 Chapter 40 • Terra Libertas
could only be used to defend those things which
each citizen holds dear.
Some are afraid of choices or believe they
are free enough already. But people who seek a
greater measure of personal freedom will take
courage from you. There is plenty of work to
do!
Background
Hubert and Rita Jongen gave life to the idea
of a global Jonathan Gullible by publishing
the first international edition in Dutch. Hubert
is the Chairman of Libertarian International:.
There are many well known personalities
who believe in these principles. You can see
a long (and partial) list of these on: http://.
Ken: A sequel to the Adventures of Jonathan
Gullible – A Free Market Odyssey might feature
Jonathan making a free market success where
he lives. Now that this edition has made him a
friend of Alisa, she might come and comment on
the free society that is new to her. Just a thought
at this point.
References
In Mark Skousen’s The Making of Modern
Economics: The Lives and Ideas of the Great
Thinkers, a free market economist reviews the
great economic minds of history from a lively,
humorous, free market perspective.
For frequently asked questions on this subject
see:.
Rigoberto Stewart’s Limon Real is a practical
inspiration of how a land beyond democracy can
be achieved. View at:.
Alan Burris’ A Liberty Primer is an easy
reference book which sums up various aspects
of freedom.
John Stossel, on
ABC News, quoted
Thomas Jefferson as
saying, “The natural
progress of things
is for government
to gain and liberty
to yield.” Then he
added, “The choice is
up to you.”
You are the fellow
who has to decide
Whether you do it or
toss it aside
You are the fellow
who makes up your
mind
Whether you’ll do it
or linger behind
Whether you’ll try for
the goal that’s afar,
or just be content to
stay where you are.
Take it, or leave it
There’s something to
do,
Think it over
IT IS ALL UP TO
YOU.
Child’s rhyme
Epilogue 251
Epilogue
M
r. Gullible, a wise man many years my senior, gave me far more than
a story of adventure. During many months of discourse he provided
me with an outline of his intriguing philosophy of life. Over the years, this
philosophy of life guided Mr. Gullible to fruitful activity in his homeland.
That is yet another story. Nevertheless, I leave you with words from the
conclusion of his journal.
My Guiding Principles
M
y labour, officials
with fine hats and fancy titles.
You have the right to protect your own life, liberty, and justly
acquired property from the forceful aggression of others. So you
may rightfully ask others to help protect you. But you do not have a
Epilogue 252 officials are selected,
they are only human beings and they have no rights or claims that
are higher than those of any other human beings. Regardless of the
imaginative labels for their behaviour or the numbers of people
encouraging them, officials sacrifice. officials to initiate force on their behalf. Evil does not arise
only from evil people, but also from good people who tolerate the
initiation of force as a means to their own ends. In this manner, good
people have empowered evil throughout history.
Having confidence in a free society is to focus on the process of
discovery in the marketplace of values rather than to focus on some
imposed vision or goal. Using governmental force to impose a vision
on others is intellectual sloth and typically results in unintended,
perverse consequences. Achieving a free society requires courage
to think, to talk, and to act – especially when it is easier to do
nothing.
Jonathan Gullible
Acknowledgements and Notes 253
Acknowledgements and Notes
I am grateful to many people for their contributions to this project. Sam
Slom and Small Business Hawaii are responsible for bringing the original
US English publication to life. Flora Ling made fundamental editorial
contributions to the writing style and overall presentation of this story.
Lucile Schoolland, Nicolai Heering, Fred James, Harry Harrison, Scott
Kishimori, Ralph Smeed, and Stuart Hayashi gave meticulous editorial
assistance. Randall Lavarias, David Friedman, Tiffany Catalfano, and
Orlando Valdez all provided superb art work for earlier editions. Gerhard
“Geo” Olsson and Stuart Hayashi contributed many philosophical
insights. Geo introduced this book to Milton Friedman. Vince Miller and
Jim Elwood did the promotion around the world; Louk Jongen, Louis van
Gils, Reg Jacklin, Pelle Jensen, Jeff Mallan, and the HPU SIFE team have
promoted the book extensively through the Internet.
Hubert & Rita Jongen, S Wimmie Albada, and Ton Haggenburg
produced the Dutch edition. Dmitrii Costygin and William Milonoff
produced the first Russian edition and Kenneth DeGraaf and Elena
Mamontova are responsible for the new Russian translation, which has
been place online by Jaroslav Romanchuk and Elena Rakova. Linda
Tjelta, Jon Henrik Gilhus, and Bent Johan Mosfjell are responsible for the
Norwegian editions. Virgis Daukas arranged the Lithuanian edition and uses
it regularly in his English language camp along with Monika Lukasiewicz
and Stephen Browne. Tomislav Krsmanovic is the great and courageous
champion of liberty who has arranged the Serbian, Macedonian, Croatian,
Slovenian, Albanian, and Romany editions. Trifun Dimic translated and
published the Romany edition. Valentina Buxar translated both Romanian
editions and, along with Cris Comanescu, is responsible for the soon-to-be
published second Romanian edition on line. Valdis Bluzma published the
Latvian edition. Arlo and Gundega Pignotti are preparing a new Latvian
edition. Margaret Tse, Wilson Ling, and Carlos Fernando Souto produced
the Portuguese edition. Toshio Murata, Yoko Otsuji, Toyoko Nishimura,
Mariko Nakatani, Kayoko Shimpo, and Hiroko Takahashi are responsible
for the translation and publication of the Japanese edition by Nippon
Hyoron Sha. Alex Heil worked diligently on a translation and Stefan Kopp
published the German edition. Jonas Ekebom, Carl Henningsson, Christer
Olsson, and Mats Hinze all worked on the Swedish translation and John-
Henri Holmberg is preparing it as an epublication. Jan Jacek Szymona,
Jacek Sierpinski, and Andrzej Zwawa produced the Polish editions. Andras
Szijjarto is responsible for the Hungarian edition. Judy Nagy translated
and published the Spanish edition. Joy-Shan Lam is primarily responsible
for the Chinese edition in The Hong Kong Economic Journal; Dean Peng
and Jerome Ma, for the book in the People’s Republic of China. Kozeta
Acknowledgements and Notes 254
Cuadari translated the Albanian edition that was published by Dr. Zef Preci
and the Albanian Center for Economic Research. And many thanks to the
brothers Dulmaa Baatar and Hurelbaatar for the publication in Mongolia,
to K-mee Jung for the publication in Korean, and to Zarina Osmonalieva
and her SIFE team for the publication in Kyrgyzstan. Louise Zizka has
produced the French translation and brought it on-line with Sieg Pedde.
Shikwati James Shikuku has published the Kiswahili edition. Bojidar
Marinov and Assen Kanev have produced the Bulgarian translation. Paul
Vahur is working on an Estonia translation. The Somali publication is due
to the work of Faissal Hassan. And the Urdu edition has been translated
and published through the efforts and hard work of Dr. Kahlil Ahmad and
Paul Lindberg. Dimitrios Malamoulis and Neos Typos of Magnesia are
responsible for the Greek publication. And surely there are many others
I could add.
Kevin Tuma is currently preparing a graphic novel of the book.
Andrew Sullivan and Tim Skousen have collaborated Kerry Pearson
in the production of a DVD presentation of the Philosophy of Liberty.
Shahram Sadeghi, Henry and Roya Weyerhaeuser, and Uncle Reza have
been diligently preparing a Farsi edition. SIFE@HPU team member Mary
Disbrow prepared the powerpoint quiz game for the classroom, assisted by
Andy Jacob, Claes Insulander, and Benedikt Goetz. Simone Knobel was
largely responsible for preparing the Global SIFE Essay Contest. Edgar
Peña and Tomislav Krsmanovic conducted the national essay contests in
Mexico and Serbia respectively. Winners of those contests were Valerija
Dasic and Carlos Francisco Mendoza, respectively.
Also I wish to acknowledge some of the terrific supporters of this
book: Mark Adamo, Mike Beasley, Glenn Boyer, Charles Branz, Rodger
Cosgrove, John Dalhoff, Jean Frissell, Henry Haller III, Thomas Hanlin
III, Frank Heemstra, Dave Hoesly, Doug Hoiles, Michael J. LeCompte,
Paul Lundberg, Jim McIntosh, William & Denise Murley, Roger Norris,
Tom Payne, Richard Riemann, Jim Rongstad, Lucile Schoolland, Dagney
Sharon, Mark and JoAnn Skousen, Cliff and Bobbie Slater, David
Steigelman, Rudy & Pat Tietze, Howard Thomsom, Doug Thorburn,
Susan Wells, and Louise Zizka.
For all of this work on line I am grateful to Ginger Warbis, the fabulous
webmistress. Kerry Pearson has produced a magnificent flash animation
in many languages (English, Spanish, Portuguese, French, and German)
with the help of others. Raul Costales has arranged for this to be broadcast
weekly on national TV in Costa Rica. And Dick Morris, Ryan Segawa,
Ron Corpus, and Geo Olsson have produced radio spots that are broadcast
weekly on station KXEM in Phoenix.
Credits 255
Co-author of the Commentaries
On first reading Jonathan Gullible, Janette found it
extremely entertaining. It made her laugh out loud, and
with every subsequent reading, she kept finding more
subtle points. This was probably because she had been
exposed to the more serious side of these ideas. However,
she found that others, not exposed to these ideas, did not see
the humour. Thus, the idea of a commentary edition was conceived. Whilst
a Computer Tutor, Janette used her knack of taking involved subjects and
making them “understandable”. She has used this same gift with these
economic theories. With Ken’s guidance, she has been on a ‘voyage of
discovery’ in giving birth to the Commentary Edition. She hopes it will
give you enjoyment, laughter, and many fascinating discussions.
I would like to dedicate the joy of the work I have done on these
commentaries to the memory of Ilona Daukas, Lithuania, who was my
inspiration for this project. – Janette
The Publisher
Barry Kayton is a writer, a developer of learning materials
and a publisher. He began in the academic world of English
literature, classical civilisation, mythology and philosophy.
He then entered the commercial world of advertising,
marketing, copy writing, photography and graphic design.
Since 1999 he has been designing learning materials for
adults and children in the field of entrepreneurship. “If it’s not fun, it’s not
effective!” says Barry.
Leap Publishing’s logo is of a photograph Barry took in Israel. Children
were leaping into the sea off the ancient wall. To Barry this kind of daring
attitude is a vital entrepreneurial trait. Every project is a leap into the
unknown, and to take the plunge demands courage.
Jonathan Gullible’s Greatest Supporter
Li Schoolland, a teacher of Chinese and Asian History, is Jonathan
Gullible’s background supporter. Her duties
are keeping her husband, a professor in
economics, financially solvent and patiently
waiting for him while he corresponds with the
great many Jonathan Gullible projects around
the world. She is the only woman who says:
“A man’s work is never done”.
Recommended Reading 256
Recommended Reading
• Frederic Bastiat, The Law – Seventy-five pages of reasoning.
Although written in 1850 it reads as if it were written today.
• Alan Burris, A Liberty Primer – An easy reference book on the
various aspects of freedom.
• David Friedman, The Machinery of Freedom – An excellent
analysis of market solutions to the tough issues, from streets to
defence.
• Milton and Rose Friedman, Free to Choose – A popular account
of the economic benefits of freedom.
• R.W. Grant, The Incredible Bread Machine – Explains why
government doesn’t work.
• Henry Hazlitt, Economics in One Lesson – An enjoyable and
easy to read book for laymen.
• Ayn Rand, Atlas Shrugged – A masterpiece which presents her
philosophy in an exciting novel.
• Murray Rothbard, For a New Liberty – A classic general book
on liberty.
• Mary Ruwart, Healing Our World, The Other Piece of the Puzzle
– Shows the practical possibilities of how a nation of individuals
could achieve freedom today.
• Linda and Morris Tannehill, The Market for Liberty – Excellent
analysis of market alternatives to traditional government
interventions.
• Henry David Thoreau, On the Duty of Civil Disobedience – The
“bible” of non-violent protest successfully used by Gandhi and
many others. It is only 19 pages long.
• E-Publication of The Adventures of Jonathan Gullible
– A Free Market Odyssey –
languages.htm
Recommended Organisations and Websites 257
Recommended Organisations and Websites
Adam Smith Institute . . . . . . . . . . . . . . . . . .
Advocates for Self-Government . . . . . . . . . . . . dvocates for Self-Government dvocates for Self-Government
Atlas Research Foundation . . . . . . . . . . . . . . . .
Cato Institute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Foundation for Economic Education . . . . . . . . . . . .
Fraser Institute . . . . . . . . . . . . . . . . . . . . . .
Freedoms Foundation at Valley Forge . . . . . . . . . . .
Free Market Foundation . . . . . . .
Independent Institute . . . . . . . . . . . . . . . . .
Institute for Economic Affairs . . . . . . . . . . . . . . .
Institute for Humane Studies . . . . . . . . . . . . . .
International Society for Individual Liberty . . . . . . .
Laissez Faire Books . . . . . . . . . . . . . . . . . . . . . . . . .
Liberty Tree: Review and Catalogue . . . . . .
Libertarian Alliance . . . . . . . . . . . . . . . . .
Libertarian International . . . . . . . . . . . . . . . . . .
Ludwig von Mises Institute . . . . . . . . . . . . . . . . .
Makinac Center . . . . . . . . . . . . . . . . . . . . . . . . akinac Center akinac Center
Reason Magazine and Reason Foundation . . . . . .
Stossel in the Classroom . . . . . . . . . . . . .
Some of Ken Schoolland’s articles:
Jonathan’s Philosophy in flash animation:
Jonathan Gullible Web site:
Index 258
Index of Concepts
Subject Chapters
Agriculture 4, 22
Art 16
Beggars 39
Bribery 11, 13, 19
Building codes 13
Bureaucracy 8, 18, 19, 22, 24, 29, 30
Campaigns 11, 25
Censorship 15
Charity 13
Choice 15, 16, 20, 27, 33, 36
Civil strife 15, 10, 38
Commons 3
Competition 2, 3, 4, 5, 10, 14, 19, 20, 21, 22, 27, 28, 29,
31, 33, 37
Con men 39
Condemnation 7
Conscription 29
Consumers 5, 9, 10
Contract 7, 18, 31, 34
Costs 5, 13
Counterfeiting 9
Crime 14, 21, 28, 34
Debt 11
Economists 23
Education 20, 21, 27, 28, 33
Elections 11, 25, 26, 30, 37, 39
Elitism 16
Employment 2, 5, 10, 14, 17, 24, 28, 29, 37
Enforcement 2, 4, 7, 8, 14, 15, 28, 29, 35, 37
Environment 3, 8
Forecasting 23
Fraud 31, 39
Free riders 15, 32
Freedom 21, 36, 40
Index 259
Subject Chapters
Gambling 17, 37
Guns 14, 21, 38
Homelessness 13
Ideologies 22
Immigration 29
Inflation 9, 10, 30
Innovation 2, 31, 32, 40
Invention 2, 31, 32
Invisible gun 14
Job loss 2, 5, 10, 12, 24, 28, 37
Labour unions 2, 5, 10
Labour laws 28, 31, 32, 37
Liability 32
Libraries 15
Licensing 14, 28, 33
Majorities 25, 38
Market 4, 22, 40
Media 24, 34
Medicine 33
Minimum wage 28
Money 9, 10
Monopoly 14, 31, 33
Morality 21, 25, 34, 35, 38, 40
Nepotism 13
Ownership private 4, 7, 14, 21, 31
Ownership government 32, 33, 38
Patents 31
Peddling 28
Planning 7
Pollution 3
Pork barrel 11
Power 11, 25, 36, 40
Price controls 4, 13, 28, 33
Index 260
Subject Chapters
Prison 8, 14, 28
Production 4, 7, 31, 39
Prohibition 35
Property 4, 7, 14, 31, 32, 33
Protectionism 5
Public goods 32
Religion 18
Rent control 13
Responsibility 35, 36
Retirement 30
Rights 25, 40
Robin Hood 21
Selfishness 14, 35
Sin taxes 6, 17
Special interest 17
Statism 8, 18, 19, 22, 24, 29, 30, 38
TANSTAAFL 10, 13
Taxes 5, 6, 7, 8, 15, 16, 17, 18, 21, 32, 35
Trade 5, 9, 10, 22
Unemployment 12
Vice 34, 35, 36, 37
Virtue 27, 36, 40
Voting 25, 26, 31, 36, 38
Wealth 7, 25, 34, 35, 38
Welfare 4, 13, 21, 27
Zoning 7, 13 | https://fr.scribd.com/doc/228692095/Ken-Schoolland-Jonathan-Gullible | CC-MAIN-2018-30 | refinedweb | 73,987 | 74.79 |
W3C XML
Schema document defines both the syntax and semantics of names in this
namespace.
This document serves as a first point of information for all interested parties. It contains information on accessing all releases of the TS, and gives a general account of current activities, finalized work, and pointers to further information..
2007-06-20: Latest release. More data and reports still welcome.
2006-11-06: MS/Sun revision and augmentation release. The WG is actively seeking result reports and comments on specific tests in this new release.
2005-04-01: The XML Schema Working Group reviews the first public release of the TS.
For further information on recent and past activities, see the XML Schema TS mailing list. | http://www.w3.org/XML/2004/xml-schema-test-suite/index.html | crawl-002 | refinedweb | 120 | 58.69 |
acl_set_file - set an ACL by filename
Linux Access Control Lists library (libacl, -lacl).
#include <sys/types.h> #include <sys/acl.h> int acl_set_file(const char *path_p, acl_type_t type, acl_t acl);
The acl_set_file() function associates an access ACL with a file or directory, or associates a default ACL with a directory. The pathname for the file or directory is pointed to by the argument path_p. The.
The acl_set_file() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.
If any of the following conditions occur, the acl_set_file() function returns -1 acl does not point to a valid ACL.. ().
acl_delete_def_file(3), acl_get_file(3), acl_set_fd〉. | http://huge-man-linux.net/man3/acl_set_file.html | CC-MAIN-2017-13 | refinedweb | 116 | 55.64 |
DOM guide: Working with documents
This section describes how to load COLLADA instance documents into the COLLADA runtime database and how to save the runtime database into COLLADA instance documents.
- Note: In some cases, pointer and return value checks have been removed from this code for brevity.
Creating the DAE Object
To use the COLLADA DOM, your client code needs to include the following header files:
#include <dae.h> #include <dom/domCOLLADA.h>
To use a specific effect profile, such as <profile_COMMON> or <profile_CG>, you must include the header for that profile. For example:
#include <dom/domProfile_CG.h>
A useful header to include is
dom/domConstants.h. This provides constants for strings that are commonly used in the DOM. These strings include all the COLLADA element names and element type names. Many examples to follow use these constants.
After including the appropriate headers, your application needs to create a DAE object. The following example shows a DAE object created on the heap (using
operator new) and accessed as a pointer.
DAE *collada_dom = new DAE();
Don't forget to call
operator delete to delete the object when you're done. You could also create the DAE object globally or on the stack.
Use the
DAE::load method to read an existing COLLADA document into the runtime database. When you load a document, the COLLADA DOM uses the document URI as the name of the document when searching or doing other operations where the document needs to be identified. In this example, the name of the document created by the load process is, the same as the URI it was loaded from:
daeInt error = collada_dom->load("");
Note: A common mistake is to pass a Windows or Linux file path to the
DAE::load or
DAE::save methods. See Using URIs in COLLADA.
The
DAE::load method returns:
DAE_OKif the load is successful.
DAE_ERR_COLLECTION_ALREADY_EXISTSiff a document with the same name, or the same document, has already been loaded.
DAE_ERR_BACKEND_IOfor other errors encountered during load.
Note: The terms "collection" and "document" mean the same thing in the COLLADA DOM interface and documentation.
Creating New Documents
You can use the COLLADA DOM to create a set of elements, add them to an empty database, and write the database to a COLLADA instance document.
daeDocument *doc = NULL; collada_dom->getDatabase()->insertDocument("", &doc); // doc is now a valid COLLADA document
Saving Documents
After you have completed any changes to the elements in the document, you can write the document to a new URL using the
DAE::save method. You can use either the document name or the document index to choose which collection to save:
daeInt error = collada_dom->save("");
To save the document to a different URI than the URI that was used to create it, use the
DAE:saveAs method. The last argument to all of the save methods is an optional flag that specifies whether to overwrite an existing document. This flag defaults to true.
Note: The COLLADA DOM XML parser does not fully validate the data. It detects some types of errors in XML input but not all of them. You may want to run new COLLADA data through an XML validator before loading it into the DOM. If you are developing programs that write COLLADA data, you should run a validator on the output of your programs during testing. See schema validation.
Querying and Removing Documents
Three functions allow you to query for and iterate over documents in the runtime database:
daeDatabase::getDocumentCount
daeDatabase::getDocument
daeDatabase::isDocumentLoaded
If you want to release a document from memory, you can use the
DAE::unload method. The document to be unloaded is specified by its URI name. Removing a document removes the root element and, subsequently, the entire element hierarchy from the database. This method returns either:
DAE_OKupon success.
DAE_ERR_COLLECTION_DOES_NOT_EXISTif the document does not exist in the runtime database.
It's necessary to call
DAE::unload only if you want the document released from memory immediately. Otherwise, the document is automatically removed when the parent DAE object is destroyed.
See also | https://www.khronos.org/collada/wiki_collada/index.php?title=DOM_guide:_Working_with_documents&redirect=no | CC-MAIN-2022-05 | refinedweb | 674 | 54.63 |
A Python ecosystem offers numerous tools for the visualisation of data on a map. A lot of them depend on XYZ tiles, providing a base map layer, either from OpenStreetMap, satellite or other sources. The issue is that each package that offers XYZ support manages its own list of supported providers.
We have built
xyzservices package to support any Python library making use of XYZ tiles. I’ll try to explain the rationale why we did that, without going into the details of the package. If you want those details, check its documentation.
The situation
Let me quickly look at a few popular packages and their approach to tile management –
contextily,
folium,
ipyleaflet and
holoviews.
contextily
contextily brings contextual base maps to static
geopandas plots. It comes with a dedicated
contextily.providers module, which contains a hard-coded list of providers scraped from the list used by leaflet (as of version 1.1.0).
folium
folium is a lightweight interface to a JavaScript leaflet library. It providers built-in support for 6 types of tiles and allows passing any XYZ URL and its attribution to a map. It means that it mostly relies on external sources of tile providers.
ipyleaflet
ipyleaflet brings leaflet support to Jupyter notebooks and comes with a bit more options than
folium. It has a very similar approach as
contextily does – it has a hard-coded list of about 37 providers in its
basemaps module.
holoviews
holoviews provides a Python interface to the Bokeh library and its list of supported base maps is also hard-coded.
A similar situation is in other packages like
geemap or
leafmap.
Each package has to maintain the list of base maps, ensure that they all work, respond to users requiring more, update links… That is a lot of duplicated maintenance burden. We think it is avoidable.
The vision
All XYZ tile providers have a single lightweight home and a clean API supporting the rest of the ecosystem. All the other packages use the same resource, one which is tested and expanded by a single group of maintainers.
We have designed
xyzservices to be exactly that. It is a Python package that has no dependencies and only a single purpose – to collect and process metadata of tile providers.
We envisage a few potential use cases.
The first – packages like
contextily and
geopandas will directly support
xyzservices.TileProvider object when specifying tiles. Nothing else is needed,
contextily will fetch the data it needs (final tile URL, an attribution, zoom and extent limits) from the object. In the code form:
import xyzservices.providers as xyz from contextily import add_basemap add_basemap(ax, source=xyz.CartoDB.Positron)
The second option is wrapping
xyzservices.providers into a custom API providing, for example, an interactive selection of tiles.
The third one is using different parts of a
TileProvider individually when passing the information. This option can be currently used, for example, with
folium:
import folium import xyzservices.providers as xyz tiles = xyz.CartoDB.Positron folium.Map( location=[53.4108, -2.9358], tiles=tiles.build_url(), attr=tiles.attribution, )
The last one is the most versatile. The
xyzservices comes with a JSON file used as a storage of all the metadata. The JSON is automatically installed to
share/xyzservices/providers.json where it is available for any other package without depending on
xyzservices directly.
We hope to cooperate with maintainers of other existing packages and move most of the functionality around XYZ tiles that can be reused to
xyzservices. We think that it will:
- Remove the burden from individual developers. Any package will just implement an interface to Python or JSON API of
xyzservices.
- Expand the list easy-to-use tiles for users.
xyzservicescurrently has over 200 providers, all of which should be available for users across the ecosystem, without the need to individually hard-code them in every package.
While this discussion started in May 2020 (thanks @darribas!), the initial version of the package is out now and installable from PyPI and conda-forge. We hope to have as many developers as possible on board to allow for the consolidation of the ecosystem in the future. | https://martinfleischmann.net/xyzservices-a-unified-source-of-xyz-tile-providers-in-python/ | CC-MAIN-2022-27 | refinedweb | 688 | 65.52 |
C++ inverted right-angled triangle :
We can print one inverted right-angled triangle using two loops. In this C++ tutorial, we will use two for loops. The program will take the height of the triangle as input from the user and print out the triangle.
The program will also take the character to print the triangle as user input. You can use different characters to print the triangle.
Example program :
#include <iostream> using namespace std; void printInvertedTriangle(int size, char c) { // 4 for (int i = 1; i <= size; i++) { for (int j = size; j >= i; j--) { cout << c << " "; } // 5 cout << "\n"; } } int main() { // 1 int size; char c; // 2 cout << "Enter the size : " << endl; cin >> size; cout << "Enter the character : " << endl; cin >> c; // 3 printInvertedTriangle(size, c); return 0; }
Explanation :
The commented numbers in the above program denote the step numbers below :
- Create two variables size and c to store the size of the triangle and the character to print the triangle.
- Ask the user to enter the size of the triangle. Read it and store it in size. Similarly, read the character to print the triangle and store it in c.
- Call the printInvertedTriangle method to print the triangle.
- Inside printInvertedTriangle, we are using two for loops. The outer loop denotes the current line. It runs for size amount of time. The inner will run from j = size to j = i. Inside this inner loop, print the value of the character c that is passed to printInvertedTriangle.
- Once the inner loop completes, move to the next line by printing a newline ‘\n’.
Sample Output :
Enter the size : 5 Enter the character : * * * * * * * * * * * * * * * * | https://www.codevscolor.com/c-plus-plus-inverted-right-angle-triangle/ | CC-MAIN-2020-29 | refinedweb | 272 | 63.9 |
Opened 8 years ago
Closed 8 years ago
Last modified 3 years ago
#15307 closed New feature (wontfix)
slugify should take an optional max length
Description
A SlugField has a max_length of 50 by default, but the slugify template filter does not easily truncate.
Perhaps altering to something like this would be helpful:
SLUG_RE = re.compile('\-[^\-]*$') def slugify_max(text, max_length=50): slug = slugify(text) last_len = len(slug) while len(slug) > max_length: slug = SLUG_RE.sub('', slug) # avoid infinite loop if len(slug) == last_len: break last_len = len(slug) slug = slug[:max_length] #hack off end if unable to nicely crop it. return slug
Design decision needed because I'm not sure folks will agree this is needed in core.
Change History (5)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
1) No, I was just using it for illustrative purposes. It'd just be an optional to slugify.
2) Well, I'm trying to preserve word boundaries there, "this is an example headline" -> "this-example-headline" -> "this-example", not "this-example-he" if length were 15.
comment:3 Changed 8 years ago by
comment:4 Changed 8 years ago by
Indeed, I'm not sure this belongs to core:
- The relation to the
max_lengthof
SlugFieldisn't obvious to me — and if a form field was involved, a human would be better than a computer at shortening its contents while preserving its meaning.
- It's easy to implement your idea as a custom template filter (I hope you've done so).
- I'd prefer to keep slugify simple.
Thanks for the suggestion anyway!
comment:5 Changed 3 years ago by
Here's a more efficient version of
slugify_max, if anyone comes looking.
def slugify_max(text, max_length=50): slug = slugify(text) if len(slug) <= max_length: return slug trimmed_slug = slug[:max_length].rsplit('-', 1)[0] if len(trimmed_slug) <= max_length: return trimmed_slug # First word is > max_length chars, so we have to break it return slug[:max_length]
{{ thing|slugify|slice:"N" }}? | https://code.djangoproject.com/ticket/15307 | CC-MAIN-2019-30 | refinedweb | 328 | 60.55 |
15 March 2011 15:31 [Source: ICIS news]
TORONTO (ICIS)--?xml:namespace>
Mannheim-based ZEW Centre for European Economic Research said its widely-followed investor confidence index fell 1.6 points in March, to 14.1 points.
The centre pointed, in particular, to impacts from the earthquake in
Meanwhile,
The government also suspended, for three months, a recent move to extend operations of the country’s nuclear industry to 2036 from 2022.
While
Germany's chemical and energy union IG BCE welcomed the government’s measures, but said they did not go far enough.
Union head Michael Vassiliadis said the earlier move to extend the life-span of
The government should shift energy policies towards clean-coal technologies and carbon capture and storage, | http://www.icis.com/Articles/2011/03/15/9444161/germany-investor-confidence-falls-as-govt-suspends-7-nuclear-plants.html | CC-MAIN-2015-22 | refinedweb | 123 | 52.7 |
Create Custom Modules and Mappings
In addition to using the built-in DataWeave function modules (such as dw::Core and dw::Crypto), you can also create and use custom modules and mapping files. The examples demonstrate common data extraction and transformation approaches..
You write modules and mapping files in a DataWeave Language (
.dwl) file and import into your Mule app through DataWeave scripts in Mule components. Both modules and mapping files are useful when you need to reuse the same functionality or feature over and over again.
Custom modules can define functions, variables, types, and namespaces. You can import these modules into a DataWeave script to use the features.
Custom mapping files are a type of module that contains a complete DataWeave script that you can import and use in another DataWeave script or reference in a Mule component.
Fields in many Mule connectors and components accept DataWeave expressions and scripts.
Note that if you want to import and use a built-in DataWeave function module, and not a custom one, see DataWeave Function Reference.
Creating and Using DataWeave Mapping Files
You can store a DataWeave transformation in a
.dwl mapping file (mapping module), then import the file into another DataWeave script. Mapping files can be executed through the Transform Message component, or you can import them into another mapping and execute them through the
main function.
In your Studio project, set up a subfolder and file for your mapping module:
You can create a subfolder in
src/main/resourcesby navigating to New → Folder → [your_project] →
src/main/resources, then adding a folder named
modules.
You can create a new file for your module in that folder by navigating to New → File → [your_project] →
src/main/resources/modules, then adding a DWL (DataWeave language) file such as
MyMapping.dwl.
Saving the module within
src/main/resourcesmakes it accessible for use in a DataWeave script. component in a Mule app in that project.
Create your function in your mapping file, for example:Example: Mapping File Content
%dw 2.0 import dw::core::Strings fun capitalizeKey(value:String) = Strings::capitalize(value) ++ "Key" --- payload mapObject ((value, key) -> { (capitalizeKey(key as String)) : value } )
Save your DWL function module file.
Using a Mapping File in a DataWeave Script
To use a mapping file, you need to import it into a DataWeave script and use the
main function to access the body of the script in the mapping file.
Assume that you have created the MyMapping.dwl file in
/src/main/resources/modules that contains this script.
To import and use the body expression from the
MyMapping.dwl file (above) in DataWeave Mapping file, you need to do this:
Specify the
importdirective in the header.
Invoke the
MyMapping::mainfunction. The function expects an input that follows the structure of the input that the mapping file uses. For example, the body of
MyMapping.dwlexpects an object of the form
{"key" : "value"}.
%dw 2.0 import modules::MyMapping output application/json --- MyMapping::main(payload: { "user" : "bar" })
Here is the result:
{ "UserKey": "bar" }
Even though the capitalizeKey function is private, it is still used through the
main function call, and the DataWeave mapping file is also able to import and reuse the
dw::core::Strings module.
Creating and Using a Custom Module
The steps for creating a custom DataWeave module are almost identical to the steps for creating a custom mapping file. The only difference is the contents of the
.dwl file. Unlike a typical DataWeave script or mapping file, a custom DataWeave
module cannot contain an
output directive, body expression, or the separator (
---) between header and body sections. (For guidance with mappings, see Creating and Using DataWeave Mapping Files.)
A custom module file can only contain
var,
fun,
type, and
ns declarations, for example:
%dw 2.0 fun myFunc(myInput: String) = myInput ++ "_" var name = "MyData" ns mynamespace
When you import a custom module into another DataWeave script, any functions, variables, types, and namespaces defined in the module become available for use in the DataWeave body. In the next example, a DataWeave script:
Imports the module
MyModulethrough the
importdirective in the header. In this case, the imported module is stored in a Studio project path
src/main/resources/modules/MyModule.dwl
Calls a function in
MyModuleby using
MyModule::myFunc("dataweave").
%dw 2.0 import modules::MyModule output application/json --- MyModule::myFunc("dataweave") ++ "name"
There are several ways to import a module or elements in it:
Import the module, for example:
import modules::MyModule. In this case, you must include the name of the module when you call the element (here, a function) in it, for example:
MyModule::myFunc.
Import all elements from the module, for example:
import * from modules::MyModule. In this case, you do not need to include the name of the module when you call the element. For example:
myFunc("dataweave") ++ "name"works.
Import specific elements from a module, for example:
import myFunc from modules::MyModule. In this case, you do not need to include the name of the module when you call the element. For example:
myFunc("dataweave") ++ "name"works. You can import multiple elements from the module like this, for example:
import myFunc someOtherFunction from modules::MyModule(assuming both
myFuncand
someOtherFunctionare defined in the module).
"dataweave_name"
Assigning a Local Alias for an Imported Element
To avoid name clashes, you can use
as to assign an alias for a custom module or its elements when you import the module into a DataWeave script.
Assume that you have a custom module like this one:
%dw 2.0 fun myfunc(name:String) = name ++ "_" var myVar = "Test"
When you import the custom module into a DataWeave script, you can create aliases to elements in the custom module, for example:
%dw 2.0 import myFunc as appendDash, myVar as weaveName from modules::MyModule var myVar = "Mapping" output application/json --- appendDash("dataweave") ++ weaveName ++ "_" ++ myVar
You can create an alias to the imported module, for example:
%dw 2.0 import modules::MyModule as WeaveMod output application/json --- WeaveMod::myFunc("dataweave") | https://docs.mulesoft.com/dataweave/2.2/dataweave-create-module | CC-MAIN-2022-21 | refinedweb | 999 | 53.41 |
case (C++)
Go Up to Keywords, Alphabetical Listing Index
Category
Syntax
switch(switch_variable) {casebreakdefault case constant_expression: statement; // [break;] // … default: statement; }
Description
Use the case statement in conjunction with switches to determine which statements evaluate.
The list of possible branch points within <statement> is determined by preceding substatements with
case constant_expression: statement;
where <constant expression> must be an int and must be unique.
The <constant expression> values are searched for a match for the <switch variable>.
If a match is found, execution continues after the matching case statement until a break statement is encountered or the end of the switch statement is reached.
If no match is found, control is passed to the default case.
Note: It is illegal to have duplicate case constants in the same switch statement.
Example
This example illustrates the use of keywords break, case, default, return, and switch.
#include <iostream> using namespace std; int main(int argc, char* argv[]) { char ch; cout << "PRESS a, b, OR c. ANY OTHER CHOICE WILL TERMINATE THIS PROGRAM." << endl; for ( /* FOREVER */; cin >> ch; ) switch (ch) { case 'a' : /* THE CHOICE OF a HAS ITS OWN ACTION. */ cout << endl << "Option a was selected." << endl; break; case 'b' : /* BOTH b AND c GET THE SAME RESULTS. */ case 'c' : cout << endl << "Option b or c was selected." << endl; break; default : cout << endl << "NOT A VALID CHOICE! Bye ..." << endl; return(-1); } } | https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Case | CC-MAIN-2022-40 | refinedweb | 226 | 63.8 |
You can generate Data Matrix in MS Excel spreadsheet, MS Access, Crystal Reports.
To print QRCode in C#, you need both bcsqrcode.ttf true type font and cruflbcsn.dll.
To get cruflbcsn.dll, you can either download it from qrcode QRCode in C#
cruflbcsn.IQRCode pQRCode = new CQRCode();
textBox2.Text = pQRCode.Encode(textBox1.Text);
using cruflbcsn;
The first parameter is string to encode.
cruflbcsn.IQRCode pQRCode = new CQRCode();
textBox2.Text = pQRCode.EncodeCR(textBox1.Text, 0, 1);
The second parameter is index. Always set it to zero please.
The third parameter is security level. Its values range between 0 and 3. It stands for L07, M15, Q25 and H30 separately | https://www.barcodesoft.net/en/barcode/print-qrcode-c-sharp | CC-MAIN-2021-43 | refinedweb | 109 | 55.5 |
The queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The Queue class in this module implements all the required locking semantics. It depends on the availability of thread support in Python; see the threading module.
Implements three types of queue whose only difference is the order that the entries are retrieved. In a FIFO queue, the first tasks added are the first retrieved. In a LIFO queue, the most recently added entry is the first retrieved (operating like a stack). With a priority queue, the entries are kept sorted (using the heapq module) and the lowest valued entry is retrieved first.
The queue module defines the following classes and exceptions:
Constructor for a priority queue. maxsize is an integer that sets the upperbound limit on the number of items that can be placed in the queue. Insertion will block once this size has been reached, until queue items are consumed. If maxsize is less than or equal to zero, the queue size is infinite.
The lowest valued entries are retrieved first (the lowest valued entry is the one returned by sorted(list(entries))[0]). A typical pattern for entries is a tuple in the form: (priority_number, data).
See also
collections.deque is an alternative implementation of unbounded queues with fast atomic append() and popleft() operations that do not require locking.
Queue objects (Queue, LifoQueue, or PriorityQueue) provide the public methods described below.
Two methods are offered to support tracking whether enqueued tasks have been fully processed by daemon consumer threads..
Example of how to wait for enqueued tasks to be completed:
def worker(): while True: item = q.get() do_work(item) q.task_done() q = Queue() for i in range(num_worker_threads): t = Thread(target=worker) t.daemon = True t.start() for item in source(): q.put(item) q.join() # block until all tasks are done | http://docs.python.org/3.1/library/queue.html | CC-MAIN-2014-10 | refinedweb | 319 | 58.69 |
Is inertia scalar n vector quantity?
Inertia is due to mass. Mass is scalar. Hence inertia too is a scalar
What is the difference between average speed and average velocity?
Difference between pressure and force?
What is the importance of scalar and vector quantity?
Scalar quantity is the usual one. It is already there unavoidable. But vector is the new one. Why do we need it? Suppose say two persons by name John and Johann push a box with forces 4N and 3N, what could be the effective force on the box? One may say 7 N by adding them. One may say just 1N because of getting the difference. Another may say 5N. How? Why do they give…
Is it true that force is a vector?
No! Force can be a scalar or a vector and both. It is true that force is a quaternion, the sum of a scalar and a vector! There are two kinds of numbers in physics real numbers also called scalars and vector numbers. Hamilton discovered this in 1843 when he invented Quaternions. Real numbers have positive squares and vector numbers have negative squares. Vectors are denoted by I, J and K unit vectors real numbers…
What is the difference between zero and vector zero?
The zero vector occurs in any dimensional space and acts as the vector additive identity element. It in one dimensional space it can be <0>, and in two dimensional space it would be<0,0>, and in n- dimensional space it would be <0,0,0,0,0,....n of these> The number 0 is a scalar. It is the additive identity for scalars. The zero vector has length zero. Scalars don't really have length. ( they can represent length of course…
Does torque and work are equivalent? length of a vector arrow represents?
What is scalar force and vector force in the force?
To put it simply, scalar is essentially just a number of the force, such as 10 newtons whereas a vector is a force with a direction such as 10 newtons south. Answer2: Forces like many quantities in Physics are Quaternions. Quaternions consist oa a scalar number and three vector numbers. Quaternions can be viewed as Angles and Axis. Positive Scalar forces have angles of 360 degrees and negative scalar forces have 180 degrees rotation. Positive…
What is the equation for inertia?
Definition A simple definition of the moment of inertia (with respect to a given axis of rotation) of any object, be it a point mass or a 3D-structure, is given by: where m is mass and r is the perpendicular distance to the axis of rotation. Detailed analysis The (scalar) moment of inertia of a point mass rotating about a known axis is defined by The moment of inertia is additive. Thus, for a rigid…
Are velocity and displacement a pair of vector quantities?
Yes they are. Vector quantities has both magnitude and direction, whereas scalar quantities only have magnitude. Examples of vector quantities: Displacement (Δd) - 10 m [W] or 36 km [W] Velocity (v) - 10 m/s [60° N of W] or 36 m/s [60° N of W] Acceleration - 9.8 m/s2 [↓] - this value is the acceleration dude to gravity (if we ignore air resistance).
What does pressure do?
What is the pressure?
What is the maximum value a 5 N vector and an 8 N vector can have?
What does Newton's second law of motion states?
Newton's 2nd law states that vector force F is proportional to acceleration A; F = mA. This law is related to the vector energy cP, F= dcP/dr = cdP/cdt = dP/dt = mdV/dt = mA. Energy is a Quaternion quantity. Newton's scalar energy -mGM/r gives f=- d(mGM/r) /dr = mGM/r2 = vp/r = vp/ct = (v/c)mv/t = (v/c) ma = 1/n ma.
How can an electron jump to a higher energy level?
What describes unequal forces acting on an object - results in change in the object's motion?
Newton's 2nd Law of Motion states that F = m * a, where F = the net force acting on an object [N]; m = the mass of the object [kg]; and a = acceleration [m/s2] . If the motion is linear, then we can consider scalar operations on F and a. If the force is a vector, then a has to be a vector too. ============================
Is eigenvalue applicable only to n x n matrices?
The answer is yes, and here's why: Remember that for the eigenvalues (k) and eigenvectors (v) of a matrix (M) the following holds: M.v = k*v, where "." denotes matrix multiplication. This operation is only defined if the number of columns in the first matrix is equal to the number of rows in the second, and the resulting matrix/vector will have as many rows as the first matrix, and as many columns as the second…
What is boson and fermion?
Bosons and Fermions are parts of Quaternion Electronic Particles. The Boson is the Quaternion Scalar part and the Fermion is the Quaternion Vector part. Quaternions are four dimensional "particles" a Boson and a three dimensional Fermion The Quaternion Unit can be described by Q= Cos(Spin) + v Sin(Spin) where v is the unit vector. The Quaternion consists of a scalar part the Boson = Cos(Spin) and a vector part the Fermion = v Sin(Spin). When…
What realtionship does mass have with weight?
mass is a scalar quantity, while weight is a vector quantity. In particular, weight is defined as the force experienced by a some body of mass due to gravity. On earth, near the surface, the weight of any object is the product of its mass(Kg) and the acceleration experienced by gravity (m/s^2). In equation form. Weight (N) = mass (m) * 9.8 (m/s^2) for example a ball with mass of 10kg has a weight equal…
Weight and mass are different describe how they are different?
Weight and mass are different. Here are some points of difference. Mass | Weight 1. It is the amount of matter contained in | It is the force with which a body is attracted the body | to the center of earth | 2. It is a scalar quantity | It is a force so a vector quantity. | 3. it is a constant quantity(from place to | It may vary from place to place…
What is the net force on an object when you combine a force of 7 N north with a force of 5 N south?
Where is the inertia button n 2005 Chrysler town and country?
Are speed and distance a pair of vector quantities?
Speed and distance are examples of scalar quantities, meaning they only have magnitude. Velocity and displacement are vector quantities, meaning they have both magnitude and direction. Examples of scalar quantities: speed (s) - 10 m/s or 36 km/h distance (d) - 100 m or 0.1 km Examples of vector quantities: velocity (v) - 10 m/s [E] or 36 km/h [E] displacement (Δd) - 100 m [E] or 0.1 km [E] The value in square brackets…
How do You create a n by m matrix which contains 13 numbers?
Is the force of 10 newtons a vector?
If you weighed 70 pounds on earth how many pounds would you weigh on a neutron star?…
What has the author T N Lockyer written?
Write a program in C language to find out the dot product of two vector quantities in Cartesian?
#include <stdio.h> #include <ctype.h> #define n[] int main() { int n, result , answer; int a[n], b[n]; printf("Enter number of terms you would like to use :"); scanf("%d", &n); printf("Enter first vector:\n"); scanf("%d", &a[n]); printf("Enter second vector:\n"); scanf("%d", &b[n]); printf("The dot product is \n" ); return 0; }
What theory does the experiment of force between two parallel currents work?
Quaternion Vector Theory: The currents have vector direction I and -I; II= - Minus scalar sign indicates attraction; I(-I) = + Positive scalar sign indicates Repulsion. Thus parallel lines with current in the same direction bow-n; parallel lines with opposite currents bow-out. This result can be reasoned in the first case that the magnetic field created by the currents is reduced between the wires (opposite flow) and increased outside the wires and thus the wires…
What do you exactly mean by magnitude?
The amount is known to be magnitude of a physical quantitiy. 2 second. 2 is the magnitude of time. 5kg, here 5 is the magnitude of the mass. 76 N, this is for the force whose direction is also to be mentioned. Apart from that it has magnitude of 76 N. Those having only magnitude are termed as scalar quantities and those having direction too are taken as vector quantities.
C program to read and print a scalar matrix?
Here is the C program to check whether the inputted matrix is scalar matrix or not. ( its not my creation, its get from other website,am not check) #include<stdio.h> #include<conio.h> int main() { int a[10][10],i,j,m,n,f=0; printf("Enter the order of the matrix\n"); scanf("%d%d",&m,&n); printf("Enter the matrix\n"); for(i=0;i<m;i++) { for(j=0;j<n;j++) { scanf("%d",&a[i][j]); } } if(m!=n) { printf("The matrix is not identity"); } else { for(i=0;i<m;i++) { for(j=0;j<n;j++) { if((i==j&&a[i][j]!=a[0][0])(i!=j&&a[i][j]!=0)) { printf("The matrix is not scalar\n"); f=1; break…
What is the difference between unit vectors and column vectors?
What is polygon law of vector addition?
C plus plus program for hamiltonian cycle algo?
#include <iostream> #include <fstream> #include <string> #include <vector> using namespace std; vector<int> procedure_1(vector< vector<int> > graph, vector<int> path); vector<int> procedure_2(vector< vector<int> > graph, vector<int> path); vector<int> procedure_2b(vector< vector<int> > graph, vector<int> path); vector<int> procedure_2c(vector< vector<int> > graph, vector<int> path); vector<int> procedure_3(vector< vector<int> > graph, vector<int> path); vector<int> sort(vector<vector<int> > graph); vector<vector<int> > reindex(vector<vector<int> > graph, vector<int> index); ifstream infile ("graph.txt"); //Input file ofstream outfile("paths.txt"); //Output file int main() { int i, j, k, n, vertex…
When the size of vetor is fixed in c plus plus?
The size of a vector cannot be fixed because a vector is a wrapper for a dynamic array where resizing occurs automatically (by virtue of the vector class). So, even if you reserved enough memory for n elements in advance, the vector will resize automatically as soon as you push more than n elements. A normal dynamic array does not resize automatically (you have to manually resize the array in order to accommodate more elements…
How would I add numbers input by a user one at a time into a vector in MATLAB I have the loop set up but don't know how to add the data into the vector?
First, make sure your vector is initialized outside of the loop. Then, within your loop you need to update the vector. If you want data entered by the user only, you should initialize with an empty vector. Example program (not sure which loop you're using, but I'll use a while loop here): vector=[]; user='y'; while user=='y' user=input('Enter another variable? Type y for yes and n for no: '); if user=='n' break end var=input('Please input variable…
What is the physical quantity of weight?
When do you get a magnitude of 0 in vector?
What is the tendency of an object to stay in motion?
What is dimensional formula?
How do you write algebraic expression 25 times the quantity of 16 less than n?
Will a vector be zero if one of its compoent is zero?
A symbol that stands for an unknown quantity?
What is the column vector?…
How can a vector be determined if its rectangular components are known?
What is variable size array in java?
Calculate the acceleration of a 82 kg couch that is pushed across the floor with an unbalanced force of 21 N?
Newton's 2nd Law of Motion: F [N] =m [kg] *a [m/s2], where F = net force acting on an object; m = mass of the object; and a = acceleration of the object. Rearrange the equation: a = F / m = 21 [N] / 82 [kg] = 0.2561 [m/s2]. Note that scalar quantities for F and a are assumed. This statement is true when the motion is linear (a straight line). The situation will…
What is the difference between the ''dot product'' and the ''cross product''?
Dot Product: Given two vectors, a and b, their dot product, represented as a ● b, is equal to their magnitudes multiplied by the cosine of the angle between them, θ, and is a scalar value. a ● b = ║a║║b║cos(θ) Cross Product: Given two vectors, a and b, their cross product, which is a vector, is represented as a X b and is equal to their magnitudes multiplied by the sine of the angle… | https://www.answers.com/Q/Is_inertia_scalar_n_vector_quantity | CC-MAIN-2019-39 | refinedweb | 2,209 | 64.81 |
Fourth Edition
Table of Contents
List of Tables
This document provides guidelines for implementers of OpenGL ES, OpenVG and other API standards specified by the Khronos Group. The aim of these hints is to provide commonality between implementations to ease the logistical problems faced by developers using multiple different implementations of an API.
One of the primary goals is to allow an application binary to run on top of multiple different implementations of an API on the same platform.
Implementers are strongly urged to comply with these guidelines.
This document contains links to several Khronos specifications and header files at versions current at the time of publication. Readers may wish to check the Khronos registry for post-publication updates to these files.
When providing implementations for platforms where the platform vendor does not provide or has not yet established a standard Application Binary Interface for an API, implementers are strongly urged to comply with the following recommendations. Vendors newly establishing ABI specifications for their platforms are also strongly urged to comply with these recommendations.
Implementers are strongly
encouraged to use the standard header files (
egl.h,
gl.h,
kd.h, etc.) for each specification
that are provided by Khronos and listed in Table 1, “Header File Names and Locations”. Links are provided there.
Portable and non-portable definitions are separated into
<api>.h and <api>platform.h files, e.g.,
gl.h and
glplatform.h. Implementers should
not need to change the former; they are strongly discouraged
from doing so. They should rarely need to change the latter as
it already contains definitions for most common
platforms.
Khronos provides a common underlying
khrplatform.h defining sets of
base types, linkage specifications and function-call
specifications covering most common platforms. Many
Khronos-provided <api>platform.h and other header files
include
khrplatform.h
and use its definitions as the basis for their own. Implementers should rarely
need to change this file.
For most APIs, functions and enumerants for
extensions registered with the Khronos Extension Registry are
declared and defined in a Khronos-provided <api>ext.h
file, e.g,
glext.h.
Exceptions are noted below. These header files can be used even
if the implementation doesn't provide a particular extension
since applications must query the presence of extensions at run
time.
Functions and enumerants for unregistered implementer extensions should be declared and defined in an implementer's own header file. Follow the extension writing and naming rules given in How to Create Khronos API Extensions. Use enumerant values obtained from the Khronos Extension Registry, as explained in OpenGL Enumerant Allocation Policies. Implementers are strongly encouraged to register their extensions even if they are the only vendor.
Some APIs define optional utility
libraries. Functions and enumerants for these are declared and
defined in Khronos-provided header files, e.g.,
glu.h. For some other APIs, header file
names are reserved for use by future utility libraries.
Header files for a given API are packaged in an
API-specific folder, e.g.,
GLES. Folder names are listed in
Table 1, “Header File Names and Locations” All API specific folders should be
placed in a common parent folder.
Consider contributing any header file changes back to Khronos so that others may benefit from your expertise. Contact the relevant working group and, on approval, update the files in the Khronos Subversion tree.
Use the function-call convention defined for the platform in the Khronos-provided <api>platform.h, if a definition exists for the platform in question.
If you make your own header files use the names given in Table 1, “Header File Names and Locations”.
If the platform is Windows or WindowsCE, make sure your
header files are suitable for use with MFC. Make sure
that any base API types referred to are preceded by
::. For example you need to refer to
::GetDC(0) because several Microsoft
Foundation Classes have their own
GetDC(void) methods.
When including one header in another, include the parent
directory name. For example when including
eglplatform.h in
egl.h use
#include <EGL/eglplatform.h>. Do not
use
#include <eglplatform.h>
because it forces application makefiles to specify 2 different
-I<path> options to
find both include files.
Table 1. Header File Names and Locations
[f]
glplatform.h does not
exist in many early implementations of OpenGL ES 1.x.
Platform dependent declarations were included directly
in
gl.h .
[g] This file contains unique interface IDs for all API interfaces. These IDs have been automatically generated. Neither implementers nor application developers should edit these interface IDs.
To find the include files, use appropriate compiler
options in the makefiles for your sample programs; e.g.
-I (gcc, linux) or
/I (Visual C++).
Given the different IDEs & compilers people use, especially on Windows, it is not possible to recommend a system location in which to place these include files. Where obvious choices exist Khronos recommends implementers take advantage of them.
In particular, GNU/Linux implementations should follow the Filesystem Hierarchy Standard for the location of headers and libraries.
Implementers may need to modify
eglplatform.h. In particular the
eglNativeDisplayType,
eglNativeWindowType, and
eglNativePixmapType typedefs must be defined as
appropriate for the platform (typically, they will be
typedef'ed to corresponding types in the native window
system). Developer documentation should mention the
correspondence so that developers know what parameters to pass
to
eglCreateWindowSurface,
eglCreatePixmapSurface, and
eglCopyBuffers. Documentation should also
describe the format of the
display_id parameter to
eglGetDisplay, since this is a
platform-specific identifier. See Section 3.2.1, “EGLDisplay” for more details.
Do not include
gl.h in
egl.h.
For historical reasons both Windows and GNU/Linux
include an old version of
gl.h, that is
beyond the control of Khronos, containing OpenGL 1.2
interfaces. All post-OpenGL 1.2 interfaces of the
Compatibility profile of the most recent version of OpenGL are
defined in the Khronos-provided
glext.h.
glcorearb.h
defines all the interfaces of the most recent core profile of
OpenGL and any ARB extensions to it. It does not include
interfaces that have been deprecated and removed from core
OpenGL. Vendor extensions to the Core profile should be
defined in
glcoreext.h
but implementers should keep in mind that people using the
Core profile probably have more concern about portability than
most coders and may want to avoid using extensions.
Implementations supporting only the Core profile should provide the header files listed for OpenGL 3.1+ . Implementations supporting the Compatibility profile should provide the header files listed for OpenGL 3.x & 4.x following the conventions documented in Section 2.2.2, “OpenGL”.
When introducing OpenGL to a platform for the first time, only the Core profile is required. The Compatibility profile is optional and not recommended.
Khronos recommends using EGL as the window abstraction layer, when introducing OpenGL to a platform. Follow the EGL guidelines given herein.
For compatibility with GLES 1.0 implementations, include
in
GLES a special
egl.h
containing the following:
#include <EGL/egl.h> #include <GLES/gl.h>
This is because many early OpenGL ES 1.0
implementations included
gl.h in
egl.h so many existing
applications only include
egl.h .
The name
glu.h
is reserved for future use by the Khronos Group.
As noted earlier, implementers are
strongly encouraged to use the Khronos provided header files.
Implementers, who are
creating their own
kd.h or need to modify
kdplatform.h, are urged to code
them such that they include as few as possible of the
platform's include files, and to avoid declaring C and POSIX
standard functions. This will ease the creation of portable
OpenKODE applications, and help stop non-portable code being
added accidentally.
Each OpenKODE extension is defined in its own header file. Khronos provided header files for each ratified extension are available in the Extension Headers subsection of the OpenKODE registry.
The OpenWF API is divided into two parts: Composition and Display Control. Separate header files must be provided for each part as indicated in Table 1, “Header File Names and Locations”.
It is highly desirable to implement all API entry points as function calls. However in OpenKODE Core, macros or in-lines may be used instead of function calls provided the rules in Section 4.3 OpenKODE Core functions of the OpenKODE specification are followed:
When calling a function or macro, each argument must be evaluated exactly once (although the order of evaluation is undefined).
It must be possible to take the address of a function.
These rules apply except where individually noted in the specification.
Except in cases where macros are allowed or versioned symbol naming is recommended (e.g., OpenCL symbol naming), ensure the API function names exported by your lib & dll files match the function names specified by the Khronos standard for the API you are implementing.
The entry points for each API must be packaged in separate libraries. Recommended library names are given in Table 2, “Recommended Library Names”.
However to provide backward compatibility for existing applications, two OpenGL ES 1.1 libraries should be provided: one with and one without the EGL entry points.
Note: There are extant implementations of the dual OpenGL ES libraries demonstrating this is possible on Symbian, GNU/Linux, Win32 and WinCE.
For OpenGL ES 2.x and 3.x, only a library without EGL entry points is needed.
To allow interoperability through EGL with other Khronos APIs, implementers may want to provide an additional OpenGL library, that can be used with EGL, on platforms having existing GL ABI conventions. In such a case, use the name recommended below for the OpenGL library without EGL.
When introducing OpenGL to a platform, implementers are recommended to provide two OpenGL libraries similarly to the OpenGL ES 1.1 case.
Khronos recommends the library names shown in Table 2, “Recommended Library Names”. The table lists the names developers would typically supply to a link command. The actual file names may vary according to the platform and tools in use.
The ld command on GNU/Linux and Unix
systems prefaces the base name with
lib
and appends the extensions .
so and
.a in that order when searching for the
library. So the full name of the library file must be
lib<base name>.{so,a} depending on
whether it is a shared or static library.
Neither the Microsoft Visual Studio linker nor the ARM
RealView linker offer any special treatment for library names;
the extension for a standard library or import library on
Windows is
.lib, while that for a dynamic
link library is
.dll.
On Windows, if the implementer will provide both 32- and 64-bit libraries, it is necessary to disambiguate by adding a suffix of 32 or 64 to the base name.
Khronos therefore recommends that library names be
of the form
lib<base
name>[<nbits>].<platform specific
extension>; <nbits> being possibly needed only
on the Windows platform.
Table 2. Recommended Library Names
[a] May contain Core or Compatibilty profile. See Section 2.2.2, “OpenGL” below.
[b] These names are required for OpenGL ES 1.0 and the libraries must contain the EGL entry points as detailed in Chapter 8, Packaging, of the OpenGL ES 1.0 specification.
[c] These names are deprecated for OpenGL ES 1.1 and beyond and should only be used for a library that includes the EGL entry points in order to support legacy applications.
[d] These alternate names for GL ES libraries that do not contain the EGL entry points were introduced starting at revision 1.1.09 of the OpenGL ES 1.1 specification.
Vendors of controlled platforms are strongly urged to follow the recommendations given above for Uncontrolled Platforms when adding a Khronos Group API to their platform.
Implementers should follow any linkage specifications established by the platform vendor .
Use the header files, (e.g., for OpenGL ES, gl.h, glext.h & egl.h) provided by the platform vendor.
Package header files in the same containing folder used by the platform vendor.
Use the function names specified in those header files.
Use the function-call convention specified in those header files.
Implement all API entry points in the same way as in the vendor-provided ABI. That is, functions should be functions, in-line functions should be in-line functions and macros should be macros.
Use the library names specified by the platform vendor.
Because of OpenGL's long history, a series of conventions have been established, even for platforms which are not strictly controlled by their vendors. This section documents the established conventions for all common platforms. They should be followed by Implementers supporting the Compatibility profile in order to provide the least surprises to application developers. Implementers supporting only the Core profile of OpenGL 3.1+ are encouraged to follow the guidelines given in the preceding sections.
Platform SDKs typically come with 2
OpenGL-related header files pre-installed:
gl.h, which defines the OpenGL
interfaces, and a header file that defines the interfaces to that
platform's window abstraction layer (e.g.
glx.h) . These files are commonly
outdated, often having only OpenGL 1.2 interfaces. As these files are
outside the control of Khronos, Khronos provides
*ext.h files which define newly added
functions and enums, such as those specified by OpenGL 4.x. Some
platform SDKs may also include
*ext.h files. These can also be
outdated. Implementers are advised to use the Khronos provided
*ext.h files and supply these
with their SDKs.
Implementers can choose to provide their own up-to-date
gl.h. Developer documentation
should explain how to ensure the compiler finds any updated or
implementation specific files.
With the exceptions noted in the tables below, all files are
packaged in the folder
GL.
The following sections give details for each platform.
In order to allow interaction with other Khronos APIs, implementers may wish to provide an EGL implementation, that supports OpenGL, in addition to a platform's standard window abstraction layer. In this case, EGL should be packaged in a separate library following the guidelines given in Section 2.1, “Uncontrolled Platforms (e.g. GNU®/Linux®, Windows®, Windows CE)” above. Implementers must ensure that an application can link with both the OpenGL library and the EGL library without any errors arising from the OpenGL library having entry points for the platform's standard window abstraction layer.
Those implementing OpenGL on GNU/Linux or Unix systems should follow the OpenGL Application Binary Interface for Linux which has been approved by the Linux Standard Base Workgroup. The file and library names given below apply to any platform using the X Window System.
Table 3. GL on GNU/Linux, Unix and other platforms using the X Window System
[a] Per the above referenced ABI, libGL.so.1 contains a minimum of OpenGL 1.2, GLX 1.3 and ARB_multitexture.
OpenGL is the primary 3D rendering API for Mac OS X so is a core part of the system. Information is presented here more for completeness than from any expectation that third party implementations will appear. For a complete description of Apple's implementation see the OpenGL Programming Guide for Mac OS X. Primarily aimed at developers, it provides a good description of the structure of OpenGL in Mac OS X.
Apple's SDK includes up-to-date gl.h and glext.h header files that track their implementation. These headers contain all GL 3.x features and are used regardless of the vendor of the underlying GPU. The headers are packaged together with the libraries in the OpenGL Framework.
Those creating an implementation for Windows will need to provide an Installable Client Driver (ICD). See Loading an OpenGL Installable Client Driver and OpenGL and Windows Vista™ for more information.
Table 5. GL on Microsoft Windows
OpenCL implementations may optionally include an off-line
compiler. When such a compiler is provided, the compiler must accept
the same options as the on-line compiler. These are specified in the
OpenCL
specification. In addition, the compiler must support a
-o <file name> option for
specifying the name of the output file and a
-b
<machine> option for specifying the target
machine. Khronos recommends that the string "clc" be used as the last
part of the compiler name as in, e.g., openclc or
<your company name>clc.
OpenCL implementations on GNU/Linux should decorate the symbol
names in shared libraries with version numbers in the form
<symbol>@@OPENCL_<version>
where
<version> is the version of the OpenCL
specification in which the symbol first appeared, e.g. 1.0, 1.1 or
2.0.
The EGL specification (Section 2.1.2 Displays) describes what an EGLDisplay represents. It states that,“In most environments a display corresponds to a single physical screen.”In reality most environments have only one EGLDisplay even when multiple physical screens are supported. Many vendors match the EGLDisplay to the display driver implementation. So if there is only one display driver on the system then the system has only one EGLDisplay (even though that one driver may be capable of driving more than 1 physical screen). For example, in the X Window System an EGLDisplay is likely to correspond to an X Display, not to an X Screen.
The implementer is free to choose what an EGLDisplay represents. There could be one EGLDisplay per physical screen. There could be one EGLDisplay per graphics chip or graphics card. There could be one EGLDisplay per graphics driver vendor. Or there could be one EGLDisplay per system which abstracts all available graphics hardware on the system into a single EGLDisplay handle.
While the implementer is free to choose the abstraction for the
EGLDisplay, there are advantages to choosing the latter
approach where only a single EGLDisplay exists on the
system. For example EGLImages and
EGLContexts can only be shared within a single
EGLDisplay. If there is more than one
EGLDisplay on a system (e.g. one per physical screen) it
makes sharing resources between the two displays difficult or
impossible. Another example is that most applications are written to
use a single EGLDisplay (the one corresponding to
EGL_DEFAULT_DISPLAY), and those apps will not
generally be able to take full advantage of systems with multiple
EGLDisplays.
Recommendation: Have only one EGLDisplay per system, even if the system has multiple physical screens.
If there is only one EGLDisplay on a system, how
does that work with multiple physical screens? This is up to the
native window system (or OpenKODE). When an application wants to
render to a window on a particular physical screen, it should ensure
that the window it creates is displayed on that physical screen. The
mechanism is specific to the native window system (or possibly
OpenKODE if using
kdCreateWindow()). NOTE: There
is currently no way to tell OpenKODE upon which screen to open a
KDWindow. An extension to allow this (by setting a "which
screen" window attribute between calling
kdCreateWindow() and
kdRealizeWindow()) may be available in the
future.
The various EGLImage specifications describe how EGLImages can be created and used. Some of the implications made by the spec. are not immediately obvious. This section attempts to clarify what choices may need to be made by an implementation, and how an implementation addresses those choices. The discussion in this section assumes that the reader has read at least the EGL_KHR_image_base specification.
EGLImages are created with the
eglCreateImageKHR command. They can be created
from a variety of source image objects (e.g. OpenGL ES textures,
OpenVG VGImages, native pixmaps, etc).
Regardless of what type of object the EGLImage is created from, the specifications allow an implementation to reallocate the memory which backs the EGLImage. However, there are a number of issues which make this very difficult. For example, when one API is rendering to an EGLImage in one thread, another API is reading the same EGLImage in another thread, and a third thread calls a function which creates a sibling object from the same EGLImage, then it is not clear that reallocation is possible. If an implementation performs reallocation, it is likely that it will have to do expensive locking around the use of EGLImages which will hurt performance. Therefore implementations may benefit from not performing reallocation once an EGLImage has been created.
Recommendation: Implementations should avoid reallocating the memory backing the EGLImage after the EGLImage has been created.
When an EGLImage is created from a client API
object, the context that contains the object is current to the
thread that called
eglCreateImageKHR().
Therefore there are fewer issues with reallocating the memory at the
time the EGLImage is created than when a sibling is
created from the EGLImage.
Implementations of client APIs may have special requirements for the memory accessed by the API. For example, there may be alignment requirements, or requirements that memory come from a specific range of physical addresses. These requirements may not be the same for all client APIs on a particular system. An OpenGL ES texture may have different alignment requirements than a VGImage, for example.
In addition, there may be constraints on what internal formats
are accessible to certain APIs. An implementation may choose to
change the internal representation of the image when an
EGLImage is created or when a sibling is created from
the EGLImage, so long as this is transparent to the
application. For example, when an EGLImage is created
from an OpenGL ES texture which was specified as RGBA 4444, the
implementation may choose to represent the EGLImage
internally as an RGBA 8888 image even if the texture was originally
internally represented as RGBA 4444. However, in this case the
implementation must continue to treat the original texture as an
RGBA 4444 texture. This means that
glTexSubImage2D with
type=
GL_UNSIGNED_BYTE
must fail and
glTexSubImage2D with
type=
GL_UNSIGNED_SHORT_4_4_4_4
must succeed. An implementation may choose to do this if, for
example, its OpenMAX renderer can support RGBA 8888 but not RGBA
4444. Alternatively, an implementation may choose to simply fail to
allow an EGLImage represented internally as RGBA 4444
to be used as an OpenMAX buffer.
Generally an implementation may discard the contents of an EGLImage (and all associated client API objects) when the EGLImage is created or when any sibling object is created from the EGLImage. Therefore there is no need to copy and/or convert the contents of a buffer, if the memory backing the EGLImage gets reallocated. Note that, if the EGLImage PRESERVED attribute is set to TRUE when the EGLImage is created, then the contents of the EGLImage (and all associated client API objects) do have to be preserved when the EGLImage is created and when a sibling object is created from that EGLImage. An implementation may still reallocate the memory backing the EGLImage so long as it copies the contents of the old memory to the new memory. An implementation may also opt to fail creation of the EGLImage or the sibling object if the PRESERVED attribute is set to true.
If an implementation chooses not to reallocate the memory backing the EGLImage after it has been created, then it must take extra care when first creating the EGLImage to ensure compatibility among APIs. For example, if the backing memory is allocated using an alignment that is incompatible with an OpenGL ES texture's requirements then that EGLImage cannot be used to create an OpenGL ES texture sibling. An implementation has several choices for addressing this issue:
Fail to create the sibling object.
Reallocate the memory with the required alignment.
Ensure the allocation performed when the EGLImage is created is compatible with all (or as many as possible) types of API objects.
The third choice is the most desirable.
Recommendation: When creating an EGLImage, an implementation should allocate (or reallocate) memory backing the EGLImage in such a way that the memory is compatible with the largest possible set of API objects.
As mentioned above, an implementation is free to reallocate memory backing an EGLImage whenever an EGLImage sibling is created from the EGLImage (or at any other time). The only requirement is that any such reallocation be transparent to the application (other than discarding the pixel values, if the PRESERVED attribute is not set to TRUE). As discussed above, performing such reallocation when a sibling is created from an EGLImage may be very difficult to implement robustly. Therefore the recommendation is to avoid such reallocations when creating siblings.
An implementation which never reallocates must fail any attempt to create a sibling from an EGLImage which has an allocation incompatible with the sibling object being created. This failure is acceptable according to the spec, but is still undesirable. This is why it is important for the original memory allocation to be compatible with as many types of API sibling objects as possible.
Another option for allocating memory to back an EGLImage is to delay the allocation until one of the EGLImage sibling objects is actually used. This may allow an implementation to be more flexible and/or perform better. Since the pixels in an EGLImage can be discarded when any sibling object is created, it is advisable for applications using EGLImages to create all sibling objects before using (e.g. rendering to) any of the sibling objects. Delaying the allocation of memory until one of the sibling objects is first used allows the implementation to take into account what type of sibling objects the EGLImage has, and to allocate memory appropriate to all of those sibling objects. Once any of the siblings is actually used (e.g. rendered to) it becomes much more difficult to reallocate the memory.
An application may still request that a sibling object be created from the EGLImage after one of the siblings has been used, but an implementation may choose to fail to create the sibling at this time, if the already allocated memory is incompatible with the requested sibling. Such an implementation would be maximally flexible about what siblings can be created, and maximally efficient in its memory allocation, before any siblings are used. After siblings are used the implementation may be less flexible, but that is a less important case.
Creation of an EGLImage and its sibling objects is not intended to be an operation which is performed frequently (e.g. per frame). It is far more important to optimize the use of EGLImage siblings (binding sibling objects, rendering to sibling objects, and reading from sibling objects (e.g. as textures)) than to optimize their creation and destruction. Where tradeoffs can be made between use performance and creation/destruction performance, it is recommended that the choice be made in favor of optimizing the use of sibling objects even if at the expense of creation/destruction performance (within reason).
Developer documentation should describe which types of EGLImage can be used for which types of API objects in the implementation. For example, what are the restrictions (if any) on a GLES texture in order for an EGLImage, that is created with it, to be used to create a VGImage sibling from that EGLImage? Are there any additional restrictions which will guarantee optimal performance?
The documentation should also describe which operations are likely to be slow (e.g. creating EGLImages or creating EGLImage siblings).
To claim your product is compliant with an API specification or use its trademark and logo to market that product, your implementation must pass the API's conformance test and the results must be submitted to the Khronos Group. To do this, you must join Khronos as an Adopter which requires a fee and a legal agreement. More information about the conformance process and fees can be found on the Khronos Adopters page. Adopters will receive an account giving them access to the relevant API-specific Adopters area of the Khronos web site.
No fee or agreement is needed to implement a Khronos API or use it in a product but you may not claim compliance and may not use its trademark and logo.
API-specific Adopters areas provide links for downloading test packages and submitting results. The test packages contain instructions detailing the format and and required content of a Submission Package.
The low-level interface between a compiled application program and the operating system or its libraries.
The source-code level interface between an application program and the operating system or its libraries.
An OpenGL driver for Microsoft Windows that is identified by a renderer string. The OpenGL runtime decides which ICD to run by reading the contents of a specific registry entry. More details can be found here.
A tool for the purpose of software development in which, at a minimum, an editor, compiler and debugger are integrated together for ease of use.
A company or person who implements a Khronos API.
A set of C++ utility classes provided by Microsoft Corporation.
A kit containing the header files, libraries and documentation required to develop software for some device or environment.
A company providing an operating system platform that includes an ABI specification for one or more Khronos APIs. E.g., Google (OpenGL ES & EGL on Android) and Qualcomm (OpenGL ES on BREW). A Vendor may also be an Implementer. | http://www.khronos.org/registry/implementers_guide.html?%3f | CC-MAIN-2014-10 | refinedweb | 4,849 | 56.15 |
TI-BASIC to Python 3 Transpiler
Project description
ti842py is a TI-BASIC to Python 3 transpiler. A transpiler is a piece of software that can convert code from one language to another. This program should be able to convert a lot of programs, but if you find something that it can't convert yet, start an issue. This transpiler also has the ability to automatically decompile any 8Xp file that you supply as the input file, with the help of my other project that I contribute to, basically-ti-basic. Note that this software is in beta and may produce inaccurate results.
Features
- Converts string literals to comments
- Attempts to interpret implicit multiplication
- Attempts to fix floating point arithmetic errors
Disp/
Output()
- Variable assignment
If/Then/Elsestatements, including
Else If
ClrHome
Input/
Prompt
- For, While, and Repeat loops
Pause
Wait
Stop
DelVar
getKey
Goto/
Lbl
getDate,
getTime, and
dayOfWk
IS>(/
DS<(
toString()
randInt()/
rand
- Most drawing functions
- List subscripting
- Matrices
Ans
prgm
Planned Features
round()
Return
eval()/
expr()
Known issues
Issues can be found at
Installation
ti842py can be installed via PyPI or by cloning the repository. To install it with PyPI, just run
pip3 install ti842py in a terminal. To install it locally, you can clone the repository and run
python setup.py install --user.
Usage
Feel free to use the programs found at to test this project out.
CLI Usage
ti842py can be used in 3 different ways. The first way is just running it from the command line. For example, if you wanted to convert the program in
tiprogram.txt to
tiprogram.py, you can this command:
ti842py tiprogram.txt -o tiprogram.py. If no value is specified for
-o, the converted program will be written to
stdout. The
-n flag can be added to force the transpiler to not decompile the input file, and the
-d flag can be added to force the transpiler to attempt and decompile the input file. If the
--run or
-r argument is supplied, the resulting python file will be run after it is done transpiling
usage: ti842py [-h] [-o OUTFILE] [-n] [-d] [--no-fix-multiplication] [--no-fix-floating-point] [--turbo-draw] [-r] [-V] [infile] TI-BASIC to Python 3 Transpiler positional arguments: infile Input file (filename or stdin). optional arguments: -h, --help show this help message and exit -o OUTFILE, --out OUTFILE Optional output file to write to. Defaults to standard out. -n, --force-normal Forces the program to not attempt and decompile the input file. Useful for false positives -d, --force-decompile Forces the program to attempt to decompile the input file --no-fix-multiplication Do not attempt to fix implicit multiplication. For example, AB -> A*B and A(1) -> A*(1) --no-fix-floating-point Do not attempt to fix floating point arithmetic errors. For example, 1.1 * 3 would normally say 3.3000000000000003 instead of 3.3 --turbo-draw Remove the 0.1 second delay between drawing actions -r, --run Runs the program after it's done transpiling. Will not print to stdout -V, --version show program's version number and exit
Advanced terminal usage
You can use ti842py by piping files to it's stdin. This can be done via pipes or redirects, and the files can be either 8Xp or plain text files, just like normal. Here's some examples:
$ cat BAR.8Xp | ti842py --run $ ti842py -o bar.py < BAR.8Xp $ cat CLOCK.bas | ti842py -nr $ ti842py --no-fix-floating-point --run < CLOCK.bas
Programmatic Usage
ti842py can also be imported and used in a program. Here is an example program to convert
tiprogram.txt to
tiprogram.py:
from ti842py import transpile transpile("tiprogram.txt", "tiprogram.py")
Again, if the second argument is not supplied, the program will be written to
stdout. The
transpile command can be supplied with optional arguments.
decompileFile,
multiplication, and
floating_point default to
True, and
forceDecompile,
run, and
turbo_draw default to
False
The last way that ti842py can be ran is by running the main python file. After cloning the repository, cd into the repository and run
python ti842py/main.py inputfile.txt. You can supply any arguments that you would supply with the
ti842py command.
Special functions
getKey- The
getKeyfunction works just like it does in normal TI-BASIC, except with some special rules. Any key on the keyboard pressed will be converted to the corresponding key on the calculator. This works for letters, numbers, arrow keys, enter, delete, and symbols. As for the buttons not on a keyboard, the top 5 keys are the F1-F5 keys on the keyboard,
2ndis grave
`, and
alphais tilda
~.
modeis F6,
statis f7,
varsis F8,
clearis F9, and the
X,T,θ,nkey is F10.
If-
Ifblocks with
Thenafter the
Ifmust be ended with
End, they cannot be left open.
Ifblocks on 2 lines without a
Thencannot be closed with
End
prgm-
prgmwill search the current directory for a file matching the provided name (case insensitive; extension of
.8xp). If found, the file will be passed to the command
ti842py {filename} --run, where
{filename}is the name of the file. If a path is given that contains
.or
~, or if the path is not all uppercase, the transpiler will assume that the path has been manually provided by the user (this will be useful once I implement a TI-BASIC shell).
Libraries used
My fork of basically-ti-basic - for decompiling
.8Xpfiles
graphics.py - for drawing features
insignification's fork of the goto module - for
goto/
lblsupport
pynput - for non-blocking input support
pythondialog - Python wrapper around
dialogfor
Menusupport
token_utils - Support for fixing implicit multiplication
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages. | https://pypi.org/project/ti842py/ | CC-MAIN-2021-43 | refinedweb | 962 | 64 |
Let's be frank. Many aspects of editing Wikipedia article text can be challenging: finding reliable sources, drafting new text in your own words (without plagiarizing the source), preparing the inline citation, adding the text to the article, and then engaging in discussion with fellow editors over whether your text should be included or not. In some cases, the end result of drafting and saving a new paragraph is that it is deleted with a curt edit summary.
Even though editing text is hard, Wikipedia needs editors to work on drafting new text, and improving existing text. Only a fraction of Wikipedia's 5 million articles are featured articles. If the encyclopedia is going to be improved, it is essential that editors spend a good deal of their time adding text or improving text in existing articles that are in earlier stages of development.
But if you need a Wikibreak from some of the stress that goes along with editing text, particularly when proposing major additions, there is another activity that you can do on Wikipedia that is helpful to the encyclopedia, rewarding, and low stress: adding images from Wikimedia Commons.
Longtime editors can testify that they have had countless disagreements, debates and discussions regarding adding or deleting text. But veteran editors who have been adding well-chosen images from Wikimedia Commons for years will rarely get a complaint on their Talk page–indeed, they may even get "thank you" messages for particularly well-chosen image additions.
Of course you can't just go adding images to Featured articles (on these articles, the images are chosen after careful discussion), but if you focus your image contributions on articles in earlier stages of development, particularly those with no images, and you pick images that properly illustrate the topic of the article, your contributions are likely to stay in the articles. When you are adding images, you must comply with the Wikipedia Image Use Policy. More information about using images is available at WP:IMAGES.
Adding an image to an article is easy!
When you have found an article in an earlier stage of development that has few images, it is time to find some good images. You have a lot of choices. Let's say the article is about the "African Athletic Games". Wikimedia Commons may have a range of pictures available, including photos of athletes, officials, opening and closing ceremonies, medal awarding ceremonies and athletic facilities built for the event. One consideration in choosing pictures is to try and give a reasonably fair coverage of the different elements covered by the article. For example, if the games include three types of sports and you are choosing three photos of athletes, you may want to have one photo that illustrates each of the main sport categories.
As well, MOS:IMAGES, the Wikipedia guidelines in the Manual of Style regarding images says that editors should choose photos that depict individuals of different ages, genders and races.
Overall, try to get a balance of photos of different aspects of the event. If all of the photos are of athletic facilities built for the games, this will not convey enough of the human aspect of the event. On the other hand, if only close-up photos of athletes are used, the reader will not get a sense of the local setting and the special facilities built for the games.
Of all the photos that you choose, the photo for the lead (introduction) section is arguably the most important. Many readers will only read the lead of an article. If they do decide to read the article, it is because the lead managed to spark their interest. The text, of course, plays a crucial role in engaging the reader's interest in the lead, but the lead image also has an important role. Don't pick a photo of athletes waiting on the starting line; pick a dramatic action photo of a runner surging past the finish line that will captivate the reader's imagination!
Once you have chosen photos for the article, when another editor sees the photos, this may prompt her or him to think "that is a good photo, but I have seen an even better one that illustrates that aspect of the article." These types of changes are part of the normal Wikipedia process. If you think that the new picture is less suitable, you can discuss this on the article's Talk page. As long as your discussion is civil and respectful, you may be able to make a compromise (e.g., keeping the new photo and relocating the old photo to another location in the article).
For some topics, choosing the right image is easy. For milkshake, pick a photo of a frothy chocolate milkshake with whipped cream on top. For toaster, you can pick from a number of gleaming chrome appliances. But can you illustrate abstract concepts like emptiness or insignificance with a photo? Yes, it may be possible. Finding an image for an abstract concept may take a lot more searching through Wikimedia Commons. If you really want a photo of a person sad about losing a running race to illustrate a Wikipedia essay on dealing with defeat, you may not be able to find it by searching for keywords like "defeat" or "losing". You may have to go through hundreds of running race photos until you find the one you're looking for.
If you browse through Wikimedia Commons, you will see that it is a mixture of photos of people, objects, and different landscapes. These range from antique sepia-toned black and white photos from the 19th century to current colour photos of modern items and cityscapes. Some of the objects that are photographed include works of art such as paintings and sculptures. When you are looking for an image to illustrate an abstract concept like rage or sadness, there may be paintings or sculptures of these concepts that will serve as good illustrations. The images also include tables, graphs, computer-generated images, music notation and some video screenshots. When using an image of a table or graph, the rules on reliable sourcing (WP:RS) apply to images in the same way that they apply to text. You will need to supply a citation for the table or graph.
A widely-held, yet incorrect, view is that captions are somehow a Wikipedia rule-free zone, where editors can express any views they want. Nope! All the standard Wikipedia rules like WP:NPOV and WP:OR apply to text in captions, just as with article text. A photo illustrating a historical person should not have a caption with POV comments that she is the most brilliant (or the cruellest) ruler in history. A photo of a historical wartime event should not have a caption with the editor's own original theories of why the "X" side lost that battle.
If you are illustrating a sensitive or controversial topic, it is best to keep the caption as simple and factual as possible. For a photo of a controversial political figure, you may wish to simply caption it "John Smith in 1925", without making reference to any of the controversies or disputes in his biography. For a photo of a disputed territory, you may wish to simply describe what is in the picture, without referring to any of the disputed names for that area, e.g., "A farming region, pictured in 2009."
To add a light touch to a long day of editing, an especially enjoyable task is to add images to Wikipedia essays (WP:Essays). The rules for adding images to essay pages in the Wikipedia namespace are somewhat more relaxed, and there are many essays that have funny, ironic or sarcastic images as illustrations. The essay Wikipedia:There is no deadline, for example, has a photo of a turtle ambling through the grass. | https://readtiger.com/wkp/en/Wikipedia:Adding_images_improves_the_encyclopedia | CC-MAIN-2019-47 | refinedweb | 1,317 | 57.71 |
avr-os: Multitasking on Arduino
Arduino is an open source prototyping platform for electronics. There is so much you can do with Arduino and the community is proof. In playing with Arduino I decided that it would be a great project to create a small multitasking library for use on AVR platforms, which includes Arduino.
A small introduction.
Hello World, avr-os style
The following sketch is a basic example of how multitasking can be used in your Arduino sketches. This sketch has two tasks that continously print the task name and some information to the LCD.
It demonstrates how a task is started, how os_sleep can be used to sleep tasks, and the ability to use spinlocks.
#include <Arduino.h> #include <LiquidCrystal.h> #include <util/delay.h> extern "C" { #include <os.h> } LiquidCrystal lcd(12, 11, 5, 4, 3, 2); spinlock_t testLock; void kernel_task(void *arg) { while(1) { spinlock_acquire(&testLock); lcd.setCursor(0, 0); lcd.print("kernel: " + String((long)os_get_uptime())); spinlock_release(&testLock); os_sleep(1000); } } void user_task(void *arg) { int x = 0; while(1) { spinlock_acquire(&testLock); lcd.setCursor(0, 1); lcd.print("user_task: " + String(x++)); spinlock_release(&testLock); os_sleep(5000); } } void setup() { os_init(); lcd.begin(16, 2); lcd.print("Starting up..."); } void loop() { spinlock_init(&testLock); os_schedule_task(kernel_task, NULL, 0); os_schedule_task(user_task, NULL, 0); lcd.clear(); os_loop(); }
The image below shows the sketch in action:
Using the OS
The following is the header for avr-os that demonstrates the features available:
#include <stdint.h> typedef void(*os_task_function)(void *arg); /** * Initializes the OS * * This should be the first call in the * application's main method. */ void os_init(); /** * Starts the OS loop. * * This will execute tasks. * Make sure to create at least one task before * starting the loop. */ void os_loop(); int os_schedule_task(os_task_function function, void *arg, uint16_t start_delay_secs); void os_exit_task(); void os_sleep(uint16_t millis); /** * Returns the amount of seconds since the OS has started. */ uint64_t os_get_uptime(); /** * Returns the amount of milliseconds since the OS has started. * * This will overflow after about */ uint64_t os_get_uptime_millis(); typedef volatile int spinlock_t; void spinlock_init(spinlock_t *lock); void spinlock_acquire(spinlock_t *lock); void spinlock_release(spinlock_t *lock);
Try it out
The code is available here and contributions are definitely welcome.
Tweet | http://www.chrismoos.com/2012/12/05/avr-os-multitasking-on-arduino | CC-MAIN-2014-10 | refinedweb | 359 | 50.33 |
- NAME
- SYNOPSIS
- DESCRIPTION
- DTL INTRO
- REFERENCE
- BUGS
- LICENSE
- LEGAL
- SEE ALSO
- AUTHOR
NAME
Dotiac::DTL - Run Django Templates in Perl
SYNOPSIS
Template File: (file.html):
Hello, my name is {{ my_name }}
Perl skript:
require Dotiac::DTL; my $t=Dotiac::DTL::new("file.html"); $t->print({name=>"adrian"});
Or maybe you want a string returned;
require Dotiac::DTL; my $t=Dotiac::DTL::new("file.html"); $t->string({name=>"adrian"});
Use it like HTML::Template:
require Dotiac::DTL; my $t=Dotiac::DTL::new("file.html"); $t->param(name=>"adrian"); print $t->output();
Use it like Django:
use Dotiac::DTL qw/Template Context/; my $t = Template("file"); my $c = Context({my_name=>"Adrian"}); print $t->render($c);
DESCRIPTION
This template system implements (almost) the same template language as the templates in the Django project only for Perl.
If you don't know what the django template language is see for a very good introduction, which is also valid for this implementation.
This is not supported by, so please don't send your questions there, drop me a mail instead.
But if you ever going to program webapplications in python, go check it out.
This is just a quick overview over the features, for detailed information and internals look at Dotiac::DTL::Core.
Exported Functions
Template(FILE, COMPILE)
Creates a template from FILE. This function is for Django like syntax, use new(FILE, COMPILE) for better results and control.
- FILE.
- COMPILE
Controls if and when the template should be compiled.
See new(FILE, COMPILE)
Returns a Dotiac::DTL::Template object.
Context(HASHREF)
Python's Django uses Context() to create a Context, Dotiac::DTL doesn't use this, it just uses a hash.
- HASHREF
A Hash of parameters.
Returns the first Argument.
Class constructers
new(FILENAME, COMPILE)
Creates a template or loads it from the cache.
- FILENAME
The filename of the template to open or a scalarref to parse:
$t=Dotiac::DTL->new("file.html"); $file="Hello World"; $t=Dotiac::DTL->new(\$file);
Templates from scalarrefs are never compiled.
- COMPILE
Dotiac::DTL can translate (compile) text templates to perl code (as FILENAME+".pm") for faster parsing, execution and less memory consumption.
See Dotiac::DTL::Compiled on information on the autocompiler.
The parameter "COMPILE" controls how the template is compiled:
- undef (default)
Will use a compiled template if it is there and older than the uncompiled version, otherwise the normal one.
Will recompile the template if it was outdated. (original version younger than compiled one)
- 1 (newandcompile)
Will compile the template if it is not compiled already.
Will recompile the template if it was outdated. (original version younger than compiled one)
Returns the uncompiled version if it has been compiled by new() and the compiled version if it was already compiled.
unlink "file.html.pm" my $t=Dotiac::DTL->new("file.html",1); #$t is the uncompiled version. $t=Dotiac::DTL->new("file.html",1); #$t is now the compiled version.
- 0 (no recompile)
Will use a compiled template if it is there and older than the uncompiled version, otherwise the normal one.
Will not ever recompile the compiled version, if its outdated, its outdated.
- -1 (no compiled)
Will never use the compiled version even if it is there.
If you want to use only compiled templates, see Dotiac::DTL::Reduced, which skips the parser to save memory.
Returns a Dotiac::DTL::Template object.
newandcompile(FILENAME)
Same as new (FILENAME,1), which means: Compiles the template if it is not already compiled and recompiles if the compiled one is older.
Returns a Dotiac::DTL::Template object.
Methods
These work only on the returned Dotiac::DTL::Template object of new()
param(NAME, VALUE)
Works like HTML::Templates param() method, will set a param that will be used for output generation.
my $t=Dotiac::DTL->new("file.html"); $t->param(FOO=>"bar"); $t->print(); #Its the same as: my $t=Dotiac::DTL->new("file.html"); $t->print({FOO=>"bar"});
- NAME
Name of the parameter.
- VALUE
Value to set the parameter to.
Returns the value of the param NAME if VALUE is skipped.
string(HASHREF)
Returns the templates output.
- HASHREF
Parameters to give to the template. See Variables below.
output(HASHREF) and render(HASHREF)
Same thing as string(HASHREF) just for HTML::Template and PyDjango syntax.
print(HASHREF)
You can think of these two being equal:
print $t->string(HASHREF); $t->print(HASHREF);
But string() can cause a lot of memory to be used (on large templates), so print() will print to the default output handle as soon as it has some data, which uses a lot less memory.
- HASHREF
Parameters to give to the template. See Variables below.
Returns nothing.
compiled(PACKAGENAME)
Treats PACKAGENAME as a compiled template. See Dotiac::DTL::Compiled.
This is useful to insert perl code into templates.
Returns a Dotiac::DTL object.
DTL INTRO
Everything in {# and #} will be ignored by the parser. There is also a comment-tag.
Hello World {# This is a default text, TODO enter more text #} {% comment %} This is also a comment. {% endcomment %}
See Dotiac::DTL:Comment and Dotiac::DTL::Tag::comment.
Variables
Variables are either perl datastructures/objects made to look like python style objects (case sensitive), or in "" or '' encased strings.
$foo=new foo; $template->print({hash=>{text=>Foo},scalar=>"Hello World",array=>[1,2,3],object=>$foo});
Template:
{{ scalar }} <!-- Hello World --> {% for loop in array reversed%} {{ forloop.counter:}} {{loop}} <!-- 1:3 2:2 3:1 --> {% endfor %} First is {{ array.0 }}; {{ hash.text|escape }} <!-- Foo --> {{ "10"|add:"10" }} <!-- 20 --> {{ object.member }} <!-- either gets $foo->{member}/$foo->[member] or calls $foo->member() if $Dotiac::DTL::ALLOW_METHOD_CALLS is true(default) -->
Everywhere you can use a variable, you can also use a static string in single or double quotes. And everywhere you can use a string, you can also use a variable, this includes filters:
{% with "HelloXXX, World"|cut:"X" as helloworld %} {{ helloworld|lower }} {# Prints hello, world #} {% with "l" as L %} {{ hellowordl|cut:L }} {# Prints heo, word #} {% endwith %} {% endwith %}
See Dotiac::DTL::Variable for more details and Dotiac::DTL::Tag::with for the {% with %} tag.
Variables will be escaped for use in HTML. Which means {{ "<" }} will turn to "<" during output.
If you want to prevent this. Use either the global Autoescaping value Dotiac::DTL::Core, the autoescape tag Dotiac::DTL::Tag::autoescape or the safe filter Dotiac::DTL::Filter
String literals (" ... text ... ") are not going to be escaped, because the Django doesn't do it as well. See
Note
Don't ever use }} or %} in strings, it might confuse the parser. But you can use \}\} or %\} instead.
Making your objects work better in Dotiac::DTL
Python has some default representations of objects, that perl lacks. But you can provide one, two or all of these three methods to make your object work in Dotiac::DTL as python object would work in Django:
string()
When the object is rendered in the output without a call to the member variable, Dotiac::DTL tries to call its string() method without arguments.
my $t="{{ Object }}" $template=Dotiac::DTL->new(\$t); $template->print({ Object=>new foo }); #Will print "foo=<address>"
But this way:
package foo; .... sub string() { return "foo&bar" } package main; my $t="{{ Object }}" $template=Dotiac::DTL->new(\$t); $template->print({ Object=>new foo }); #Now it will print "foo&bar"
repr()
Like string(), but it should print out the objects complete data. Not used yet.
count()
This is used in if and if(not)equal.
As default, objects are always true and counted as one. This is not good, better to implement your own count() method:
my $t="{% if emptyobject %}true{% else %}false{% endif %}" $template=Dotiac::DTL->new(\$t); $template->print({ emptyobject=>new foo }); #Will print "true"
with your own:
package foo; .... sub count() { return 0; } package main; my $t="{% if emptyobject %}true{% else %}false{% endif %}" $template=Dotiac::DTL->new(\$t); $template->print({ emptyobject=>new foo }); #Now it will print "false"
Differences
There are some differences with the original template implementation of Django:
I wrote this using just the documentation, so it will differ a lot on undokumented features, If you are missing something or notice something not listed here, drop me a mail.
One mayor difference is: Python has a default string representation for objects (__str__()), Perl doesn't. So if you writing an object into the template it will appear as a perl pointer. For a solution to this see above.
The perl side interface is quite different from the Python one:
#Python: (from) from django.template import Context, Template t = Template("My name is {{ my_name }}.") c = Context({"my_name": "Adrian"}) t.render(c)
This was to un-Perl for me, so this follows the HTML::Template way:
require Dotiac::DTL; my $text="My name is {{ my_name }}."; my $t=Dotiac::DTL->new("file.html"); #or my $t=Dotiac::DTL->new(\$text); $t->string({my_name=>"Adrian"}); #or $t->print({my_name=>"Adrian"});
There is also a Django-like interface.
use Dotiac::DTL qw/Template Context/; my $t = Template("file"); #This also looks in @Dotiac::DTL::TEMPLATE_DIRS for file, file.html and file.txt if nothing exists, it treats file as a string. my $c = Context({my_name=>"Adrian"}); #This just returns the first argument. $t->render($c); #this equals $t->string($c); #of course: $t->print($c); #works just as well
Tag: load
The tag {% load %} will work, but do something else internally.
Look at Dotiac::DTL::Addon and Dotiac::DTL::Tag::load for information.
The greatest difference is:
In Django the load doesn't affect included templates, in Dotiac::DTL load is global, this means you can do this:
load.html:
{% load lib1 lib2 lib3 someohterlibrary %}
template.html:
{% include "load.html" %} {{ text|lib1filter }}
Adding filters and Tags
If you want create addons with filters and tags, look at Dotiac::DTL::Addon, but if you just want to add filters and Tags for one skript, this can be done easily:
You can add costum tags by create a module named Dotiac::DTL::Tag::Yourtag and simply "require-ing" it. See Dotiac::DTL::Tag for details
You can simply add filters by adding them to the Dotiac::DTL::Filter namespace.
All parameters to filters are Dotiac::DTL::Value-objects and the filter needs to return one of those as well
package Dotiac::DTL::Filter; sub myjoin { my $value=shift; my @param=shift; return Dotiac::DTL::Value->escape(join($value->repr(),map {$_->repr()} @param)); # {{ ", "|myjoin:"Foo","Bar","Baz" }} = Foo, Bar, Baz } package main; #Your script here
Tag: url
This one can't work without a complete django backend. If you have such a backend you will have to overwrite the Dotiac::DTL::Tag::url module.
However, it tries to do the right thing.
Parsing
The parser will ignore many mistakes and syntax errors since I build it for speed. It will only stop if it can't make out what to do next:
Too many end tags.
Unclosed {{ }}, {% %} or {# #}
Some tags will also die() if the syntax is wrong.
string() or print()
The normal Django templates only support a method that converts them into a long string. I added a print() method which prints directly to the current output handle. This should be easier on the memory and might even a bit faster.
More filter arguments
I thought it might be useful to allow filters to have multiple arguments, this is only useful for your own filters and some of the inofficial extension in this module. Arguments can be seperated by either a comma "," or a semicolon ";" (In some tags commas are used to split arguments, its better to always use ";")
{{ "Hello"|center:"20","-" }} {% for x in "Hello"|center:"20";"-"|make_list %}
Other changes:
There are some additional features to some tags and filters ( {% else %} in {% ifchanged %}, padding chars in |center |left and |right )
Speed
I have tried to make this as fast as I could, there are however some minor problems:
Filter arguments will be reparsed every time a {{ variable|cut:" "|escape }} is called. (cut:" " and escape will be parsed again)
The whole filter thing will be parsed every time a variable in a Tag {% regroup var|dictsort:"gender" by gender as new %} is called. (var|dictsort:"gender" will be parsed again)
These cases shouldn't happen that often.
I might add caching to prevent this.
Using {% extend "filename" %} or {% include "filename" %} is faster than using {% extend variable %} or {% include variable %} because the parsing of the included template will happen during parsing time, not evaluation time.
{% include variable %} in a for-loop will be cached if the variable doesn't change during the loop. If it changes, prepare for a extrem slowness.
See Dotiac::DTL::Compile for a solution to included templates containing perl as a variable and other speed stuff
Extension to Dotiac::DTL (own Filters, own Tags)
I don't like the way Django handles extensions to the template language, so I wrote some other way:
Filters
Just extend the Dotiac::DTL::Filter package:
require Dotiac::DTL; package Dotiac::DTL::Filter; sub times { my $value=shift; #The value on which the filter is applied return $value unless defined $value; #$value might be undef, beware. my $param1=shift; #Rest of the parameters are in @_; return $value x $param1 if Scalar::Util::looks_like_number($param1); return $value; #param1 might be string. } package main; my $text='{% filter times:"4" %} H{% endfilter %}ello, {{ myvar|times:"3" }}'; my $t=Dotiac::DTL->new(\$text); $t->print({myvar=>"World"}); #prints ' H H H Hello, WorldWorldWorld';
You will have to create a module named like your tag in the Dotiac::DTL::Tag:: namespace:
package Dotiac::DTL::Tag::mytag; sub new(CONTENT) { ... }; sub print(VARS,ESCAPE,SOMEMORE) { ... } sub string(VARS,ESCAPE,SOMEMORE) { ... } sub eval(VARS,ESCAPE,SOMEMORE) { ... } #To make the template compile you also need this: sub perl(FH,ID,DIGEST,SOMEMORE) { ... } sub perlcount(FH,ID,DIGEST,SOMEMORE) { ... } sub perlinit(FH,ID,DIGEST,SOMEMORE) { ... } sub perlstring(FH,ID,LEVEL,DIGEST,SOMEMORE) { ... } sub perlprint(FH,ID,LEVEL,DIGEST,SOMEMORE) { ... } sub perleval(FH,ID,LEVEL,DIGEST,SOMEMORE) { ... } package main; #....
See Dotiac::DTL::Tag for a tutorial and what methods must be provided.
This is a lot of work, if you just want to use some perl code in one or two places it's easier just to use your own compiled templates and include them. See Dotiac::DTL::Compiled.
REFERENCE
See Dotiac::DTL::Tag for the built-in tags (Same as Django 1.1 Tags).
See Dotiac::DTL::Filter for the built-in filters (Same as Django 1.1 Filters).
BUGS
This library is not threadsafe at all.
Please post any bugs and undokumented differences to Django you might find in the sourceforge tracker of Dotiac DTL:
I did not include "django.contrib.humanize", "django.contrib.markup" and "django.contrib.webdesign" in the Core distribution, since they require some other modules (especially markup). I will release them as Addons in CPAN.
LICENSE
This module is published under the terms of the MIT license, which basically means "Do with it whatever you want". For more information, see the LICENSE file that should be enclosed with this distributions. A copy of the license is (at the time of writing) also available at.
LEGAL
Dotiac::DTL was built according to the documentation on.
SEE ALSO
Complete Dotiac::DTL namespace. for the template language this module implements
AUTHOR
Marc-Sebastian Lucksch
[email protected] | http://web-stage.metacpan.org/pod/Dotiac::DTL | CC-MAIN-2019-51 | refinedweb | 2,532 | 55.24 |
Dear All,
I’m creating a dash bar graph from a dropdown list input. the dropdown list options are from dynamic generated/updated data source (for example a freshly updated csv file). I found that the dropdown list only display the options members (for example [‘new york’,‘nyc’, ‘shanghai’,‘sh’]). but what I need is that if the file changed with adding new option members (for example now the file added a city name to [‘new york’,‘nyc’, ‘shanghai’,‘sh’, ‘tokyo’,‘tk’]) triggered by some button clicking, the dropdown list will also dynamically changed members of options with displaying the new dropdown list with added members.
Is that possible? currently all the show cases I found only have static data source (like a static csv file.)
any reply are highly appreciated.
Tony
Dear All,
Hi @tonydeck
I did something similar but creating a live connection to a DB. I used sqlalchemy for that. But you might not need that is you plan to upload the csv document every time
Hi, Adam,
thanks for your reply. Can you help to tell the stuff with more information? In my case, I update a file based on a input parameter in a callback. another callback aligned with dropdown list will then read the updated file and generate updated dropdown list. do you think the process makes sense? do I need to refresh page first?
thanks in advance.
Tony
@tonydeck
it’s challenging to see a clear picture. Can you attach your code please. Where is your csv document located? is it in the same folder as the code?
Hi, Adam,
thanks for your reply.
Here is the code. You can see that 1.I queried data and save to a file based on the input. 2. based on the newly updated file, I need to dynamically create a dropdown list.
currently status is that I can see 1. the file can be created successfully by a call back function named ‘collected data’, 2. the data for dropdown ‘options’ feature can be created correctly based on the file 3. the problem is that the web page did not updated with the newly generated dropdown list. 4. You just ignore the module githubOps.github_saveToCsv, as it is just used for query and generated file and it works as expected.
thanks!
Tony
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output,State
import pandas as pd
import json
from pandas.io.json import json_normalize
from flask import Flask
from os import path
from githubGraphql import githubOps
#define Flask Server
SERVER = Flask(name)
#define APP configuration
download_completed_div_id = “download-complete-md”
features
features = [‘forks’, ‘openIssues.openIssues’, ‘closedIssues.closedIssues’, ‘closedPullRequests.closedPullRequests’]
#app = dash.Dash()
APP = dash.Dash(name=‘app1’, server=SERVER)
APP.layout = html.Div([
html.Div([
html.Div([
‘Please input your Organization Name and click the button’,
dcc.Input(
id=‘inputOrgName’,
type=‘text’,
placeholder=‘please input your github org name’
value=‘AET’
), html.Button(id='githubButton',n_clicks=0, children='Submit'), dcc.Loading(id= loading_div_id,children=[html.Div([html.Div(id= loading_children_div_id)])],type="circle"), dcc.Markdown(id = download_completed_div_id) ],style={'width': '100%', 'display': 'inline-block'}), html.Div([ 'Choose your project by dropdown list:', dcc.Dropdown( id='dropDownProjectName' ), dcc.Interval( id='interval-component', interval=3*1000, # in milliseconds max_intervals=10)
], className=“three rows”)
] )
])
some callbacks are going to refer to divs that have not been created yet
APP.config[‘suppress_callback_exceptions’] = True
@APP.callback(
Output(‘dropDownProjectName’, ‘options’),
[Input(‘inputOrgName’, ‘value’),
Input(‘interval-component’, ‘n_intervals’)]
)
def update_dropDownProjectName(inputorgname,n1):
#read csv file
gitDataFile=’./data/’+inputorgname+’.csv’
if path.exists(gitDataFile):
jenkins_norm = pd.read_csv(gitDataFile)
jen_projectname = jenkins_norm[‘name’].astype(‘str’).tolist()
#print(jen_projectname)
jen = [{‘label’: i, ‘value’: i} for i in jen_projectname]
print(jen)
return(jen)
else:
print(“no file found.”)
on submit-button press, collect data from the github data query by graphql and store it in an invisible div, store its data types, display loading circle and display text when finished
@APP.callback([Output(loading_children_div_id,‘children’),
Output(download_completed_div_id, ‘children’)],
[Input(‘githubButton’,‘n_clicks’),
Input(‘inputOrgName’,‘value’)])
def collect_data(n_clicks,inputOrgName):
“”“Collects data from a customer if customer_id has been provided and the button
in the div “submit-button” has been clicked.
This operation can only be done from the button.
“””
# "the callbacks are always going to fire on page load. So, you’ll just need to check if n_clicks is 0 or None in your callback" if n_clicks == 0: return None,None,None,"" orgToken = 'xxxxxxx....' githubOps.github_saveToCsv(githubOps.githubOrgJson(inputOrgName,orgToken),inputOrgName) #print(jenkins_norm) #print(jenkins_norm.to_json()) #print(jenkins_norm.dtypes.to_json()) return "","Github data loading is finished! You can now view the vizualisations of your projects."
if name == ‘main’:
APP.run_server(debug=True,host=“0.0.0.0”)
@adamschroeder
Hi, Adam,
do you think this could be realized with the scenario? I attached the code and explanation above.
thanks in advance.
Tony
Let me try this when I have access to a computer. I’ll let you know if I figure this out.
Hi, Adam,
thanks a lot. I’ve found the solution. Just put the dropdown list component under a html.Div component with defining the Div component id, i.e. the children property is used.
code is like the following.
html.Div(
id=‘dropdown-parent’,
children = [html.Div([
‘Choose your project by dropdown list:’,
dcc.Dropdown(
id=‘dropDownProjectName’
),
and in the relevant call back. define the html.Div component as the input. the code is like.
@app.callback(output=Output(‘dropDownProjectName’, ‘options’),
inputs=[Input(‘my-dropdown-parent’, ‘n_clicks’)], | https://community.plotly.com/t/dynamic-dropdown-list-display-with-input-from-dynamic-queried-data-from/35786 | CC-MAIN-2020-45 | refinedweb | 914 | 52.97 |
Problem Statement
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
Now your job is to find the total Hamming distance between all pairs of the given numbers.
Sample Test Cases.
Problem Solution.
Like if array given {1,2,3,4,5}={ 001 , 010 , 011 , 100 , 101 }
so at 0th index, number of elements having set bit at 0th index is 3
And 2 elements having unset at 0th index.
So total hamming distance for i=0 will be 3 * 2=6
Same we can go for i=1,2,3,…31 and add all the distance and return final distance.
Complexity Analysis
Time Complexity: O(N) as we have to traverse the entire array.
Space Complexity: O(1) not using any data structure to store data.
Code Implementation
#include <bits/stdc++.h> using namespace std; int totalHammingDistance(vector<int> nums) { int res=0; for(int i=0;i<32;i++) { int c=0; for(int j=0;j<nums.size();j++) { if((1<<i)&nums[j]) c++; //checking ith bit set or not } res+=(nums.size()-c)*c; } return res; } int main() { vector<int>x; x.push_back(3); x.push_back(10); x.push_back(5); x.push_back(25); x.push_back(2); x.push_back(8); cout << totalHammingDistance(x)<< endl; return 0; }
public class Hamming { public int totalHammingDistance(int[] nums) { int n = 31; int len = nums.length; int[] countOfOnes = new int[n]; for (int i = 0; i < len; i++) { for (int j = 0; j < n; j++) { countOfOnes[j] += (nums[i] >> j) & 1; } } int sum = 0; for (int count: countOfOnes) { sum += count * (len - count); } return sum; } public static void main(String[] args) { Hamming m = new Hamming(); int arr[] = new int[6]; arr[0]=3; arr[1]=10; arr[2]=5; arr[3]=25; arr[4]=2; arr[5]=8; System.out.println(m.totalHammingDistance(arr)); } }
def totalHammingDistance(nums): dist = 0 for i in range(32): one_count = 0 zero_count = 0 for num in nums: bit = (1 << i) & num if bit == 0: zero_count += 1 else: one_count += 1 dist += one_count * zero_count return dist arr = [3,10,5,25,2,8] print(totalHammingDistance(arr)) | https://prepfortech.in/interview-topics/bit-manipulation/total-hamming-distance | CC-MAIN-2021-17 | refinedweb | 356 | 51.78 |
Oh yeah.. LIMIT 30,2 would show 30 records starting with the second record. I knew I was forgetting something. Sorry for the misinformation. Trying to finish some stuff before leaving for the weekend, but wanted to at least give you a nudge before disappearing.
Good luck! -TG > -----Original Message----- > From: Norland, Martin [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 24, 2004 3:38 PM > To: [EMAIL PROTECTED] > Subject: RE: [PHP-DB] how to implement "pages" of results > > > Basic example: (handwritten in email client, syntax errors may exist) > > if (!isset($pagenum) || $pagenum < 0) { $pagenum = 0; } > $range = 30; > $start = $range*$pagenum; > $end = $start + $range; > $ > I then propagate a table with the returned data. My goal is to only > display 30 records per "page", with links on each page that take the > user to the next and previous 30 records. I have played around with > using "limit", but this seems to only get me the next 30. How to > achieve the previous 30? It would be easy if the records > returned were > sequentially numbered...but, since I'm being selective in > which records > I return (host=$somename), this is not the case. The first row may be > 1, and the second row may be 10, etc. > > Anyone have any ideas on how to solve this? > > Thanks! > > -- > PHP Database Mailing List () > To unsubscribe, visit: > > -- > PHP Database Mailing List () > To unsubscribe, visit: > > -- PHP Database Mailing List () To unsubscribe, visit: | https://www.mail-archive.com/[email protected]/msg28895.html | CC-MAIN-2018-43 | refinedweb | 234 | 72.05 |
ASP.NET Application Life Cycle Overview for IIS 7.0
This topic describes the application life cycle for ASP.NET applications that are running in IIS 7.0 in Integrated mode and with the .NET Framework 3.0 or later. IIS 7.0 also supports Classic mode, which behaves like ASP.NET running in IIS 6.0. For more information, see ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0.
The IIS 7.0 integrated pipeline is a unified request processing pipeline that supports both native-code and managed-code modules. Managed-code modules that implement the IHttpModule interface have access to all events in the request pipeline. For example, a managed-code module can be used for ASP.NET forms authentication for both ASP.NET Web pages (.aspx files) and HTML pages (.htm or .html files). This is true even though HTML pages are treated as static resources by IIS and ASP.NET. For more information about IIS 7.0 Integrated mode, see ASP.NET Integration with IIS7.
This topic contains the following sections:
A request in IIS 7.0 Integrated mode passes through stages that are like the stages of requests for ASP.NET resources in IIS 6.0. However, in IIS 7.0, these stages include several additional application events, such as the MapRequestHandler, LogRequest, and PostLogRequest events.. For ASP.NET developers, the benefits of the integrated pipeline are as follows:
The integrated pipeline raises all the events that are exposed by the HttpApplication object, which enables existing ASP.NET HTTP modules to work in IIS 7.0 Integrated mode.
Both native-code and managed-code modules can be configured at the Web server, Web site, or Web application level. This includes the built-in ASP.NET managed-code modules for session state, forms authentication, profiles, and role management. Furthermore, managed-code modules can be enabled or disabled for all requests, regardless of whether the request is for an ASP.NET resource like an .aspx file.
Managed-code modules can be invoked at any stage in the pipeline. This includes before any server processing occurs for the request, after all server processing has occurred, or anywhere in between.
You can register and enable or disable modules through an application’s Web.config file.
The following illustration shows the configuration of an application's request pipeline. The example includes the following:
The Anonymous native-code module and the Forms managed-code module (which corresponds to FormsAuthenticationModule). These modules are configured, and they are invoked during the Authentication stage of the request.
The Basic native-code module and the Windows managed-code module (which corresponds to WindowsAuthenticationModule). They are shown, but they are not configured for the application.
The Execute handler stage, where the handler (a module scoped to a URL) is invoked to construct the response. For .aspx files, the PageHandlerFactory handler is used to respond to the request. For static files, the native-code StaticFileModule module responds to the request.
The Trace native-code module. This is shown, but it is not configured for the application.
The Custom module managed-code class. It is invoked during the Log request stage.
For information about known compatibility issues with ASP.NET applications that are being migrated from earlier versions of IIS to IIS 7.0, see the "Known Differences Between Integrated Mode and Classic Mode" section of Upgrading ASP.NET Applications to IIS 7.0: Differences between IIS 7.0 Integrated Mode and Classic mode.
The Global.asax file is used in Integrated mode in IIS 7.0 much as it is used in ASP.NET in IIS 6.0. For more information, see the "Life Cycle Events and Global.asax File" section in ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0.
One difference is that you can add handlers for the MapRequestHandler, LogRequest, and PostLogRequest events. These events are supported for applications that run in Integrated mode in IIS 7.0 and with the .NET Framework 3.0 or later.
You can provide application event handlers in the Global.asax file to add code that executes for all requests that are handled by ASP.NET, such as requests for .aspx and .axd pages. However, handler code in the Global.asax file is not called for requests for non-ASP.NET resources, such as static files. To run managed code that runs for all resources, create a custom module that implements the IHttpModule interface. The custom module will run for all requests to resources in the application, even if the resource handler is not an ASP.NET handler.
The ASP.NET managed-code modules that can be configured and loaded in IIS 7.0 include the following:
To configure IIS 7.0 managed-code modules you can use one of the following methods:
Use IIS Manager. For more information, see How to: Open IIS Manager.
Use the IIS 7.0 command-line tool (Appcmd.exe). For more information, see IIS 7.0 Command-Line Tool.
Edit the IIS 7.0 XML-based configuration store. For more information, see IIS 7.0: IIS 7.0 Configuration Store.
When an ASP.NET managed-code module such as the FormsAuthenticationModule module is configured to load in IIS 7.0, it has access to all events in the request pipeline. This means that all requests pass through the managed-code module. For the FormsAuthenticationModule class, it means that static content can be protected by using forms authentication, even though the content is not handled by an ASP.NET handler.
Developing Custom Managed-code Modules
The ASP.NET application life cycle can be extended with modules that implement the IHttpModule interface. Modules that implement the IHttpModule interface are managed-code modules. The integrated pipeline of ASP.NET and IIS 7.0 is also extensible through native-code modules, which are not discussed in this topic. For more information about native-code modules and about how to configure modules generally, see IIS Module Overview.
You can define a managed-code module as a class file in the application's App_Code folder. You can also create the module as a class library project, compile it, and add it to application's Bin folder. After you have created the custom module, you must register it with IIS 7.0. You can use one of the methods described for managing IIS 7.0 managed-code modules. For example, you can edit an application's Web.config file to register the managed-code module for just that application. For an example of registering a module, see Walkthrough: Creating and Registering a Custom HTTP Module.
If a module is defined an application's App_Code or Bin folder and it is registered in the application's Web.config file, the module is invoked only for that application. To register the module in the application’s Web.config file, you work with the modules element in the system.webServer section. For more information, see How to: Configure the <system.webServer> Section for IIS 7.0. Changes made by using IIS Manager or the Appcmd.exe tool will make changes to the application's Web.config file.
Managed-code modules can also be registered in the modules element of the IIS 7.0 configuration store (the ApplicationHost.config file). Modules registered in the ApplicationHost.config file have global scope because they are registered for all Web applications hosted by IIS 7.0. Similarly, native-code modules that are defined in the globalModules element of the ApplicationHost.config file have global scope. If a global module is not needed for a Web application, you can disable it.
Example
The following example shows a custom module that handles the LogRequest and PostLogRequest events. Event handlers are registered in the Init method of the module.
using System; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; // Module that demonstrates one event handler for several events. namespace Samples { public class ModuleExample : IHttpModule { public ModuleExample() { // Constructor } public void Init(HttpApplication app) { app.LogRequest += new EventHandler(App_Handler); app.PostLogRequest += new EventHandler(App_Handler); } public void Dispose() { } // One handler for both the LogRequest and the PostLogRequest events. public void App_Handler(object source, EventArgs e) { HttpApplication app = (HttpApplication)source; HttpContext context = app.Context; if (context.CurrentNotification == RequestNotification.LogRequest) { if (!context.IsPostNotification) { // Put code here that is invoked when the LogRequest event is raised. } else { // PostLogRequest // Put code here that runs after the LogRequest event completes. } } } } }
The following example shows how to register the module in the application’s Web.config file. Add the system.webServer configuration section inside the configuration section.
For an additional example that shows how to create and register a custom module, see Walkthrough: Creating and Registering a Custom HTTP Module. | http://msdn.microsoft.com/en-us/library/bb470252.aspx | CC-MAIN-2014-52 | refinedweb | 1,456 | 53.58 |
REMAINDER(3) BSD Programmer's Manual REMAINDER(3)
remainder, remainderf, remquo, remquof - remainder functions
libm
#include <math.h> double remainder(double x, double y); float remainderf(float x, float y); double remquo(double x, double y, int *quo); float remquof(float x, float y, int *quo);
Provided that y != 0 , the remainder() and remainderf() functions calcu- late representa- tion of the quotient may not be meaningful when x is large in magnitude compared to y.
The functions return the remainder independent of the rounding mode. If y is zero , NaN is returned and a domain error occurs. A domain error oc- curs and a NaN is returned also when x is infinite but y is not a NaN. If either x or y is NaN, a NaN is always returned.
div(3), fast_remainder32(3), fmod. | http://mirbsd.mirsolutions.de/htman/sparc/man3/remainderf.htm | crawl-003 | refinedweb | 135 | 55.64 |
Below are the rules associated with declaring classes, import statements, and package statements in a java source file.
- There can be one and only one public class per source code file and can have more than one nonpublic class.
- If there is a public class in a file, the name of the file must match the name of the public class. For example, a class declared as public class HelloWorld { } must be in a source code file named HelloWorld.java. Files with no public classes can have a name that does not match any of the classes in the file.
-.
- Comments can appear at the beginning or end of any line in the source code file, they are independent of any of the rules discussed above. | https://www.javaxp.com/2013/01/java-source-file-declaration-rules.html | CC-MAIN-2019-30 | refinedweb | 126 | 75.74 |
iReport
files. iReport is a powerful Java rich-client application, and
can also easily..., and
developers
Usable in Eclipse or as a stand-alone Java (Swing... iReport
Other
the Eclipse binaries with a broad range of Eclipse plugins for Java, Java Enterprise... source released Eclipse-plugins and tools for the Eclipse IDE we believe might...-in for Eclipse
With the iReport Plug-in for Eclipse, Eclipse users can
jasper with ireport - JSP-Servlet
jasper with ireport how to send pdf into mail
pls send me the answer
using iReport Plugings
how to run applet in
Eclipse 3.0. An applet is a little Java program that runs...
applications. There are many plugins available for eclipse IDE, which
can...;
Java Eclipse Shortcuts
In this section, I have presented you
Eclipse Spy
Eclipse Spy
When you are developing Eclipse Plugins sometimes you
need to "spy" other plugins to learn "how they do it that amazing
thing"
Apache Maven plugins
directory is
removed. Here, we are
providing a list of core and other plugins below... Apache Maven plugins
Plugins are used to interact with a host application to provide
use of plugins - Swing AWT
use of plugins hi dear
i m making a project on java swing .i needed a plugins for search buttons........
Thanks
Axis2 Eclipse plugin Tutorial
plugins tutorial we will see how to install the
plugin in the Eclipse IDE...;
In this section we will learn about Axis2 Eclipse plugins. There
are plugins available for the Eclipse IDE to make the development
easy. The Axis2 Eclipse plugins
languages flavors, therefore a lot of users use Eclipse as a Java IDE... by including Plug-in Development Environment (PDE). Since Eclipse is
written in java, it doesn't mean that it is limited to the java language.
Eclipse supports the plug
Download Eclipse with Maven Plugin support
can use the same power
of Maven in your Eclipse IDE, using the latest release...
have explained how to create and run the web application through Eclipse... Lunar IDE for Java EE developers comes with many plugins:
Data Tools
FITpro for Eclipse
Tests (Fit) for
Java within the Eclipse IDE.
FITpro requires Eclipse 3.2... plugins directory (at <eclipse
dir>/plugins). If this does not work... information on how to use the
FITpro features.
3. You can checkout
Eclipse Goodies
Eclipse Goodies
Eclipse Goodies is a set of open source released
Eclipse-plugins and tools for the Eclipse RCP and other Eclipse projects like
BIRT or GEF we
TOM Eclipse Plugin
into Eclipse
The plugin offers automatic compilation
Tom and Java errors... directory in ECLIPSE_HOME/plugins and ECLIPSE_HOME/features.
Open Eclipse...
Let Eclipse restart to take into account
modifications
All other
Eclipse Plunging/Tool
are developing Eclipse Plugins
sometimes you need to "spy" other... functionality for Eclipse plugins &
features and other bundled packages... is a product that assists developers, who use Eclipse-based
IDEs, in delivering
Maven 2 Eclipse Plug-in
the following
Now the Eclipse-Maven plugin is ready for use...
Maven 2 Eclipse Plug-in
Plugins are great in simplifying the life of programmers
Tikal Eclipse
Tikal Eclipse
Tikal Eclipse is an open source Eclipse-based distro
which combines the Eclipse binaries with a broad range of Eclipse plugins for
Java, Java
Installing axis2 eclipse plugin
Environment(IDE). Software needed are:
a) Eclipse IDE 3.5.1
b) Eclipse Axis2 Plugins... and Axis2_Service_Archiver_1.3.0
in Eclipse plugins directory.
Eclipse plugins... Axis2 Wizards (Axis2 plugin for Eclipse).
In the next section we will learn how In starting Glassfish in Eclipse.
in eclipse when i use Glassfish as server.I have installed Glassfish in C:\Glassfish..." (in directory "C:\Documents and Settings\Yogesh\Desktop\eclipse jee Indigo\plugins...Error In starting Glassfish in Eclipse. Sir,I am new
Save Any Eclipse Editor as HTML
the java into a
webpage).
So I figured, Eclipse has the style information needed... in Eclipse, but it needs to know how to get a hold of the StyledText widget... Save Any Eclipse Editor as HTML
jQuery with other libraries
with other Libraries:
Let's see how we can use jQuery with other libraries...;
</html>
In this we have studied how to use jQuery with other... the function of
variable name. In this example you will see how to use $ to access
Eclipse - Java Beginners
Eclipse hi, can someone help me do an array/using other easier function to do something like this and if I enter a seat value, the seat... are already taken. So how do I modify the code such that some of the seats are already
Entertainment
plugins for Eclipse IDE including minesweeper, snake and
sokoban.
... and an easy to use Eclipse plugin.
CodeRally
CodeRally is a Java-based, real-time programming game based o�n the Eclipse
Tomcat Configuration For Eclipse Server
Tomcat Configuration For Eclipse Server How to configure Eclipse... button.
8)After above step, you have configured tomcat with Eclipse and can use... on eclipse
1)First download the tomcat and install it on your hard drive.
2
Debug in Eclipse
Debug in Eclipse How to debug a java application in Eclipse Helio version
Eclipse
Eclipse how to compile using eclipse
eclipse
eclipse Hi
how to debug in eclipse ide and how to find bug in eclipse ?
Thanks
kalins naik
Eclipse Plunging/Testing
on programs written with
Java and Swing. To use GUIdancer, no programming... is an easy-to-use, fully-featured set of tools that provides a
new approach to java...
Java Code Coverage
EclEmma is a free Java code coverage tool for Eclipse
Tomcat For Eclipse
of your
eclipse installation
How To Use... Tomcat For Eclipse
How To Install
Eclipse Plugin-Rich Client Applications
. It is available as an Eclipse plugin and makes use of the JFace/SWT APIs... written in Java. It is built using the Eclipse RCP and can be extended using plug... Eclipse Plugin-Rich Client Applications
eclipse
eclipse how to add tomcat server first time in eclipse
Maven Eclipse Integration - IDE Questions
Maven Eclipse Integration How to integrate Maven with eclipse? Hi, If you are using maven to build, test and deploy your java... steps: 1: Create... in eclipse.Now everything is setup and you can use the project in your eclipse IDE.Thanks
Eclipse Plunging/Web
;
Java2Script
Pacemaker
Java2Script (J2S) Pacemaker provides an Eclipse Java... of Eclipse Standard
Widget Toolkit (SWT) with other common utilities... information to Eclipse
IDE, local or remote server and other destinations
Eclipse
Eclipse How to develope web application servlets or jsp using eclipse id
CFEclipse
the CFEclipse plugin is one of the top rated Eclipse plugins and is in
use... developers to take advantage of the wealth of other Eclipse plugins,
CFEclipse...;
The CFEclipse project is to create a plugin for the
Eclipse
TUM
, which wraps Eclipse and Callisto-format update sites, adding
intuitive discover/install/update/remove functionality for Eclipse plugins &
features and other... Callisto
categorization capabilities to reveal sets of plugins and prepackaged
Hibernate Example Step by Step in Eclipse
works well with the Hibernate framework. If you have other
database you just... if you don't know how to install MySQL
databse.
After installing MySQL.... Use the following
query to create database:
create database hibernate4
How to add JDK 8 support in Eclipse?
Learn how to update Eclipse and add the JDK 8 support?
This tutorial... of JDK 8.
Since Eclipse is one of the most used IDE for developing the Java program, so
probably you would like to use Eclipse for learning the new features
Crystal Reports for Eclipse
of Crystal Reports for Eclipse mark the first time that a Java version of the world's... of charge. That's right, Crystal Reports for Eclipse, will provide Java Developers... you have the latest version or not.
Use the existing Eclipse Update Manager
Lambda Expressions example in Eclipse
Lambda Expression example in Java 8 using Eclipse IDE
Learn how to download the JDK 8 RC build and configure it with Eclipse IDE.
You will also learn how... will show you how you can set-up the development environment
using Java 8 RC
Eclipse Plunging-Build and Deploy
source plugins tested and packaged with an easy to use installer for MacOS... to export Java runtime targets of eclipse projects to shell scripts in various languages...
Eclipse Plunging-Build and Deploy
how to execute jsp and servlets with eclipse
to create a java project in Eclipse and how can you add additional capabilities...how to execute jsp and servlets with eclipse hi
kindly tell me how to execute jsp or servlets with the help of eclipse with some small program
Struts with Eclipse - IDE Questions
Struts with Eclipse How to develope struts application in Websphere Rational Application Developer 7.0? AT First Check Your Eclipse contain Plugins for Websphere 7.0 or not?
ifcontain go preference/eclipse
Java with OOP assignment (Eclipse)
Java with OOP assignment (Eclipse) How do i control the length of characters in an input?
E.g.:
Enter your name > Hi
* Name too short
Struts2 Application in Eclipse: Running the application in Eclipse IDE
Struts2 Application in Eclipse: Learn how to run the Struts2 application in Eclipse IDE
In this tutorial we will run the Struts2 application from Eclipse IDE... 2 for
configuring Eclipse IDE to use Tomcat 7 for deploying the Struts 2
Eclipse Plugin- Editor
Crystal Reports for Eclipse is a set of free plugins provided by the makers.... Eclipse 3.2 or later and a Java 5 runtime.
There are few feature... workspace and plugins
* Link to Java source code in the current project
Java with OOP assignment (Eclipse) - Java Beginners
Java with OOP assignment (Eclipse) "THREE Ts GAME"
*Description... is made of 3 X 3 grids. The two players, one being assigned with 'O' and the other..." games using Java. When your game application started, the players will be able
Eclipse plugin-Network
to use localhost as http proxy. with this setup all plugins wether... Eclipse plugin-Network
RMI Plugin for Eclipse
Genady's RMI Plug
Eclipse Connectivity - JDBC
Eclipse Connectivity Hello Friends..
I want to do connectivity with eclipse 3.4 Genemade with mysql Database.
can u please help me to how to do connectivity..and which plugins are required for it.
i have try to do
Web services using eclipse helios and apache tomcat-7
want to learn how I can use web service for in my project and what are the other...Web services using eclipse helios and apache tomcat-7 My name is sahas shah studying in mca.
I want to use web service in project which is on tours
Afae - An All-purpose Editor for Eclipse
All-purpose Editor. It is a group of plugins for Eclipse that do the following... Afae - An All-purpose Editor for Eclipse
... this is the only development environment / editor I use.
For more
Eclipse Plunging/UI
. Jigloo parses java class files to construct
the form that you use when... to Eclipse's SWT. It is a
GUI date picker for Java using SWT as the GUI toolkit... Eclipse Plunging/UI
Eclipse update proxy settings
have to update the eclipse proxy setting to use proxy server to
download the required plugins.
Configuring Eclipse to use proxy
Configuring eclipse to use... to for developing small and big applications.
There are many plugins available for eclipse IDE
DWR eclipse Plugin - Framework
DWR eclipse Plugin Hi,
I am new to DWR, can u please guide me how to use DWR with eclipse3.1
Eclipse Plunging- Application Management
for Unicode-enabled servers.
You can use above plugins to manage your... Eclipse Plunging- Application Management
...
Cape Clear Orchestrator is an intuitive Eclipse-based editor intended to simplify
Struts2 Tiles Example
. Then write the header.jsp, footer.jsp, menu.jsp, body.jsp and other JSP file specific
Selection based on other selection in jsp
Selection based on other selection in jsp I am trying to create... category there are products which are taken from a ms access table using a java... based on the category would come in the product drop-down list. How can I do
Eclipse Plunging/Team Development
for the Eclipse platform to use Mercurial
version system. From Mercurial homepage... Eclipse Plunging/Team Development
MKS
SCM for Eclipse
MKS has
Eclipse Wiki Editor Plugin
* Embed other wiki documents, eclipse resources and Java code in Wiki documents... Eclipse resources. (Java source is converted to HTML using the excellent Java2Html... Eclipse Wiki Editor Plugin
SWT in Eclipse - Java Beginners
SWT in Eclipse hi..
how to call a function in SWT when the shell is about to close... ??
thanks in advance
Downloading, Installing and Initializing Eclipse
Downloading, Installing and Initializing Eclipse
To use Eclipse in your system...? file in the eclipse
folder.
2. Now it will ask to specify a workspace to use
Applet in Eclipse - Running Applet In Eclipse
and run Applet in
Eclipse IDE. In this section, you will learn how to run applet in
Eclipse 3.0. An applet is a little Java program that runs inside a Web... Applet in Eclipse - Running Applet In Eclipse
Eclipse Plugin-Language
bytecodes. CAL can use any Java class, method, field or constructor.
....
TOM
Eclipse Plugin
The way to use Pattern... the Eclipse framework. ProvideX is an easy to learn, easy to use programming
JNI using eclipse
JNI using eclipse Hi how to call a c function in java using JNI which we must me able to do entirely in eclipse.as i am a newbie to java,i dont know how to implement JNI using eclipse
thread inside other thread - Java Beginners
thread inside other thread Hello, can you help me please:
I want to connect client and server that the client send three times msg1 and when he send msg2 he will connect with another server by create new thread that use
Struts-It
;
Struts-It is a set of Eclipse plugins for developing
Struts-based web applicatons. SIt is based on Eclipse 3.1 and well integreted
with WTP 0.7.... Forward
DataSourc
MessageResources
Plugins
Form class
how to color the Eclipse editor background programmatically?
how to color the Eclipse editor background programmatically? I have to color specific portion(background) of the of the Eclipse editor by running the java programm and provided that do the coloring from a given line number
how to use setAttribute
how to use setAttribute how to get following codes using setAttributes in java???
Employee xlink:type="extended" xlink:show="new" xlink:actuate="onRequest
How to Use Collections
How to Use Collections how to use ArrayList and HashMaps in case of user defined class Hi Friend,
Please visit the following links.../index.shtml
EasyEclipse Expert Java
Java(tm) runtime, packaged
for Eclipse use. (Windows only)
Java...;
EasyEclipse Expert Java
Bare-bones Eclipse distro for experienced Java
developers who are new to Eclipse.
EasyEclipse Expert Edition
Subtraction of a date from Sql and other from java.
Subtraction of a date from Sql and other from java. I want... retrieve from java. I want the difference between the two date in the integer form. how do i do it ? Please help me. Thank you !
import java.sql.*;
import
How to use charAt() method in Java?
How to use charAt() method in Java? Hi,
what is the correct way of using chatAt() method in Java?
Thanks
The charAt() method in Java... at charAt() Method In Java.
Thanks
Eclipse Plunging-Database
is a powerful and easy-to-use Java based object relational mapping tool...
Eclipse Plunging-Database
...
This plug-in has many innovative features that allow Java professionals to easily
How to use Apache POI?
How to use Apache POI? Can anyone tell me how to use Apache POI??I... how to implement.Please help me out.
Download zip file from...-scratchpad-3.2-FINAL-20081019.jar files into the following path:
\Java\jdk1.7.0\lib
\Java
How to use this keyword in java
How to use "this" keyword in java
... use this keyword. Here, this section provides you an example
with the complete code of the program for the illustration of how to what is this
keyword and how
javaproject in eclipse - IDE Questions
javaproject in eclipse upto now we are creating only dynamic web project in eclipse,now i created java project how to add server to this project... in eclipse
Click ok and click redeploy
if not configure server
goto
How to use Java Beans in JSP?
How to use Java Beans in JSP? Hi,
I have developed a employee bean in Java:
public class Employee{
private String name;
private String code;
.....
}
Please tell me how I can use Employee Java bean in JSP page?
Thanks
JPA Examples In Eclipse
.
JPA setFirstResult
In this section, you will learn how to use... setMaxResults
In this section, you will learn how to use the setMaxResults...;
JPA getResultList
In this section, you will see how to use
ProvideX Plugin for Eclipse
ProvideX Plugin for Eclipse
About the ProvideX Plug-in for Eclipse:
This plug-in is designed for the development of
ProvideX applications within the Eclipse framework
Easy Eclipse Plugin
servers.
Note that some of those plugins have dependencies on other plugins, so it
may easier to install the Server
Java distribution.
Eclipse
J2EE tools...
Easy Eclipse Plugin
how to use foreign key in java
how to use foreign key in java I have two tables in my MySQL database, which were created like this:
CREATE TABLE table1 (
id int auto_increment... entries to both of the tables within one transaction
how it is passible please
How to use Java?
, protecting users
and programmers from crashes and viruses.
Here is how Java..., and other JSP examples.
Java Applets
Java Applets are used within a web page...Java, an Object Oriented Programming language was developed by Sun
Java For Firefox
;
Thorough this tutorial we are trying to explain how to install Java
plugins... with the java
or not USE flag enabled:
# eix -e mozilla-firefox...#Possibility_Nr._2:_EiX
If you don't have then add the corresponding java USE | http://www.roseindia.net/tutorialhelp/comment/80894 | CC-MAIN-2014-52 | refinedweb | 2,993 | 64.91 |
- NAME
- VERSION
- GENERAL
- SYNTAX
- General
- How to state in as well as !in in the same clause set?
- Hash
- AUTHOR
NAME
Sah::FAQ - Frequently asked questions
VERSION
version 0.9.10
GENERAL
Why use a schema (a.k.a "Turing tarpit")? Why not use pure Perl?
Schema language is a specialized language (DSL) that should be more concise to write than equivalent Perl code for common validation tasks. Its goal is never to be as powerful as Perl.
90% of the time, my schemas are some variations of the simple cases like:
"str*" ["str": {"len_between": [1, 10], "match": "some regex"}] ["str": {"in": ["a", "b", "c", ...]}] ["array": {"of": "some_other_type"}] ["hash": {"keys": {"key1": "some schema", ...}, "req_keys": [...], ...}]
and writing schemas is faster and less tedious/error-prone than writing equivalent Perl code, plus Data::Sah can generate JavaScript code and human description text for me. For more complex validation I stay with Sah until it starts to get unwieldy. It usually can go pretty far since I can add functions and custom clauses to its types; it's for the very complex and dynamic validation needs that I go pure Perl. Your mileage may vary.
What does "Sah" mean?
Sah is an Indonesian word, meaning "valid" or "legal". It's picked because it's short.
The previous incarnation of this module uses the namespace Data::Schema, started in 2009 and deprecated in 2011 in favor of "Sah".
Comparison to other schema languages and type systems
Comparison to JSON schema?
JSON schema limits its type system to that supported by JSON/JavaScript.
JSON schema's syntax is simpler.
It's metaschema (schema for the schema) is only about 130 lines. There are no shortcut forms.
JSON schema's features are more limited.
No expression, no function.
Comparison to Data::Rx?
TBD
Comparison to Data::FormValidator (DFV)?
TBD
Comparison to Moose types?
TBD
SYNTAX
General
Why is
req not enabled the default?
I am following SQL's behavior. A type declaration like:
INT
in SQL means
NULL is allowed, while:
INT NOT NULL
means
NULL is not allowed. The above is equivalent to specifying this in Sah:
int*
One could argue that setting
req to 1 by default is safer/more convenient to her/whatever, and
int should mean
["int", "req", 1] while something like perhaps
int? means
["int", "req", 0]. But this is simply a design choice and each has its pros/cons. Nullable by default can also be convenient in some cases, like when specifying program options where most of the options are optional.
How about adding a
default_req configuration in
Data::Sah then?
In general I am against compiler configuration which changes language behavior. In this case, it makes a simple schema like
int to have ambiguous meaning (is undefined value allowed? Ir not allowed? It depends on compiler configuration).
How to express "not-something"? Why isn't there a
not or
not_in clause?
There are generally no
not_CLAUSE clauses. Instead, a generic
!CLAUSE syntax is provided. Examples:
// an integer that is not 0 ["int", {"!is": 0}] // a username that is not one of the forbidden/reserved ones ["str", {"!in": ["root", "admin", "superuser"]}]
How to state
in as well as
!in in the same clause set?
You can't do this since it will cause a conflict:
["str ", {"in": ["a","b","c"], "!in": ["x","y","z"]}]
However, you can do this:
["str ", {"cset&": [{"in": ["a","b","c"]}, {"!in": ["x","y","z"]}]}]
How to express mutual failure ("if A fails, B must also fails")?
You can use
if clause and negate the clauses. For example:
"if": [{"!div_by": 2}, {"!div_by": 5}]
General advice when writing schemas?
Avoid
anyor
allif you know that data is of a certain type
For performance and ease of reflection, it is better to create a custom clause than using the
anytype, especially with long list of alternatives. An example:
// dns_record is either a_record, mx_record, ns_record, cname_record, ... ["any", "of", [ "a_record", "mx_record", "ns_record", "cname_record", ... ] ] // base_record ["hash", "keys", { "owner": "str*", "ttl": "int", }] // a_record ["base_record", "merge.normal.keys", { "type": ["str*", "is", "A"], "address": "str*" }] // mx_record ["base_record", "merge.normal.keys", { "type": ["str*", "is", "MX"], "host": "str*", "prio": "int" }] ...
If you see the declaration above, every record is a hash. So it is better to declare
dns_recordas a
hashinstead of an
any. But we need to select a different schema based on the
typekey. We can develop a custom clause like this:
["hash", "select_schema_on_key", ["type", { "A": "a_record", "MX": "mx_record", "NS": "ns_record", "CNAME": "cname_record", ... }]]
This will be faster.
Hash
How does Sah check allowed/unallowed keys?
If
keys clause is specified, then by default only keys defined in
keys clause is allowed, unless the
.restrict attribute is set to false, in which case no restriction to allowed keys is done by the clause. The same case for
re_keys.
If
allowed_keys and/or
allowed_keys_re clause is specified, then only keys matching those clauses are allowed. This is in addition to restriction placed by other clauses, of course.
How do I specify schemas for some keys, but still allow some other keys?
Set the
.restrict attribute for
keys or
re_keys to false. Example:
["hash", { "keys": {"a": "int", "b": "int"}, "keys.restrict": 0, "allowed_keys": ["a", "b", "c", "d", "e"] ]
The above schema allows keys
a, b, c, d, e and specifies values for
a, b. Another example:
["hash", { "keys": {"a": "int", "b": "int"}, "keys.restrict": 0, "allowed_keys_re": "^[ab_]", ]
The above schema specifies values for
a, b but still allows other keys beginning with an underscore.
What is the difference between the
keys and
req_keys clauses?
req_keys require keys to exist, but their values are governed by the schemas in
keys or
keys_re. Here are four combination possibilities, each with the schema:
To require a hash key to exist, but its value can be undef:
["hash", "keys", {"a": "int"}, "req_keys": ["a"]]
To allow a hash key to not exist, but when it exists it must not be undef:
["hash", "keys", {"a": "int*"}]
To allow a hash key to not exist, or its value to be undef when exists:
["hash", "keys", {"a": "int"}]
To require hash key exist and its value must not be undef:
["hash", "keys", {"a": "int*"}, "req_keys": ["a"]]
Merging and hash keys?
XXX (Turn off hash merging using the
'' Data::ModeMerge options key..
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 68:
You forgot a '=back' before '=head3' | https://metacpan.org/pod/release/SHARYANTO/Sah-0.9.10/lib/Sah/FAQ.pod | CC-MAIN-2016-50 | refinedweb | 1,056 | 76.01 |
This weakref module. Signals may also have arguments as long as all connected functions are callable with the same arguments.
Discussion
I really liked the C++ implementation of the Signal/Slot pattern by Sarah Thompson that can be found at. My goal here was to create a similar implementation in python.
Utilizing this implementation, you need only create an instance of Signal. The instance could be a member of a class, a global, or a local variable. It doesn't matter. There is no explicit slot implementation, as a Signal accepts any function or instance method.
Signal.connect(func) or Signal.connect(object.method)
Weakrefs are used, thus the Signal itself will never keep a connected object alive. When connected objects are deleted for any reason the Signal will remove that object's connections automatically.
Signals implement the __call__ method. In order to fire a signal to all connected functions, simply invoke the signal:
sig = Signal() sig.connect(function) sig()
It is also possible to call signals with arguments, as long as all the connected functions are callable with those same arguments:
def function(a, b): print a, b
sig = Signal() sig.connect(function) sig("hello, ", "world!")
Advantages...? What's the advantage of this over PyDispatcher?
Signal and Borg. Connecting a Borg method to a Signal does not work if no Borg instance is kept (which is the aim of the Borg).
The solution is to use a 'staticmethod'. No Borg instance will be given to the method, but as it is a Borg, it's not a problem.
Here is an example:
Result:
onClick: val = 2
What's a borg method?
Borg method. See this recipe about Borg/Singleton: | http://code.activestate.com/recipes/439356/ | crawl-002 | refinedweb | 280 | 59.4 |
#include "inline_rewrite_context.h"
Class that unifies tasks common to building rewriters for filters that inline resources.
Subclasses of InlineRewriteContext may override this to customize resource creation. Default version just uses CommonFilter::CreateInputResource(). url is permitted to be NULL. is_authorized is not.
Rewrites come in three flavors, as described in output_resource_kind.h, so this method must be defined by subclasses to indicate which it is.
For example, we will avoid caching output_resource content in the HTTP cache for rewrites that are so quick to complete that it's fine to do the rewrite on every request. extend_cache is obviously in this category, and it's arguable we could treat js minification that way too (though we don't at the moment).
Implements net_instaweb::RewriteContext.
Performs rendering activities that span multiple HTML slots. For example, in a filter that combines N slots to 1, N-1 of the HTML elements might need to be removed. That can be performed in Render(). This method is optional; the base-class implementation is empty.
Note that unlike Harvest(), this method runs in the HTML thread (for top-level rewrites), and only runs if the rewrite completes prior to the rewrite-deadline. If the rewrite does make it by the deadline, RewriteContext::Render() will be invoked regardless of whether any slots were actually optimized successfully.
Reimplemented from net_instaweb::RewriteContext.
Takes a completed rewrite partition and rewrites it. When complete, implementations should call RewriteDone(kRewriteOk) if they successfully created an output resource using RewriteDriver::Write, and RewriteDone(kRewriteFailed) if they didn't. They may also call RewriteDone(kTooBusy) in case system load/resource usage makes it dangerous for the filter to do optimization at this time.
Any information about the inputs or output that may be needed to update the containing document should be stored inside the CachedResult.
If implementors wish to rewrite resources referred to from within the inputs (e.g. images in CSS), they may create nested rewrite contexts and call AddNestedContext() on each, and then StartNestedTasks() when all have been added.
Implements net_instaweb::RewriteContext.
Subclasses of InlineRewriteContext must override these:
Return whether the resource should be inlined. If false is returned, this should set *explanation to the reason for the failure. explanation is guaranteed to be non-NULL.
Starts the actual inlining process, and takes over memory management of this object. Returns true if the process is started, false if it cannot be started because the input resource cannot be created, in which case 'this' is deleted and accordingly no rewriting callbacks are invoked. | http://modpagespeed.com/psol/classnet__instaweb_1_1InlineRewriteContext.html | CC-MAIN-2017-30 | refinedweb | 420 | 56.55 |
Conflict error updating records
Bug Description
Hello,
The following code will raise a Conflict exception when executed when there is no reason for it to occur:
from desktopcouch.
from desktopcouch.
test_data = {
'_id': '6b8189fd34e844
'name' : 'Manuel',
'surname': ' de la Pena',
'record_type':'http://
}
record = Record(test_data)
db = CouchDatabase(
db.put_
db.delete_
db.put_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
self.
File "/usr/lib/
resp, data = self.resource.
File "/usr/lib/
**params)
File "/usr/lib/
raise ResourceConflic
couchdb.
I believe the problem is related with the couchdb library when trying to update a new document in the database. The current version in my system is 0.6. I have attached a patch that solves the problem although I would no recommend to use it since it adds an extra web request to delete the current doc in the database. I have contacted the couchdb guys regarding the problem. The related bug report can be found here: http://
Although the owner of the bug is not desktopcouch perse, it will be nice to provide a temp solution or at least let developers know.
I have changes the issue name to a more descriptive one, this will happen with any update!!!
The problem is that we access and update the same document that you want to write.
put_record(r) # mutates r, sets _rev
delete_record(id) # downloads record with that id, updates and sets _rev to new value in DB.
put_record(r) # tries to push with a record revision that is out of date.
To say it another way, the act of marking as deleted will make a new revision. You can not put a record again without getting the new revision id from the database.
Indeed, but I was expecting the behavior of the delete to be the same as the one found in couchdb-python. That is, because you are putting a new version of the document (with the deleted flag) I was expecting the same behavior of the __setitem__ of couchdb-python where the new revision of the document is added, which would allow to perform the mentioned operations.
gwibber is also infected by this bug. so is it something the app should deal with or it can be fixed in desktopcouch?
Hello,
The reason for this bug to occur is actually quite simple and I believe
is Desktopcouch fault and has no relation what so ever with CouchDb. Let
me explain my statement:
The delete method in the Desktopcouch library is the following:
def delete_record(self, record_id):
"""Delete record with given id"""
record = self.with_
'Ubuntu One',
{}).setdefault(
as you can see in the method the document is actually not deleted from
the database but marked as deleted instead. When you executed the given
test code you are trying to update your document with the same id and an
old rev. This is actually a feature used in the server side. I believe
this behavior is easy to solve in two different ways:
1. Ensure that you do not reuse your ids.
2. Add extra logic to the desktopcouch lib to solve the issue.
The bug has been triaged, but if it gets reopened I'm more than happy to
become the owner and provide a solution :D
Kr,
Manuel
"""Delete record with given id"""
357
153.1.1
record = self.with_
358
2
record.
359
'Ubuntu One', {}).setdefault(
360
'deleted'] = True
361
153.1.1
self.with_
On Wed, 2010-06-30 at 19:05 +0000, Omer Akram wrote:
> gwibber is also infected by this bug. so is it something the app should
> deal with or it can be fixed in desktopcouch?
>
The correct bug post should be the following from Oct the first: http://
code.google. com/p/couchdb- python/ issues/ detail? id=93 the above mentioned bug has already merge by the python couchdb guys | https://bugs.launchpad.net/desktopcouch/+bug/462245 | CC-MAIN-2016-50 | refinedweb | 645 | 72.46 |
So why a lottery program?? Like everyone else, I am learning C# in any spare time I have and instead of diving in and writing a monster program I thought a nice introduction would be good. I chose the Lottery program as it allowed me to play with the .Net Random and Stack class.The problem is this. To generate a selection of unique random values. So if I want 6 numbers and want to in effect simulate rolling a 6 sided dice I would enter 6 at the first prompt and 6 at the second. Note that because we do not want duplicate numbers your Number Range ie the second question should be either the same or larger than your first entry.Here in the UK our national lottery requires you select 6 unique numbers whos value must be between 1 and 44 (I think) so of course you enter 6 at first prompt and 44 at second.The random class is easy to use and after declaring a new instance using Random r = new Random(); you can use the .Next method to get a random number. The gotcha is that if you wanted a random number between 1 and 6 and did r.Next(), you would actually get a value from 0 to 5. There is another way where you can specify a from to range ie r.Next(1,6) however at this point I thought lets write a dice class so I can learn about creating my own additional classes. This class has only one method RollDice and if you pass in a value of 6 it will return from 1 to 6 and ignore zero values.Our UK lottery requires 6 unique values so if I roll my dice how to do it. In the old days we would maybe use an array and check the array to see if my value was already there but hey! were using .NET now, there must be a better way.The .Net framework provides a Stack class which is sort of like assembly language in that you can push items onto the stack and retrieve them later. In my case I dont care that the first item in is the last item out. However of real use is the Contains method of the Stack class which allows you to see if a value is already on the stack. Looking at the documentation it almost looks like anything can be pushed and pulled on the stack. If you want to retrieve items of the stack in the order you pushed them ie first in first out, Microsoft has also added a class called Queue which more or less works the same way as the Stack class. Instead of Push and Pull methods you have Enqueue and Dequeue (hey I didnt make these names up!).Compile from the command prompt using csc lottery.csConclusionsMicrosoft have created an easy to use development framework which actually makes coding fun again! I highly recommend you read the docs thoroughly as there of many useful classes to be found. Also the development system and in particualar its context sensitive help is a joy to use and makes all the features of the .Net framework very discoverable.Roll on Beta 2! Source Code//Example Lottery program to generate a set of unique pseudo random numbers//Written in C# with Microsoft .NET beta 2//Shows use of Random and Stack class.//J O'Donnell 29/06/01 //[email protected] //only change needed from beta 1 to beta 2 was to use Convert class. namespace Lottery{using System;using System.Collections;/// <summary>/// Summary description for Class1./// </summary>public class Lottery{public static int Numbers, EndRange;//Displays titles and gets start valuespublic static void DisplayTitles(){EndRange=0;Numbers=1;while (EndRange<Numbers) {System.Console.WriteLine("=============================");System.Console.WriteLine("Lottery number generator");System.Console.WriteLine("=============================");System.Console.Write("How many unique numbers? : ");Numbers=Convert.ToInt32(System.Console.ReadLine());System.Console.Write("Enter end range : ");EndRange =Convert.ToInt32(System.Console.ReadLine());}}//Generate our unique numbers and push them onto stackpublic static void GenerateNumbers(Stack s, Dice d){bool exists=true; int i;int val; for (i=1;i<=Numbers;i++){val=d.RollDice(EndRange); //Roll EM!exists=s.Contains(val); while (exists==true) //Reroll if we already{ //have that numberval=d.RollDice(EndRange);exists=s.Contains(val); }s.Push(val);}} //Retrieve all values from the stack and output to consolepublic static void DisplayResults(Stack s){for (int i=1;i<=Numbers;i++){System.Console.WriteLine(s.Pop());} }//Entry point for programpublic static int Main (string[] args){Stack s = new Stack();Dice d = new Dice();DisplayTitles(); GenerateNumbers(s,d);DisplayResults(s); return 0;}} //Class to simulate a dicepublic class Dice{public int RollDice(int sides){Random r = new Random();int i=0;while(i==0){i=r.Next(sides+1);//Get another random number but} //discard zero valuesreturn i;}}}. | http://www.c-sharpcorner.com/UploadFile/jodonnell/ALotteryPrograminCS12052005060050AM/ALotteryPrograminCS.aspx | CC-MAIN-2015-22 | refinedweb | 819 | 64.81 |
This is the mail archive of the [email protected] mailing list for the glibc project.
On 11/26/2013 04:57 AM, Siddhesh Poyarekar wrote: > On Mon, Nov 25, 2013 at 11:28:43AM -0500, Carlos O'Donell wrote: >> On 11/25/2013 12:50 AM, Siddhesh Poyarekar wrote: >>> Hi, >>> >>> -march=z10 eliminates GOT pointer loads for static variables whenever >>> it can, which exposes a bug in the TLS implementation in s390x. The >>> TLS implementation assumes that the compiler will load the GOT pointer >>> (%r12) and implements __tls_get_offset with that assumption. This >>> however is true only in cases where the compiler sets up TLS for a >>> __thread. For cases where we call TLS_GET_ADDR directly (like in >>> dl-sym.c and in some test cases), we have to explicitly ensure that >>> %r12 is set up. >> >> How are you ensuring r12 is "setup?" >> >> The bug here seems to be that r12 != GOT, not that the compiler has >> failed to do anything special. This might have been a binutils >> issue or a compiler issue that moved r12 away from GOT to optimize >> loads. I can see that in tls-macros.h you need to artificially setup >> r12, but that's not a bug fix, that's simply fixing the test cases ;-) > > The bug here is that the value that is added in __tls_get_offset > before it jumps to __tls_get_addr is not the same value that was > subtracted earlier. In dl-sym.c, the value subtracted was the GOT > pointer and the value added was 0 (since r12 was not set to the GOT > pointer). Likewise in the test case. So we're fixing both, a valid > use case *and* a test case. Is r12 actually uninitialized or does the compiler and runtime ensure it's exactly zero? Could an undefined value cause an overflow or underflow that might set a comparison flag? I don't think so, as long as we use `unsigned' everywhere I think we're fine. >>> >>> +# ifdef __s390x__ >>> +# define LOAD_R12(r12) asm ("lgr %0,%%r12" : "=r" (r12) ::) >>> +# elif defined __s390__ >>> +# define LOAD_R12(r12) asm ("lr %0,%%r12" : "=r" (r12) ::) >>> +# endif >> >> You should add an `else ... error ..' case here in the even the compiler >> ever breaks these defines. If you don't want to do that I'd just put >> the __s390__ case in the else as is done in string.h for s390. >> >> I know there is at least one other case of this kind of idef/elif/endif >> without an error case in dl-tls.h for s390, but that should also be made >> more robust or just accept that !defined __s390x__ == defined __s390__. > > I'll do that for both cases in this file as a separate patch if it is > OK. But then your suggestion to use __asm__("%r12") should eliminate > this? Yes, that's right, but if you try out using register please review the generated code to make sure it's sensible. >>> + >>> # define GET_ADDR_OFFSET \ >>> (ti->ti_offset - (unsigned long) __builtin_thread_pointer ()) >>> >>> +/* Subtract contents of r12 from __TI. We don't really care if this is the >>> + GOT pointer. */ >> >> This comment is a bit obscure and oblique. Why don't you care that r12 is the >> GOT pointer? Is it just because the ABI says to use r12 and it wouldn't >> really matter what it pointed at as long as you had a register to use for an >> offset? >> >> I suggest rewriting this comment to explain why we use r12. >> >> e.g. >> >> /* The s390/s390x ABIs use r12 as a pointer to access the GOT and other data >> via register+offset addressing. Their TLS ABI also uses r12 to access the >> tls_index structure via r12+offset in __tls_get_offset. Thus knowing the >> final address of the tls_index variable in __TLS_GET_ADDR we are forced >> to subtract r12 here to get an offset which is what __tls_get_offset expects. >> We don't use _GLOBAL_OFFSET_TABLE_ because that's wrong, r12 is not the GOT, >> it is simply a register near the GOT to be used for register+offset >> addressing. */ >> >> Did I understand this correctly? > > No. in terms of the strict definition (which is relevant for > interoperability between gcc-generated code for __thread access and > glibc) %r12 must be set to the GOT pointer before calling > __tls_get_offset - it does not have to be something else. The > compiler will generate the code to load the GOT pointer in %r12 and > generate the offset to pass to __tls_get_offset. OK, in that case please write up some more detailed comment. > In our case in __TLS_GET_ADDR (ignoring TLS_IE for a moment since it > is just a test case fix), the compiler is not aware of a TLS access > and is hence under no obligation to load the GOT pointer in %r12, nor > is it responsible to generate the offset to the tls_index. We have to > explicitly do that by subtracting the GOT pointer from the tls_index > structure passed to the __TLS_GET_ADDR macro and then setting up %r12 > to the GOT pointer so that __tls_get_offset adds it back to the > offset. Right. > However, since we have full control over these operations, we can > avoid loading the GOT pointer in %r12 and just get away with > subtracting whatever is there in %r12 so that adding it back in > __tls_get_offset gives us back the tls_index address. Exactly. This should be in the comment :-) >>> # define __TLS_GET_ADDR(__ti) \ >>> - ({ extern char _GLOBAL_OFFSET_TABLE_[] attribute_hidden; \ >>> - (void *) __tls_get_offset ((char *) (__ti) - _GLOBAL_OFFSET_TABLE_) \ >>> - + (unsigned long) __builtin_thread_pointer (); }) >>> +({ \ >>> + unsigned long int r12; \ >>> + LOAD_R12 (r12); \ >> >> register unsigned long int r12 __asm__ ("%r12"); ? > > That looks nicer too, will try it, thanks. > >>> + ((void *) __tls_get_offset ((unsigned long int) (__ti) - r12) \ >>> + + (unsigned long) __builtin_thread_pointer ()); \ >>> +}) Suggest using `unsigned long' or `unsigned long int' consistently. >>> #endif >>> >>> diff --git a/sysdeps/s390/s390-32/tls-macros.h b/sysdeps/s390/s390-32/tls-macros.h >>> index 8a0ad58..0a11998 100644 >>> --- a/sysdeps/s390/s390-32/tls-macros.h >>> +++ b/sysdeps/s390/s390-32/tls-macros.h >>> @@ -8,12 +8,17 @@ >>> >>> #ifdef PIC >>> # define TLS_IE(x) \ >>> - ({ unsigned long __offset; \ >>> + ({ unsigned long __offset, __save; \ >>> asm ("bras %0,1f\n" \ >>> - "0:\t.long " #x "@gotntpoff\n" \ >>> - "1:\tl %0,0(%0)\n\t" \ >>> - "l %0,0(%0,%%r12):tls_load:" #x \ >> >> This old code looks like it expects r12 to be setup to a specific >> value, but it's probably not given the optimizations you point >> out initially. > > It expects GOT pointer to be loaded in %r12. Understood. >>> - : "=&a" (__offset) : : "cc" ); \ >>> + "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \ >>> + ".long " #x "@gotntpoff\n" \ >> >> Compute the offset from the GOT to this literal pool. >> >>> + "1:\tlr %1,%%r12\n\t" \ >> >> Save r12. >> >>> + "l %%r12,0(%0)\n\t" \ >>> + "la %%r12,0(%%r12,%0)\n\t" \ >>> + "l %0,4(%0)\n\t" \ >>> + "l %0,0(%0,%%r12):tls_load:" #x "\n\t" \ >> >> Set r12 to the GOT, set %0 to the offset of the GOT entry that holds the >> TLS variable offset and then do the load to get the value? >> > > Set r12 to the GOT and set %0 to x@gotntpoff. So basr loads the > address of the word after itself (which is the location of .long > _GLOBAL_OFFSET_TABLE_-0b) into %0. Dereference that and add that > value to its own address to get the GOT address. The word after the > address in %0 is x@gotntpoff, i.e. the offset to compute the location > of the TLS variable. Finally, add %r12 and the offset and dereference > to get the value. Makes sense. >> I reviewed the other macros and noticed they setup r12, so they are OK. >> However, they are artificially making r12 == GOT, but it need not be, >> it's just for the test. > > No, they need to be == GOT, because the compiler will generate offsets > relative to GOT. Understood. Either way they look correct. OK to checkin IMO as long as: * Use register for r12 *or* fixup the defines to be robust. and * Enhance the comment around __TLS_GET_ADDR to explain the situation in more detail. I think you're good to go now unless you object to any of that. Cheers, Carlos. | https://sourceware.org/legacy-ml/libc-alpha/2013-11/msg00773.html | CC-MAIN-2020-40 | refinedweb | 1,327 | 71.85 |
It’s Time to Learn Java!
has JVM (Java Virtual Machine) which knows how to execute Java bytecode. Java lets us build applications that could be used by as many people as possible with as little work as possible. Java is a very powerful programming language. Us, developers, write code ( a series of commands to tell the computer what to do ) and Java has made the process of us talking to the computer super easy. The reason is because Java is a higher order language.
Let’s write our first “Hello Word” Java program.
public class MyFirstJavaProgram {
public static void main(String []args) {
System.out.println("Hello World"); // prints Hello World
}
}
Easy! Here are some things to remember when writing Java code:
- Java is case-sensitive
- The first letter of a Class name should always be capitalized
- Java is Object-Oriented
- Java data types are: String, int, float, boolean, char (stores single characters)
- Integer data type has its own types such as long, short, byte (that depends on how long a number is)
- When declaring a variable, you always have to assign it it’s data type —
String name = "Olesya"
int myNumber = 31
7. If you add the keyword ‘final’ to the beginning of a variable declaration it becomes immutable
final int myNumber = 31
myNumber = 30 (that will generate an error)
I didn’t know Java was so much fun!
That’s it for today, guys! Happy coding! | https://olesyam-miller.medium.com/its-time-to-learn-java-e73257a757af?source=post_internal_links---------6---------------------------- | CC-MAIN-2021-39 | refinedweb | 238 | 60.75 |
incoming shipment' move date same as the picking date
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- 2012-09-18
- Last reply:
- 2015-05-25
Ok, for expample i do internal Moves, but a try move some product this date
09/04/2012 but when i press Process Now, the date change for 09/18/2012, Is
it Correct??
Greatting
2012/9/17 Federico Manuel Echeverri Choux - Conectel <
> New question #208808 on OpenERP Addons:
> https:/
>
>
>
> --
> You received this question notification because you asked the question.
>
I'd like to post a question about this...I'm seeing the same problem but I will express in another way:
When receiving inbound shipment, the resulting moves - both stock and accounting - ultimately get dated with current system date, and there doesn't seem to be any way to enter the actual date the shipment was received? (Which IMHO should be the date that gets placed on the moves and the accounting journal entries).
This is clearly absurd, because it means it is not possible to enter historical data and have the accounting records reflect accurately the moves in the correct period.
The incoming shipment record has two dates on screen:
* Order Date ... not sure what this is really supposed to be representing, since it is a separate editable value from the original PO Date.
* Scheduled Date
Ideally, it seems to me that there should be a third date - initially empty - which is filled in with the actual date the goods were received.... and this is the date that should go on the move and accounting journals.
On thee individual move lines there is also a Date and a Schedule Date. The date is editable, but ultimately gets overridden with system date when the goods are 'received'.
I can see a couple of simple solutions to this, but I'd like to at least get agreement that the way it works at the moment is kind of "silly" and makes things unworkable from an accountants point of view. The general accounting parts of openERP allow records to be entered with historical effective dates. Goods in and out should not be an exception.
I'm sure if we go looking on the Sales side we will find the counterpart problem concerning Despatch dates to customers.
OpenERP seems not to believe that other than real-time transactions exists.
obviously if external stock locations without internet connection exists - and we have 2 installations - it is necessary to enter "historical" data for these location to get correct monthly data.
in
https:/
there are a lot of modules which are necessary to handle this matter correctly including historical evaluation of stock.
I don't know that I agree with your opinion about philosophically what OpenERP had intended. Surely this is quite simple.... it does not a whole new module simply to get a different date on the move rather than current date.
I propose that it is either:
(a) A design deficiency, (that seems to me to be easily corrected) - i.e. not possible to enter stock movements from say three months ago and have it accounted for in the correct period; or
(b) It's a simple bug... the move date is just being set with the wrong date! i.e. now() instead of the actual move date.... which could be taken from the editable date on the reception record, or even the editable date on the move before it is committed.
On this basis I am going to re-open the bug this is linked to to try and get a sensible position on this.
Hi, Suppose a company the warehouse men captures 2 times weekly the incoming shiping, but he need to put the real date where the product incoming at warehouse. How to?
For 7.0, https:/
This patch was provided by Odoo to us when we reported something similar:
diff --git a/addons/
index 93f3bf1..683e3d7 100644
--- a/addons/
+++ b/addons/
@@ -883,7 +883,15 @@ class stock_picking(
This method is called at the end of the workflow by the activity "done".
@return: True
"""
- self.write(cr, uid, ids, {'state': 'done', 'date_done': time.strftime(
+
+ # correctly preserver any historic processing date the user enters for the picking
+ for picking in self.browse(cr, uid, ids, context=context):
+ values = {
+ 'state': 'done'
+ }
+ if not picking.date_done:
+ values['date_done'] = time.strftime(
+ self.write(cr, uid, ids, values, context=context)
return True
def action_move(self, cr, uid, ids, context=None):
@@ -1802,6 +1810,21 @@ class stock_move(
+
+ #ensure stock moves are created with the same date as their pickings if any
+ for move in self.browse(cr, uid, ids, context=context):
+ if move.picking_id:
+ picking_in_obj = self.pool.
+ picking = picking_
+ if picking.date_done:
+ vals['date'] = picking.date_done
+ logging.
+ picking_out_obj = self.pool.
+ picking = picking_
+ if picking.date_done:
+ vals['date'] = picking.date_done
+ logging.
+
return super(stock_move, self).write(cr, uid, ids, vals, context=context)
def copy_data(self, cr, uid, id, default=None, context=None):
@@ -2379,12 +2402,23 @@ class stock_move(
+ #find the period related to the current date of the stock move
+ ctx = dict(context or {})
+ ctx.update({'dt': move.date})
+ period_id = self.pool.
+
+
for j_id, move_lines in account_moves:
+
+ # specify the temporal information for stock moves
+ 'date': move.date,
+ 'period_id': period_id[0],
+
def action_done(self, cr, uid, ids, context=None):
Hello Federico,
I have completely read your issue, But I don't think it's bug because we can't set the stock move date same as a picking date.
First of all picking date comes from the PO date (for incoming shipment) and SO date (for Delivery Order date).
Now about the stock move dates, in stock move there is a two date field one is 'date' which is the move date and it's changed at the system date. Like follow.
First Date (Move Date) is write the system date when shipment is generated. Same as this date override the the time of shipping date on which date when the product will received. Additionally Order date is not required on incoming shipment but the Date field if required on stock move , So we can't take the date from the picking 's order date.
Second date field which is the schedule date which is calculated from the procurement based on supplier lead time company security day. So also we can not take the schedule date as a order date.
So everything working correct now, that's why I am closing this issue.
Correct me If I am wrong.
Thanks for the reporting! | https://answers.launchpad.net/openobject-addons/+question/208808%C2%A0 | CC-MAIN-2020-34 | refinedweb | 1,087 | 62.38 |
pip install tensorflow
The Python tensorflow library is among the top 100 Python libraries, with more than 17,248,257 downloads. This article will show you everything you need to get this installed in your Python environment.
How to Install tensorflow on Windows?
- Type
"cmd"in the search bar and hit
Enterto open the command line.
- Type “
pip install tensorflow” (without quotes) in the command line and hit
Enteragain. This installs tensorflow for your default Python installation.
- The previous command may not work if you have both Python versions 2 and 3 on your computer. In this case, try
"pip3 install tensorflow"or “
python -m pip install tensorflow“.
- Wait for the installation to terminate successfully. It is now installed on your Windows machine.
Here’s how to open the command line on a (German) Windows machine:
First, try the following command to install tensorflow on your system:
pip install tensorflow
Second, if this leads to an error message, try this command to install tensorflow on your system:
pip3 install tensorflow
Third, if both do not work, use the following long-form command:
python -m pip install tensorflow tensorflow on Linux?
You can install tensorflow on Linux in four steps:
- Open your Linux terminal or shell
- Type “
pip install tensorflow” (without quotes), hit Enter.
- If it doesn’t work, try
"pip3 install tensorflow"or “
python -m pip install tensorflow“.
- Wait for the installation to terminate successfully.
The package is now installed on your Linux operating system.
How to Install tensorflow on macOS?
Similarly, you can install tensorflow on macOS in four steps:
- Open your macOS terminal.
- Type “
pip install tensorflow” without quotes and hit
Enter.
- If it doesn’t work, try
"pip3 install tensorflow"or “
python -m pip install tensorflow“.
- Wait for the installation to terminate successfully.
The package is now installed on your macOS.
How to Install tensorflow in PyCharm?
Given a PyCharm project. How to install the tensorflow
"tensorflow"without quotes, and click
Install Package.
- Wait for the installation to terminate and close all pop-ups.
Here’s the general package installation process as a short animated video—it works analogously for tensorflow if you type in “tensorflow” in the search field instead:
Make sure to select only “tensorflow” because there may be other packages that are not required but also contain the same term (false positives):
How to Install tensorflow in a Jupyter Notebook?
To install any package in a Jupyter notebook, you can prefix the
!pip install my_package statement with the exclamation mark
"!". This works for the tensorflow library too:
!pip install my_package
This automatically installs the tensorflow library when the cell is first executed.
How to Resolve ModuleNotFoundError: No module named ‘tensorflow’?
Say you try to import the tensorflow package into your Python script without installing it first:
import tensorflow # ... ModuleNotFoundError: No module named 'tensorflow'
Because you haven’t installed the package, Python raises a
ModuleNotFoundError: No module named 'tensorflow'.
To fix the error, install the tensorflow library using “
pip install tensorflow” or “
pip3 install tensorflow” in your operating system’s shell or terminal first.
See above for the different ways to install tensorflow. | https://blog.finxter.com/how-to-install-tensorflow-in-python/ | CC-MAIN-2022-33 | refinedweb | 518 | 56.96 |
: June NBA draft Who's the number one pick? PAGE 1B z~ 0 CI T R U S C O U N T Y HIGH FORECAST: Partly 87 sunny in the morning, LOW numerous t-storms in 74 the afternoon. PAGE 2A Nvwm w- am& B Ake h 1 0elp Syndi atedCnlen Available from Commercial News Providers Lawyer: ERRAG fails to grasp terms of deal TERRY WITT terrywitt@ chronicleonline.com Chronicle Members of a Suncoast Parkway 2 advisory group met Tuesday for the first time to ;begin the process of correcting a Sunshine Law violation that triggered a lawsuit, but the attorney who filed the litiga- tion said he thinks the group lacked a clear understanding of what they are required to do. The Environmental Res- ource and Regulatory Agency Group (ERRAG) was formed to give state and federal environ- mental agencies an opportuni- ty to discuss concerns about the 26-mile Citrus County toll road project. But Tallahassee attorney Ross Burnaman filed suit on behalf of Citrus County residents Teddi Bierly and Robert Roscow challenging the legality of the private meetings.- Circuit Judge Janet Ferris agreed with Bierly and Roscow that ERRAG's five pri- vate meetings were Sunshine Law violations. They should have been public meetings. The mediation agreement resulting from the lawsuit requires ERRAG members to reconstruct their private dis- cussions in two public "cura- tive meetings." Tuesday's meeting was organized to explain to ERRAG members what they must do at the second meeting, tentatively set for Aug. 29 in Citrus County. But based on what he saw, Burnaman said he doesn't think ERRAG mem- bers understand the mediation agreement. "I think they're headed for a train wreck," Burnaman said after the meeting. Members of the anti-park- way group Citizens Opposed to Suncoast Tollway (COST) filled the meeting room wearing bright red stickers bearing the word STOP The group wants the parkway project stopped. Burnaman noted several ERRAG members did not attend the meeting. The U.S. Army Corps of Engineers missed the meeting. The Florida Department of Community Affairs and Florida Fish and Wildlife Please see ERRAG/Page 4A mm -w- m 40040 - BRIAN LaPETER/Chronicle Fritz the schnauzer gets a kiss from his owner Merry Lewis, of Beverly Hills, Saturday at Fort Island Gulf Beach. "He loves the water, but they don't want him in it," said Lewis. CFCC Board of Trustees votes to raise tuition College president declines pay raise CRISTY LOFTIS [email protected] Chronicle Students attending Central Florida Community College classes next year can expect to see tuition increases because of the college's board of trustees vote Tuesday. CFCC President Charles Dassance said that while the increase is less than what legis- lators recommended for the upcoming year, it still may hurt students. "Students with the greatest financial need really suffer," Dassance said. On average, the increase means about $6.40 more per credit hour, which continues Florida's pattern of tuition rates being among the lowest in the nation. The cost of credit program hours for residents will rise from $60.41 to $65.37 and from $226.14 to $239.24 for non-resi- dents. Non-credit program. hours for residents will rise from $53.48 to $56.24 and from $213.90 to $224.60 for non-resi- dents. Adult education credit hours for residents will rise from $26.57 to $27.95 and from $106.26 to $111.78 for non-residents. Dassance explained the increase was almost unavoid- able with rising health insur- ance rates for the college and stagnant student enrollment "Our enrollment's flattened out," Dassance said. "I would- n't be surprised to see it drop a little bit." He said that while pinpoint- ing a cause is not easy, it may be partially because of unem- ployment rates. "When employment gets very low, it affects enrollment," Dassance said. CFCC's Board of Trustees met at Citrus County's campus, which they usually do about twice a year Also at Tuesday's meeting, Dassance asked the board not to give him a salary increase this year, and not to continue to offer the president a car, but instead offer regular mileage reimbursements like what is given to other employees. Pine Ridge residents steamed about high utility charges County Commission looking for answers TERRY WITT [email protected] Chronicle Citrus County Commissioner Gary Bartell apologized Tuesday when two Pine Ridge residents asked why they were being assessed $6,571 for water line extensions, and he had no answers. Bartell, who was acting chairman in the absence of Commission Chair- woman Vicki Phillips, said the county is not responsible for the assess- ments and the Florida Governmental Utility Authority, the group imposing the fees, has ' yet to discuss its plans with the county commission. Phillips was out sick, and Commissioner Jim Fowler also missed the meeting. Gary In 2003, FGUA bought the pri- Gary vate water and sewer systems comm owned by Florida Water want Services Inc. in Citrus County, info including Pine Ridge and FG Citrus Springs. The group says high growth rates in both communities are forcing it to impose property assess- ments on vacant lots and new homes to E 'L is uL pay for the extensions. Pine Ridge residents George VanTeslaar and John Lepore received identical June 24 let- ters from FGUA instructing them to pay a $6,571 assessment for the water lines built to their homes. They said they can't afford such a high fee. artell VanTeslaar said he has already inty paid his builder $1,700 to con- ssioner nect water to his home. rom Lepore said he wondered if UA. the county was trying to drive people away. "We wanted to bring this to light It's like getting hit on the head with a ham- mer," said Lepore, a retired New York police officer. Pine Ridge residents who have water service t& their homes would not have to pay the tee. But if a new line has to be extended to a vacant lot or a new home, the assessment would be imposed. Residents who don't pay the assess- ment before Sept 1 would be charged $7,805. They also have the option of making annual payments of $836.55 for 30 years, for a total payout of $25,096. County Administrator Richard Wesch, who sits on FGUA's board of directors, referred Lepore and VanTeslaar to several administrators in FGUA. Please see CHARGES/Page 4A Annie's Mailbox .. 5C Movies .......... 6C Comics ......... 6C Crossword ....... 5C Editorial ......... 8A Horoscope ....... 6C Obituaries ....... 5A Stocks .......... 6A Three Sections 84578 20025 5 Fortunate, not fraudulent 'Oui' to the future cadarache France chosen as testing ground for new experimental fuel source./1OA It's Thal-riffic! Local Thai restaurant whets the appetite with mouth-water- ing dishes. /Thursday 7 1w Ii Board OKs legal action * The school board gives the go- ahead to sue the contractor for the Homosassa school./3A * A string of car burglaries has sheriff's deputies looking for answers./4A Copyrighted MaIera Small dog, big whale a: lk ; I. %E~ CITRUS COUNTY (FL) CHRONICLE ENTERTAINMENT 2A VYnWV~n TTT-, 2c) 2005 Florida LOTTERIES Here are the winningnumber selected Tuesday in the Florida Lottery: to 9^ W I AP III w oft's lk m.:Okm * a w a CASH 3 2-5-6 PLAY 4 5-5-9-5 MEGA MONEY 16 31 32 33 MEGA BALL 14 FANTASY 5 1-2-9-15-20 MONDAY, JUNE 20 Cash 3:5 3 5 Play 4:5 9 7 9 Fantasy 5:1-11-14 27 29 5-of-5 1 winner $206,460. 4-of-5 298 $111.50 3-of-5 8,426 $11 SUNDAY, JUNE 26 Cash 3:;7-3-4 Play 4:6-5-4-8 Fantasy 5: 2 13 26 30 31 5-of-5 2 winners $88,502.8P 4-of-5 190 $150 3-of-5 6,213 $12.50 SATURDAY, JUNE 25 Cash 3: 8-3- 3 Play 4:5 9 6 5 Fantasy 5:7 11 30 34 35 5-of-5 4 winners $63,166.2 4-of-5 298 $136.50 3-of-5 10,116 $11 Lotto: 6- 8- 16-28-46-48 6-of-6 No winner 5-of-6 99 $3,800 4-of-6 5,071 $60 3-of-6 95,060 $4.50 FRIDAY, JUNE 24 Cash 3:6-2-6 Play4 INSIDE THE NUMBERS U To verify the accuracy of winning lottery numbers, players should double-check the numbers printed above with numbers officially post, by the Florida Lottery. On the Web, go to .com; by telephone, call (850 487-7777. W*o 4 , . w'- w .. . .. .. -* . SI: ::. ai p-A-m .4 C Si. J *.. a 311avol oft ...~_r~~I ~~........ Searbtrk Dyian remt&ns oaCD a um pa :.... .. . -a m- e S .I* S .a -ie lowIs .4 . 2.. CopyrIghted Materia .. .. .... . ... - - .-... - adx a -^ -^ a -^h^* : S1 Available from Commi'eal News Proves .a - pe a a . m- a .. ... - .. ........f .q : , .-a a- qp , S e ai. l ap. -.&W ** : . sitE:: 0-: :: i ... X .5 we2 X .0 - , : . unk * ** , -:: ,,,, a -e a S ~.e a a. ~ -. W b w flee' opmp90M am at .a1 :: :i:: ...f ai i a"MiM ai iim -4w 'KM1 lf * | : >* |. S* -S.. k. .. Uf _a40 .... -i":iiii a-_ a m" iiipiiiiiiiii as e 4b ll 9, a-- MI em a e mo a r rM ... ... ... ......... _ "S.,. ..- * mg -|| .h.d.b. =- e A ... -4HNunll -. ,, -al .a. :iii:if iI -t kp A op S S mEm Si.i.. ammm arl e d.J% WEDNESDAY, JUNE :49, Z`--U--- ~--n bop" ';;;;;;;;;;;;;;;;;;;;;~"""; --;;;;;;; ;;;;;;;;;;;;" .. . .. . -*4 . ^ Wk M.Idrd. - -~ - ~ a uQ H -' 2 \..~' - ~'r4 3A WEDNESDAY JUNE29, 2005 imilpipsim 'Sl3lBPil, 111 f C-pyrightedMaterial __ -- a - -1W - - -- -- -0 - to. a - -- * - - 00 * " Available frmCommercal News Pridersve a- -- * - ~0 - - - Structure, brush fires down Rain keeps. flames at bay AMY SHANNON ashannon@ chronicleonline.com Chronicle It's unusual, but a good unusual. That's how Citrus County Fire Rescue officials describe the decline in structure fires in the past.few months, "It's been extremely quiet," spokesman Tom McLean said. "There really hasn't been any- thihg major. Usually, we're a bit busier." The number of brush fires also has been knocked down because of recent rain. But, McLean said,. the changes haven't left firefight- ers volunteers and paid per- sonnel -with any down time. "The call load hasn't changed," he said. "We're still running EMS and vehicle acci- dents. We're running more EMS backup calls with the paid guys than we'd normally hit with just the volunteers." McLean said firefighters worked two reports of fire Sunday, but neither caused major damage. A fire that started in a deep fryer at the Beverly Hills Winn- Dixie stayed contained and did not cause any damage to the store, he said. Lightning struck an area homeowner's stove that same day, but it, too, stayed contained and only burned the heating element inside the stove. McLean said there's nothing to really attribute the drop in structure fires to other than perhaps a heightened aware- ness by residents. Looking ahead into July, McLean said if residents decide to use a generator in the event of a storm, they must make sure it is properly hooked up. McLean said an improperly hooked up genera- tor can put firefighters' and utility workers' safety in jeop- ardy. - a ~0 - a - - - -- ~.- - - ~- - -. - .0 - -~ - - - - a - a = ~ a - Board prepares for Homosassa school litigation CRiSTY LOFTIS [email protected] Chronicle The time for lawyers to work out who is responsible for the Homosassa construction deba- cle has come. At a special meeting Tuesday, the Citrus County School Board gave board attor- ney Richard "Spike" Fitz- patrick authority to begin liti- gation against R.E. Graham Contracting Inc. In May 2004, the school board learned Homosassa Elementary School's media center and cafeteria were built with major construction flaws, including missing steel and grout from the walls. Throughout the past year, the school district, architects, construction crews and experts have scrambled to house and educate displaced children, fix the problems and figure out how the errors went unnoticed in the first place. Despite the two buildings being complete, Fitzpatrick It appears somebody owes us some money. Richard "Spike" Fitzpatrick school board attorney. said the district is still with- holding about $638,000 from R.E. Graham Contracting Inc. However, total damages are now estimated at about $780,000. "It appears somebody owes us some money," Fitzpatrick said. He will draft litigation papers, but hopes to have a remediation session with Graham Contracting to avoid going to court. "If we can find a way to resolve this without knock- down, drag-out litigation, then that is what we're going to do," Fitzpatrick said. Fitzpatrick added he does not expect to place financial blame on the architect firm used for the project, Williamson Dacar Associates in Pinellas County. Since the Homosassa proj- ect, several lawsuits have been filed by subcontractors against Graham Contracting for non- payment. Graham Contracting is also building the Citrus County Extension Services and envi- ronmental health building in Lecanto, which is about six months behind schedule. Also Tuesday, the board accepted Superintendent of Schools Sandra "Sam" Himmel's recommendation for: Inverness Primary School assistant principal Patricia Douglas to serve as principal at Citrus Springs Elementary School; Citrus High School teacher Danita Eatman to serve at Crystal River High School as an assistant princi- pal; and program specialist Suzette Pelton to serve at Crystal River Middle School as an assistant principal. Correction Because of a reporter's error, a story on page 3A of Tuesday's Chronicle, "Family remembers father as caring, courageous," contained incor- rect information. Dorothy and Ernest Temple had four children: Susan McNiel, Sandra Cullum, Bruce Temple and Robin Lehman. The Chronicle regrets the error. So you know Citrus County residents have reported fraudulent telephone solicitations in recent days. The Florida Highway Patrol does not solicit funds and is not conducting a fund-raising campaign. v:. I /: CREST job class learns to cook Pro .chefi putpizzazz in pizza-nmaking CRIsTY Lo.T.is [email protected]' " Chronicle While CREST student Chris Derosa was thrilled Wvith the transformation of his cafeteria . - into a pizza-making classroom, one thing was holding him back from joining in. "As long as there's no mushrooms involved," Chris, 19, said. "I don't like mushrooms -just pepperoni, cheese, sausage and green pep- . pers." Monday, his class received a special visit from two Chateau Chansezz restaurant chefs. The workshop was for students in the school's ., \" vocational education class, a class designed to ' introduce students to different types of jobs in preparation for graduation. "They give us the opportunity to teach kids how to do a job and stay on task," teacher Rona Cooper said. . Throughout the year, she and two job coaches place the students in volunteer jobs stih, as office work maintenance crews, restaurants, laundries and nursing homes' Graduates of Cooper's class have gone onto work throughout the community in printing and pet stores, nursing homes and restaurants. "It's totally thrilling how much the kids learn from when they start to when they leave," Cooper said. Nineteen-year-old Tracy Penell followed the chef's directions carefully by first washing her hands and then putting on gloves. '4'. "It's like performing surgery," Tracy said, as NW she struggled to get the plastic glove over her hand. Erica Guest, 17, has been volunteering at Publix learning how to face products on shelves, 2 but Monday's cooking may make her rethink her , future career. ". "I love cooking," she said smiling, as she strut- ted around the cooking station in her chef's uni- form. The pizza activity was a special treat for the students because not only were they preparing the pizzas, but also eating them afterward. Chef Ken Roix, who has been completing a mentorship at Chansezz for the past three years, hopes to continue coming to CREST to intro- DAVE SIGLER/Chronicle duce children to cooking. Chef Barrott Vannoy, second from left, helps Jess Berry, left, roll out dough Monday while Tony "I wanted to show them my love," Roix said, Dayton, William Armstrong and Erica Guest work on other pizzas during a vocational workshop at "and passion for food." CREST School. Vannoy and Chef Ken Roix from Chateau Chansezz volunteered to give the workshop. - - . o County BRIEFS Attempted robbery under investigation Sheriff's detectives are searching for two men believed to be involved in an attempted robbery early Monday outside the SunTrust Bank on U.S. 41 in Inverness. A woman told authorities she was about to make a deposit at the bank's drive-thru just before 2 a.m. when two men jumped out of a bronze Taurus and ran in front of her truck, Citrus County Sheriff's Office spokes- woman Gail Tierney said. One man pointed a handgun at the woman and grabbed onto a door handle, but the woman sped off without any injuries. Two witnesses said they saw the men head south on U.S. 41 following the incident, Tierney said. The men are described as white, 5 feet 10 inches tall, of average weight. One man wore. a gray shirt and a blue bandana. The other man was wearing a black shirt. Anyone with information should call the Citrus County Sheriff's Office at 726-4488. Mentoring program to return to county Leaders from Big Brothers Big Sisters of Pinellas County and Sertoma Mentoring Village met Tuesday to sign an agree- ment that will bring the national mentoring program for at-risk youth back to Citrus County. The new BBBS office will open July 1 at the Heron Woods Community Center, 701 White Blvd., Inverness. Sertoma Mentoring Village is a grassroots organization that has operated a local mentoring program since Big Brothers Big Sisters of Citrus County lost its funding and closed about two years ago. Crystal River to conduct workShops The Crystal River City Council will conduct the third of three budget workshops at 6:30 p.m. Thursday at city hall on U.S. 19. The public is invited and encouraged to attend. Utility issues boil water notice After a power outage at the water plant in El Dorado Estates in Lecanto, the county on Tuesday issued a precautionary boil water notice because of a loss of pressure in the distribu- tion system. Citrus County Utilities will be flushing the affected lines and will collect two consecutive days of bacteriological samples as soon as all flushing and disin- fecting is completed. Call 527-7650. From staff reports State BRIEFS 1111111 U - . . CITRUS COUNTY (FL) CHRONICLE 4A v7EDNESDAY, JUNE 29, 2005 Robbery reported in Floral City AMY SHANNON ashannon@ chronicleonline.com Chronicle Sheriff's detectives are sear- ching for three men believed to have broken into a Floral City woman's home early Tuesday and robbed her at gunpoint The woman told detectives she was sleeping on a couch with her 8-year-old daughter when three masked men bran- dishing handguns broke into her home, Citrus County Sheriff's Office spokeswoman Gail Tierney said. Sometime before 1 a.m., the men demanded the woman remove her jewelry and give them all her money, but she was so distraught she asked them to remove her bracelets and necklace themselves. Tierney said the men then ransacked the home and put the woman's jewelry inside a pillowcase. The men also took an unknown amount of cash from the woman's bedroom and additional jewelry from a jewelry box. One man grabbed the woman around her neck and forced her onto a bed, but then left the bedroom after the other two men told him it was time to leave, Tierney said. The woman did not know the men, Tierney said. Tierney said the woman saw the men -leave her South Tara Point home in a maroon Ford Focus with Kentucky tags. The car was last seen headed south on U.S. 41 S. The men are described as black with thin builds, wearing camouflage pants, black T- shirts and masks that covered the bottom part of their faces. Two of the men are 6 feet tall and the third man is described as 5 feet 6 inches. Anyone with information about this incident should call Citrus County Sheriff's Det- ective Gary Atchison at 726- 4488. Deputies investigate car burglaries AMY SHANNON [email protected] Chronicle Sheriff's detectives are investigating a string of seven car burglaries that took place Saturday morning in a neighbor- hood just north of Crystal River. Citrus County Sheriff's Office spokes- woman Gail Tierney said all of the cars were left unlocked in the driveways and yards of homes along Basilico Street and neighboring Lazy Trail. ERRAG Continued from Page 1A Conservation Commission participated by conference phone. And not all those partic- ipating in the meeting were part of the original ERRAG group. CHARGES Continued from Page 1A Responding to Bartell's request, Wesch said he would arrange an FGUA presentation at the next county commission meeting. VanTeslaar said he also was upset because FGUA claims he has no choice but to pay the "They appear to be linked," Tierney said. "It was definitely a crime of opportunity." Tierney said detectives found no signs of forced entry The owners reported vari- ous items stolen including a change hold- er, 12 compact discs, $40 in quarters, a stethoscope and a piece of medical equip- ment worth $1,000. After the first victim reported his car bur- glarized just after 6 a.m., detectives discov- ered multiple victims throughout the day. The burglarized vehicles varied and included: two F-150s, a Saturn, a Hyundai But Burnaman said the mediation agreement requires the agency officials who attended the private meetings, and were therefore most knowledgeable about the issues, to attend the curative meetings. ERRAG members were told they could no longer talk about assessment. Bartell said his recollection of the inter-local agreement the county signed with FGUA allows the county to regulate any proposed increases in what consumers pay County Attorney Robert Battista said Michele Lieberman, assistant county attorney, is preparing an opin- ion for the Citrus County Water and Wastewater Authority Scallop Season! 14kt Sea Life Jewelry ECIALT available GEMS 795.5900 Established 1985 600 SE Hwy. 19, Crystal River BLINDS SAVE up to 80" OFF m'i FAST DELIVERY PROFESSIONAL STAFF FREE * In Home Consulting * Valances * Installation Verticals Wood Blinds Shutters Crystal Pleat Silhouette F1 ,_ .... .. C L I- LECANTO -TREETOPS PLAZA 1657 W. GULF TO LAKE HWY 527-0012 _M HOURS: MON.-FRI. 9 AM 5 PM VIS I Evenings and Weekends by Appointment "must present written estimate from competitor for like product COMMUNITY PHYSICIAN LECTURE SERIES F: Dr. R. Crane Couch Board Certified Orthopedic Surgery "Hip and Knee Arthritis" Date: Time: Location: July 12th 1:00 pm Community Center at West Marion Medical Plaza Please RSVP for this FREE lecture by July 11th 291-6401 JOINT THE CARE CENTER WEST MARION COMMUNITY HOSPITAL Ocala, FL Sonata, a Dodge Caravan, a Dodge Ram and a Mazda, Tierney said. Detectives are working to develop sus- pects in case and Tierney said she expects deputies to increase their patrols in the area. Tierney stressed the importance of resi- dents keeping their vehicles secured at all times, "These are preventable crimes," she said. Anyone with information about these incidents should call the Citrus County Sheriff's Office at 726-4488. Suncoast Parkway 2 outside the public meeting. The ruling by Ferris requires them to dis- cuss all ERRAG business in public meetings. Future ERRAG meetings are open to the public. ERRAG members at the meeting were uncertain about what type of presentation they about whether the authority can regulate the assessments. The authority regulates water and sewer rates for private utilities. FGUA agrees the authority can regulate rates, but says the county has no authority over property assessments. "The board entered into an are supposed to give at the sec- ond meeting. Raymond Ashe, representing the Turnpike Enterprise, said the mediation agreement spells out in detail what they must include in the presentations. He said the agencies must decide the for- mat they use for the presenta- tions. agreement, and this board and FGUA will have to -determine what the agreement says," Battista said. FGUA's agreement with the county gives the commission the option of purchasing all the water and sewer systems in Citrus County that are' con- trolled by FGUA. S_ MURPHYY BEDS DEALER . FREE REMOVAL OF OLD BEDS . 2.0 aJ = ,2 FURNITURE DEPOT Top Notch New & Used Furniture ,, Ethan Alien Thomasville Drexel Broyhill SWhen Available) It , * Oak Server ................................................. $295 * Sofa Sleeper.........................................................$395 * Table and 6 Chairs .......................................5....$195 * Rattan Sofa, Loveseat, Recliner ....................$....$895 * Assorted Recliners ....... ................................$155 * Book Cases ..... ............................ ................. $55 * 3 Living Room Groups ...................................S....695 Citrus County Sheriff Domestic battery arrests Phillip Michael Cox, 29, Hemando, at 2:55 a.m. Monday on charges of domestic battery and battery. A deputy responded to a Hemando home in reference to a disturbance. A woman told the deputy she and several others were involved in an altercation with Cox that became physical, according to an arrest report. The woman said Cox pushed her and another woman to the ground and hit a man in his face, according to the report. Two witnesses' stories corroborated what the three injured individuals said happened. The deputy saw injuries on the two women and the man. No bond was set for the domestic battery arrest. His bond was set at $1,000 for the battery charge. David Fries, 21, Beverly Hills, at 11:42 p.m. Sunday on a charge of domestic battery. A deputy responded to a Beverly Hills home in reference to a verbal dispute. A man said he had been involved in a verbal argument with Fries. The man said Fries spat on him during the argument, according to an arrest report. A witness corrob- orated the man's account of what happened. No bond was set, Also arrested in this incident was John Koney, 39, Beverly Hills, at 11:40 p.m; Sunday on a charge of aggravated assault. A man told the deputy Koney threatened to cut him with a steak knife during an argument, according to an arrest report. A witness corrob- orated the man's account of what happened. No bond was set. Other arrests E Earl Wayne Hammaker, 29, Z- G P T R U S.. 3495 S. Kings Ave., Homosassa, at 1:55 p.m. Monday on charges of grand theft, burglary of a dwelling and contributing to the delinquency of a child. Detectives questioned) Hammaker and his juvenile son, about a recent home burglary. The4 boy told detectives he and" Hammaker docked their boat at a .home and went inside, according to, an arrest report. j The boy said Hammaker told him; to carry a yellow toolbox to the boat; so he complied. The boy told detec!- tives he also removed a lantern and" a crab net, according to the report:- The boy said Hammaker removed a, large plastic bag containing house-t hold items from the house, along with a second lantern, according to' the report. 7" Hammaker denied involvement irfi the incident, according to the reported No bond was set for Hammaker. Hammaker's son was arrested on- charges of grand theft and burglary- of a dwelling, and was turned over tod another parent. It Ronald Dean Watkins, 21, 515 Beverly Hills Blvd., Beverly Hills, at 11:45 p.m. Monday on charges of; aggravated battery with a deadly weapon and aggravated assault with a deadly weapon. A deputy responded to a Beverly Hills home in reference to a an" aggravated battery/assault that had,; already occurred. r) Witnesses told the deputy they" saw Watkins fire a.paint gun at two1 people walking along Beverly Hillso, Boulevard, according to an arrest> report. One female told the deputy, she got hit with a paintball, accordO ing to the report. The deputy caught up to Watkins, i who admitted he fired a paint gun into the air to scare some juveniles;) but he denied shooting at anyone, according to the report. His bond was set at $10,000. C 0 J J.1 Ymnlrnicleonlipe Where to find us: Meadowcrest office Inverness office S | ,,, ',, ,, ,, 162 N. Meadowcres 41 44 1624 N. Meadowerest Blvd. 106 W. Main St., Crystal River, FL 34429 Inverness, FL 34450 Beverly Hills office: Visitor Homosassa office: Beacon Truman Boulevard 46 _ -1 PERIODICAL POSTAGE PAID AT INVERNESS, FL SECOND CLASS-PERMIT #114280 For the RECORD---- -M -1 IM 1- 26-4835 565 Hwy. 41 South Inverness, FL -1 Mon. -Fri. 9 A.M. 5 P.M. Sat.10A.M.-4P.M. A -n - A 11 ski. -7, Ir CrRUS COUNTY (FL) CHRONICLE Obituaries Virginia McCuller, 86 ONTARIO, ORE. Virginia Barcus McCuller, 86, of Ontario, Ore., mother of Pat Cassity of Inverness, died Saturday, June 25, 2005, at an Ontario care center. She was born Nov 22, 1918, at Institute, W Va., the daugh- ter of William Francis and Juliet Joy (Barcus) McComas. As a young girl, she moved with her family to the Miami area, where she was raised and edu- cated. She married Bruce McCuller Dec. 14, 1935, in Fort Lauderdale. In 1944, Virginia brought herself and three chil- dren west to San Diego, Calif., where Bruce was serving in the U.S. Navy. They continued to live in Southern California. Bruce died in March 1969. Following his death, she moved several times following her children. In 1991 she set- tled in Ontario, Ore., near her daughter, Joy. She enjoyed going to church and especially loved the Lord. She was preceded in death by her parents, one sister and one brother- Survivors include her three children and their spouses, Joy and Ray Loynes of Ontario, Ore., Jim and Justine McCuller of Fallon, Nev., and Pat and Gail Cassity of Inverness; 13 grandchildren; 17 great-grand- children; four great-great- grandchildren; a sister, Louise Cash of Southern California; and numerous nieces and nephews. , Lienkaemper Funeral Chapel, Ontario, Ore. James Muench, 45 NEW TAMPA James Edward Muench, 45, New Tampa, died suddenly on Saturday, June 25, 2005. Mr. Muench was born Nov. 19, 1959, in Jersey City, N.J. He was a claims examiner for an insurance company. He was Lutheran. He was preceded in death by his father, Howard Muench, Dec. 16, 1998. ; Survivors include his wife of seven years, Catherine Limone-Muench of Tampa; one son, T.J. Muench of Skaneatilis, N.Y; two daugh- ters, Dominique Limone of Tampa and Callie Muench of Skaneatilis, N.Y; his mother, Barbara Muench of Inverness; brother, Gary Muench of Inverness; and sister, Patti Muench of Inverness. Chas. E. Davis Funeral Home with Crematory, Inverness. Beverly Mulder, 64 ALACHUA Beverly G. Mulder, 64, Alachua, former resident of Homosassa, died Monday evening, June 27, 2005, at Hospice of North Central Florida in Gainesville. ; She was born March 11, 1941, in Oklahoma City, Okla., and moved to Alachua from Iomosassa three years ago. , She was a retired legal sec- r tary in Oklahoma City. SShe was a member of the Gamma Phi Beta Sorority at Oklahoma University in Norman, Okla., and the Kerr- McGee Swim Team in Oklahoma City, Okla. ',She was a member of the Western Oaks Christian Church in Bethany, Okla. 'Survivors include her hus- land, Doran Mulder of Alachua; two sons, Robert Meador of Marianna and James Meador of San Diego, Calif.; one sister, Nancy Berry of Bethany, Okla.; and two grandsons. SStrickland Funeral Home, Crystal River William Roddenberry Sr., 58 TALLAHASSEE SWilliam Edwin Roddenberry Sr., 58, Tallahassee, died Monday, June 27, 2005, in Tallahassee. Born June 23, 1947, in Citronelle to Charlie Edwin and Kate (Hamilton) Roddenberry, he moved to Bristol in 1993 and to Tallahassee two years ago. :Mr. Roddenberry was a retired probation officer for the State of Florida and a U.S. Army veteran. SHe was a 1973 graduate of Florida State University He was preceded in death by one son, William E. Roddenberry Jr.; two daugh- ters, Dawn and Tonya Roddenberry; his parents, Charlie E. and Kate Roddenberry; sister, Edna M. Baker; and two brothers,Willie F and Jimmie D. Roddenberry. Survivors include his son, Joshua L. Roddenberry of Tallahassee; daughter, Katie M. Wilkins of Nashville, Tenn.; grandson, William K. Roddenberry of Tallahassee; granddaughter, Kaitlyn Wilkins of Nashville, Tenn.; stepmoth- er, Daphine Roddenberry of Cross City; five brothers, James T. Roddenberry and John Roddenberry, both of Bristol, Charles R. Roddenberry of Lecanto, Monte L. Roddenberry of Barnsville, Ga., and Randy C. Roddenberry of Polk City; and one sister, Patsy K. Collett of Crystal River Wilder Funeral Home, Homosassa Springs. Bruce White, 76 INVERNESS Bruce White, 76, Inverness, died at home Monday, June 27, 2005. A native of Philadelphia, Pa., he was born March 15, 1929, and moved to this area 12 years ago from Fort Lauderdale, where he worked as a plant supervisor for Universal Doors. Mr White was an avid sports fan and enjoyed watching the' Miami Dolphins and the Tampa Bay Bucs. Survivors include his wife of 40 years, Clara Snyder White of Inverness; two daughters, Beverly Dearden of Inverness and Linda Sutton and hus- band, Don, of Pine Ridge; four grandchildren; and four great- grandchildren. Chas. E. Davis Funeral Home with Crematory, Inverness. James Wixted, 79 BEVERLY HILLS James Justin Wixted, 79, Beverly Hills, died Monday, June 27, 2005. * A native of Hartford, Conn., he moved to Beverly Hills from Meriden, Conn., in 1991. Mr Wixted was a retired - shipping clerk ' for Cyanamed Chemical Co. and a veteran of World War II. He was Catholic. He is survived by his sister, Mary Boyce of South Burrowick, Maine. Florida Cremation Society, Ocala. Funeral NOTICES Virginia Barcus McCuller. Memorial services for Virginia Barcus McCuller, 86, Ontario, Ore., will be conducted at 10:30 a.m. Wednesday, June 29, 2005, at Ontario's Lienkaemper Chapel. Inurnment will take place at a later date at Rose Hills Memorial Gardens, Whittier, Calif. Memorials may be made to Presbyterian Community Care Center, c/o Lienkaemper Chapel, PO. Box 970, Ontario, OR 97914. James. Edward Muench. Friends may call at the Chas. E. Davis Funeral Home of Inverness from 5 to 7 p.m. Thursday, June 30, 2005, where funeral services will be con- ducted at 10 a.m. Friday, July 1, 2005, with the Rev. John Fischer officiating. Burial will follow at the Oak Ridge Cemetery, Inverness. Beverly G. Mulder. A funeral service for Beverly G. Mulder, 64, Alachua, formerly of Homosassa, will be conducted at 11 a.m. Friday, July 1, 2005, from the Church of the Nazarene, Hernando, with the Revs. Randy Hodges and Larry Brincefield officiating. Friends may call at Strickland Funeral Home in Crystal River from 2 to 4 p.m. and 6 to 8 p.m. Thursday, June 30, 2005. Interment will be at Fero Memorial Gardens Cemetery in Beverly Hills. Strickland Funeral Home, Crystal River 'Tunera[ afliome mWit Cearod, Rupert C. LaBelle , Private Cremation Arrangements Rudolph LaBranche Private Cremation Arrangements Edward Hunt, Sr. Mass: Wed 1pm Our Lady of Fatima Burial: Florida National Cemetery Rachel Shipman Funeral: Wed 10am Chapel Burial: Hills of Rest, Floral City Ron Lee Services: Sat 2pm Chapel James Muench View: Thurs 5-7pm Funeral: Fri 10am Chapel Burial: Oak Ridge Cemetery Gary Burton Private Cremation Arrangements Bruce White Private Cremation Arrangements 726-8323 Deaths ELSEWHERE Shelby Foote, 88 HISTORIAN car- riage, he seemed to have stepped straight out of a Mathew Brady photograph. Later he would say that being a celebrity made him uneasy, and he worried it might detract from the serious- ness of his work." Burns said Foote gave the documentary a "sense of will- ing the past moment to life." "We had planned to film 30 or 40 historians. Shelby Foote was in it 89 times or something like that The next closest was seven or eight times," Burns said. Though a native Southerner, Foote did not favor the South in his history or novels and was not counted among those Southern historians who regard the Civil War as the great Lost Cause. He publicly criticized segre- gation fel- low Mississippi native. John Walton, 58 WAL-MART HEIR JACKSON, Wyo. -As one of the richest men in the world, John Walton could have spent his entire life traveling around the globe on luxury jets. But the heir to the Wal-Mart for- tune loved to tool around Wyoming in a cheap airplane built from a kit. Walton died Monday at the age of 58 when the homemade experimental plane he was piloting crashed near the Jackson airport in Grand Teton National Park Walton was remembered as a humble man with a passion for education, the outdoors and all things flying. "He was the kind of guy you'd never imagine had 20 bil- lion," said Michael Collins, a flight instructor at Jackson Hole Aviation. "He didn't put on airs, you know what I mean? He could have just been one of the guys." Walton's father was Sam Walton, who founded the dis- count store chain that would later become one of the biggest companies in the world. In March, Forbes magazine listed John Walton as No. 11 on the list of the world's richest peo- ple with a net worth of $18.2 billion. He was tied with his younger brother, Jim one spot behind his older brother, Rob, who is Wal-Mart chair- man. John Walton was on a com- pany committee that reviews Wal-Mart finances and over- sees long-range planning, but was not widely regarded as being a potential successor to his brother. Acquaintances described him as one who pre- ferred to avoid publicity. The cause of the crash was under investigation. The National Transportation Safety Board said Walton was flying a CGS Hawk Arrow, hap- p compa- ny shareholder gatherings, but generally limited his appear- ances to a wave to the crowd while his older brother con- ducted the meetings. In 1998, he and Ted Forstmann founded the Children's Scholarship Fund to provide tuition assistance for low-income families wanting to send their kids to private schools. The fund has benefit- ed 67,000 students. Friends said Walton also chaperoned regular ski outings for kids at a local ski resort and volunteered at his son's school. e.i,~L, -a. t- .;~t Choose your... * SEAT style * ARM style * PILLOW style * BASE style m FABRIC style - ----P~-~n~D;-"--~`";I~`r"l=Y`LY~h-;m~~2 "K...' From Casual Elegance From Casual Elegance... __ -_ ------- WHAT'S YOUR STYLE? CASUAL ? ... CLASSIC?... URBAN?... SOMETHING IN BETWEEN? Here's how to create your own personalized seating in five easy steps... ... to Cottage Charm. ..to Cottage Charm. FURNITURE LIGHTING AREA RUGS UNIQUE ACCESSORIES WINDOW TREATMENTS FABRICS WALL COVERINGS ACCESSORIES INTERIOR DESIGN RESIDENTIAL COMMERCIAL SMART smart interiors 1 INTERIORS S LIGHTING GALLERY & -/- ---- ; "WINDOW TREATMENTS- ,mil, ONwrdAI ~ Two Convenient Locations ~ Family Owm0 d And Operated For 25 Yearq. 97 W. Gulf to Lake Hwy., Lecanto, FL 34461 5141 Mariner Blvd., Spring Hill, FL 34609 352-527-4406 352-688-4633 Open Mon.-Fri. 9:30-5:00; Sat. 10:00-4:00 VERTICAL BLIND OUTLET 649 E Gulf To Lake Lecanto FL - 637-1991 -or- 1-877-202-1991 ALL TYPES OF BLINDS ["l . SOFAs, LOVESEATs, CHAIRs & OTTOMANs AVAILABLE IN YOUR CUSTOM DESIGNED STYLE YW BUSH Continued from Page 1A "Like most Americans, I see the images of violence and bloodshed. Every picture is horrifying and the suffering is real," Bush said. Bush said he knows Amer- ic togeth- er with Iraqi units, embedding U.S. transition teams inside Iraqi units and intensive man- agement terror- ists will not shake U.S. resolve in Iraq or elsewhere. "The ter- rorists do not understand America. The American peo- ple bal- ancing act for. the president, believed necessary by White House advisers who have seen dozens of deadly insurgent WEDNESDAY, JUNE 29, 2005 5A attacks each day eat inte sce- nario as if everything is going to be all right." But Bush said that signifi- cant progress has been made, while much work remains. "The new Iraqi security forces are proving their courage every day," Bush said. Bush said setting a timetable for withdrawing 135,000 Amer- ican troops would be "a serious mistake" that could demoralize Iraqis and American troops and embolden the enemy. He also rejected calls by some to send more troops to Iraq. Instead, he argued for main- taining his present three- pronged strategy: hunting down insurgents, equipping Iraqi security forces to take over the anti-insurgency fight and helping Iraqi political leaders in the transition to a permanent democratic govern- ment. SBush cited advances in the year since sovereignty was passed to the Iraqis. These included elections in January that drew 8 million voters and improvements to roads, schools, health clinics and basic services like sanitation, electricity and water "Our progress has been uneven but progress is being made," he said. He also noted that more coun- tries had stepped forward with assistance and that the United Nations is in Iraq to help Iraqis write a constitution and conduct their next elections. Dog Training Pet Supplies f Grooming, All Breeds Indoor Boarding of D05& Frontline/ Advantage Specializing In Skin Disorders & Oral Health - -- ~u~P~PawA~arrr mvh~Pis ~,,rmnl~c~~cn~ll~-~n~lr~llmra $, ,I\ 7% STOCKS 6A WEDNESDAY, JUNE 29, 2005 CITRUS COUNTY (FL) CHRONICLE, MOST ACTIVE ($1 OR MORE) Name Vol (00) Last Chg Pfizer 334692 27.90 -.18 GenElec 285839 35.15 +.54 Lucent 213071 3.00 +.04 EMCCp 173484 13.56 -.12 TimeWam 159013 16.97 +.07 GAINERS ($2 OR MORE) Name Last Chg %Chg StarGsSr 2.75 +.40 +17.0 DetaAir 3.97 +.45 +12.8 Consecowt 3.30 +.35 +11.9 GrafTech 4.45 +.41 +10.1 EDO 29.73 +2.69 +9.9 LOSERS ($2 OR MORE) Name Last Chg %Chg CKERst 14.12 -1.10 -7.2 MeridRes 4.89 -.28 -5.4 Wipros 20.10 -.90 -4.3 Anadrk 81.12 -3.54 -4.2 Interpublf 12.28 -.51 -4.0 DIARY Advanced Declined Unchanged Total issues New Highs New Lows Volume 2,366 899 152 3,417 160 27 1,752,060,180 MOST ACTIVE ($1 OR MORE) Name Vol(00) Last Chg SPDR 409690 120.15 +1.00 SemiHTr 207172 34.07 +.45 iShRs2000s190833 63.34 +.97 SPEngy 125933 44.78 -.85 iShJapan 65010 10.25 +.07 GAINERS ($2 OR MORE) Name Last Chg %Chg GeoGlobal 6.95 +3.56 +105.0 Sinovacn 2.92 +.37 +14.5 EmpireRs 9.70 +1.20 +14.1 MtnPDiagn 2.67 +.32 +13.6 HooperH 3.98 +.34 +9.3 LOSERS ($2 OR MORE) Name Last Chg %Chg CCAInds 9.60 -1.15 -10.7 TransGIb 6.57 -.66 -9.1 MexcoEn 12.34 -1.18 -8.7 Terremkrs 6.45 -.55 -7.9 CKX Lands 13.00 -1.10 -7.8 DIARY Advanced Declined Unchanged Total issues New Highs New Lows Volume 566 373 81 1,020 27 20 230,292,393 MOST ACTIVE ($1 OR MORE) Name Vol (00) Last Chg SiriusS 972004 6.43 +.44 NasdlOOTr 715952 37.15 +.35 Microsoft 524846 25.07 +.02 Intel 524450 26.33 +.47 Orade 488270 12.83 +.29 GAINERS ($2 OR MORE) Name Last Chg %Chg GMXwtA 3.35 +1.05 +45.7 Uonbrdg 6.78 +2.05 +43.3 SeeBeyond 4.29 +1.01 +30.8 Consulier 5.50 +1.00 +22.2 CubistPh 13.32 +2.39 +21.9 LOSERS ($2 OR MORE) Name Last Chg %Chg BrantCp If 7.21 -3.10 -30.0 FiRbrstrs 9,60 -1.93 -16.7 OraLabs 2.52 -.42 -14.3 CorAutus 4.35 -.65 -13.0 Innovo 3.23 -.47 -12.7 DIARY Advanced Declined Unchanged. Total issues New Highs New Lows Volume 2,215 842 162 3,219 95 36 1,607,586,566diing Name Lest Chg .44 A L 24.88 -.1 1 1 ACMIn 75 13 8B ACMOp 725 110 ACMS ; - WEMBB Stock Footnotes: cc PE greater than 99. cd Issue has been called for redemption by PE PPE Name L. Chg company. d -.New 52-week low. dd Loss in last 12 mos, ec Company formerly listed 9C- -i", . on the American Exchange's Emerging Company Marketplace, g Dividends and'eamn- 5 . ings in Canadian dollars. h temporary exmpt from Nasdaq capital and surplus listing : Sj.alfii[,i,', r,.Si,.:i -'a 5rrt'.''u r ir,n la ydi Tr,.. -. 4,i di',- ardi i..2.1 H:.1,1- e T.' I l'T q -. r C [ re r .Tui lu n- u ,, , 48rnIr, irie aolT d. a. ,,a Ea .,1 3 ..ni ruin se, TEA A.l-r i. 1: Ui a] y ir. ji C ACELid 24.88 -.13 IrIlruli] T irr'ani AillA n u...lni i. k J. a : u 'J .- rac r, u-' IJr., AOL ACM. 975 r 13 nu.ji',ig .T, Ir, ,',e :, u T ,, ':C.T .a .'. ,'aru l,:i .. id-,:-..r,]a l I.,,r,,e "B ADAt, AC s AC P 725.' reorganized under the bankruptcy law. Appears in front of the name. cFso .S Dividend Footnotes: a Extra dividends were paid, but are not Included. b Annual rate lu.; ".:- C Lrqu" 11ll"a ,']irAj d '6 Am r j,',i lar, 1 r D, )r a i l 1 I I .T.i :.rr - Cu4 ,' i. i 8r ,lual r3ai w r,,.:r, a ir- :lea.iU ,' rT.,. a rC',i f iAlu' j le irrl.d :.ur,,:.Em irI . .r, GIk ic:. l.3.i Ii 1 -1 .1-5 V 131; 1 t,1. j, 0 i C3-'acnLliAIN- p paJ I r ' 'D ue A .i, a, l..-la 'd,da I, a,' rs r Ciur.rrt .,_ru l an l ', aro 'n ,r,: l, '-,;.ea V, m :.1 ... .. ,. ,,:e.l 3,' ,.0-'d ,r] ar".nur'.: mP.I p r Ir.is l al .',a,,d. nr-, ii r-..l ,r i nr. ,l.1,] n-,l .r i.,: r. r o .1 l, U. .. S rs In ,,',g I P r er,: I [i lr.:e s..- ur.. I P l Ir. l& ,k p.u.imatrn u u, Source: The Associated Press. Sales figures are unofficial. SOKOFL A YTD Name DIv YId PE Last Chg %Chg Name AT&T .95 5.0 ... 19.06 +.21 ... LowesC AmSouth 1.00 3.8 15 26.20 +.34 +1.2 McDnid BkofAm s 2.00 4.3 12 46.67 +.27 -.7 Microso BellSouth 1.16 4.4 11 26.55 +.24 -4.5 CapCtyBk .76 1.8 18 41.77 +1.62 -.1 Motorol Citigrp 1.76 3.7 14 47.02 +.25 -2.4 Penney Disney .24 .9 21 25.86 +.23 -7.0 Progrss EKodak .50 1.9 19 26.65 +.10 -17.4 SearsH ExxonMbl 1.16 2.0 14 59.09 -.21 +15.3 FPLGps 1.42 3.4 17 42.37 +.57 +13.4 SprntFC FlaRock .90 1.3 26 71.17 +1.79 +19.6 TimeWm FordM .40 3.8 8 10.40 +.28 -29.0 UniFirst GenElec .88 2.5 21 35.15 +.54 -3.7 Verizon GnMotr 2.00 5.8 46 34.36 +.89 -14.2 Wacho HomeDp .40 1.0 17 39.31 +.84 -8.0 Intel .32 1.2 20 26.33 +.47 +12.6 WalMar IBM .80 1.1 15 75.30 +1.42 -23.6 Walgrn YTD Div YId PE Last Chg %Chg os .24 s .55 ft .32 a .16 .50 En 2.36 Idgs ON .50 am .20 t .15 Cml.62 via 1.84 t .60 .21 +1.06 +.7 +.08 -11.9 +.02 -6.2 +.16 +6.7 +.96 +26.8 +.95 +1.0 +6.30 +55.7 +.24 -.2 +.07 -12.8 +1.30 +44.8 +.27 -14.5 +.67 -4.2 +.91 -8.0 +1.44 +23.2 52-Week Net % YTD 52-wk High Low Name Last Chg Chg % Chg % Chg 10,984.46 9,708.40 Dow Jones Industrials 10,405.63 +114.85 +1.12 -3.50 -.07, 3,889.97 2,959.58 Dow Jones Transportation 3,480.91 +85.07 +2.51 -8.35 +9.30. 386.29 274.52 Dow Jones Utilities 385.95 +3.76 +.98 +15.23 +39.52' 7,455.08 6,215.97 NYSE Composite 7,267.92 +57.60 +.80 +.25 +10.55 1,554.37 1,186.14 Amex Index 1,534.34 -.97 -.06 +6.97 +23.31 2,191.60 1,750.82 Nasdaq Composite 2,069.89 +24.69 +1.21 -4.85 +1.72 1,229.11 1,060.72 S&P500 1,201.57 +10.88 +.91 -.85 +5.75. 656,11 515.90 Russell2000 641.48 +13.17 +2.10 -1.55 +9.13 12,110.00 10,268.52 DJ Wilshire 5000 11,956.37 +119.07 +1.01 -.12 +7.87' NEYOKTCEXH ANGE PE PPE Name Last Chg ... 16 ABB Ltd 6.90 +.02 12 7 ACE Ltd 44.74 +.91 ACM Inco 8.30 +.02 23 18 AESCp 16.31 +36 17 16 AFLAC 43.67 +.35 12 10 -AGCO 19.26 +,45 16 16 AGLRes u38.29 +.59 5 4 AKSteel 6.30 12 .. AMLIRs 31.10 +.46 A...... MR 12.25 +1.04 ASALtd 38.16 -.56 ... 11 AT&T 19.06 +.21 .. 16 AUOpon 17.07 +22 SAXA 25.07 +.14 24 19 AbtLab 49.50 +51 28 20 AberFlc 69.24 +1.78 17 15 Aaenture 23.26 +.54 ...... AdamsEx 12.9 +.11 19 15 Adesa 21.83 +10 .. 55 AMD 17.70 +1.03 22 17 Aeropst l 33.67 +.66 11 17 Aelnas 83.77 +1.39 29 14 AfMMgrs u69.08 +1.78 .. 26 Agerers 12.25 -21 31 19 Agient 23.49 +.15 ...... Ahold 8.11 +.06 21 18 AIrProd 60.52 +.52 ...... ArTran 9.47 +54 15 15 Abertsn 20.55 +22 31 11 Akcan 30.45 -.08 19 12 Alcoa 26.37 +28 15 8 AIlBgTch 21.97 +.82 18 22 Alotes 49.98 +1.08 19 15 AliCap 46.50 +.48 32 20 AlliData 40.09 +1.15 ...... AWrld2 12.35 -.01 57 19 AldWaste 797 12 12 ArlmrFn 36.91 +.13 12 10 Allstate 59.73 -.52 16 17 AlItel u61.58 +.45 28 Alpharma 14.6 +.40 14 12 Atrna 65.19 +.22 21 17 Amdocs 26.56 +.42 12 10 AmHass 106.26 -4.16 19 18 Amreron u55.30 +.64 ... 15 AMovilL 59.73 -.12 SAmWest 5.84 +24 10 15 AmAxte 24.64 +1.38 12 15 AEP u36.5 +.30 19 16 AmExp. 54.00 +.63 SAFndRT 15.67 +.11 22 17 AGreet 26.99 +.64 15 11 AmlntGpf 55.17 +.14 26 15 AmStand 41.80 +24 ...... AmSlP3 11.16 +.01 AmTower u20.75 +.28 14 13 Americdt 25.27 +.33 21 18 Amerigas 32.18 .+.26 20 18 AmedsBrg 68.02 +1.21 15 13 AmSoulh 26.20 +.34 1210 Anadr 61.12 -3.54 28 25 AnatogDev 37.68 +.40 17 16 Anheusr 46.16 +.37 10 11 Annaly 17.85 +.04 12 12 AonCorp 25.12 +.46 11 10 Apache 64.57 -2,08 23 ... Aptlnv 40.20 +15 19 19 ApplBio 20.12 +.07 34 29 AquaAm 29.93 +.44 ... Aquila 3.42 +.13 75 19 ArchCoal 54.24 -1.06 19 15 ArchDan 21.29 +29 .. 29 AshfordHT 10.60 +.17 10 17 Ashland 70.49 +.29 ...... AsdEstat 9.01 +.06 14' 11 Assurant 36.14 +.05 18 ... AstraZen 41.06 +24 15 16 ATMOS 28.70 +20 13 14 AutoNatn u21.54 +.68 25 21 AutoData 42.38 +125 13 12 AutoZone 93.56 +2.14 17 13 Avaya 8.35 +28 24 17 Aviall 31.96 +.08 20 17 Avon 3721 +.32 10 7 AXIS Cap 27.95 +.10 14 13 BB&TCp 40.40 +.70 ... BHPBIIILt 27.82 +.55 21 18 BJSvcs 52.69 -.91 19 16 BJsWhis 32.25 +123 40.20 BMCSft 17.38 +.88 13 ... BPPL C 64.40 +.35 ...... BREpID 24.95 14 ... BRT 23.15 +.10 28 20 BakrHu 50.67 -128 14 12 BallCps 36.83 +33 12 11 BkofAmrs 46.67 +27 16 14 BkNY 29.52 +.70 17 15 Banta 46.50 +1.32 23 21 Bard 66.86 +.81 48 44 BarrickG 24.70 +.10 26 22 BauschL u81.13 +.74 54 19 Baxter 37.72 +.57 11 11 BearSt 104.94 +1.12 ... 25 BeangPf 729 +.02 8 7 BeazaHms 57.63 +2.18 24 17 BedoDck 51.95 +.38 11 15 BellSouth 26.55 +24 22 20 BestBuy 69.17 +1.48 55 22 BgLols 13.19 +25 ... 9 Biovail 16.21 +.04 19 18 BIkHCp 37.20 +.20 ...... BIkFL08 15.49 +.03 16 13 BlockHR 58.45 +.32 ... 20 Bockbs* 9.20 +.15 ...... BlueChp 6.48 +.16 28 22 Boeing 682.45 +.69 15 14 Borders 25.17 +.70 22 21 BostBeer 22.73 +.33 27 32 BostProp 68.72 +.36 19 14 BoslonSd 27.71 +.19 ... 34 Bowatr 33.35 +.52 19 18 Bowne 15.14 +1.10 24 19 BrMySq 25.28 +.38 14 12 Brunswick 44.48 +90 20 12 BudNSF 48.00 +1.45 13 12 BudRsc 54.68 -1.77 35 19 CBREnis u44.00 +.92 19 19 CH Engy 48.74 +1.30 8 15 CIGNA u107.65 +1.88 12 10 CITGp 42.25 +.70 44 14 CKERst 14.12 -1.10 10 16 CMSEng 15.14 -.02 10 CNOOC u59,00 +320 95 ... CRTProp 27.48 14 CSSInds 33.90 +.59 11 13 CSX 43.16 +1.47 28 20 CVSCps 29.40 +.82 ...... CablysnNY 32.33 +.03 49 16 Cadence 13.59 +.09 .. 26 CallGolf 1525 +.18 . ... Caine 3.60 +.11 ... Camecogs 44.64 +.55 19 17 CampSp 31.35 +.34 13 CdnNRyg 58.70 +.92 ... 14 CdnNRsgs 37.02 -.40 65 .. CapLease 11.00 +20 15 10 CapOne 74.35 +.73 ...... CapMpfB 13.20 -.05 21 15 CardnlHth 57.02 +.59 29 21 CaremkRx 44.21 +.66 24 21 CarMax 26.17 +.71 22 18 Carnival 55.12 +.49 20 28 Catellus 33.00 +.17 16 11 Calerpillr 97.80 +.88 15 Celpcg 13.07 +.25 ... Cemex 42,20 +.73 15 15 Cendant 22.35 +.53 16 CenterPnt u12.94 +.30 9 8 Cenlex 71.20 +1.41 33 23 CentPrkg 13.69 +.29 14 15 CntryTel 34.40 +.42 68 23 Ceridlan 19.15 +.42 24 18 ChmpE 9.99 +25 13 15 Checkpnt 17.72 +.31 15 11 ChesEng 22.72 -.53 9 10 Chevrons 57.00 -.25 38 29 ChlMerc u271,00+15.50 40 30 Chicos 033.95 +120 ... ChieTels 1021 -.04 10 10 Chubb 86.28 +.10 27 19 CincdBell 4.26 +.07 20 15 CINergy u44.93 +.39 59 26 CircCity 17.10 +24 14 11 Cto 47.02 +.25 66 28 CtzComm 1329 +.15 17 14 ClairesSrs 24.14 +.36 24 22 ClearChan 30.91 -.08 5 5 ClevCIf s 5925 +2.49 10 18 Clorox 5620 +.93 36 27 Coachs 3321 +129 22 20 CocaC 42.87 +.54 20 16 CocaCE 22.52 -.15 ...20 Coeur 3.42 -.04 22 18 ColgPal 50.63 +.48 . Collntln 8.73 -.02 13 12 Comerica 58.40 +.75 18 15 CmcSNJs 30.05 +.54 6 6 CmrclMs 24.25 +.92 12 ... CVRDs 29.57. +.72 . CVRDpfs 25.47 +.87 ... 28 CompAs 27.91 +57 10 13 ComrpSd 43.75 +59 16 16 ConAgra 23.44 +24 9 9 ConocPhis 58.10 -1.42 14 12 Conseco u21.95 +28 30 14 ConsolEgy 53.02 -.03 20 16 ConEd 46.55 +.42 26 18 ConstellAsu30.83 +1.25 ... ... CUAIrB 13.64 +95 17 13 Cnvrgys 13.16 +.34 32 21 CoopCam 62.84 -.24 25 17 CooperCo 62.00 -.06 ... 21 Coming 16.63 +.40 SCorusGr 7.42 +.06 11 9 CntwdFns 38.97 +.09 18 15 Coventry 70.77 +1.11 ... 14 Crompton 14.30 +.32 28 ... CrwnCsOe u20.40 +.16 43 16 CrownHold 14.35 +.10 9 8 Cummins 75.53 +2.32 ... 45 CypSem 13.00 +.07 21 11 Cytec 40.16 +.30 ... DNPSelct 11.57 +.01 14 19 DPL 27.60 +.03 11 8 DRHorns 37.63 +1.13 22 13 DTE 46.82 +.27 ... 10 DaimliC 40.72 +.09 66 10 DanaCp 14.47 +.37 22 18 Danaher 52.65 +.40 18 16 Daoden 32.66 -.15 19 14 DeanFds 34.08 -.17 11 10 Deere 66.30 +1.25 19 13 DelMnte 10.40 -.02 17 ... Delphil 4.69 +.14 .. DellAlr 3.97 +.45 26 16 Denbury 39.90 -1.01 ...... DeutTel 17.99 +.16 11 10 DevonEs 50,35 -1.68 .. 20 DiaOffs 53.34 -1.39 20 16 Diebold 50.54 +.64 19 30 Dilards 23.67 +.33 .. 50 DirecTV 15.54 +.08 21 18 Disney 25.86 +.23 19 17 DollarG 20.38 +.52 20 15 DomRes 74.28 +1.16 20 15 DonlleyRR 34.18 +.06 4 8 DoralFIn 16.75 +1.33 10 9 DowChm 44.61 +1.07 922 DmrksAn 27.07 +.52 22 15 DuPont 44.94 +.42 14 18 DukeEgy u29.76 +.20 15 16 DuqUght 18.92 +.45 ...... Dynegy 4.90 +.04 14 13 ETrade 14.03 +.60 33 24 EMCCp 13.56 -.12 19 16 EOGRess 56.00 -.74 13 9 EastChm 55.75 +.90 19 10 EKodak 26.65 +.10 14 11 Eaton 60.42 +1.44 23 19 EatnVans 24.00 +.44 13 16 EdisonInt u40.34, +.59 21 19 EDO 29.73 +2.69 18 15 Edwards 44.80 +1.19 .. 17 EIPasoCp 11.58 -.08 ...... Elan 6.43 -.03 55 36 EDS 19.27 +.10 20 17 EmrsnB 64.30 +1.12 31 17 EmpDist 24.00 +.47 27 18 Emutex 17.96 -.01 28 25 EnbrEPtrs 53.25 +.02 .. 13 EnCanas 40.62 -.73 ...... Endesa 22.49 +.33 18 15 EnPro 26.84 +.19 43 17 ENSCO 35.63 -1.12 ...... Enterasysh .89 -.03 20 16 Entergy 75.50 +.49 ... 57 Eqlylnn u13.65 +.29 ... 43 EqOflPT 33.41 +.04 20 .. EqtyRsd 36.70 +.45 22 18 EsteeLdr 39.00 +.15 17 16 Exelon u51.35 +.60 14 13 ExxonMb1 59.09 -.21 17 16 FPLGps u42.37 +.57 52 29 FairchldS 15.15 +26 18 17 FamDIr 26.49 +.49 10 8 FannieMIf 58.79 +.93 17 15 FedExCp 81.58 +1.44 ... 22 FedSignl 15.74 +.50 18 15 FedrDS 74.45 +2.42 ...... Feldmann 13.10 -.34 ... 29 Ferrelgks 20.85 37 17 FerroIf 19.91 +.92 6 11 FidiNFns 35.75 +.36 19 16 FistData 40.30 +.43 ... ... FFinFds 18,11 15 12 FstMarb 35.40 -.29 ...... RTrFidn d18.95 -.01 19 16 RrstEngy u48.63 +.89 36 17 FishrSd 64.02 +.14 26 21 lRaRock u71.17 +1.79 26 20 Ruor 58.49 +.57 14 13 FootLockr 27.06 +.79 8 9 FordM 10.40 +.26 18 16 ForestLab 39.45 +.70 17 16 FortuneBr 90.08 +2.61 23 18 FrankRes u76.36 +2.17 1710 FredMac 65.43 +.98 24 13 FMCG 37.15 +41 18 Freescalen 21.18 -.14 SFreescBn 21.34 +.04 5 5 Fremont 23.71 +.96 8 9 FriedBR 14.18 +.16 15 15 FrontOw 29.17 -.13 3 .. Frontline 39.79 -.19 10 18 GATX 33.81 +.62 ....... GabelliET 9.00 -.01 34 13 Gallghr 26.67 +.11 28 21 GameStp 32.42 +.84 15 14 Gannet d72.25 +.16 17 14 Gap 19.95 +.40 17 Gateway 3.33 +.04 98 59 Genentch 82.50 +2.17 17 15 GenDyn 111.25 +1.23 21 18 GenElec 35.15 +.54 41 74 GnGdhPrp 40.65 +.16 18 16 GenMills 50.61 +21 46 72 GnMotr 34.36 +.89 ... GMdb33 21.40 +.49 12 12 Genworth 3026 +.37 13 11 GaPadif 32.40 +.80 ...... Gerdaus 9.6 +.28 41 31 Getlylm 75.80 -1.65 29 25 Gillette 51.09 +.65 ...... GlaxoSltn 48.87 +.02 51 18 GlobalSFe 40.61 -.68 ......GoidFLtd 10.65 -.18 36 23 Goldcrpg 15.43 -.11 15 13 GoldWFs 65.75 +.85 12 11 GoldmanS103.96 +.76 28 19 Goodrich 41.35 +1.02 11 14 Goodyear 14.95 +.68 ...... vGrace 7.88 +.21 21 17 Grao 33.63 +.66 23 8 GrafTech 4.45 +.41 38 18 GrantPrde 25.75 -.98 20 21 GtLkCh 31.85 +.75 14 16 GtPlainEn 31.97 +.32 14 ... GMP 29.34 -.14 15 13 Grisfon 22.086 +.56 19 17 Gtechs 28.93 +81 ...... GuangRy 17.95 +.02 39 23 Guidant 65.7C +.90 20 17 HCAInc 57.70 +.22 .. 19 Hallibtn 47.88 -1.12 ...... HanJS 15.13 +07 ..... HanPIDiv 9.23 -.07 .. HanPtDv2 12.05 +.05 Hanson 48.20 -.10 16 15 HareyD 50.14 +.02 27 22 Harman 8324 +2.39 ... HamnnonyG 8.21 +.06 21 18 HarrahE 72.94 +2.71 10 10 HarfdFn 76.66 -.60 ...... HardlF6un 68.89 -.64 ...... HarfF7un 70.06 -.69 22 16 Hasbro 20.37 +.45 18 16 HawaiEl 26,84 +.19 28 30 HICrREIT 37.62 +.55 19 16 HftIgt 26.09 +.42 27 28 HIthcrRIf 38.40 88 15 HealthNet u38.75 +.54 . 30 HedaM 4.47 +.01 17 15 Heinz 35.48 +.14 ... HellnTel 9.54 +17 44 18 HelmPay u46.04 -.43 ... 12 Hercules 14.32 +.31 27 26 iershey 62.91 +.75 23 18 HewitlAsc 26.05 +.43 20 15 HewleOtP 23.66 +.15 16 15 Hibem 31.93 +.07 ... 12 HghwdPIIf 29.42 +.33 35 26 Hilton 23.74 +.30 17 14 HomneDp 39.31 +.84 21 17 Honwlllnl 36.97 +.67 20 22 Hospira u39.61 +.85 ... 36 HoslMarr 17.41 +.06 11 8 HovnanE 65.97 +2.29 14 12 HughSups 28.32 +.39 20 17 Humana 38.69 +.84 25 18 IMSHIth 24.64 +.07 30 21 ITTEd 52.35 +.67 20 18 [TTInds 97.84 +1.19 16 17 Idacorp 30.63 +.36 18 15 ITW 81.24 +1.50 25 21 Imtion 38.57 +1.48 4 7 ImpacMtg 21.55 +.61 12 10 INCO 38.18 +.35 13 9 Indymac 40.73 +.54 10 12 IngerRd 72.99.+2.19 11 11 IngrmM 15.33 -.07 ... 29 InputOut 6.41 +07 ... 5 IntegES 1.70 +.19 15 15 IBM 75.30 +1.42 26 21 InGame 28.74 +.51 ... 16 IntPap 31.44 +.01 24 18 IntRect 48.06 +.47 .. 19 Interpublf 12.28 -.51 5 Ipscog 43.74 +98 35 IronMn '30.15 +.47 29 11 JPMorqmCh 35.92 +.33 31 20 Jabil u31.28 +.22 17 28 JanusCap 15.30 +.17 22 18 JohnJn 66.07 +.42 13 12 JohnsnCt 56.62 +1.17 13 11 JonesApp 30.78 +.04 11 8 KB Homes 76.05 +2.05 8 10 KCSEn 1720 -.37 ... KKRFnn 24.95 +.46 21 17 Kaydon 28.01 +46 27 19 Keane 13.75 20 18 Keltogg 44.75 +.34 13 12 Kelaxood 27.07 +.47 19 9 KerrMcG 76.22 -.46 14 12 Keycorp 33.27 +.54 15 17 KeySpan 40.75 +.33 17 16 KtmbCk 63.23 +.62 50 12 KingPhnm 10.03 +.37 .. 24 Kinrossg 5.78 -07 260 21 Kohls 56.14 +.54 ...... KoreaEIc 15.84 -.33 19 16 Kraft 31.92 +43 ... 39 KrspKrmi 7.10 +.12 .. 14 Kroger 1925 -.15 14 ... LLERy 6.22 -.15 .. 19 LSILog 8.60 +25 14 LTCPrp 20.85 -.14 20 13 LaZBoy 14.26 +.34 .. LaQuinta u9.50 +.23 18 16.Laclde 31.95 +70 8 24 Laidlaw 24.05 +.05 8 13 Learcorp 36.88 +1.26 30 23 LeggMassu104.20+4.21 11 11 LehmBr 98.65 +.63 10 8 LennarA 63.75 +.70 15 14 Lexmark 66.05 +.46 ...... LbtyASG 5.92 +.04 93 68 LibyMA 10.27 +.02 29 19 UllyEli 56.66 +.22 15 15 Umited 21.58 +.33 11 11 UncNat 47.51 +.61 58 35 Undsay 24.80 +1.10 .. 23 UonsGIg 10.90 +.30 21 17 LockhddM 64.42 +.92 11 10 Loews 77.75 -.95 7 13 LaPac 24.85 +.40 20 16 LowesCos 58.00 +1.06 12 16 Lucent 3.00 +,04 19 7 Lyondell 25.91 +1.09 17 15 M&TBk 106.57 +1.72 11 10 MBIA 60.81 +2.32 13 10 MBNA 21.30 +28 15 14 MDURes 27.95 +.13 13 13 MEMC 15.96 +.46 ...... MCR 8.69 -.06 28 22 MGMMirs 39.83 +1.00 29 29 MackCali 45.62 -.28 ... Madeco 9.16 -.10 18 9Mgag 09 19 I 14i or-o2.5+0 10 9 Magnal g 70.97 +1.97 ... ... MgdHi 6.32 -.01 16 13 Manpwl 39.39 +.29 ... 13 Manulifg 48.63 +.17 14 11 Marathon 53.96 -1.62 14 MarshM 27.68 -.08 ... MStewrt 29.40 -.15 18 16 MarveE 19.27 -.07 15 13 Masco 32.65 +.72 47 12 MasseyEn 37.61 -.08 ... 12 MatSdlf 14.45 -23 13 14 Matlle 17.97 +.37 6 8 MavTube 29.33 +.50 ... 30 Maxtor 5.13 26 21 MayDS 40.54 +79 ... 23 Maytag 15.95 +.15. 14 14 McDnkds 28.24 +.08 23 20 McGwHas 44.34 +79 ... 18 McKesson 43.26 +.87 22 21 McAfee 26.81 +97 .. 20 MeadWvco 28.92 +62 29 21 MedcoHIth 54.00 +27 31 20 Medcis 30.89 +.73 36 24 Medmoic 53.00 15 15 MellonFnc 28.60 +26 24 19 MensWs 34.70 +1.09 12 13 Merck 30.97 +.47 14 9 dMeidRes 4.89 -28 13 11 MentlLyn 55.57 +.66 11 11 MetLife 45.37 +.47 ...... MetULife un u26.30 +21 26 21 MichStrs 41.59 +1.29 30 21 McrnT 10.25 +.08 98 ... MhMpt 45.00 +.90 4030 Midas 22.90 +.59 ...... Mllacron 1.93 -.06 25 21 Millipore 54.35 +.55 21 .. MilsCp 59.90 +51 63 9 MobleTels 33.14 +.87 34 27 Monsnto u67.84 +1.8 31 26 Moodyss 45.37 +.68 13 11 MoroStan 53.02 -.03 ..... MSEmMkt 18.15 +.19 .7 MtgeT 18.51 -28 ... 16 Mosaic 15.40 +.40 27 17 Motorola 18.35 +.16 .. MunlenhFdull.51 +.05 14 16 MurphOs u53.86 -1.01 26 19 MylanLab 19.33 +31 22 21 NCRCps 36.63 +51 9 11 NatlCity 34.72 +.54 S 1 15 NatFuGas 28.62 +.10 ...... NatGrid 49.22 +.76 13 .. NIHIthlnv 28.24 +.64 32 21 NOilVarco 47,01 -.49 21 23 NatSemi 22.11 +.61 20 17 NavigCons 17.92 +.64 8 6 Navislar 32.08 +1.05 58 36 Navteqn 37.99 +.72 ... .:. NewAm 2.14 6 6 NwIentFn 50.38 +.54 17 17 NJRscs u48.02 +1.12 15 12 NYCnltyB 17.96 +.03 ... 16 NeweiRub 23.76 +27 16 10 NewfExps 39.64 -.88 39 34 NewmtM 38.62 -.46 72 23 NwpkRs 7.16 +.23 SNewsCAn 16.41 -.05 ... 21 NewsCpBn 17.24 -.07 16 16 NiSource u24.99 +.35 19 19 Nicor 41.72 +.93 21 17 NikeB 88.00 +2.23 51 19 NobleCorp 61.24 -1.96 12 10 NobleEngy 74.76 -1.54 ... .. NoklaCp 16.98 +.04 22 18 Nordstr 67.60 +1.93 13 12 NorflkSo 31.26 +1.25 ... 23 NortelNet 2.70 +.07 14 11 NoFrkBcs 27.85 +.33 ... 17 NoestUt 20.90 +.05 17 19 NoBordr 48.60 -.50 16 14 NorthropG 55.67 +1.07 ... 17 Novartis 4729 -.36 18 16 NSTARs u30.50 +.30 6 7 Nucors 47.67 +1.50 22 18 Nuveenlnv 37.40 +.12 ...... NvFL 15.49 -.03 ...... NvIMO 15.63 +.01 ...4 OCAIncf 1.85 +.10 17 16 OGEEngy 28.80 +.39 6 7 OMICp 18.93 +.33 11 10 OcciPet 78.97 -1.36 22 17 OfMcDpt 23.04 +98 11 10 OldRepub 25.23 +.03 14 8 Olin 1820 +.41 19 16 Omncre 42.39 +1.55 20 17 Omnoom 79.72 +1.33 4 5 OreStt 17.79 +.83 20 15 OHkshTrk 76.63 +.53 21 16 OuthkStk 45.02 +28 9 16 PG&ECp 37.42 +.29 11 9 PMIGrp 39.27 +.72 13 12 PNC 54.65 +43 19 17 PNMRes 29.33 -.30 .. 4 POSCO 45.17 +.72 17 12 PPG 64.13 +.98 16 14 PPLCorp 59.83 +.40 21 17 PacdCre u71.60 +1.64 25 24 Packsmer 21.40 +.82 94 17 PaylShoe 19.70 +.43 34 16 PeabdyEs 52.44 -.11 ... Pengrthg 22.35 -.07 17 PenVaRs 47.15 +.24 23 15 Penney 52.50 +.96 37 PepBoy 13.45 +.38 17 15 PepsiBot 28.70 +.16 22 20 PepsiCo 54.83 +.55 20 18 PepsiAmeru25.44 +.21 24 16 PerkEm 18.75 +.59 15 ... Prman 15.08 -.37 5 6 PeBroKazg 38.75 +.60 ... 11 PetChina 74.07 +32 ...... PetbrsA u46.03 -.47 ...... Pelrobrs 52.73 -.24 23 13 Pfizer 27.90 -.18 8 8 PhelpD 93.71 +1.70 20 18 PiedNGs 24.14 +.04 35 33 Pier1 14.40 +30 ...... PimcStrl 12.36 -.31 17 14 PioNOI 41.85 -.75 20 16 PtnyBw 43.13 +.42 26 35 PlacerO 15.16 -.15 ... 12 PlainsEx 35.51 -.87 21 23 PlumCrk 37.04 +.34 13 11 PogoPd 5126 -.92 18 .. PostPrp 36.14 +.29 21 18 Praxair 47.17 +.69 ... 16 PreNOls 39.40 -1.15 12 11 Premcor 73.50 -1.05 .... 24 Pridelntl 25.26 -.49 .16 14 PrinFncI 41.85 +.02 20 18 ProctGam 53.33 +.66 15 14 ProgrssEn 45.67 +.95 13 14 ProgCp 99.78 -.87 36 '26 Prologis 40.45 +25 .. ProsStHiln 3.40 +.02 14 11 Providian 17.64 +.13 16 14 Prudent u66.28 +73 19 17 PKEG 60.25 +.61 40 16 PugetEngy 23.42 +.14 10 8 PuetaHmn 84.47 +1.37 ...... PHYM 7.14 +.81 ...... PIGM 9.61 -.10 ...... PPrIT, 6.45 -.02 12 10 Ouanexs 53.15 +2.40 ... 34 QuantaSvc 8.72 +13 22 18 QstDiags 53.61 +.76 92 39 QuikslvR u64.06 +.19 21 17 Quikstilws 15.95 +.35 ... O... QwelstCm 3.70 +.07 6 8 R&GFnc 18.00 +.90 19 13 RPM 18.21 +.29 9 9 Radian 47.05 +.90 12 12 RadioShk 23.59 +.40 17 16 Ralcorp 41.18 +.94 38 18 RangeRscu27.46 -.32 16 13 RJamesFn 28.07 +27 24 24 Rayonier 53.53 +.46 40 18 Raytheon 39.32 +.28 23 23 Rlylncos 25.45 +.43 13 12 Reebok 42.20 +1.53 35 19 RegalEnt 18.63 +.23 16 13 RegionsFn 3426 +.36 38 RellantEn 12.42 +.05 26 22 RenaCare 46.27 +.48 ...... Repsol 25.67 -.25 .. 26 RetailVent 12.87 -.19 ...... Raevlon 3.10 +.03 9 51 RteAid 4.10' +.07 25 20 Robtalf 25.00 +70 17 17 RodkwAul 4925 +1.40 19 16 RoHaas 46.05 +.668 61 18 Rowan 29.71 -.50 20 16 RyCarb 47.85 +.67 11 ... RoylDut u65.97 +1.52 . Royce 18.80 +.15 10 10 Ryder 35.04 +.44 12 9 Rylands 76.30 +2.57 26 SAP AG 42.75 +.42 16 16 SBCCom 23.70 +.13 19 15 SCANA 42.72 +24 13 19 SLMCp 50.77 +1.12 30 ... STMicro 15.84 +.15 S.. SigdSci 1.26 -.03 1615 Sa eway 23.23 +.13 68 44 SUtJoe 81.74 +1.81 38 28 Studes u44.15 +1.09 47 8 StPaulTrav 38.91 +.33 22 26 Saks If 17.51 +.35 94 Salesforce 20.66 +.42 ...... SalEMlnc2 13.27 +.06 ...... SalmnSBF 13.02 +.09 15 ... SJuanB 42.20 -.85 13 13 SaraLee 19.61 +.20 ... 49 ScherqPI 19.51 -.13 30 25 SchImb 76.55 -1.63 57 20 Schwab 11.49 +.08 20 19 SciAtanta 32.42 +.37 S...... saotltPw u35.63 +.53 22 9 SeagateT 17.45 -.65 11 13 SempraEn 40.88 +.12 14 13 Sensient 21.08 +.55 .. 24 SvceCp 8.02 +.06 12 19 Svcmstr 13.37 -.03 ...... ShellTr u59.16 +1.24 16 15 ShopKo 24.33 +.18 56 78 Shurgard 45.90 +`35 ... SiderNac 16.71 +.08 28 22 SierrPac 12.69 +.05 ... ... SilcGph h .71 50 50 SimonProp 72.40 +.73 ... Sixlags 4.62 +14 20 13 SmithAO 26.16 -.26 31 21 Smithlnt 63.12 -.88 10 10 SmithfF 27.57 +.17 .. 16 Solectm 3.71 +.17 ... .. SonyCp 34.76 -.14 17 16 SouthnCo u34.91 +25 ... ... SPeruC 43.18 +.98 31 25 SwstAid 14.05 +28 29 24 SwnEngys 43.15 -.25 .. 46 UdMiro 4.13 +7.6 16 12 SovrgnBcp 22.37 +93 2319 UPSB 69.82 +1.42 ... 17 SpmFON 24.79 +.24 13 1 Bap 29.25 +25 9 7 StdPac 87.43 +1.60 1312 USBancrp +. S... Standex 2954 +1.60 3 5 USSteel 35.00 +.90 29 25 SlaiwdHt 58.34 +1.18 19 16 UtdTechs 53.02 +1.50 21 17 StateStr 49.17 +.84 25 20 Utdhlths u52.69 +1.37 ... 11 Statol 20.09 +.22 21 18 Steris 25.89 +.72 37 30 Unsion 28.20 +.38 21 20 StrTch 36.30 +04 13 13 Unocal 65.79 +.01 S sTodn 43.45 -.46 ... 35 Unova u26.91 +.68 39 25 Styker 47.88 +1.02 1210 UnumProv 1822 +b2 55 18 SturmR 8.18 ...... SunCmts 37.15 +.65 18 Suncorg 47.75 -1.15 23 22 SuGard 35.13 +1 ... 58 ValeantPh 17.93 -07 13 13 Sunoco u113.60 -2.61 1010 ValeroEs 78.54-2.41 14 13 SnTrst 73.16+1.18 mn 12 13 Supvalu 32.73 +.23 14 V' laCn 13.56 -.6 27 21 Symblrr d10.47 +.08 VKHllIncT 3.73 -.02 25 21 Sysoo. 36.26 +51 31 23 VadanMs 37.59 +1.04 14 13 TCFFnds 26.06 +.26 20 16 Vetren u28.73 +32 21 13 TDBknorlh 29.83 -.14 12 1 z 3.6 19 15 TJX 24.39 +.57 ...... ViaomB 32.64 +.42 ... 12 TXUCorp 82.45 +10 6 11 VinrgPt 30.32 +.'12 ... .. TXUpfD 6680 +.15 ... Veon 6.11 +,13 ...... TaiwSeml 925 1620 Target 5.67 +.95 Vdafone 24.44 +.03 ...... Teekayun 49.95 +.95 11 11 WHolds 10.20 +.54 ...... TelMexLs 18.92 +29 12 8 WC[Cmits 32.54 +120 22 17 Templelns 37.25 +119 12 8 Wabash 24.59 +44 27 19 TempurP 23.25 +.03 ... ... TenetHIt 12.40 -.01 3 11 Wachovia 50.40 +67 24 21 Teppo 41.45 -.07 16 15 WaddeiR 18.51 +.40 36 ... Teradyn 12.72 -.12 19 17 WalMart 48.43 +.91 15 12 Terra 6.89 +.10 31 10 ... TerraN 268.49 +.14 3127 Walgm u47.29 +1.44 11 11 Tesoro 47.01 -.67 24 9 WalterInd 41.44 +.94 34 17 TelraTech 31.35 +25 13 11 WAMutM 40.90 +25 26 22 Texlnst 28.26 +.73 18 17 WsteMInc 28.79 +.47 24 17 Textron 76.20 +. 20 18 Waters 37.4 -.42 .Theragen 3.25 -.08 12 16 ThermoEl 26.75 +27 24 22 WatsnPh 30.12 +.37 17 15 ThmBet 28.53 +.68 24 20 Weathflnt 58.70 -1.70 10 10 Thombg 29.34 -.22 8 Wellmn 10.15 +,02 20 17 3MCo 77.10 +1.31 15 21 Tiffany 32.75 +.47 23 16 WelPsits 6849 +.92 24 20 TimeWarn 16.97 +.07' 15 13 WellsFrgo 61.34 +.74 13 10 Timken 23.52 +.04 94 19 Wendys 47.01 +.60 . 19 TtanCp 22.69 +.14 11 15 WestarEn 23.86 +.41 ... 18 Todco 24.70 -.25 12 ... ToddShp 18.88 -.03 WAsITIP2 12.65 -.82 15 10 ToIBros 102.05 +2.53 15 11 WDigit 13.25 +,05 .. 14 THilfgr 13.38 +.34 11 15 Weyerh 66.16 +1415 .. ... TorchEn 6.45 -.10 1211 Whrpl 7031 +29 12 11 Trohmrk 53.16 +.73 1 7 +1 13 TorDBkg u4525 +.73 10 10 WhiingPet 36.75 -1.11 ...... TolalSA 117.94 -.10 11 ... WilmCS 16.23 +.12 28 23 TotalSys 23.26 +.35 29 20 WmsCos 18.50 -.19 TwnCtry 28.65 +.22 13WisGp 32.31 +.32 24 25 ToyRU u26.49 +.04 .. 13 WMlsgp 32.31 +`32 80 20 Transocn 54.20 -1.76 17 14 Winnbgo 33.25 +.52 18 14 Tredgar 15.51 +.46 15 16 WiscEn u38,31 +1.01 ...... TreaHsend29.65 -.90 811 Woihgtn 15.80 +24 ...... TdCootl 17.94 +.14 27 18 TnidH 54.97 +.07 31 27 Wrigley 69.60 +1.10 20 16 Tribune 35.65 +.07 39 15 Wveth 44.89 +1.89 28 14 Tcoln 30.02 +.26 9 7 XLCap 74.00 +.15 18 13 Tyson 17.62 +.18 20 13 XTOEgys 33.60 -.95 14 16 UGICorpsu27.03 +.33 24 15 XelE 19.45 6 9 23 UILHold 53.68 +.95 2415 elngy 19.45 16 33 33 USEC 14.31 +.61 17 14 Xerox 14.00 -,03 6 8 vUSG 44.55 +1.89 19 16 YankCdl 32.18 +,93 19 17 UniRrst 40.95 +1.30 21 19 YumBrds 52.04 +.78 30 16 UnkonPac 65.02 +1.81 .. 36 Unisys 6.19 +.09 31 23 mmer 77.62 +1l28 41 ... UDomR 23.65 -.01 ...... ZweiglT 5.14 +.01 AMEICNSTCECANG PE PPE Name Last Chg ...... CanAgo 1.10 +.06 SAbdAsPac 6.28 +.02 ... CanoPetn 5.15 +.08 8 ... AdmRsc 20.27 -.33 ...... Chenieres 28.26 +.51 SAleon d21 -.01 C...... CrcleGp 1.20 +.13 SAmO&Gn 5.97 -.14 ..... CogentCrs 6.84 -.13 SApexSllv 12.72 +.13 17 15 ComSys 10.30 -.18 SApolloGg .29 -.01 .. ... Crystalxg 3.52 -.14 SAvanirPh 2.79 +.10 13 10 DHBInds 8.80 +.50 .. BemaGold 2.29 +.05 ...... DJIADiam103.96 +1.01 ...... BotechT 170.00 +3.45 ...... DSLneth d.08 -.01 .. CalypteBn .17 +.01 16 .. DaniHd 11.74 +.07 .. 19 Cambiorg 1.92 -.03 ...... DesetSgn 1.48 +.02 ... CdnSEng 1.59 +.01 ...... EaaleBbnd .25 +.01 ..... EVLdDur 17.88 ...... EdorGldg 2.40 -.05 ... ... swth 7.64 +.05 ... ... eMagin .90 -.01 10 ... EmplreRs 9,70 +120 ...... Endvrnlot 380 ...... EnNthg 1.80 -.61 ...... FTrVLDv 14.68 +.08 16 ... FlaPUIl 18.60 +.10 ...... GascoEnn 3.75 +.09 ... GeoGlobal u695 +3.56 ...... GlobeTeln 2.99 -.03 25 GoldStqr 3.00 -.10 44 13 GreyWol 7.42 -.10 ...... Gurunetn 16.10 +.10 ... ... Harken .44 ...... HemoSenn 5.52 ...... -Trax 1.54 -.05 ...... INGGRE 15.3 6 .16 ... ... iShBrazil 24.67 +.13 ...... iShGerm 17.80 +.19 ...... IShHK u12.48 +.08 ...... IShJaan 10.25 +.07 ... iShKor 32.50 +.10 ... iShMalasia 6.96 +.06 ...... iShMexio 27.00 +.18 .. iShSing 7.49 -.03 .. iShTaiwan 12.44 +.13 ..... iShSP500 120.24 +1.05 ...... iShEmMkts 72.24 +.54 . iSh2OTB 95.99 -.66 ... iShEAFEs 52.68 +.30 .. iShSPMids 68.79 +.90 .... ShNqBio 68.40 +1.25 ... ShRIO0OV 67.12 +.32 ... iShR100G 48.43 +.56 ... iShRuslOO 64.98 +.48 ...... iShR2000Vs64.58 +1.28 ... iShR200OG65.10 +1.40 .iShRs2000s6334 +.97 .... iShREsts 63.40 +.31 ...... iShSPSmls54.90 +.90 ..... InSiteVs .71 -.07 3 ... IngSys 2.01 -.01 74 39 Intermixn 8.16 +.16 ... 46 IntrNAP .46 +.01 ...... InttHTr 55.22 .06 ... 30 InlerOilgn 27.78 +.38 ...... Isolagen 4.20 +.01 30 19 IvaxCps 21.34 +.18 ..... KFXInc 13.88 -.22 ..... MadCatzg 1.19 -.01 7 17 MetlroHtn 2.58 -.05 26 16 Nabors 59.55 -1.74 ... 10 NOrong 2.38 -.07 11 27 NthgtMg 1.06 -.07 39 ... OdysMar 5.04 -.04 ...... OilSvHT 101.90 -2.27 27 15 PainCare 4.37 +12 ... ... Palain 1.79 . PaxsnC .59 +.02 ...15 PetrodEg 15.74 -.49 PhmHTr 74.25 +.72 51 17 PionDil 15.37 -.29 Prvena .92 +.02 ... 15 PromvEg 10.42 -.04 ......Qnslakegn 22 66 41 RaeSyst 3.30 -088 ... RegBkHT 135.61 +1.45 ......ReailHT 96.69 +1.54 ... .. SemiHTr 34.07 +.45 ...... Sinovacn 2.92 +.87 ..16 SPDR 120.15 +1.00 ... SPMi 125.49 +1.62 ... 14 SPMatls 27.70 +.43 ... 19 SPHrhC 31.28 +.31 ... 18 SPCnSt 23.01 +.29 .. 14 SPEnav 44.78 -.85 ... 12 SPFnd 29.52 +.22 ... ... SPInds 29.76 +.51 .. 20 SPTech 20.08 +.25 ... 17 SPUIl 31.62 .+.31 ...... Stonepath .93 +.02 94 29 TelDatas 39.92 +.58 ...... Telkonet 5.02 +.08 4 ... TeltonPet 4.30 -.23 47 ... TransGIb 6.57 -.66 25 UlraPIgs 29.20 -.75 8 ... VaalcoEn 3.52 -.12 34 11 Wstmind 20.34 -25 ... ... Wyndham 1.11 ATIONALMARKE PE PPE Name Last Chg .. 11 ABXArn 8.15 37 24 ACMoore 30.97 +1.09 21 19 ADCTelrs 21.35 +.67 2 20 AFCEnts 13.18 +.13 .. 16 ASMLHId 16.12 +.03 17 14 ATITech 12.03 +.16 30 28 ATMIInc 29.64 +.60 .. ATSMed 3.35 +.06 ...... Aasrom 3.00 +.12 .. Abgeni 8.72 ... AbleEnr 15.17 -,81 4 ... AbleLabs 3.39 -.04 7 6 AccHme 44.36 +1.31 30 25 Accredo 44.48 +,23 ... ActivCrd 4.44 +.04 26 22 Actvisns 16.95 +.17 63 9 Actuate 1.90 28 23 Acxiom 20.99 +.42 ... Adaptec 4.03 +.11 28 24 AdobeSys 28.70 -.14 ... AdobrCp 9.50 +.28 28 22 Adtran 24.45 +.32 7 ... Advanta u25.62 +1.18 8 13 AdvantB u28.50 +1.46 28 17 Aerofex 8.38 +.21 10 8 AfflnsHidn 16.15 +1.01 53 44 Alfymet u53.99 +1.99 23 16 Agisys 15.86 ...... AirNelrs 1.77 +.40 ...... AirspanNel 5.87 +.02 41 24 AkamaPir 13.61 +.41 ...... Akzo 39.37 +07 ... 33 Alamosa u13.81 +27 ... AlaskCom 10.06 +.04 10 ... Aldila 19.85 +.44 .. Ale)don 23,70 +.48 46 58 AllgnTech 7.40 +.44 Alkerm 13.47 +.30 ... MlianSemi 2.51 +.26 .. 45 Alscripts u17.12 +.80 ..... tairNano 2.81 -.05 26 23 AlteraCp 19.52 -.19 25 14 Aris 14.50 +.33 .. 29 Avarion 11.32 +.17 26 43 Amnazon 33.71 -.79 21 17 AmegyBSc20.82 +1.98 .. AmrBowt .24 .. 11 AmCapStr 35.83 +.05 20 18 AEagleOs 31.53 +1.20 41 30 AmHIthwys 39.87 +1.32 .. 27 AmrMeds 20.59 +.74 43 20 AmPharm 41.00 +.26 26 23 APwCnv 2428 +28 28 22 Ameritrde 18.77 +.48 32 20 Amoen 61.79 +.71 ... AmkorT 4.62 +.07 ... Ayi 20.51 +.93 24 38 Anklogc u 50.09 +1.77 32 ... Analysts 3.48 +.08 11 ... AnySur 1.89 +.04 58 18 Andrew 12.84 +29 20 17 AndrxGp 20.33 +43 .. 14 Angiotchg 14.15 +.49 .. 67 Animas 20.75 +.41 77 27 ADolloG 79.13 -1.10 41 25 AppleCs 37.31 +21 19 15 Applebees 25.90 -.86 .. 50 AppldDgl 3.39 -.02 .. Apldlnov 4.43 -.02 19 21 ApdMal 1631 +.08 29 AMCC 2.59 -.04 28 43 aQuantrveul8,05 +1.51 24 7 Arbinetn d6.50 -.11 ... ArtadP 6.75 +.41 21 Arbalnc 6.00 +.14 ... ArmHd 6.40 -.04 17 Arris 8.56 +.03 14 AnTech 1.06 -.04 ... 33 ArlhroCr 34.96 +1.87 32 3B Asialnfo 5.69 +.16 37 20 AskJvs 3120 +.63 19 18 AspectCm 11.49 +.76 ... 33 AspnTc 5.52 -.18 14 13 AsscdBanc 33.42 +.43 ...... AtRoad d2.49 AthrGnc 16.22 +.7 46 00 Atheros -8.2 +06 ... Atmel 2.47 -.05 . 65 Audible 17.60 +.85 54 22 AudCodes 10.18 +.06 5 24 Audvox 15.90 +.08 ... 22 AugstTc 11.79 +1.00 ... Authentdte 2.66 +.18 34 27 Autodsks 34.81 +.86 . Avanex .94 +.02 25 18 AvidTch 53.58 +.92 .. 19 AvoctCp 26.21 -.03 ... Aware 6.28 +.28 14 24 Axelis 7.07 +.16 .. Axonyx 1.38 -.20 .. 21 BEAero 16.03 +29 27 19 BEASys 8,95 +.25 ...... BallardPw 4.89 +.12 28 23 BankMutl 11.30 +98 .. BankFndn 13.40 ... .. BeaconP 1.07 -.03 27 22 BeasleyB 14.58 -.02 45 32 BebeStrss 27.25 +1.03 25 21 BedBalh 42.41 +.98 20 12 BellMic 9.56 -.31 ...... Bioenvisnt 7.10 -.22 20 Bogenidc 34.36 +.37 ... BioMarn u7.72 +.33 27 19 Bomet 34.98 +.51 .. Biopurers 1.38 -.11 .. 27 BIkbo'ard u22.90 +.18 73 31 BluCoat 30.11 +1.65 22 22 BobEvn 22.86 +39 37 27 Borland 6.67 +.34 3 17 BostnCom 2.09 -.06 19 15 Brightpnt 21.22 +.39 52 30 Brdcom 36.65 +.59 ...... Broadwing 4.55 +.03 13 10 BrcdeCmil 3.94 +.03 41 22 BrooksAut 15.20 +.39 ...... BldrFstSrc n15.99 +.79 42 ... BusnObi 27.11 +.24 .. 16 C-COR 6.78 17 14 CBRLGrp 39.61 -1.69 .. 20 CDCCpA 2,96 +.09 20 17 CDWCorp 56.75 +.87 33 27 CHRobn 57.71 +.77 64 ... CMGI 1.92 +.03 ... 32 CNET 10.47 +.25 37 29 CUNO u71.57 +.37 ...... CVThera 22.05 +.92 22 17 CalDive 52.23 -.51 32 31 CalMic 5.68 +.19 25 18 CapAuto 37.70 +.06 18 20 CapClyBk 41.77 +1.62 ...... CpstnTrb 1.33 +.08 :.. ... CardkiaSd 1.04 +.09 13 33 CardioDyn 2.26 +.11 21 15 CareerEd 38,51 +.15 34 26 Carrizo 17.14 +.07 77 52 Celgenes 40.76 +.34 ...... CellThera 2.68 -.07 23 16 CenterFn u24.33 +.83 19 5 CentAl 20.35 +.10 ... 12 Cephrn 38.55 +.67 19 13 Ceradynes22.36 +2.23 ...... Chris vrdu24.70 +2.40 17 14 ChnnrmSh 9.60 +.53 ...... ChadrCm 1.23 +,03 18 15 ChkPoint 19.93 +.04 68 22 ChkFree 34.05 +.65 14 13 Checkers 13.00 -.16 8 27 Cheroklnt 3.75 +.05 32 19 Chi[dPc 48.60 -.74 ... 22 Chlron 35.63 +.74 .. ... Chordnt 2.06 +.06 89 24 ChrchilD 42.85 +1.48 ... ... CienaCp 2.12 -.01 23 19 Cintas 38.43 +.61 ... 26 Crrnus 5.37 +.28 23 18 Ciso 19,16 +.13 24 20 CirixSy 22.00 -.11 ... 15 CleanH 22.15 +.35 46 37 Cogentn 27.75 +1.48 61 40 CogTech 47.36 +1.18 23 21 Cognosg 35.04 +.61 28 26 Coherent 36.30 +1.57 ...... EricsnTI 32.53 -:15 ...... Idenfix 5.14 +.16 ,_i_',] 62 30 CidwtrCrs 22.80 +.95 ...... EuroTechs 4.17 +.10 Illumina 12.45 +.79 2816 M-SysFD 19.68 -.11 Comarco 8.00 .. 51 28 Euronaet 29.04 +.57 33 24 ImaxCp 10.24 +.34 1211 MCGCap 17.04 +.15 58 40 Comcast 31.20 +.05 ... .. EvrgrSIr 6.45 +.12 35 21 Imclone 31.60 +.15 MClncn 25.69 56 41 Comcsp 30.41 +.08 ...... Exelixis 7.40 +.10 68 27 Immucors 28.69 +.54 19 MGIPhr 20.90 +.52 12 11 CmrdCapB 17.17 +.80 .. ... ExideTc 4.35 -.46 ... 15 ImpaxLablll16.04 -.25 24 21 MIPSTech 7.18 +23 15 13 CompsBc 44.51 +.09 34 27 Expdlnt 50.20 +.90 .. 15 nPhonicn 14.69 +.5 815 MIVA 4.55 +03 13 10 CompCrd 33.01 +.57 26 10 ExpScdpts 50.19 +.17 ...... Incyte 7.20 +.10 MRVCm 2.24 +10 35 17 Compuwre 6.95 +.24 35 27 FxtNetw 4.15 -.02 ...... IndevusPh 2.61 +.03 22 2 MTS 33.86 +.86 26 22 Comtechs 3324 +1,24 ...... Eyetech 12.78 +.22 9 16 InfoSpce 33.51 +.83 MacroCh .30 -.05 66 37 Conmvers 23.90 -.17 37 30 F5Netw 45.02 +.64 ...... InFocus 4.34 +.06 70 33 Macmdia 38.24 -.16 ... 67 ConcCm 2.12 +09 51 29 FEICo 23.52 +.89 ... 24 Intormat 8.65 +.44 13 17 MageInHI 35.49 +82 .. Conexant 1.50 +.02 31 23 FLIRSyss 29.53 +1.09 50 36 Infosyss 75.48 +1.53 MagelPI 249 -.12 28 15 Conmed 30.47 +.66 .. FXEner 10.56 +.71 45 ... IniknePh, 3.18 +.01 .. 19' Magma 9.00 +.53 36 20 Connetics 17.66 +.63 33 26 Fastenal 60.24 +v83 ... 7 Innovo 3.23 -.47 29 21 ManhAssc 20.05 -.17 15 12 CorinthC 12.76 -.10 16 13 FilhThird 41.68 +.42 35 24 Insinet 5.26 -.01 Manugist 1.72 +.06 52 38 CorpExc u75.16 +.60 32 28 RleNet 25.83 +1.08 24 23 IntegCirc 20.64 -.07 23 42 Martek 38.06 +.70 ...... Cosilnc 6.67 +.08 ...... FRnsar 1.08 +.05 89 19 InIgDv 10.67 -.06 62 30 MarvellT 38.73 -.02 22 20 Costco 45.39 +.68 15 12 FinUnes 19.07 +.38 ...... SSI 7.54 +,25 11 17 Mattson 7.34 -.05 ...... Crayinc dl1.31 -.10 268 16 FrstHrzn 18.73 +.64 20 17 Intel 26.33 +,47 25 23 Maxim 38.75 -.B08 ... 31 CredSys 9.20 +.22 21 16 FstNiagara 14.38 +.30 27 ... Interchgn 7.73 +.69 MaxwIlT 11.62 +.50 22 21 Croelenc 26.10 +.28 19 15 FstMenit 26.46 +.39 .. ... InterMune 12.99 +.07 .. 17 McDataA 4.15 -.02 ...... CriPath .46 -.07 20 18 Fiserv 43.34 +77 65 12 IntlDisWkn 7,78 -.34 ... 63 Medlmun 27.18 +.25 ...... CubstPh u1332 +2.39 23 15 Fextm 13.13 +.05 17 18 IntSpdw 55.60 -.09 ... Medarex 8.37 +.05 26 21 CumMed 1227 +.32 ...... FLYi .74 +.01 ... n.. temlcap 7.14 +.13 17 14 MedAct 17.87 -.33 ...... CurHtth 2.35 -.10 59 ... Fonar 1.18 ...... ntmlniU 7.88 +.01 77 29 MediCo 23.83 +.23 ...... Cyberonic 44.49 +.16 27 ... Forward 17.93 +.37 38 23 IntntSec 21.51 +39 ... 16 MentGr 10.36 +.51 60 32 CybrSrce 7.76 +.49 16 13 Fossil Inc 21.41 +09 86 28 Intersil 19.01 +.12 40 22 Merclntr 38.66 -.15 25 28 Cymer 2725 +.54 ... FosterWhn 18.07 +.59 14 15 Intervolce 8.74 +.20 5 7 MetalMg 19.19 +1.37 ...... Cytogen 5.44 +.11 32 24 Foundry 8.72 +.19 .. 32 IntraLasen 19.98 +.25 4 7 MetalsUSA 19.62 +.27 29 21 Cytyc 22.54 +.20 24 18 Fredslnc 16.90 +.54 .. 22 Intrado 14.99 +1.22 7 8 Methanx 15.98 -.12 ......_ _ Fm rAir 10.70 +33 2420 Intuit 45.27 +.44 33 29 Micrel 11.74 +.20 -.87 .. FuelCell 10.40 +.97 17 14 InvFnSv 37.94 +.67 27 24 Microchp 29.44 +.08 .. ... DRDGOLD .93 -.07 ...... Fmda .45 +02 37 22 Invitogn u8314 +1.14 50 18 Mcromse 5.50 -.05 ...... Danka 1.38 -,05 onatonn 820 79 21 McroSemi 18.94 +04 99 23 Datawatch 3.95 +.108 n.. atronn .20 .. 7921 Mk roSmi 18.04 +.02 ... .. DayStar 14.00 -.67 21 16 Gamin 11.52 +45 nic 273 -139 2 18 Microtune 525 +21 11 10 DeckOut 25.05 +.68 ...... Gemstar 3.64 +.10 .. 27 n 42 +1.39 23 ... Mirne 5 15 -.2103 ... decdGenetu8.96 +.51 40 27 GenPrbe 36.83 +.60 anhoeEn 237 -.06 Melhr 1.75 -.03 31 23 Delllnc 39.55 +.28 ... Genaera 1.64 +.02 59 3 0 a 19.13 +.41 .'-l nrh .1 39 19 DtaPtr 13.64 -.36 ...... GeneLTc .52 -.03 29 16 IxysCp 13.47 -.02 03223 6.1i,,",p 1 1 . Mindspeed 1.26 +.03 ...... Dndreon 5.48 +.17 ... 34 GenesMcr 18.60 +.43 36 15 Misonix 6.13 +.08 .. 36 Dennysn u5.08 +.40 ... Gentope 13.25 +-29 25 17 j2Gob 33.88 +1.04 68 11 MissnRes u8.21 +.25 ...... Depomed 4.53 +.28 ... Genta 1.09 +02 .. JDSUniph 1,53 -.02 .. Momenta 19.55 -.65 10 30 DiamClust 10.78 +.08 29 22 Gentexs 17.85 +.35 24 19 JackHenry 18.64 +.14 40 26 MnstrWw 27.27 +.59 47 27 Dglnsght 24.65 +.61 ... 26 Genzyme 61.02 +61 31 Jamdatn 28.71 +1.20 17 9 MovieGal 26.80 +.24 29 16 DgRiver 31.83 +.98 40 ... Geores 13.89 -.51 59 56 JetBlue 20.67 +.81 ...... Myogen 6.68 +.25 29 22 Dfigtas 11.70 +.50 ...... GeronCp 7.83 +23 Jmar 1.24 +.08 23 17 NETgear 18.87 +.14 8 7 DirectGen 18,84 +.68 ... 13 GigaMed 2.19 -.03 29 15 JoyGbls 34.47 +.36 69 29 NGASRs u6.19 +.65 3 ... DfiechCo 6.57 +.22 40 29 GileadSds 43.23 +1.21 8432 JnrNtw 25.18 -.09 34 21 NIIHIdg 63.42 +1.75 ...... DobsonCm 4.39 -.06 ... ... Gladstlnvn 15.00 -.09 20 22 KLATn 45.27 +.50 ... 30 NMSCm 3.03 +.25 15 14 DIrTree 24.35 +.35 24 ... Glenayre 3.90 -.01 2622 KenseyN 29.54 +g 18 ... NTLInc 66.15 +.81 16 16 DotHill 537 +.13 ...... GlobCrsg 16.75 +.19 KeryxBio 13.15 +.38 ..... Nanogen 3.80 +.03 42 42 DbleCdck 8.40 +.04 25 18 Globlind 8.35 -.23 12 14 Kfore 817 +.67 19 14 Nanomtr 12.60 +1.37 ...... DurectCp u4.81 +.61 ...... GlycoGenrs 1.02 -.01 2 14 Krce 0.1 19 Napster 4.11 -.06 ... DynMatl 40.78 +2.24 ... 9 GoldKistn 21.60 +.85 1324 Kogh Cap .. 27 Nasd1O0Tr 37.15 +.35 54 37 eBeys 33.45 -.18 ... 51 Googlen u302.00 -2.10 16 8 Komg 2.69 -1. ... 32 Nasdaq n 18.99 -.54 28 28 eResrch 13.55 +.40 .. 57 GrWifResn 20.15 -.05 1 83 KoplnCp u8407 +.08 .. 32 Nasech 18,56 -.04 16 88 EZEM 14.49 +.07 17 16 GrtrBay 26.23 +73 18 22 KosPhr 64.77 +1 .08 NastHn 14541 -.04 ...... Eaglekn 13.20 +.30 ... 17 Greenfldn 12.02 +.17 26 23 Kronos 41.29 +94 78 28 NekhCar 33.54 +.07 9 11 ErthUnk 9.24 +.09 ...... GuilfrdPh 2.31 +.06 71 23 Kuchke 7. +28 7828. NekharTh 17.2654 +.54 21 16 EstWstBcp 33.34 +.81 12 11 HMNFn 30.50 -.15 63 41 KCAhon 34.268 +.1 ... NeoseT 3.01 +.53 24 13 EchoStar 29.82 +.12 38 25 Hanson 85.80 +2.69 3634 LCAss 48.8 +111 ...... Net2Phn 1.41 ... 45 Eclipsys 14.69 +.56 20 17 HarbrFL 37.17 +.20 2621 LKQCp 2723 +.42 ... 20 Netease 57.97 +1.27 ...... eCostcmn 4.30 -.08 63 12 Harmonkc 5.02 +.08 24 17 LSllnds 14.06 +.16 62 62 Nefiin 16.08 +09 26 20 EducMgt 32.90 +.05 34 27 HithCSs 19.20 -.14 ..... LTX 512 +'.01 . NetRatn 13.34 -.26 17 ... EduDv 1025 +00 ... 20 HlhTroncs 1323 +.30 LaJolPh .87 49 35 NetwkAp 29.01 -.04 ... ... 8x81nc 1.78 -.06 23 19 HrlndEs 19.53 +.52 LaeEnsIl 16,55 +64 4. 35 Neu p 2.01ne 4 -.02 14 18 EletSd 17.55 +37 11 10 HelenTr 26,00 +.73 14 15 LamRsch 28,80 +.40 19 Newport 13.54 +.16 ...... EIctrgis 3.38 -.05 14 25 HelixTech 13.49 +.49 66 LamarAdv 4263 +1.2 12 16 NexteC 31.93 +.29 36 33 BectArs '57.58 +.43 28 20 HScheins 41.58 +.56 2218 Landslars 28.6 +1.0 67 30 NextPrt 26.00 -.13 30 25 ElecBtq 63.12 +.64 46 39 Hologic 39.99 +1.73 5543 La sp u42 +1.77 NitroMed 18.85 -.04 39 27 EFII 19.22 +.17 ...... HomeStore 2.12 +.17 .. Lattice 4.56 +.01 21 16 NobilyH 26.58 -.77 ... 19 EmbrcTc 5.62 -.10 23 18 HotTopic 19.39 +.42 34 25 Laureate 46.79 -.09 19 17 NorTrsI 45.56 +.48 ...... eMrgelnl .61 -.05 44 28 HouseValn16.40 +1.25 .. 25 LawsnSft 5.32 +.05 ... NthfidLb 13.93 +1.75 .. 27 EmmisC 17.79 +.07 28 20 HudsCrtvs 11.50 -.16 .. Level3 2.13 +.02 .. NwstAid 4,86 +.35 16 11 EncoreCap 16.74 +.11 ...... HumGen 11.23 +23 .. LexarMd 4.96 +.01 17 Novatel 26.54 +1.84 ...... EncysiveP 11.10 +.16 17 13 HuntJBs 19.38 +51 .74 ULbtyGlobA 46,61 +.06 2 21 NvIWris 12.44 +.40 30 14 EndoPhrm 25.99 +.24 15 13 HuntBnk 24.53 +48 62 44 Lfecell 16.21 +.70 7 50 Novell 6.41 +.22 14 ... EngyConv 22.95 -.01 15 14 HutchT 37.37 +.25 23 18 LJfePtH u50.42 +2.25 21 23 Notvus 25.10 +.21 30 24 Entegris 9.79 +29 ... ... Hydrgcs 3.65 -04 ... 44 UgandB f 7.00 +,36 37 27 NuHoriz 6.35 -.06 34 ... Enterrags 23.18 -25 26 18 HyperSolu 38.38 +.50 17 20 Uncare 43.06 +.16 .. NuVasive u1724 +,27 ... 38 Entrust 5.05 +.06 .. 21 IACInterac 24.74 +.41 27 26 UnearTch 37.04 -.08 ...... NuanceC 4.47 +.11 ... 26 EnzonPhar 6.81 +.43 ...... ICOS 2200 +86 48 23 Uonbrda 6.78 +2.05 ... 40 NutlSys u14.67 +.93 27 14 EpicorSft 13.52 +.57 ...... IPIXCp 2.54 +02 ... LodgEnt 17.10 +.96 33 18 Nvidia 27.04 +.17 ...... Epiphany 3.48 +.11 22 18 iPass 6,03 +.04 .. LookSmart .68 +.02 29 20 OReillyAs 29.65 +.75 ...... EpixPhar 9.62 +.18 ...... Icoda .17 -.01 .... Loudeye .78 .. ... OSIPhrm 42.27 +.89 11 11 OhioCas 24.46 +.30 ... 50 Omnlcell 7.97 +.71 11 10 OmniVnI 13.56 +.20 ..... OnAssign 4.95 -.06 .. 15 OnSmcnd 4.85 +.19 .. OnyxPh 24.49 +.27 .. 13 OpenTxt d1428 +.20 .. 25 OpnwvSy 17.03 +.58 .. Opsware 5.12 +.07 33 19 optXprsn 15.53 +558 23 15 Orade 12.83 +.29 .. 67 OraSure 10.02 +.18 20 17 OrthKx 44.86 +.72 .. Osdent 2.28 +.15 17 16 OtterTail 27.50 +.40 ... OutdrChn 13.94 -.26 .. Overstk 35.54 -.71 22 17 PETCOII 31.61 +.60 48 36 PMCSra 9.53 +.20 9 PRGSchlz 2.99 +.18 21 18 PSSWrld 12.25 +.39 12 10 Paccar 69.73 +1.22 17 13 PacSunwr 23.64 +.84 61 18 PacifcNet 7.87 +.04 35 24 Packetr 14.08 +.18 .. 47 PalmSrce 9.51 +.39 47 17 palmOne 29.89 +.77 .. PanASIv 14.52 +,01 45 35 PaneraBrd 62.29 -.59 1 1 B ParmTc 6.60 +.36 .. 50 Pathmrk 9.18 +.34 34 28 Pattersons 44.88 +.50 32 13 PattUTI 27.65 -.50 34 29 Paychex 33.01 +2.99 43 20 PnnNGmsu35.50 +1,01 12 17 PISeTch u21.17 +1.51 ... Peregrine .95 -.01 24 21 PerFood 29.29 +.37 13 Penigo d13.84 +.02 .. 14 Petmhawk 11.00 +.40 13 13 PetDv 30.74 -.48 18 11 PlroqstE 6.55 -.21 26 22 PetsMart 30.82 +.88 .. 28 Phamnnn 23.40 +.18 22 ... Phazar 21.50 +1.13 27 19 Photrin 23.14 +.39 31 46 Piars 51.26 +.80 26 28 Pxlwrks 8.70 +.48 ... PlugPower 7.42 +,38 31 18 Polyom d15.00 -.74 13 13 Popular s 25.09 +.07 .. PortfiSf dl.75 -.40 16 PortPlayn 20,32 +.24 22 18 PortfRec 42.01 +2.13 .. 21 Powrwav 10.29 +.36 . PraecsP .51 -.03 .. Precis .85 +.02 .. 24 Prestek 11.15 +.47 24 19 PriceTR 62.74 +1.57 .. PrimusT .61 -.01 .. ProgPh 21.24 +.59 ProtDsg 20.05 +.52 42 26 PsycSol u47.74 +2.42 ... 13 QLT 10.35 +.14 18 16 Qiogic 30.83 +.83 30 25 Qualcoms 33.50 -,09 40 29 QualSyss 48.79 +.36 .. 71 QuanFuel 5.24 -.01 24 19 QuestSftw 13.63 +32 ... ... RCNn 23.21 -.11 .. 71 RFMicD 5.20 +.24 24 20 RSASec 12.49 +.07 .. 27 RadntSys 11.40 +39 ... 23 ROneD 13.33 +.25 24 16 Radware 18.40 -.70 49 39 Rambus 13.67 +.34 ... 71 RealNwk 5.02 -.03 53 39 RedHat 12.81 +.61 ...... Regenm 8,75 +.51 12 10 RentACt 23.01 +.11 16 14 RepBcp 15.11 +.53 70 27 RscdMotn 76.60 +1.14 23 21 ResConns 22.95 +.90 25 18 RossSts 29.10 +.39 40 34 RoyGId 19.33 -.45 00 19 Radelyb 14.67 .5.96 17 Tersyon 2.18 +.68 33 19 Rudolph 14.67 +.90 23 24 S Corp 4.82 +.22 ... SAFLINK 1.65 +.05 ... SBACom u13.46 +.62 29 23 SCPPools 35.06 +.71 14 11 Safeco 55.05 -.13 98 22 SaixPhs 17.65 +.45 12 11 SanderFm 46.29 +2.39 17 15 SanDik 24.44 +.11 ... 13 Sanmina 5.35 +.13 37 22 Sapient 7.87 +.12 ... SaientPh u4.12 +.16 ...12 ScanSft 3.95 +.12 5 7 Schnitzer 23.19 +.96 2518 SchoolSp 46.61 +.11 17 15 Schulin 17.57 -.32 37 23 SdGames 27.00 +.33 34 25 SeaChng 7.15 +.13 15 19 SearsHldQs154.04 +6.30 ...57 SeeBeond u4.29+1.01 ...... Selectica 3.01 12 12 Setltin 49.65 +1.05 24 25 Semtech 17.05 -.20 ...... Sepracor 60.04 -.58 ... 21 Shanda 37.20 +1.03 ... 15 ShrePh. 33.41 +.17 41 32 ShuflMsts 29.08.+1.02 67 38 SiebelSys 8.76 +.04 16 15 SigmAl 56.97 +1.21 9 7 SgmaTel 17.74 -.41 37 17 Siicnlmg 10.22 +11 18 21 SilcnLab 26.76 +30 ..... SST 3.94 +.18 . SilvStdg 11.55 -.13 27 25 Sina 28,77 +.37 31 30 Sinclair 9.13 +.39 .. ... SlIrusS 6.43 +.44 13 10 SkyWest 18.70 +.83 26 18 SkywksSol 7.51 +.26 ...22 SanrfStne 10.48 -.04 29 24 Sohu.cm 22.24 +1.24 28 22 Sonicorp 31.04 -1.27 54 13 SonicSol 17.75 +.60 .. 26 SncWall 5.61 +.05 62 50 Sonusn 4.96 +.15 23 ... SouMoBc 14.49 24 15 Srcelntink 12.23 +.37 ... 71 SpanBdcst 10.10 +.46 ...... Spire 7.14 -.02 22 18 Stapless 21.77 +.36 ...... StarSden 4.50 -.03 49 38 Starbucks 53.06 +1.10 ... 29 STATSChp 7.16 +.09 5 6 StDyna 26.42 +1.01 ...... StemCells 4.12 +.09 26 18 SterBcsh u15.40 +.52 ... 13 StewEnt 6.53 37 18 StoltOffsh u8.88 +.14 ...... Stratex 1.75 +.03 19 60 SunMicro 3.74 +.05 ...... SupTech .67 +.07 ...... SuperGen 4.91 +.22 34 22 SuppodSft 5.36 +.20 16 14 SusqBnc 24.99 +.68 15 14 SwiftTm 23.00 +.54 87 ... SycamreIf 3.48 +.08 28 29 SykesEn u9.41 +.64 30 19 Symantecs 21.84 +.13 34 21 Symetric 10.45 +.19 21 19 Synaptics 21.47 +.36 26 22 Syneronn 35.60 +.78 .. 29 Synopsys 16.80 +.19 ...... Synovis 7.98 .+.16 ...... TBSInllAn 10.00 19 25 THQInc 29.45 +.63 6 7 TOPTank n 16.05 +.45 19 17 TakeTwos 25.98 +.35 11 ... Tarragns u24.94 +1.39 41 91 TASERs 10.25 +.08 13 14 TechData 36.07 +.13 ... Tegal 1.00 31 21 Tekelec 16.85 +.88 15 Telesys 15.58 -.04 .. 50 TeIwestGIn22.55 +.17 .. 22 Tellabs 8.81 +.03 ... 17 Terayon 3.10 +.09 24 27 TesseraT 34.27 +.36 ... 87 TetraTc 13.23 +52 20 ... TevaPhrm 31.58 +.56 18 16 TexRegs 30.95 +1.19 93 ... ThomasPn 12.10 +.25 ...... 3Com 3.71 +.14 26 22 TibooSt 6.48 -.02 ...... TWTele 5.96 +.01 ...... TiVoInc 6.98 39 33 Topps 10.50 32 23 TractSupp 48.76 +.80 .. Tmskry 36.66 +.01 ... Tmseta d.61 +.01 TmSwtc 2.17 +.03 87 45 Travelzoo 33.05 +.60 33 TridMc 21.72 +30 30 26 TrimbleN 39.62 +.77 .. .. TriQuint 3.43 +.13 17 16 TrstNY 13.11 +.23 14 14 Trmstk 29.11 +1.06 .. 18 TumbledC 2.60 -.07 28 62 TurboChrs 18.28 +.83 .. 18 24f7RealM 4.12 +.16 18 14 UCBHHds 16.73 +.04 15 56 USUnwirn 5.50 ... 16 ... UTStrcm 7.16 +.21 .. 25 Ubiquill 8.10 +.20 64 UltmSoft 16.45 +.50 ..... UHrtg .87 -.05 6 10 UtdOnIn 10.90 +.10 ...... USEnr 3.52 -.10 47 29 UtdThfp 49.00 +.82 20 17 UnvAmr 23.16 +.24 15 12 UnvFor 40.64 +66 46 33 UrbnOuts 58.58 +2.58 30 24 VCAAnts 23.65 -.41 .ValVisA 11.00 +1.58 28 24 ValueClck 11.74 +.46 17 19 VarianS 37.76 +.76 91 45 VascoDta 10.00 +26 26 Veecolnst 16.65 -.17 59 43 Ventanas 38.40 +.38 14 15 Ventiv 19.04 +.84 34 25 Verisgn 29.73 -.22 26 21 Veritas 24,51 +.14 VersoTch .26 . VertxPh u16.24 +.55 ... ... ViaNet .10 . Vicuron 27.92 +.04 28 19 ViroPhrm 6.97 +.10 ViroLogc 2.57 -.02 ... Vtesse 2.21 V...... us 3.80 +.31 82 33 Voterran 15.50 +.03 ... WPCSIntln 5.65 +.19 28 ... WSI Inds 3.88 +.06 79 16 WebMD 10.24 +.09 26 WebSldenu14,59 +1.02 25 22 WebEx 27.08 -.22 ... 42 webMeth 5.46 +.32 41 30 Websense 49.64 +1.62 17 14 WererEnt 19.37 +.68 22 19 WWirelss 41.97 +15 . WetSeal 6.22 +.32 3 5 WheelPil 16.55 +.05 53 43 WholeFd 119.05 +1.42 ...... WildOals 11.32 -.06 46 WndRvr 16.05 +.87 10 9 WoridAir 11.67 +.46 ... WHeatg 1.35 +.25 .. WoddGate 3.03 -.17 . 77 Wynn 49.01 +.67 XM Sat 34.20 +.59 ... .. XOMA 1.82 +.02 ... .. Xenova .75 -.02 29 25 Xilinx 25.63 -.03 55 54 Yahoo 35.80 +.12 11 8 YellowRd 49.54 +1.28 27 23 ZebraTs 45.08 +.31 ... .. ZhoneTch 3.18 +.16 ...... Zla 2.96 +21 16 14 ZionBcp 73.53 +.47 .. 46 Zoran 12,86 +.43.3076 1.2989 Brazil 2.3695 2.3807 Britain 1.8153 1.8278 Canada 1.2313 1.2285 China 8.2765 8.2765 Euro .8288 .8225 Hong Kong 7.7706 7.7708 Hungary 204.12 204.17 India 43.470 43.450 Indnsia 9700.00 9663.00 Israel 4.5455 4.5310 Japan 109.85 109.26 Jordan .7085 .7085 Malaysia 3.7999 3.7999 Mexico 10.8330 10.8140 Pakistan 59.77 59.70 Poland 3.34 3.32 Russia 28.6230 28.5600 SDR .6834 .6811 Singapore 1.6815 1.6746 Slovak Rep 31.56 31.70 So. Africa 6.6416 6.6276 So. Korea 1023.90 1012.90 Sweden 7.7905 7.7350 Switzerlnd 1.2805 1.2682 Taiwan 31.43 31.36 U.A.E. 3.6728 3.6727 British pound expressed in U.S. dollars. All others show dollar in foreign currency. Yesterday Pvs Day Prime Rate 6.00 6.00 Discount Rate 4.00 4.00 Federal Funds Rate 3.25 3.00 Treasuries 3-month 3.06 2.96 6-month 3.25 3.17 5-year 3.75 3.83 10-year 3.97 4.04 30-year 4.24 4.33 FUTURES Exch Contract Settle Chg Lt Sweet Crude NYMX Aug05 58.20 -2.34 Corn CBOT Dec 05 2381/2 -3 Wheat CBOT Sep05 338r/4 -2/ Soybeans CBOT Nov05 686 -293/4 Cattle CME Aug 05 80.10 -.47 Pork Bellies CME Aug05 58.05 -2.22 Sugar (world) NYBT Oct 05 9.24 -.09 OrangeJuice NYBT Sep05 102.55 +1.05 SPOT Yesterday Pvs Day Gold (troy oz., spot) $436.40 $438.90 Silver (troy oz., spot) $7,096 $7.287 Copper (pound) $1.6000 $1 .t8bU WEDNESDAY, JUNE 29, 2005 7A MUTUALFUNDS 12-mo Dreyfus Founders: 'Name NAV Chg %Rtn GrowtsB n9.85 +11 +3.2 S AARP Invst: GrwthFpn10.32 +.11 +4.1 ApGrr 44.s40 +35 D +72 Dreyfus Premier: Here are the 1,000 b :GNMAr 15.07 -.0 +7. CoreEqAtl4.73 +.11 +4,6 :GGNMA 15.07 -01 +5. 9 srVp 337 +3 .9.5 show the fund name, G 21.89 +20 +0 LdHYdAp 7.34 +01 net change, aswell a In 2 44.23 +08 +129 xMgLGC 15.67 +.12 +3.5 P ,wyCn 11.71 +.04 +8.0 TchGroA 21.79 +.15 -1.2 Tues: 4-wk total retur PhwyGr 13.20 +.09 +87 Eaton Vance C A: Wed: 12-mo total retu ShTrrnBd 10.08 -01 +25 CnaAp 14.85 +29 +4.8 Thu:3-yrcumulaive SmCoS1k 25.42 +50 +135 nBosA 6.37 +.01 +9.1 Fri: 5-yr cumulative to AIM Investments A: In~onA 6.37 +01 +9.1 Frh 5-yr cumulative tc Agsvp 10.34 +.14 +63 SpEqtA 4.58 +.08 39 Balp 2539 +11 +60 MunBdl 10.77 -.01 +9.3 Name: Name of mutu BasVaA p 32.58 +.25 +7.0 TradGvA 8.73 -.01 +4.2 NAV: Net asset value ChAp 12.79 +.08 +51 'Eaton Vance Cl B: ChadAp 2.79 +2308 +5 FLMBt 1097 +.01 +7.4 Chg: Net change in p HYdAp 4.44 +.01 +10.1 HISSBt 10.76 +.12 -2.1 Total return: Percent IlGrow 20.29 +.04 +17.1 NatMBI 10.53 +.01 +10.6 dividends reinvested. MdCpCEq29.18 +.14 +1.3 Eaton Vance Cl C: uBp 8.22-.01 +5 GovtCp 7,52 -.01 +3.4 ive PmEqty 9.90 +108 +55 NatMCt 10.03 +-01 +10.5 Data based on NAVs SelEqty 17.65 +21 +7.7 Evergreen B: SumlS 10.99 +.08 +9.2 Ba nB 18.49 +.05 +7.0 Footnotes: e-Ex-cal WeiAgAp 13.09 +.15 +5.1 DvrBdBt 15.00 -.03 N n No-load fund. p -1 AIM Investments B: MuBdBt 7.58 -.01 +8.2fee or ( CapDvBt 17.22 +.20 +11.0 Evergreen 1:hRedemption fee or cc PremEqty 9.15 +07 +4.7 C0ordE 10.74 -.03 +7.3 Stock dividend or split AIM Investor CI: SIMunil 10.05 +3-.5 No information availat energy 34.74 -66 +46.9 Excelsior Fuds24 44.5 wish to be tracked. N HhS 50.90 +.67 +3.4 Energy 23.35 -24 +44.5 Upper, nc.andTheA SmCoGIlp12.43 +.21 +9.7 Heldp 4.57 +.01 +5.2 UpperInc. ndThe A ToftR 24.05 +12 +3 9 ValRestr x43.34 +22 +17.5 Uiies 13.12 +.08 32.9 FPA Funds: EqlncAp 20.68 +.17 +8.0 AM/INVESCOnvtr: Nwnc 1106 +.8 Fedp 11.62-.02 +7.5 +2., Federated A: FedTFAp 12.31 -.01 +97 SC un 1049 +.12 +25 AmLdrA 24.9 +18 +3 FLTFAp 12.10 -.01 +9.3 AMF 975 +2Funds: CapApA 25.05 +.20 +5.0 FoundAlIp 12.35 +.06 +12.2 AM ni 75 ... +2 MdGrStA 31.20 +.44 +14.7 GATFAp 12.27 -.01 +8.5 Advance Capital +10 7 MuSeA 10.86 -.02 +8.4 GoIdPrMA7.71 -11 +10.0 Retlnn 10.12 -02 +1037 Federated B: GrwthAp 33.67 +.46 +6.5 Re n 1012 -02+10 StrncB 8.67 -.01 +9.8 HYTFAp 10.96 -.01 +11,3 Alger Funds B: Federated Instl: IncomAp 2.50 +.02 +13.4 SmCapGrt4.48 +.09 +10.9 Kaun 5.34 +.07 +8.6 InsTFAp 12.50 -.01 +.9 ,AllanceBernA: FidelityAdv FocT: NYiTFp 11.12 -.01 +6.3 BaGvlncAp 17.6219 +.08 +15.1 HCorT 21.66 +.31 +110 LATFAp 11.76 -.01 +8.5 BanTchAp 175.01 +34 +9.1 NatResT 38,32 -.40 +436,1 LMGvScA10.10 -.01 +2.8 OdcAp 3.72 4+.22 :+.84 FidelityAdvisor1: MDTFAp 11,90 -.01 +.7 # nctGrA22.37 +,41 +8.7 EqGd n47.44 +43 +1.8 MATFAp 12.11 -.01 +9.3 1mCpGrA22,37 +.41 +6.7 MITFAp 1242 -.01 +8.3 AIlianceBem Adv: EqInI n 28.73 +23 +83 MfTFAp 12,42 -.01 +5.3 5 0 nBdIn 11.12-.02 +5 MNInsA 12.28-.02 +8.0 LgCpGrAd18.80 +.15 +6.0 Fd Avisor MOTFAp 12.44 -.02 +9.8 AllianceBernm B: Fidelity Advisor1593 +09 38 NJTFAp 1231 -.01 +9.9 AmGvIncB 7.61 -.01 +14.2 BalancT 15.93 +..78 0901 +3+..8 DOvGrTp 11.49 +.10 +21 NYInsAp 11.78 -.01 +8.8 .CorpBdBpl12.24 -.03 +9.5 + NYTFAp 12.05 -.01 +.8 .GbTchBt 49.70 +.31 +1.4 DyCATp 14.16 +07 +95 NCTFAp 12.46 -.01 +9.2 .GrowthBI 23.59 +.26 +6.2 EqGrTp 45.02 +.41 +1.2 C Ap 1275 -.01 +9.3 SCpGrBt 18.85 +.34 +5.8 EqinT 2837 + 22 +776 ORTFAp 12,02 -.01 +9.35 USGovtBp 7.12 -.02 +6.5 GppT 3052 +29 5 PATFAp 10.56 -.01 +9.0 AIpanceBe1 C: HiinAoTp 9.79 +.04 +12.7 ReEScAp 28.01 +21 +33.7 PrSCpGrCt 18.90 +.35 +5,9 IntBf 11.10 .03 .5 RisDvAp 31.40 +.40 +4.0 ,Allianz Funds C: MidCpT p 24.36 +.19 +106 SMCpGrA 34.16 +.47 +9.6 GwthCt 17.52 +.19 +3.8 MuincTp 13.30-01 +92 USGovAp 6.61 -.01 +5.5 agtCt 15.59 +22 +5.0 seaT 1751 03 +107 Ap 1209 +11 3.3 ._ArmSouthFdsCIi: STT 9'50 -01 +2:9 VATFAp 12.00 -.01 +9.4 Value 17,00 +17 +14.1 Fidelity Freedom: Frank/Temp Frnk B: ,Amer Century Adv: FF2010 n13.69 +.05 +75 lncomB1p 2.50 +.01 +12.9 qGromp n22.46 +23 +11.6 FF2020n 13.99 +08 +.6 hconeBt 2.49 +01 +12.5 Amer Century Inv: FF2030n 14.10 +10 +89 Frank/remp Frnk C: &lancedn16.68 +.08 +9.5 Fidelitynvest: IncoCt 2.51 +.01 +12.8 Eqlncn 8.13 +.07 +10.0 AggrGrr n1635 +18 +3.3 Frank/Temp Mtl A&B: Growthln 19.54 +.19 +7,2 AMgrn 1610 +06 +45 DiA 24.98 +.07 +19.3 Herftageln12.49 +.16 +11.7 AMgrGrn 14.65 +.09 +40 QuaKdAt 19.80 +.11 +16.9 lncGron 30.84 +28 +10.1 AMgrnn 1275 +71 SharesA 23.46 +09 +12,8 IntDiscrn 13.42 +.08 +13.2 Balancr 18.18 +11 +11.8 Frank/Temp Temp A: IntlGroln 8.93 +.02 +10.2 BlueChGrn41l17 +39 +30 DvMktAp 19.55 -.01 +33.2 l. eSdn 5.19 +.08 +13.1 Canadari 3623 +16 +32.6 ForgnAp 12.20 +.01 +13.7 NewOpprn5.50 +.11 +5.4 CapApn 25.44 +19 +63 GIBdAp 10.49 -.07 +12.0 4OneChAgnlO.89 +.07 NE Cplncrn 835 +01 +139 GrwthAp 22.90 +.02 +11.6 n RealEstln26.27 +.22 +29,1 ChinaRgn 1792 +02 +2432 IrxEMp 14.69 +.01 +13.5 SSelectn 37.05 +.33 +1.9 CngSn 39361 +3.92 +5.6 WorldAp 17.98 +.06 +13.6 Ultran 28.57 +.32 +2.6 Contran 5901 +.38 +13.8 Frank/Temp Tmp B&C: WU/tn 13.23 +.08 +33,0 CnvScn 21.18 +06 +64 DevMktC 19.17 -.01 +32,4 Valuelnvn 7.41 +.07 +9.2 Destl 12.74 +.07 +4.5 ForgnCp 12.02 +.01 +12.89 2Amer Express A: Destll 11.32 +.11 +5.6 GE Elfun S&S: Cal 5.27 -.01 +8.7 DisEqn 26.14 +.27 +13.0 S&SInc 11.52 -.03 +6.6 NDiscover 8.84 +.18 +14.4 Divintln 28.84 +.02 +15.1 S&SPM 45.24 +.34 +6.6 DEIx 11.32 +.04 +17.1 DivGthn 28,00 +.25 +2.8 GMOTrustlll: DivBd 4.89 -.01 +7.0 EmrMkn 13,85 +.03 +38.5 EmMkr 18.71 +.06 446.6 DvOppAx 7.35 +.01 +18.8 Eqlncn 51,71 +.44 +7.8 For 14.71 +.04 +13.5 EqSel 13,04 +.17 +7.1 EQIIn 23.57 +.21 +9.2 GMO Trust IV: Growth 27.54 +.18 +11.3 ECapAp 21.89 +.06 +15.0 EmrMkt 18.68 +.06 +46.6 HiYId 4.49 ... +7.6 Europe 34.92 +.04 +25.6 Gabelll Funds: Insr 5,50 -.01 +7.4 Exchn 267.95 +2.83 +48.6 Asset 42.15 +.41 +13.7 MgdAIIpx 9.58 +.03 +11.4 Exportn 20.07 +.12 +12.0 GartmoreFdsD: Mass 5.45 -.01 +7.8 Fideln 29.99 +.28 +6.4 Bond 9.79 -.03 +7.9 *Mich 5.35 -.01 +7.2 Fiftyrn 20.21 +.15 +4.6 GvtBdD 10.40 -.03 +7.0 MiMr 5.36 -.01 +7.1 FRRateHirn9.94 ... +4.2 GrowthD 6.77 +.08 +7.7 Mutualpx 9.81 -.01 +9.6 FrinOne n 25.26 +,18 +9.6 NationwD20.40 +.16 +9,5 ,.NwD 23.48 +.17 +1.2 GNMAn 11.09 -.02 +6.0 TxFrr 10.71 -.01 +8.4 NY 5.18 -.01 +7.5 Govtincn 10.33 -.03 +6,8 Gateway Funds: Ohio 5.35 -.01 +7.3 GroCon 56.38 +.63 +8.3 Gateway 24.96 +.10 +6.9 PreMt 8.49 -.10 -2.9 Grolncn 37.81 +.38 +7.0 Goldman Sachs A: Sel 8.70 -.02 +6.6 Grolnclln 9.35 +.06 +3.1 GrIncA 25.40 +.14 +13.2 SDGovt 4.79 ... +2.3 Highlncrn 8.82 +.01 +8.8 SmCapA 41.88 +,85 +12.7 Stockpx 19.31 +13 +7.1 Indepnn 17.69 +.15 +8.0 Guardian Funds: TEBd 3.93 ... +7.9 InIBdn 10.48 -.02 +5.2 GBGInGrA13.28 +,05 +13.0 Th'Intl 5.77 +.02 +17.0 IntGovn 10.22 -.02 +4.4 ParkAA 30.50 +27 +3.8 ThdlInt 7.07 +.03 +10.1 IntlDiscn 28.43 +.05 +14.8 Harbor Funds: .Amer Express B: IntlSCprn 24.82 +.12 +24.8 Bond 12.06 -.02 +8.3 ,EqValpx 10.36 +.05 +14.3 InvGBn 7.52 -.01 +7.6 CapAplnst29.05 +.27 +8.2 ,Amer ExpressY: Japann 12.37 +.14 -3.3 Intlr 43.07 +.20 +15.0 NwD n23.61 +.17 +1.4 JpnSm n 12.94 +.17 +0.7 Hartford Fds A: 'American Funds A: LatAmn 23.73 +.17 +62.9 AdvrsAp 15.09 +.06 +3.8 AmcpAp 18.18 +.14 +6.0 LevCoStkn24.23 +.20 +24.4 CpAppAp33.84 +.20 +9.9 AMutIlAp 26.51 +.20 +8.8 LowPrn 41.07 +.47 +17.4 DivGthAp18.82 +15 +10.2 SBaAp 17.96 +.12 +7.0 Magelhbn103.24 +.82 +5.6 SmlCoAp 17.29 +.28 +11.8 BondAp 13.49 -.03 +7.2 MidCapn23.86 +.29 +10.3 Hartford HLS IA: CaplBAp 52.62 +.18 +15.1 MtgSecn 11.26 -.01 +6.4 Bond 11.80 -.02 +7.6 CapWAp 19.33 -.12 +11.3 NwMktrn 14.26 ... +22.2 CapApp 51.41 +.33 +10.6 CapWGAp33.94 +.18 +17.1 NwMilln 30.25 +.32 +2.2 D&Gr 20.56 +17 +10.6 ,EupacAp 36.17 +15 +15,9 OTCn 34.38 +.37 +5.0 Adviser 23.02 +.9 +43 FFdlnvAp 32.49 +.20 +12.9 Ovrsean 34.98 +,07 +11.2 Stock 45.62 +34 +3.4 ,GwlhAp 27.98 +.13 +10.1 PcBasn 20.20 +.08 +13.1 HartfordHLS IB: HITrAp 12.27 +.02 +9.8 Puritnn 18.90 +.10 +7.6 CapAppp51.15 +33 +10.3 I-IncoAp 18.41 +.09 +11.8 RealEn 31.05 +.19 +32.8 HollBalFdn15.36 +.02 +2.7 d'nltrBdAp 13.67 -.02 +3.8 STBFn 8.95 ... +3.2 IS Funds: ICAAp 30.70 +21 +8.8 SmCapInd n20.21 +.32 +13.6 NoAmp 7.56 -.03 +10.8 NEcoAp 20,85 +.14 +8.1 SmllCpSrn17.40 +34 +8.0 JPMorgan Select: NPerAp 27.37 +.11 +10.2 SEAsian 17.85 -.01 +33.4 IntEq n29.32 +07 +11.9 NwWrIdA 33.88 +.15 +26.8 StkSkIn 22.93 +.20 +8.0 JPMorgan SelCis: I SmCpAp 31.94 +.27 +16.1 Stratlncn 10.56 -.02 +11.8 CorBdn1.93 -03 +7.0 TxExAp 12,61 -.02 +7.5 Trendn 53.76 +.49 +6.0 Janus: WshAp 30.74 +.27 +8.0 USBIn 11.13 -.03 +7.1 Balanced 21.5 +14 +9.0 American Funds B: U+Wtlyn 14.26 +.11 +25.4 Contrari13.30 .06 +19.8 BaIlB 17.91 +.12 +1.3 VoStraln36.04 +.947 +63 CoMEq 20.94 +.19 +12.6 CapBBt 52.62 +.18 +14.2 Valuen 74.63 +.64 +18.2 EnMteprn 37.80 +46 +12.2 GnBtlB 27.10 +.12 +9.3 Wrdwn 18.11 +.09 +9.5 Fe7TEpn 7.11 -.01 +6.5 IncoBt 18.32 +.09 +10.9 Fidelity Selects: oBnd n 9.67 -.03 +6.5 ICABt 30.59 +20 +7.9 Air n34.23 +.80 +9.8 Fundn 24.22 +.26 +2.1 WashlBt 30.59 +27 +7.2 Autonn ,32.89 +53 +2.6 GI feSirnn8,61+,30 +8,7 Ariel Mutual Fds: Banking n 37.45 +.45 +7.6 Grechrn10.35 +.08 +0.5 Apprec 47.45 +.57 +9.0 Biotchn 54.66 +.86 -5.2 Grnc 32,96 +,22 +13.0 L Ariel 53.78 +.50 +11.7 Brokrn 59.29 +.93 +24.5 Mren ur 21 .19 ++.6 F -Artisan Funds: Chemrn 5.76+1.24 +22.8 MdCpVal 22.69 +.17 +13.3 i~4 21.73 +.01 +9.3 Compn 33.90 +.22 -0.7 Olympsn29.07 +.39 +7.5 I hidCap ... ... NA Conlndn 24.80 +.32 +10.1 Oronn 7.26 +.07 +13.4 'Baron Funds: CstHon 46.94 +.89 +33.2 Onseasr 24,87, +.02 +23.0 Asset 53.41 +.61 +17.9 DfAern 71.03 +1.18 +22.8 ShTmBd 2,89 -.01 +2.0 Growth -46.25 +.64 +20. vCmn 18.05 +.19 +1.6 Twenty 4485 +29 +13.8 SmCap 22.87 +.39 +16.3 Electrn 39.63 +.41 +1.4 Venturn 57.27 +1.13 +9.9 -Bernstein Fds: Enrgyn 40.32 -.43 +49.0 WOrWr 40,34 +.17 +6.4 IntDur 1343 -.02 +6.9 EngSvn 51.83 -.97 +46.9 Je lsonDrydenA: .GDiMu 14.21 -.01 +4.7 Enrn 1457 +.22+6 BlendA 15,61 +.07 +9.6 STxMghV 22.23 +.03 +11.4 FrnSvn 107.77 +1.08 +7,5 HiYdA p 5.73 + +.8 tnlVal2 20.89 +.04 +11.4 Foodn 5097 +.38 +10,5 Insur 11.07 -.023 +7.6 BlackRock A: Goldern 23,67 -.16 +7.8 6 LVlrvyA 1335 +.05 +9 +7 AuroraA 40,03 +.62 +6.4 Heathan 137.40 +196 +12.0 A n1 HjInvA 8.03 +.01 +10.1 HomFn 57.41 +30 +0.7 JennisonDryden B: Legacy 13.41 +.16 +6.3 OIdn 36.95 +.55 +120 GrohB 13.29 13 +7.2 Bramwell Funds: Insurn 63.29 +.51 +9.6 HiYI 5.72 ,, +3 Growthp 19.58 +.21 +3.6 LeIsrn 74,87 +.72 +8.9 Jensen 23.60 +34-0.4 SSrandywine Fds: Med 12 +71 +528 ohn ancock A: Bmdywnn28,18 +25 +16.3 M Syn24.28 +29 +92 John Hancock A: Brinson FundsY: Muln dn 44.97 +.41 +7.5 BondAp 15,31 -.04 +7.6 HiIr/Y n"7.15 +Nts .0 1 +9. l7 SlnAp 7.01 .., +11.0 CiM Funds: Paper+ 27.+ n 70 +39 -122 John Hancock B. R C FpDv 30.30 + +2 n 9 07 +1 SrlcB 7.01 ... +10,2 J nr 3.3 +0+99. 01 Julius Baer Funds: SMutsn 27.39 -.16 +21.4 Retsail 2 53.9+1018 +17.1 MFs Funds: l Calamos Funds : Sflwrn 49.71 +76 +232 IGEqlr 32.08 +.08 +18,4 CapsFundsB: G pTehn 5875 +.55 +. TolRetnI 31.49 +.07 +18.1 I GrBtnAp29.1 +.1 +57 Telon 30,15 + .5 +110 Legg Mason: Fd Gri p 51.11 +.51 +.1 Trns 3939 +.89 +12.5 OpporTrt 15,20 +.20 +3,6 GroWhCt49.08 +.490 +5.49 Uilor 42,34 +.39 +21 Splnvp 45.13 +,54 +5.1 Cawvert Groupt: invree 0.22 4:06 +24,6 VuhTrp 639.99 +,.59 +7.2 SIncop 17.15-.2 -.02 +7.2 Fdelity Spartan LeggMason nst: IntlEqAp 18.44 +.07 +1.9 CAMun n12, -.02 +,90 ValTrlnst 70,09 +,65 +8,2 MxsAI 10.52 ,. +1.7 CTMunrnll.73 -.01 +7.2 Longleaf Partners: Munlnp 10.92 ,+1 +4.7 Eqldxn 42.69 +,40 +7.9 Partners 31.10 +424 +3,5 SoalAp 27.78 +.14 +7,8 rn 8292 +.76 +79 Intl 15.70 +.06 +5.0 SocBdp 16.30 -.03 +5.1 FLMurn 1 -01 +.3 SmCap 31.22 +,23 +14.1 SocEqAp 34.83 +.37 +7.3 Gol 1114 -.02 +7,1 LoomIs Sayles: TIFLt 10.67 ,, + InvGrBdn10,7l -.02 +7.7 LSBondl 13,66 -.01 +14.6 TxF p 15 1 +55 MDMurn1.09 -.02 +7.6 LordAbbettA: C 890 0 -+.09 +65 MAMunn 12.24 -.01 +9.1 AflAp 14,41 +.11 +7.5 e 6 +3 + MIMunn 12,12 -02 +7.6 BdDebAp 7,90 +402 +7.1 SCohen & Steers: MNMann1l1,65 -.01 +7.3 GlIncAp 7,26 -.05 +6.4 , RltyShS 73.06 +442 +36.2 Munilncn 13.17 -.02 +9.2 MidCpAp 22.67 +.22 +17.4 .Columbia Class A: NJ Mun r n11.86 -.01 +9.1 MFS Funds A: Acort 26.28 +.33 +15.9 NYMunn 13.14 -.02 +5.7 MITAp 17.31 +.15 +10.2 .Columbia Class Z: OhMunn 12.04 -.02 +8.7 MIGAp 12.16 +.13 +5.9. AaomZ 26.86 +.34 +16.3 PAMunrnvl.05 -.01 +5.2 GoOpAp 8.71 +.09 +5.3 AcomlntZ 29.59 +.10 +24.1 SilntMun 10:30 -01 +3.0 HilnAp 3.88 +.01 +5.9 ' LargeCo 27.85 +.26 +7.6 TotMktlnn33.20 +.33 +9.6 MFLAp 10.27 -.01 +6.8 SmalICo 21.66 +38 +14.6 First Eagle: TotRAp 16.03 +.06 +11.0 Columbia Funds: GIlbA 39,73 +03 +152 ValueApx 23,46 +.11 +14.2 ReEsEqZ 27.33 +.16 +2606 0 verseasA22.40 -01 +174 MFS Funds B: DavisFundsA: First Investors A MIGB 11.14 +.11 +5.2 . NYVenA 31.37 +.09 +10.1 BIChpAp 20.30 +17 +63 GvScBI 9.72 -.02 +5.6 Davis Funds B: G oblAp 6.58 +02 +7.5 HilnSt 3.89 +.01 +8.3 ' NYVenB 29.99 +.09 +9.3 GovtAp 10.99 -.01 +4.5 MulnBt 8.71 -.01 +7.8 ' Davis Funds C&Y: GrolnAp 1339 +13 +10.7 TotRBI 16.03' +.06 +10.3 *,NYVenC 30.18 +.08 +9.3 I incoAp 3,06 ... +4.7 MalnStay Funds B: D, elaware Invest A: InvGrAp 9,98 -.02 +6.9 BIChGBp 9.48 +.08 +6.3 TrendAp 20,18 +.38 +2.4 MATFAp 12,15 -.02 +7.0 CapApBI 27,13 +.34 +3.3 TxUSAp 11.76 -02 +10.3 MfFAp 12.79 -.01 +6,5 ConvBt 12.95 ... +5,7 Delaware Invest B: MidCpA. p 26.60 +.24 +176 GovtBt 8.40 -.01 +5.2 Del rB 3.28 ... +11.8 NJTFAp 13.13 -.01 +6.4 HYkIdBBI 6.31 +.01 +9.4 SelGrBt 20.44 +.23 +5.3 NTFAp 14.62 -.02 +6.5 IntlEqB 12.55 -.02 +10.4 Dimensional Fds: PATFAp 13.33 -.01 +6.4 SmCGBp 14,37 +24 +7.4 IntSmVanl6.14 +.0f1+26.4 SpSitAp 19.47 +.34 +10.0 TotRIB1 18,94 +.09 +7.3 USLgVan 20.69 +.18 +17.1 TxExAp 10.26 -.02 +6.8 Mairs & Power: -USMicronl4.69 +.32 +9.7 TotRIAp 13.84 +.08 +8,8 Growth 70,26 +.89 +8.,1 USSmnallnl9.34 +.41 +10.5 ValueBp 6,54 +.05 +11.7 Managers Funds: USSmVa 26.86 +.51 +14.4 Firsthand Funds: SpcIEq n88.66 +1.49 +8.9 EmgMkrn 17.10 +.06 +37.4 GbTech 3,73 +.05 -10.8 Marsico Funds: InlVan 15.98 +.04 +16.9 TechVal 28.15 +.44 -3.0 Focusp 16,53 +.24 +13.5 DFARIEn 24.38 +.17 +31.5 Frank/Temp Frnk A: Merrill Lynch A: Dodge&Cox: AGEAp 2.11 +.01 +11.1 GIAIAp 16.70 +.05 +12.3 Balancedx 79.29 -.15 +10.6 AdjUSp 9.00 -.01 +2.6 HeathAp 6.47 +.07 +11.2 Inoomex 12.78 -.14 +6,0 ALTFAp 11.66 -.01 +8.1 NJMunBd 10.75 -.01 +10.9 nInlStk 31.25 +.03 +22.9 AZTFAp 11.34 -.01 +11.0 Merrill Lynch B: Stockx 130,23 +.39 +14.4 Ballnvp 60.14 +.70 +20,0 BalCapB t25.93 +.10 +5.9 Dreyfus: CallnsAp 12.85 -.02 +10.1 BaVIBt 30.69 +.14 +4.7 Aprec 39.46 +.26 +5,8 CAIntAp 11.69 -.02 +7.1 BdHiInc 5.02 +.01 +5.7 Discp 32.21 +.30 +8.2 CafrFAp 7.42 -.01 +11.0 CalnsMB 11.76 -.02 +7.5 Dreyf 10.13 +.09 +6.7 CapGrA 10.62 +.12 -0.3 CrBPIBt 11.85 -.03 +6.2 Dr5001nt 35.20 +.32 +7.4 COTFAp 12.16 -.01 +9.5 CplTBI 12.03 -.03 +6.3 EmgLd 44.35 +.80 +10.4 CTTFAp 11.22 -.01 +10.0 EquityDiv 14.94 +.11 +16.7 FLIntr 13.40 -.01 +5.7 CvtScAp 16.24 +.10 +10.7 EuroBt 14.55 +.05 +14.8 InsMutn 18.15 -.03 +8.5 DblTFA 12.12 -.01 +10,3 FocValt 12.42 +.11 +6.0 trVaIlAr P9A7Q +90 +19)0 I rnT,+hA R9 44 A 4 I4 Fndr/RI BISr 41; 4S4 i oREDTH UTA.FN TBE biggest mutual funds listed on Nasdaq. Tables sell price or Net Asset Value (NAV) and daily s one total return figure as follows: n (%) irn (%) total return (%) total return (%) al fund and family. price of NAV. change in NAV for the time period shown, with If period longer than 1 year, return is cumula- reported to Upper by 6 p.m. Eastern. pital gains distribution, f- Previous day's quote. Fund assets used to pay distribution costs. r- nritingent deferred sales load may apply, s - t. t Both p and r. x Ex-cash dividend. NA - ble. NE Data in question. NN Fund does not IS -Fund did not exist at start date. Source: ssoclated Press FLMBt 10.54 -.01 +9.4 GIABt 16.33 +.04 +11.4 HeallhBt 4.89 +.06 +10.5 LatABt 26.14 +.19 +66.1 MnlnBt 7.98 -.01 +8.1 ShTUSGt 9.19 -.01 +1.8 MuSWtT 9.99 -.01 +0.9 MualntBt 10,63 -.01 +5.6 MNtlBt 10.65 -.01 +8.4 NJMBt 10.75 -.01 +10,6 NYMBt 11.18 -.01 +8.1 NatRsTBt39.18 -.51 +47.8 PacBt 19.02 +.10 +8.0 PAMBt 11.47 -.01 +8.9 ValueOppt24.35 +.35 +7.1 USGvMtg 110.31 -.02 +5,2 UtMicmt 11.58 +.07 +30.9 Wld[nB1 6.26 -.03 +13.6 Merrill Lynch C: GIAICt 15.89 +.05 +11.4 Merrill Lynch I: BalCapl 26.81 +.11 +7.0 BaVIl 31.50 +.15 +5.8 BdHilnc 5.02 +.02 +6.5 CalnsMB 11.76 -.02 +8,0 CrBPtII 11.85-.03 +7.0 CplTM 12.03 -.02 +6.9 DvCapp 17.79 +.06 434.0 Equityv 14.92 +.10 +17.9 Euroll 16,97 +.05 +16.0 FocVall 13.64 +.12 +7.1 FLMIk 10.54 -.01 +10.1 GIAIIt 16.76 +.05 +12.6 Healthl 7.01 +.08 +11.5 LatAI 27.46 +.20 +67.9 Mnlnl 7.99 -.01 +9.0 MnShtT 9.99 -.01 +1.3 MulTI 10.63 -.01 +5.9 MNatl 10.65 -.02 +9.1 NatRsTrt 41.42 -.53 +49.3 Pad 20.76 +.11 +9.1 ValueOpp 27.11 +.38 +8.2 USGvtMtg 10.31 -.02 +5.9 Utncmit 11,62 +.07 +431.9 WIdlncl 6.26 -.03 +14.5 Midas Funds: MidasFd 1.92 -.02 +6.7 Monetta Funds: Monetta n10.64 +.10 +11.3 Morgan Stanley A: DivGthA 35,00 +.40 +6.7 Morgan Stanley B: GIbDivB 13.77 +.07 +7.4 GrOthB 12.21 +.13 +5.7 StraoB 17.94 +.11 +8.8 MorganStanley Inst: GIValEqAnl7.66 +.08 +7.6 IntlEqn 20.70 +.02 +10.6 Muhlenk 81.77 +.52+22.8 Under Funds A: IntemtA 17.84 +.21 -2.9 Mutual Series: BeacnZ 16.26 +.07 +14.4 DiscZ 25.21 +.07 +19.7 QualfdZ 19.91 +.11 +17.3 SharesZ 23.61 +.10 +13.3 Nations Funds Inv B: FocEqBt 17.43 +.25 +12.2 MaisGrBt 16.72 +.23 +12.6 Nations Funds Pri A: IntMVPrA n21.22 +.04 +11.3 Neuberger&Berm Inv: Focus 37.31 +.37 +7.6 Intlr 19.16 +.02 +23.3 Partier 27.09 +.15 +23.4 Neuberger&Berm Tr: Genesis 45.54 +.46 +17.0 Nicholas Applegate: EmgGroln10.16 +.20 +8.0 Nicholas Group: Nich n61.51 +.63 +12.8 NchlnIn 2.17 +.01 +7.6 Northern Funds: SmCpldxnlO.16 +.22 +10.7 Technyn 11.00 +.07 -3.5 Nuveen Cl R: InMunR 11.09 -.02 +8.2 Oak Assoc Fds: WhitOkSG 30.63 +.19 -10.6 Oakmark Funds I: Eqtylncrn24.04 +.03 +6.9 Globalln 21.99 +.06 +10.1 Inllrn 21.43 +.02 +13.6 Oakinarkrn41.33 +.35 +6.7 Select rn 33.43 +.23 +7.7 Oppenheimer A: AMTFMu 10.18 -.01 +14.5 AMTFrNY 13.00 -.01 +14.1 CAMuniAp11.51 -.02 +19,9 CapApAp 40.68 +.36 +3.7 CaplncAp 12.36 +.05 +10,9 ChncAAp 9.43 +.01 +7.5 DvMktAp 29.05 +.03 +47.7 Dsenp 41.80 +.74 -1.3 EquFyA 11.02 +.10 +10,6 GobAtp 60.61 +.27 +15.0 GIbOppA 32.49 +.37 +16.4 Goldp 17.86 -.12 +13,9 HiYdA p 9.43 +.01 +7.5 LIdTmMu 15.84 ... +12.7 MnStFdA 35.54 +.30 +7.5 MidCapA 16.80 +.25 +12.0 PAMunLAp 12.83 -.01 +17.2 StIlnAp 4.31 ... +11.6 USGvp 9.77 -.02 +7.4 Oppenheimer B: AMTFMu 10.15 -.01 +13.7 AMTFrNY 13.01 ... +13.3 CplncBI 12.24 +.05 +9.9 ChlncBt 9.42 +,01 +6.7 EqutyB 10.63 +,09 +9.6 HirldBt 9.28 +.01 +6.6 StrlncBt 4.32 -.01 +10.5 Oppenhelm Quest: QBalA 18.04 +.05 +6.0 QBalB 17,76 +.06 +5.2 Oppenheimer Roch: LIdNYAp 3.38 -.01 +9.3 RoMuAp 18,35 -.02 +14.8 PBHG Funds: SelGrwth n20.78 +.24 -0.6 PIMCO Admin PIMS: TotRtAd 10.80 -.02 +7.9 PIMCO Instl PIMS: AIIAsset 13.01 -.04 +14.5 ComodRR 15,81 -.38 +18.7 HiYIl 9.83 +.02 +11.9 LowDu 10.16 -.01 +3.2 ReaIRtnl 11.56 -.04 +11.0 ShorT 10.02 -.01 +2.4 TotRI 10.80 -.02 +8.2 PIMCO Funds A: Rea[RtAp 11.56 -.04 +10.5 TotRIA 10.809 -.02 +7.7 PIMCO Funds C: RealRICp 11.56 -.04 +10.0 TotRICt 10.805 -.02 +6.9 PIMCO Funds D: TRVnrp 10.80 -.02 +7.B Phoenix Funds: BalanA 14.82 +.08 +5.9 Phoenix-Aberdeen : Irt[A 10.04 -.04 +14.4 WIdOpp 8,40 +.02 +10.3 Phoenix-Engemann CapGrA 14.72 +.15 +0.6 Pioneer Funds A: BalanA p 9,65 +.04 +3.6 BondAp 9,39 -.01 +8.1 EqlncAp 29.39 +.30 +16.4 EurSelEqA 29.76 +.07 NE GrwIhAp 11.93 +.12 +6.4 HiYIdAp 11.19 +.02 +5.9 IntlValA 16.88 +.05 +10.5 MdCpnrA 14.90 +.24 +5.8 MdCVAp 25.98 +.26 +18.1 PionFdAp41.95 +.44 +10.3 TxFreAp 11.85 ... +10.9 ValuaAp 17,90 +.07 +10.9 Pioneer Funds B: HiYkdBt 11.24 +.02 +5.2 MdrCpVB 23.23 +.23 +17.0 Pioneer Funds C: HiYtlCn 11.34 +.02 +5.2 Price Funds Adv: Eqlncpx 26,28 +.13 +11.5 Price Fundsu Balancexn19.50 -.05 +10.0 BIChipn 30,68 +,31 +6.4 CABondn 11.15 -.02 +5.2 CapAppn 19.78 +.12 +12.2 DMohroxn 22.81 +16 +9.6 Eqlncxn 26.33 +.13 +11.6 Eqlndexxn32,30 +.17 +7.6 Europern 19,63 +.07 +11.5 FLIntna 10.99 -,01 +5.1 GNMAn 0.61 -.01 +5.6 Growlhn 26.59 +.26 +8.0 Gr&lnxn 21.69 +.11 +7.9 HlthSdn 22.53 +.40 +3.7 Hl-ieid n 6.96 +.01 +9.2 ForEqn 15.24 +.03 +9.6 IntlBond n 9,81 -.07 +7.0 InlDisn 33.49 +.04 +16.7 IntlSlon 12,74 +.03 +9.2 Japann 8.54 +.06 +5.4 LatAmn 18.57 +.11 +66.0 M'Rhr, n 4 17 +? 0 MDBondn10.84 -.01 +7.4 MidCapn 50.87 +.59 +13.7 MCapVaIln23.21 +.22 +13.8 NAmer n 32.69 +.34 +5.2 NAsian 10.71 -.01 +34.2 New Era n 37.37 -.11 +35.3 NHoz n 30.24 +.46 +15.0 Nlncn 9.16 -.02 +7.9 NYBondn 11.49 -.02 +7.7 PSIncxn 14.82 -.04 +9.0 RealEstxn18,62 -.05+33.4 SaTecn 18.63 +.14 +0.6 ShtlBdn 4.73 ... +2.6 SmCpStkn31.49 +.53 +11.3 SmCapVa in35.87 +55 +15.9 Spec~rn 17.02 +.16 +12.2 Speclnn 11.93 ... +8.3 TFIncn 10.14 -.01 +8.3 TxFrHn 11.99 -.01 +10.1 TFIntmrn 11.29 -.02 +5.5 TxFrSIn 5.40 ... +3.1 USTInIn 5.47 -.01 +4.8 USTLgn 12.40 -.07 +14.9 VABondn 11.83 -.01 +7.9 Valuen 23.17 +.21 +12.2 Putnam Funds A: AmGvAp 9.10 -.02 +5.4 AZTE 9.40 -.01 +7.8 ClscEqAp 12.87 +.10 +8.6 Convp 16.81 +.08 +3.7 DiscGr 17.14 +.23 +4.8 DvrlnAp 10.27 ... +10.3 EuEq 20.75 +.04 +14.9 FLTxA 9.37 -.01 +8,1 GeoAp 18.20 +.07 +8,8 GIGvAp 12.70 -.06 +7.5 GIbEqtyp 8.49 +.03 +11.7 GrInAp 19.45 +.17 +8.7 HIthAp 62.00 +.64 +12.2 HIdAp 8.01 +.02 +10,0 HYAdAp 6.04 +.01 +10.4 InomnAp 6.91 -.01 +7.0 Int[Eqp 23.48 +.05 +13.3 IntGrlnp 11.70 +.03 +12.7 InvAp 12.76 +.10 +10.9- MITxp 9.13 ... +7.3 MNTXp 9.12 -.01 +6.7 NJTxAp 9.35 -.01 +8,1 NwOpAp 41.80 +.47 +8,5 OTCAp 7.31 +.12 +5,3 PATE 9.24 -.01 +8.5 TxExAp 8.93 -.01 +8.2 TFInAp 15.19 -.02 +7.8 TFHYA 13.04 ... +10.7 USGvAp 13.27 -.01 +5.4 UtlAp 10.82 +.09 +25.5 VstaAp 9.53 +.09 +12.2 VoyAp 16.41 +.17 +2.9 Putnam Funds B: CapAprt 17.92 +.19 +11.1 CIscEqBt 12.77 +.10 +7.9 DiscGr 15.85 +21 +4.0 DvrinBt 10.19 ... +9.6 Eqlnct 17.46 +.14 +10.8 EuEq 20.00 +.04 +14.1 FLTxBt 9.37 -.01 +7.4 GeoBt 18.03 +.08 +8.0 GllncBt 12.66 -.06 +6.7 GbEqt 7.74 +.03 +10.9 GINIRst 26.42 -.22 +36.5 GrnBt 19.18 +.17 +7.9 HIthBt 56.51 +.57 +11.3 HiYidBt 7.97 +.01 +9.1 HYAdBt 5.96 +.01 +9.5 IncmBt 6.86 -.02 +6.1 IntGrnlt 11.47 +.03 +11.8 IntlNopt 11.25 +.05 +13,8 InvBt 11.70 +.09 +10,1 .NJTxt 9.34 -.01 +7.4" NwOpBt 37,62 +,42 +7.7' NwValp 17.80 +.15 +11.1 NYTxBt 8.87 -.01 +7.2 OTCBt 6.47 +.10 +4.5 TxExBt 8.94 -.01 +7.6 TFHYBt 13.06 -.01 +10.0 TFInBt 15.21 -.02 +7.0 USGvBt 13.20 -.01 +4.7 ULtBtI 10.76 +.08 +24.5 VistaBt 8.34 +.09 +11.5 VoyBt' 14.31 +.15 +2.1 Putnam Funds M: Dvrncp 10.19 +.01 +10.1 Royce Funds: LwPrStkr 14.66 +.18 4+3,9 MicroCapl 15.17 +.17 +6.3 Preied r 15.05 +.20 +9.5 TotRellr 12.38 +.16 +13,2 Russell Funds S: QuantEqS 37.94 +.38 +8.9 Rydex Advisor: OTC n9.80 +.10 +.3 SEI Portfolios: CoreFxA n0.58 -.02 +.9 InlEqAn 10.86 +.03 +11.1 LgCGroAn18.35 +.23 +4.6 SLgCValAn21.84 +,16 +14,5 STI Classic: CpAppLp 10.99 +.13 -1.0 CpAppAp 11.62 +.13 -0.7 TxSnGrTp 24.50 +.29 +4.5 TxSnGr.Lt22.99 +.26 +3.5 VlngoSA 12,55 +.13 +10.0 Salomon Brothers: BaevncBp 12.77 +.03 +5.3 Oppodrt 49,55 +.44 +17.4 Schwab Funds: 10001nvrn34.86 +.32 +9.0 S&Plnvn 18,61 +.17 +7.6 S&PSeln 18,69 +.18 +7.8 YIdPrsSI 9.68 ... +3.0 Scudder Funds A: DrHiRA 43.71 +.24 +14.3 RgComAp 17.29 +.15 +18.4 USGovA 8.59 -.01 +5.5 Scudder Funds S: EmMkln 11,04 +.01 +25.4 EmrMkOGrr 18.71 +,06 +34.2 GbBdSr 10.23 -.05 +7.9 GIrDis 36.38 +.29 +23.2 GIobalS 27.56 +.06 +19.7 Gold&Prc 15.46 -.14 +1.2 GrEuGr 27.17 +.04 +15.6 GroIncS 21.86 +.20 +8.0 HiYldTx 12,93 -.01 +9.0 Incomes 13,02 -.04 +8.1 IniTxAMT 11.42 -.02 +5.9 Intll FdS 44.33 +.08 +13.3 LgCoGro 23.84 +.21 +5.1 Laltnr 36.16 +.25 +59.3 MgdMunIlS9,24 ,,, +7.3 MATFS 14.65 -.01 +6.9 PacOppsr 13.86 +.04 +25.2 ShtTmBdS 10.08 -.01 +2.5 SmCoVSrn27.17 +.49 +16.4 Selected Funds: AmShSp 37,51 +.09 +9.5 Sellgman Group: FronLrAt 12.57 +.22 +2.3 FrontrDt 11.09 +.20 +1.5 GIbSmA 15.81 +.19 +17.7 GIbTchA 12.09 +.15 0.0 HYdBAp 3.40 +.01 +8.1 Sentinel Group: ComSAp29.46 +.20 +7.9 Sequoia n149.96 +.52 +0.6 Sit Funds: LrgCpGr 34,56 +.19 +9,6 Smith Barney A: AgGrAp 93,97 +.54 +7.0 ApprAp 14.51 +.10 +6,3 FdValAp 14.72 +.09 +2.0 HilncAl 6.83 +.01 +8.9 InAICGAp 13.46 +.05 +11.7 SBCplnc 11643 +,07 +9.8 Smith Barney 1: DvSlrl 17.09 +.16 +0.4 Grini 15.15 +.13 +5.1 St FarmAssoc: Gw/h 48.56 +.43 +7.3 Stratton Funds: Dividende36.68 -.39 +22.9 Growshx 41.77 -.69 +21.1 SmCape 42.28 +.31 +24.5 SunAmerica Funds: USGvBt 9,56 -.01 +7.0 SunAmerica Focus: FLgCpAp 17.23 +.16 +1.4 TCW Galileo Fds: SelEqty 18.61 +,07 +2.0 TD Waterhouse Fds: Dow30 n10,51 +.11 +2.3 TIAA-CREF Funds: BdPlus 10.35 -.06 NE Eqlndex 8.64 +.09 +9.4 Grolnc 12.16 +,06 +7,3 GroEq 9.06 +.09 +3,8 HiYrdBd 9.20 -.04 NE IntlEq 10.41 +.03 +7.9 MgdAkc 11.08 ... +5.6 ShtTrfd 1048 -.04 NE SocChEq 9.15 +.09 +5.1 TxExBd 10.98 -.05 NE Tamarack Funds: EntSmCo 31.88 +.61 +5.3 AA44OL BO '.52 .217 .39 ~ 219 .2n -h NOV h-h %f AAL Au.M: A.Lj42 I .4. NAV 95 4.Onul O0+dP 4 4.09(J-r 52~ 29 4.4 NOVl 1,4I 484 Value 45.21 +.33 +12.7 Templeton Instit: ForEqS 20.04 .. +16.4 Third Avenue Fds: Inllr 19.53. ... +26.8 RIEstVIr 29.55 +25 +31.3 Value 55.73 +.55 +23.4 Thrlvent Fds A: HiY d 5.13 +.01 +9.6 Incom 8.79 -.02 +6.7 LgCpStk 25.55 +.23 +7.8 TA IDEX A: FdTEAp 11.88 -.02 +6.9 JanGrowp 23.92 +25 +9.0 GCGIobp 23.89 +.09 +6.4 TrCHYBp 9.26 +.01 +9.2 TAFbln p 9.58 -.01 +8.1 Turner Funds: SmlCpGrn23,01 +.51 +4.4 Tweedy Browne: GlobVal 24.60 +.04 +13.9 US Global Investors: AIIAm n24.52 +.21 +9.1 GIbRs ... ... NA GldShr 7.42 -.13 +6.0 USChinae 6.88 +.02 +20.6 WdPrchn 15.04 -.26 +11.9 USAA Group: AgvGt 29.49 +.45 +13.6 CABd 11.34 -.01 +9.4 CmslStr 26.74 +.13 -+8.4 GNMA 9.73 -.01 +5.1 GrTxStrx 14.85 +.02 +12.2 Grwth 14.03 +.22 +12.8 Gr&Incx 18.54 +.14 +8.3 IncStkx 16.85 +.08 +11.8 Incox 12.46-.08 +7.8 Intl 21.43 +.06 +10.0 NYBd 12.18 -.02 +9.6 PrecMM 14.66 -.11 +4.4 SaTech 9.30 +.10 +0.8 ShtTBnd 8.91 ... +2.9 SmCpStk 14.08 +,23 +17.5 TxEt 13.39 -.02 +7.3 TxELT 14.32 -.02 +9.8 TxESh 10.70 ... +2.7 VABd 11.82 -.01 +8.5 WkdGr 17.57 +.06 +9.1 Value Line Fd: LevG1 n26.10 +.43 +11.2 Van Kamp Funds A: CATFAp 19.07 -.03 +9.1 CmslAp 18.30 +.13 +12.4 CpBdAp 6.76 -.01 +8.4 EGAp 38.64 +.42 +5.8 EqlncAp 8.61 +.03 +11.8 Exch 359.36 +1.64 +7.6 GrInAp 20.54 +.14 +14.2 HarbAp 14.13 +.05 +2.5 HiYIdA 3.59 ... +8,1 HYMuAp 10.95 ... +12.0 InTFAp 19.09 -.02 +8,5 MunlAp 14.88 -.02 +8.1 PATFAp 17.64 -.02 +8.6 StrMunlnc 13.38 ... +11.7 US MtgeA 13.91 -.01 +5.4 , UIlAp 18.45 +.14 +29,5 Van Kamp Funds B: CmstIt 18.31 +.13 +11.6 EGBt 33.06 +.35 +5.0 EnterpBt 11.35 +.14 +4.9 EqIncBt 8.49 +.04 +11.2 HYMuBI 10.95 -.01 +11.1 MulB 14.8, -.02 +7.3 PATFB1 17.59 -.02 +7.8 StrMunInc 13.37 ... +10.9 USMtge 13.86 -.01 +4.6' UIilB 18.42 +.13 +28.4 Vanguard Admiral: 500Adml nl10.75+1.02 +7.9 GNMAAdnlO.42 -.01 +6.7 HithCrn 55.88 +.51 +11.1 HiYklCpn 6.26 ... ,+.5 rTAdmln 13.57 -.02 +6.3 LIdTrAdn 10.82 -.01 +2.7 PmnCaprn63.22 +.46 +7.8 STsyAdmln10.43 -.01 +2.6 STIGrAdn 10.60 -.01 +3.4 TIBAdmln10O.29 -.02 +7.4 TStkAdm n28.70 +.29 +9.7 WelltinAdmn52.36+.23 +11.2 Windsorn 60.81 +.48 +11.0 WdsrllAdn55.75 +.40 +15.0 Vanguard Fds: AssetA n24.44 +.23 +9.6 CALTn 11.91 -.02 +8.9 CapOppn 30.63 +.34 +19.9 Convrn 12.69 +.08 +2.1 DivdGron 12.05 +.12 +8.,1 Energy 49.34 -.38 +48.3 Eqlncn 23.45 +.22 +12.0 Exp[rn 74.92 +1.21 +10.1 FLLTn 11.91 -.02 +7.9 GNMAn 10.42 -.01 +6,6 Grolncn 30.66 +.32 +9.1 GrthEqan 9.55 +.12 +3.8 HYCorpn 6.26 ... +8.4 HICren 132.039 +1.21 +11,0 InflaPron 12.58 -.04 +10,3 IntlExpIrn 17.00 +.03 +24.4 InllGrn 18.69 +.07 +12.3 IntValn 31.10 +.11 +14.8 mGraden 10.04 -.03 +7,9 ITTsryn 11.26 -.04 +6.9 UfeConn 15.25 +.06 +8,0 UfeGron 20.00 +.16 +10.2 Ufelncn 13.53 +.02 +7,3 UfeModn 17.90 +.10 +9.5 LTIGraden 9.97 -.07 +18,5 LTTsryn 12.07 -.07' +17.1 Morgn 16.40 +.15 +7.8 MuHYn 10.92 -.02 +8.7 MulnsLgn 12.90 -.02 +8.5 Mulntn 13.57 -.02 +6.2 MuLtdn 10.82 -.01 +2.7 MuLongn 11,52 -.02 +8.4 MuShrtn 15.58 ... +1.8 NJLTn 12.12 -.02 +7.8 NYLTn 11,59 -.02 +8.4 OHLTTEn12.27 -.02 +7.5 PALTn 11.62 -.01 +7.7 PrecMtls r n17.67 +.07 +34.9 Pmrcprn 60.90 +.44 +7.6 SelValurn19.45 +.21 +21.4 STARn 18.90 +.07 +10,6 STIGradenlO.60 -.01 +3.3 STFedn 10.36 -.02 +2.7 StratEqn 22.14 +.31 +17.9 USGron 16.23 +.18 +5.1 USValuen14.10 +.13 +12.9 Wellslyn 21.80 +.02 +10.6 Welltnn 30.31 +.13 +11.1 Wndsrn 18.02 +.14 +11.0 Wndslln 31.41 +.23 +14.9 Vanguard Idx Fds: 500 n110.74 +1.02 +7.8 Balanced n9l.47 +.10 +8.9 EMktn 15.57 +.07 437.5 Europen 25.88 +.10 +15.2 Extend n 32.00 +.42 +15.5 Growthn 26.14 +.28 +4,2 ITBndn 10.68 -.04 +8.9 LgCaplxn 21.42 +.19 +9.2 MidCapn 16.27 +.16 +19.6 Pacificn 9.16 +.08 +6.4 REITrn 19.44 +.13 +30.5 SmCapn 27.07 +.46 +13.9 SmICpVIn14.22 +.23 +17.6 STBndn 10.07 -.01 +3.1 TotBndn 10.29 -.02 +7.3 TotllntIn 12.57 +.06 +14,8 ToiStkn 28.70 +.29 +9.6 Valuen 21.56 +.16 +14.2 Vanguard Instl Fds: Instldx n109.84 +1.02 +.0 InsPIln 109.84 +1.01 +8.0 TBlstn 10.29 -.02 +7.4 TSInsIn 28.70 +.29 +9.7 Vantagepoint Fds: Growth 8.01 +.08 -0.3 Victory Funds: DvsStA 16.44 +.07 +8.3 Waddell & Reed Adv: CorelnvA 5.82 +.04 +12.8 Wasatch: SmCpGr 41.00 +.76 +14.5 Weitz Funds: PartValx 23.39 +.07 +9,2 Values 36.64 -.05 +8.7 Wells Fargo Funds: Opptylnv 46.83 +.34 +10.7 Western Asset: CorePlus 10.69 -.01 +9.9 Core 11.50 -.01 +8.0 William Blair N: GrowthN 10.68 +.13 +8.2 Yacktman Funds: Fundp 15.19 +.06 +7.4 Stocks up sharply as oil plummets Associated Press NEW YORK Wall Street roared back Tuesday, pro- pelling the Dow Jones industri- als up 114 points as crude oil prices plunged more than $2 and consumer confidence surged to a three-year high. Investors bought up stocks as crude oil, which had closed above $60 per barrel Monday for the first time, fell to $58 amid profit-taking following the recent run-up in prices. Light crude settled at $58.20, down $2.34, on the New York Mercantile Exchange. In addition, the Conference Board's consumer confidence index rose to its highest level since 2002, and consumers' optimism about the future also rose. That gave the market enough impetus to rebound from last week's oil-driven sell- ing that sliced more than 325 points from the Dow.. "The sell-off last week was a little much based on the under- lying economic fundamentals," said Scott Wren, equity strate- gist for A.G. Edwards & Sons. "Companies were able to make plenty of money over the last two quarters when oil was in the mid-$50s, and consumers will continue to spend money at these levels. It was just over done, and we're getting some of it back now." According to preliminary calculations, the Dow rose 114.85, or 1.12 percent, to Market watch June 28, 2005 Dow Jones +114.85 industrials 10,405.63 Nasdaq +24.69 composite 2,069.89 Standard & +10.88 Poor's 500 1,201.57 Russell +13.17 2000 641.48 NYSE diary Advanced: 2,366 New highs Declined: 899 160 New lows Unchanged: 152 27 Volume: 1,812,814,125 Nasdaq diary Advanced: 2,215 New highs 95 Declined: 842 New lows Unchanged: 162 36 Volume: 1,607,586,566 AP 10,405.63. Broader stock .indicators also moved sharply higher. The Standard & Poor's 500 index closed up 10.88, or 0.91 percent, at 1,201.57, and the.Nasdaq composite index climbed 24.69, or 1.21 percent, to 2,069.89. Bonds fell sharply after a long stretch of gains tied to concerns over oil. The yield on the 10-year Treasury note rose to 3.97 percent from 3.91 per- cent late Monday. The dollar '4th u S f.. Starts TOd FRE EIVER & EU :1.1.: aN Foam memo Pi SIto -Sw .e 0 on the Best K:4 1 LO A I 1k 1411M 5YR. WARRANTY TWIN SET ....... 49 QUEEN SET.....2 FULL SET....... 99 KING SET.......$34 95 WITH RFRATF nlCPON S S I,~, 15 YR. WARRANTY TWIN SET .....$199 QUEEN SET. 299 T FULL SET .....269 KING SET.........369 WITH REBATE COUPON * I13 T n-. KVV-rtMlN I TWIN SET........2999 QUEEN SET...$44995 FULL SET.........$399 KING SET.........54995 WITH REBATE COUPON 20 YR. WARRANTY TWIN SET .......299 QUEEN SET.,, 46995 FULL SET 369........ KING SET.........$59995 WITH REBATE COUPON . I hi SWIVEL ROCKER 4 colors to $ 19 95 choose from..... 7r r BEST CHAIR WALL. HUGGER RECLINER 6 colors to $ 29995 choose from.... LADIES SWIVEL ROCKER RECLINER 8 colors to $SA49O choose from.... % r CHAISE ROCKER- RECLINER 6 colors to $13 95 choose from..... o. ur i n : Fum FURNITURE PALAC3106 S. Florida Ave. & MATTRESS WAREHOUs(Hwy41) 1.5 MilesS. & MATTRESS WAREHOUSE'Of The Courthouse Inverness 726-2999 - reached an eight-month high against the Japanese yen and rose slightly against the euro. Gold prices fell. The market's upswing pro- vided some stability going into Thursday, when the Federal Reserve will release its deci- sion on interest rates less than two hours before the market closes and the second quarter ends. Investors hope the Fed will shed light on how long rates will continue to rise, as well as the impact of oil on the economy. "It's good to see the dollar rise. It's good to see oil come down. And it's good to see con- sumer confidence numbers like this," said Hugh Johnson, chairman and chief investment officer of Johnson Illington Advisors. "But we still have problems out there that need to be addressed, starting with the Fed. So while we have a nice move higher, it likely won't last that long." . Starting on Thursday with the Fed and stretching through July, investors will be inundat- ed with economic data and the first wave of second-quarter earnings reports. The upcom- ing news will likely keep investors on the sidelines until the market can sift through the data and choose a direction. Analysts at Morgan Stanley raised its price target for crude oil to $50 per barrel in 2005 and 2006, up from a $43-per-barrel projection earlier this year. 8A WEDNESDAY JUNE 29, 2005 'Judgment is not the knowledge of fundamental laws; it is knowing how to apply a knowledge of them." Charles Gow FACT VS. RUMOR Be careful about making snap judgments There is huge national interest in the coming first-degree murder trial of John Couey. Couey is the sexual predator who was arrested and charged with the kidnapping and murder of 9-year-old Jessica Lunsford of Homosassa. Couey originally confessed to the crime, but later came back and pleaded inno- cent to the capital charges against him. THE I From the very The fac beginning, the hor- the COL rifle abduction and murder of young OUR O1 Jessica has pro- duced a tremendous Be ca number of rumors about and accusations from people on the fringe. This case will take more than nine months to prepare for trial and you can expect plenty of additional rumblings for many months to come. The case is extremely high profile because it has created a national firestorm about how sexual predators are permitted to operate with very little official interaction. On the positive side, the firestorm has created an atmosphere where reforms will be implemented across the nation. If those reforms save the life of just one child, the effort will be worthwhile. But on the negative side, expect all sorts of crazy things to be said. Just last week, the charge was that Couey's original confession would not be permit- ted in court because the county sheriff's office failed to read People's docks t Last Tuesday, friends and I went and tried to take our boats over to the Third Street pier, the pub- lic dock, so that we could go walk and have breakfast on Citrus Avenue. To our amazement, all of the boat slips were taken by CALL commercial boats ... Why 563- is this public (pier) that the public is paying for, why are these docks being used by a commercial business? These are the people's docks. They should be able to park there and not these other boats park there all hours of the day and night. And they're not supposed to even be parked there at night. I wish someone would look into this and make public docks public once again. RFshbowl runoff Help. I live on Fishbowl Drive and with all the new construction going on two houses going up, sand piled up water has no place to go but right in the front yard and in the road on Fishbowl Drive and the neigh- bors' yards and it will run back into to the river. It's no different than the one where they're putting the sewer in. The water is going into the river anyway. Everyone that we've called that has had anything to do with this or even knows anything, says to wait 'til the house gets built and sue the person that owns it. Well, I think there should be an engineer who knows a little bit more about how to raise that road up and put a retention pond there so that water can go in. The people on Bluewater Court can t F r 0 him his Miranda rights. The cable news commentators immediately got judgmental about the effectiveness of our county sheriff's office. The problem is that the origi- nal information about the Miranda rights was wrong. Transcripts released late last week by State Attorney Brad King show that law enforcement officials from the sheriff's office, the SSUE: FBI and the ts about Savannah Police ey case. Department read ey case. Couey his rights on seven different PINION: occasions. utious This community umors. is hungry for infor- mation about the case, but we urge residents to be careful about what they hear. Folks looking for television ratings or those with political vendettas are quick to jump on any criticism of Sheriff Jeff Dawsy or other elected offi- cials involved. Sometimes those critics jump before they make sure their information is correct. The high interest in this case has had another unfortunate impact. John Couey will not face a jury in Citrus County. The pub- licity has been so tremendous that court officials on both sides already concede that an impar- tial jury would be hard to come by in our community. The moving of the trial will make the hunger for information that much more intense. The murder of young Jessica is bad enough. Be careful about reaching other conclusions before the real facts get out. hardly get into their island over there. We're in a real bad mess over here and we can't get anybody to listen. Build a toll road I read with interest the article about the 10 most dangerous intersections in Citrus County, five of them being on (U.S.) 19. You'd )579 think some intelligent people by now would have come up with an idea of maybe put- ting a thruway or a toll road or some way to get the traffic from the south- ern part of the county all the way up to the northern part of the county without having to go on (U.S.) 19. I'm sure if intelligent people thought of this, the intelligent people of this county would back it. That way we wouldn't have all these accidents and traffic on (U.S.) 19. It won't alleviate all of them, but it surely would help. Maybe some intelligent person could come up with this idea. Gun safety On the issue of the little boy ... who shot and killed his friend acci- dentally, the other parents are really upset. I would say to Mrs. Ash, as well as all parents: We all take responsibility for our children's actions. We have to teach our chil- dren not to play with guns, not depend on the other parents teaching their children not to play with guns. Let's all show some responsibility in teaching our children what's safe and what's acceptable and what is not safe and what is not acceptable. My heart goes out to Mrs. Ash, but it also goes out to Johnny's parents. What a shame. Let's stop childish rhetoric C TRUS COUNTY CHRONICLE EDITORIAL BOARD Gerry Mulligan .........................publisher Charlie Brennan .................................editor Neale Brennan ...... promotions/community affairs Kathle Stewart ........advertising services director Steve Arthur ................... Chronicle columnist v 'T attacks against the United States." And billionaire George Soros said, "War is a false and misleading L' combating terrorism." Rep. Dennis Kucinich, Democrat from Ohio and also a liberal, said, "Afghanistan may be an omas incubator of terrorism, but IER it doesn't follow that we bomb Afghanistan." Now CES there is a man in need of therapy. That great spiritual guru and cam- era-chaser, the Rev. Al Sharpton, engaged in liberalism's favorite pas- time: Blame America first. Sharpton said the attacks on the World Trade Center were evidence that "'America is beginning to reap what it has sown." Rove didn't mention Democrats, so if the Democratic leadership respond- ed to his critique of liberals, I guess those feigning outrage must be consid- ered liberals. There are few, if any, statements I could find from any leftist organiza- tion con- servatives about the response to 9/11. p I I 1 I .4 c OPINIONS INVITED The opinions expressed in Chronicle editori- als are the opinions of the editorial board of the newspaper. I. Slne.com. based on the voice at the other end of the line. Chester H. Cowen Hernando Change grading process Another round of school grades has come and gone and the "accountabili- ty process," which is basically driven by the FCAT, lives on. In the early '90s, when Blueprint 2000 became our state's school improvement process, we all knew down the line there were going to be some horrible inconsisten- cies when school grades came on the scene. What we didn't realize was the fact that the FCAT would basically determine a school's grade. In fact, it has also determined the curriculum and how teachers spend a great off hosts "After Hours" on Fox News Channel Saturdays at 11 p.m. Direct all mail to: Tribune Media Services, 2225 Kenmore Ave., Suite 114, Buffalo, N.Y. 14207. Readers may leave e-mail at. Dialing for dollars A year ago, I received a call in ref- erence to a $30 donation to an organization. After much research locally to find this organization, I realized it was not in Citrus County, even though the letterhead made reference to this county. Upon receipt of the literature that contained an Inverness post office box number, the telephone number listed was a toll-free number to a location outside of our area. This same incident has taken place this year with a request for $30, which drops to half the amount when they learn you are on a fixed income. The point of this letter to the pub- lic is the fact I remembered the post office box number from last year because I had done my best to find out who these people were. The paper has the following: Citrus County Professional Paramedics and EMTS International Association of EMTS & Paramedics. Upon receipt, I called the county commission office, and it was suggested I tele- phone the Sheriff's Fraud Division, which had no information about these people. I was then referred to the EMT office and was informed that they in no way receive any money from these people. Today, I called Tallahassee and found that solicita- tions are outside of the no-call list. The person to whom I spoke suggest- ed that if I did not wish to contribute to a solicitation based upon my inner feelings, not to. Perhaps others are also receiving the same calls that are somewhat demanding, amount of their time, especially in the lower grades. Our school system is to be com- mended for their efforts in providing a sound, quality education for those who want to succeed. We have a ter- rific educational climate and environ- ment for our students to achieve. Even though Citrus is one of the leading districts in the state according to the FCAT, I firmly believe our school grades would be even better if they were based on something other than basic performance accountability. I recently had the pleasure of attending Crystal River High School's Award Assembly to award two schol- arships. I was pleased to learn that 86 of the 250 graduates were honor grad- uates. Also, 134 of the 250 were Florida Bright Scholarship candi- dates. Over $2 million in scholarships were awarded that night Crystal River High School has an excellent curriculum, with many Advanced Placement, Dual Enrollment, and honors courses. Does this sound like a high school that deserves a D grade? I think not! The D grade was based on the other end of the spectrum, the FCAT. The unfortunate fact remains that there are a certain few students that could care less what they score on the test, especially at the secondary level. Citrus County will excel on any method of accountability, but for heaven's sake, let's measure the things that matter most We need to get our state legislators to make some serious changes in the process. Bill Sheets, retired Citrus County Schools. D democrats, after tak- ing it on the chin for Sen. Dick Durbin's .. remarks comparing U.S. interrogation tactics at Guantanamo Bay, Cuba, to those used by Hitler, Stalin and Pol Pot, are trying to change the subject by jumping all over White House deputy chief of staff Cal Th Karl Rove. "OTH In a speech last Wednesday to the VOlI want- ed to prepare indictments and offer therapy and understanding for our attackers." Rove added, "Conservatives believed it was time to unleash the might and power of the United States military against the Taliban... liberals believed it was time to submit a peti- tion." circulat- ed a petition appealing to the presi- dent to use "moderation and restraint in responding to the recent terrorist LETTERS to the Editor --I-----~I --L-- ('mTN I^ (n Vv(flC-nnr ENEDYJN 2,205S V.., 4,Lv ""~-1t^W ,. I "- -"" L ,2r- ^ 1 ,v* .. *. -4 .'.."* ...."'..., . BA .- ,. r' o tN,'" 1 ^ ^ r ,' "_-, ',,, ' "WITH GOOD PEOPLE, SAME VALUES, AGE DOESN'T MATTER. ESPECIALLY WHEN YOU'RE WORTH OVER $21 BILLION." 71 YEAR-OLD LAKE COUNTY BRIDE After 71 years, First Federal Savings Bank has become part of the Colonial Bank family. And things couldn't be any sweeter. personal and commercial loans. Visit today. And help us welcome our new extended family. COLONIAL BANK. Member FDIC .~ II ' . . . . . . . y L ~__ ~~ WEDNESDAY, JUNE 29, 2005 9A CrrRus CouNTY (FL E t "a ... ....... `* 10A WEDNESDAY JUNE 29, 2005 ,n 0 f - A : HealthSouth CEO acquitted Nation BRIEF Derailment Richard Scrushyfound not guilty of all charges, including 36 counts offraud Associated Press BIRMINGHAM, Ala. HealthSouth Corp. founder Richard Scrushy walked away a free man Tuesday after a jury cleared him of all charges in a stun- ning setback for federal prosecutors who sought to add his name to a list of CEOs convicted of fraud. Scrushy was the first of the high-profile chief Richard executives to escape Scrushy conviction since a wave evaded of corporate scandals conviction in and indictments fol- scandal wave. lowed Enron Corp.'s collapse almost four years ago, even though the case against him was widely considered among the strongest With all five former CEOs pleading guilty and testifying that Scrushy led a scheme to inflate earnings by $2.7 bil- lion at the rehabilitation and medical' services chain, some viewed the gov- ernment's case as stronger than in other fraud trials. Yet when it finished 21 days of delib- erations, the last five with an alternate replacing a sick juror, the panel acquit- ted Scrushy of all 36 counts of fraud, false corporate reporting and making false statements to regulators. Eight jurors who met with reporters after the verdict said key witnesses were not credible and the prosecution failed to present substantial evidence linking the fraud to Scrushy. "The smoking gun wasn't pointing toward Mr. Scrushy," said one juror, identified only by court-assigned number and not by name. Senate passes energy bill Aims to increase gas imports Associated Press WASHINGTON The Senate overwhelmingly ap- proved energy legislation embraced by both Republicans and Democrats Tuesday, but hard bargaining looms with House GOP leaders who favor measures more favorable to industry. After finishing most work on the bill late last week, the Senate approved the sweeping legislation 85-12. It includes a proposed $18 billion in energy tax breaks, an expansion of ethanol use and measures aimed at increasing natural gas imports to meet growing demand. But lawmakers acknowl- edged that the measure would do little, if anything, in the short run to stem the soaring cost of energy including oil that this week has eclipsed $60 a barrel and gasoline that last week averaged $2.22 a gallon at the pump, according to the Energy Department. "We still have many hurdles to overcome," said Sen. Jeff Bingaman, D-N.M., who led the Democrats in fashioning the massive bill. The bill passed by the House in April differs sharply from the Senate legis- lation over oil production and the degree of emphasis on con- servation. Sen. Pete Domenici, R-N.M., said the Senate bill would usher in "a new policy for the United States ... that energy should be clean, renewable and that we have conserva- tion" to curtail energy demand. He said it would help assure a broad mix of energy sources in the future from nuclear power to wind energy. But the Senate deliberately skirted some of the most con- tentious energy issues facing Congress. The legislation says nothing about drilling in the Arctic National Wildlife Refuge in- Alaska, although that's a top priority of the Bush adminis- tration. The House-passed bill calls for developing the refuge and assumes $2.6 billion over 10 years in federal revenue from refuge oil lease sales. President Bush praised the Senate for passing the meas- ure, saying it would help U.S. economic growth by address- ing the causes of high energy prices and the nation's dependence on foreign sup- plies of energy. Italy asks for Interpol's help Wants to try 13 CIA agents Associated Press ROME Italian prosecutors want to extradite 13 CIA officials accused of kidnapping a radical Muslim cleric and transporting him to Egypt where he reported- ly was tortured, and they've asked Interpol to help track down the Americans, a court offi- cial said Tuesday. A man identified as the former CIA station chief in Milan is among the 13, according to a report by the judge who issued the arrest warrants. The American was traced by cell phone records to Egypt in the days after the abduction when the cleric was "likely undergoing the first" rounds of torture, according to the report obtained by The Associated Press. The Egyptian preacher was snatched in 2003, purportedly as part of the CIA's "extraordi- nary rendition" program in which terror suspects are transferred to third countries without court approval, sub- jecting them to possible ill treatment. The order for the arrests in the transfer of. the cleric - made public last Friday was a rare public. objection to the practice by a close American ally in its war on terrorism. The leftist opposition said Premier Silvio Berlusconi's government will respond in parliament Thursday to their demands to know whether Italian officials were involved. Court officials said they had no evidence of Italian involve- ment, but Vince Cannistraro, a former leading counterterror- ism official in the CIA, said he doubted the U.S. government would launch such an opera- tion in an allied country with- out coordinating first with the government "No question," he told AP in Washington, adding the govern- ment may look the other way, as happened in Sweden when two suspected Islamic terrorists were handed over to Americans. Prosecutors have asked the help of Interpol in tracing the suspects, all identified as U.S. citizens, said the court official who asked that his name not be used because the investigation is still under way The Milan prosecutor's office, in an- nouncing the arrests last week, also said it would ask for American and Egyptian assis- tance in the case. As the "not guilty" verdicts were read' on count after count, Scrushy started crying, then reached around and hugged his wife, Leslie, in the first row behind the defense table. "I'm going to go to a church and pray," Scrushy said as he left the courthouse. "I'm going to be with my family. Thank God for this." Emerging from the building to cheers from his supporters, Scrushy said, "You've got to have compassion, folks, because you don't know who's next. You don't know who's going to be attacked next." - Scrushy still faces civil charges by the Securities and Exchange Commission, which some experts say are more likely to be successful for the government. "I'm disappointed in the verdict," said U.S. Attorney Alice Martin, who plans to ask the 11th U.S. Circuit Court of Appeals to reinstate obstruction of justice and perjury charges that were thrown out earlier by U.S. District Judge Karon Bowdre. Scrushy's acquittal contrasts with recent convictions of several former prominent CEOs for their roles in vari- ous frauds, including Tyco International's former chief L. Dennis Kozlowski, former WorldCom boss Bernard Ebbers and Adelphia Communications Corp. founder John Rigas. A corporate law specialist who had followed Scrushy's trial was stunned at the verdict. "There was a mass of evidence against him. I certainly expected the jury to convict. I thought the prosecu- tion could get a fair hearing in Birmingham, but that appears not to be the case," said Larry Soderquist, direc- tor of the Corporate and Securities Law Institute at Vanderbilt University. Soderquist noted that the defense appeared to appeal throughout the trial to the sympathies of the jury, composed of seven blacks and five whites. Soderquist said Scrushy, a white busi- nessman, has "a very high reputation in the African-American community" as he took on a more visible role at black churches in the months after his indictment.. France's Greens and other environmen- Associated Press Two freight trains collided Tuesday in west Jackson, Miss., starting fires around the engines and in a nearby wooded area. No serious injuries were reported. World BRIEFS' Ahoy Associated Press The Turk, a replica 18th cen- tury man-o-war that played the HMS Victory on Tuesday in the Battle of Trafalgar re- enactment, sails off the coast of Portsmouth, Eng- land. Tuesday marked the 200th anniversary of the Battle of Trafalgar, during which Adm. Horatio Nelson routed Napoleon Bonaparte's French and Spanish forces and ensured that Britain ruled the waves for more than 100 years. Sainthood process' begins for pope . ROME The Roman Catholic Church placed Pope John Paul II on the path to saint- hood Tuesday during a joyous ceremony at a Roman basilica - the fastest start to a beatifica- tion process in memory for a man many considered a saint T long before he died. Cardinal Camillo Ruini, John i Paul's vicar for Rome, presided over the Latin-filled ritual launch ing the beatification "cause" at \ the Basilica of St. John Lateran.' During the ceremony attend- ed by cardinals, archbishops and other faithful, key officials sat at a table set up on the altar; standing to recite an oath to keep their work secret and to refuse any gifts that might cor- rupt the process. From wire report France chosen for nuclear fusion testing Associated Press PARIS France was chosen Tuesday as the home for an experimental $13 billion nuclear fusion project scientists say will produce a boundless source of clean and cheap energy. A consortium of United States, the European Union, China, Russia, Japan had been divided about whether to put the test reactor in France or Japan, and com- petition was intense. The United States had favored placing the plant in Japan. At stake was billions of dollars for research, construction and engineering. The threat of global warming has brought nuclear power currently avail- able only through fission and long out of favor back to the forefront as a way of generating energy because it creates no so-called greenhouse gases, a cause of global warming. Nuclear fission with heat as a byprod- uct occurs when heavy atoms such as those of uranium or plutonium are split. But the process leaves behind highly radioactive waste, and the reactors can catastrophically melt down. The major source of energy right now, talist groups argue, however, that the fusion project will turn the focus awaV from the immediate need to fight global warming. "This is not good news for the fight against the greenhouse effect, because we're going to put $13 billion toward a project that has a term of 30-50 years, when we're not even sure it will be effec- tive," Greens party lawmaker Noel Mamere said on France-Info radio. UFO for peace Associated Press Pensioner Joachim Oesterreich waves from his self-made "UFO" Tuesday in Boilstedt near Gotha, eastern Germany. Oesterreich has been living for 60 days in his high-grade steel space- craft In memory of the 60th anniversary of the end of World War II. With his action, the 65- year-old is demonstrating for peace all over the world. Associated Press The entrance of the Atomic Energy Commissariat (CEA) in Cadarache, southern France. A six-party consortium on Tuesday chose Cadarache as the site for nuclear experimentation. I : : . - CrrRUS3 OUTYA.~JI (.0) ',llLf'VUE "bhtT N TWE EDAJ E2,205 A Special to the Chronicle Special to the Chronicle Sarah Keene, 13-year-old daughter of Selena and Joel Steele, recently won the title of Miss Junior Homosassa Teen and will be competing for the title of Miss Junior Florida on Nov. 27. The winner of the state title will travel to New Jersey in July 2006 to compete for the national title of Miss Junior America. Sarah attends Crystal River Middle School and she is active in cheerleading, basketball and Girl Scouts. She has WHAT CAN YOU DO TO HELP PREVENT FISHING LINE -_ INJURIES? RECYCLE IT! Citrus County has installed Fishing Line Recycling Stations at a number of popular fishing piers and launching ramps. If you place your old fishing line in these containers it will be collected and recycled into new fishing equipment. The Fishing Line Recycling Stations are located at: 0 Fort Island Beach Fishing Pier M Fort Island Beach Boat Ramp M Fort Island Trail Park Fishing Pier M Fort Island Trail Park Boat Ramp John Brown Fishing Pier (Ozello) a MacRae's Boat Ramp (Homosassa) M Hernando Boat Ramp m Eden Park Fishing Pier m Eden Park Boat Ramp 0 Duval Island Boat Ramp Turner Camp Road Boat Ramp Chassahowitzka Campground Boat Ramp New locations: Redfish Hole m Mullet Hole P Fort Island Trail Bridge Homosassa Springs State Wildlife Park Crystal River State Preserve Please use the Fishing Line Recycling Stations and help us avoid injuries to marine wildlife while putting your old fishing line to a beneficial use. A Message from the Division of Solid Waste Management 527-7670 E-mail: [email protected] TDD Telephone 527-5214 received a Citizenship Award, Athletic Award, Academic Achievement Award and was on the Honor Roll all year. Sponsoring Sarah in the state pageant are her family and friends. The Miss Junior America Pageant has been in existence for 20 years and offers its con- testants an experience of a life- time with opportunities unlike any other pageant today. Many previous pageant win- ners, like Tiffani Amber Thiessen on "Beverly Hills 90201," among others, have AIRPORT 746-2929 been discovered in the Miss Junior America pageant by well-respected agents, man- agers and casting directors who judge the competitions. For more information on the Miss Junior America Pageant, call (800) 783-1115. ThnkYo Ctr sCony fr CRYSTAL CASUAL INC. Family Owned & Operated for 15 Years We Ship Nationwide 352-795-2794 Open Mon.-Sat. 10 A.M. to 5 P.M. HfStS 17892 W. Gulf to Lake Hwy., Crystal River On Rt. 441.4 miles E. of Hwy. 19 Eagles Ladies Auxiliary change your plan without changing your contract what's not to tunwS Cl Sg. L. thNaioalR0 oM* 900 Anytime Minutes $599 Unlimited Mobile-to-Mobile Minutes Unlimited Calls Homes. Unlimited Nights & Weekends Start your nights at Add lines for $9- 7:00 p.m. for $7T "al..-.il-,-am. ul S- Cii >-v: Camera phone Full Fhi,-rl ,: - Sale Price $ 999 OF Color sc SSale 9c screen Price la come and get your love" Cwireless wireless alltel.com 1-800-alltel9 Alitel Retail Store Authorized Agents Equipment offers at these locations may vary. Inverness Crystal River ComCentral Inverness Lecanto Citrus Shopping Center Charles Pope Cellular Crystal River Mall Charles Pope Cellular Charles Pope Cellular 2625 E. Gulf-to-Lake Hwy. Crystal River Mall (352) 564-8505 511 W. Main St. 6. 782 W. Gulf-to-Lake Hwy. (352) 860-2241 (352) 795-4447 Homosassa (352) 341-4244 (352) 564-2355 Charles Pope Cellular Charles Pope Cellular Proud Sponsor of. Business Sales 602 N. Suncoast Blvd. 4155 S. Suncoast Hwy. n @ g (800) 663-4886 (352) 795-7048 (352) 628-2891 *Coverage may not be available in all areas. See Alltel for details. **Federal, state and local taxes apply. In addition, Alltel charges a Regulatory Cost Recovery Fee (currently 56), Alitel Mon-Thurs 9:00pm-5:59am. Weekends are Fri 9:00pm. Additional Information: Limited-time offer at participating locations. While supplies last. Credit approval & approved handset required. $20 non-refundable activation fee applies. $200 early termination fee may apply. Offers are subject to the Alltel Terms & Conditions for Communications Services available at any Alltel store or alltel.com. All other product & service marks referenced are the names, trade names, trademarks & logos of their respective owners, @2005 Alltel Communications, Inc. A u **n ww, /Consumer\ SInformation \ Co /. --i DAVE SIGLER/Chronlcle Eagles Ladles Auxiliary officers from Eagles Aerie #3992 were recently Installed during an IQstallation dinner at the Inverness Aerie. Officer pictured from left rear are: Pat Baker, Inside guard; Marge Jobe, outside guard; Diane Watkins, secretary; Judi Nixon, treasurer; Dixie Peterson, Installing madam conductor; Deana Stetkar, chairman. Seated from left are: Bonnie Dreher, madam chaplain; Donna Marcinak, junior past president; Joan Ruggiero, madam president; Marilyn Hancock, vice president; and Joanne Cover, Installing grand madam president. Sarah Keene chosen as Miss Junior Homosassa CMH seeking program volunteers Citrus Memorial Hospital Volunteer Program is seeking vol- unteers that are interested in serv- ing the hospital four hours per week in various areas. Volunteers attend orientation, receive free uni- forms, a meal for every four hours worked and are invited to several social events during the year. A tiny bit of computer knowledge can be of great value to the Admitting and Medical Records Departments. Scanners are need- ed anytime from 8 a.m. to 8 p.m. The emergency room has open- ings for volunteers. A concierge is needed to greet patients and fami- lies and keep them informed of the process. The laboratory has several posi- tions available. This is a chance to work in all areas of the hospitals making deliveries and picking up lab specimens. If you are outgoing and enjoy doing a variety of jobs, this is for you. If exercise is what you are seek- ing, Nutritional Services will keep you busy dishing desserts, wrap- ping silver or delivering meals to patients. This position is for some- one that doesn't mind standing and walking. Volunteers are needed to assist Nutritional Services by taking meal orders using a palm pilot. Several other positions are open in offices, as transporters, and at the information desk. The next orientation wil' be July 6 from 8:30 to 11a.m. in the Gulf Room of the Administration Building. The second part of the orientation will be on July 8 start- ing at 8 a.m. You must be prereg- istered to attend the orientation. These service positions, along with others, are open now. Call Penny Zaphel, volunteer coordina- tor, at 344-6598. Unlimited Access! PER AMONTHI "^ ^NoC No.CrArd SETUP SOFTWARE I makes connecting fast & easy! 10 Email Addresses Webmaill INSTANTMESSAGING AIM, MSN and Yahoo Free LIVE Technical Supportl Immediate Access: Surup to JustS3mom seU &Xroster! S1- 795-7691 l^SsalNss "ss WEDNESDAY, JUNE 29, 2005 IIA COMMUNITY rrwzh M E "i iaI tCR C T)Ic 12A WEDNESDAY, JUNE 29, 2005 Canning center to offer salsa workshop Special to the Chronicle Spice up your life by making homemade salsa! In this work- shop, students will be learning in the classroom as well as actually making salsa in the kitchen. Bring lunch and an apron. For safety, wear Particip closed-toed shoes. be able The work- shop will be home from 9 a.m. to 2 p.m. Friday, both r July, 8, at the Can ning green Center, 3405 W Southern St., Lecanto, which is off of County Road 491 just north of State Road 44. The cost of the workshop is $25 per person and is limited to 12 people. Prepaid registra- tion is required and no refunds or transfers to other classes will be given. The deadline for registration is Thursday. To register, call Janet at 726-2141. Participants will make two a a re C kinds of salsa a red and a green variety. We will provide the jars, all ingredients and delicious recipes. Each person will be able to take home one jar of both kinds of salsa and a Ball Blue Book Programs and activities offered by 3nts will Florida Coop- erative Exten- to take sion Service are available ijar of to all persons without regard Dd and to race, color, handicap, sex, salsa. religion or national ori- gin. For persons with disabilities requiring special accommoda- tions, contact the extension office at 726-2141 at least five working days prior to the pro- gram so that proper considera- tion may be given to the request. For the hearing impaired, please contact the Florida Relay Center Service at (800) 955-8771. Worth y Kings Bay meeting will be Thursday The June meeting of the Kings Bay Association will be at 7 p.m. Thursday at the Coastal Regional Library in Crystal River. This will be a working meeting and an update on the native plant project and sewer project will be given. All those interested in the quality of our waters are welcome to attend. VFW posts meetings, events for July The Edward W..Penno Post of Citrus Springs will have its general meeting at 7 p.m. the first Tuesday monthly; Ladies Auxiliary will meet at 7 p.m. on the second Tuesday; the Men's Auxiliary will meet at 7:30 p.m. the third Monday; and the monthly staff meeting will be at 7 p.m. the third Tuesday. We will host our annual Independence Day Ceremony and Picnic on Monday. The ceremony will start at 11 a.m. and this year we will have a special treat for lunch a hot roast beef sandwich super plate with all the trimmings. The Country Bluegrass Band will entertain, so bring lawn chairs. On Friday, the post will be serv- ing oven-roasted turkey dinner from 5 to 7 p.m. and pork roast dinner will be served on July 8. Breakfast will be served from 8 to 10 a.m. Saturday. . Don't forget the weekly activities: bingo at 1 p.m. Tuesday, shuffle- board at 7 p.m. Wednesday, and dart tournament on Thursdays at 7. Companion program needs participants Are you age 60 or older and looking for a way to generate extra income while assisting others? Eligible prospective Senior Companion Program volunteers CASH OW Aseen FOR STRUCTURED SETTLEMENTS, on TV. ANNUITIES and INSURANCE PAYOUTS (800) 794.7310 J.G. Wentworth means CASH NOW for Structured Settlements! 727-0629 TUCRN FLORIDA DEPARTMENT OF ENVIRONMENTAL PROTECTION PUBLIC SERVICE ANNOUNCEMENT KNOW WHAT YOU NEED BEFORE YOU BUILD..... To protect Florida's fragile waterways, the DEP requires an Environmental Resource Permit for dredging or filling in wetlands and/or surface waters. If the project you are planning requires dredging or filling in a wetland area and/or surface waters, you may need a permit from DEP prior to construction. For further information, contact the DEP at (813) 744-6100. OGC Case No.: 05-0618 benefit from modest compensation, partial mileage reimbursement, an annual physical, supplemental accident and liability insurance, preservice and ongoing training, plus recognition events.. Call Tindy Cunningham, Senior Companion Program coordinator, at 527-5431. Thrift store raises funds for charity The Helping Hands Thrift Store is having an ongoing five items for $1 sale. Proceeds from all sales help benefit the less fortunate. ,, Donations are always welcome. Estate donations are also accept- ed. Items donated are tax deductible and a form will be pro- vided from Helping Hands. The thrift store is at 5164 S. Florida Ave. in the Heath Mini Storage units. It is open from 9:30 a.m. to 3 p.m. Monday through Saturday. Call 726-2660. Inverness man earns college degree Samuel A. McLain of Inverness was among the June 4 graduates of Furman University, Greenville, S.C. The school awarded 640 under- graduate and 77 master's degrees during its 179th commencement. SDinettes Stools Us Casual Dining (352) 237-5557 3131 S.W. COLLEGE RD. HwY. 200 OCALA, FLORIDA (Opposite Paddock Mall) What's your flvorite chil new bicycle on a :warm su1rrd 4;r f beach, goihn on a picnic? All cese to provide those memories. Eveyaiar, Chil Society brings loving families and children to er thr6 l adoption. We would love to speak with you about our optionn services, and the children we have available qif adoption. If you are interested in providing the lov i4 home that so many children need and deserve, please come'to one of our Adoption Open Houses. ' Wildwood Inverness ".j-;- Thursday, June 23 -. Wednesday, June 29.: 6:30pm 6:30pm ..:..; 1601 W-. Gulf Atlantic HwV 2315 Hwv 4.1N, Rm54.4" .-,14 536 352.865" :.gtare.informh toh,:about the many children a-nGifilis,, contact Children's children's 6aety at 866.427 51 x2, or home visit our website at SOCIety w. . or id a ild ren or 01 LO IDA' *. E-. n, C-n ~Irlpiring Lrfel Can you get the best interest rate on your terms? Absolutely! You choose the CD term! From 6 to 15 months A5 PY MERCANTILE BANK We takheyrbankingpersonally. Crystal River 1000 S.E. U.S. Highway 19 (352) 564-8800 Inverness 2080 Highway 44W (352) 560-0220 Member FroC wvhnv anklnercantle con 'Annual Percentage Yield (APY) is available and accurate as of date of publication and subject to change without notice. Minimum opening deposit is $2500,00. Fees may reduce earnings. Penalty for early CD withdrawal. $24.99 a month for 1 year. Taxes and surcharges apply. One-year term agreement required. After one year, pay $29.99 a month. $50 online rebate covers $49.99 activation fee. 4-Sprints" bundle and other Sprnt tr receive rebate. Limit of one rebate per household. Sprint will not honor lost, late, damaged, misdirected, illegible, incomplete or duplicate rebate forms. @2005 Sprint. All rights reserved. Sprint, the diamond loc design, Sprint PCS and Sprint Solutions are trademarks of Sprint Communications Company L.P EarthLink is a registered trademark of EarthLink, Inc. All other trademarks are property of their respective owne, SPONSOR AN EXCHANGE STUDENT For only three weeks, 25 students from Europe will arrive to play tennis and golf with several Citrus A County ~------CC-C-~--~ CITRUS CoUN7, (FL) CHiRONICLE COMMUNITY Cimus COrINTh (FL) CHRONICLE COMMUNITY ~~FDNE'~DA~ JIJNI 29. 2005 13A CMH volunteer training Special to the Chronicle New Volunteers were recently trained at Citrus Memorial Hospital. Volunteers are involved in 37 departments of the hospital. If you are interested in becoming a volunteer, please call Penny Zaphel, manager of volunteer services at 344-6598. Seated, from left, are: Bonnie Sany, Joyce Onyschuk, Catherine Davis, Renny Gerou, Doris Parsons. First row, from left, are: Betty Hillman, Audrey Gathany, Laurie Bouchard, Johnna Stiles, Donna Johnson, Jackie Reeves. Second row, from left, are: Charlotte VanBuskirk, Bernie VanBuskirk, Kathy Hildebrandt, Bob Kline, Linda Godby, Richard Colvin. Not pictured is Janet Welsh. SEALY POSTUREPEDIC'2' ADORNMENT PILLOWTOP QUEEN. 2-PC. SET STEARNS & FOSTER-' SILVER DREAM ULTRA PLUSH EURO PILLOWTOP $299999 QUEEN 2-PC SET SEALY POSTUREPEDIC DEVOTION FIRM OR PLUSH Seay. ) SEALY POSTUREPEDIC'-' WESTGLOW PILLOWTOP KING. 3-PC SET $369999 STEARNS & FOSTER" BRYANSTON FIRM STEARNS & FOSTER"' CHARLETON PILLOWTOP $ 799 $99 1049" 12499 OUEEN 2-PC SET OLEEN 2-PC SET t OUEEN 2-PC SET i.'IEEIJN -PC: SET '559' TWIN SET 9w TWIN SET k '829'STWIri SET '29 TTWIrJ SET '"90 FULL SET ''89 FULL SET V1 949" FULL SET 6149" F'ILL SET 'O9' KING, 3-PC '2i ']59 9" tirj - FPC SET Bring this ad and get an extra 10% off select Stearns & Foster ^ sets!! Visit our websile today We offer furniture 1or every room in your home E>c.:luie, Sitarnj LaraestLa-Z-Bov Showroom In Citrus County I, F.-'ster Dea3ler and iture.com 527-2558 Financin Feel at home with... Available -= - Easy iv nitr 4100 W. Gulf to Lake Hwy, Lecanto FL 34461 90 DAYS asy Livin u tureMon-Fri 9am 6 pm Sat 9 am 4pm, Sun 12pm 4pm S.A.C. . Free gift wrapping in-store everyday In-store postal service Bealls Online Service System BOSS*, Friendly return policy BEi2LLS beallsflorida.com Bealls & BeallsFlorida.com are operated by Bealls Department Stores, Inc. and by Bealls West Gate Corporation. To find the Bealls nearest you call 1-800-569-9038 Open daily 9-9, Sunday 10-8 CRYSTAL RIVER INVERNESS CRYSTAL RIVER PLAZA CITRUS CENTER 346 NORTH SUNCOAST BOULEVARD 2851 GULF To LAKE 352-795-7900 352-637-6250 clearance' --L...;-.... ..._ .'.. . - * '. .. .:. '. /: P ;='":":r' pa O i. ", Club donates to troops The Germania Verein (German Club) of Inverness donated tele- phone cards, snacks and packaged foods to the 690th MP Company serving in Afghnistan. The items were given to Tammie Griffin, secretary of the Family Readiness Group. Pictured, from left, are: Mary-Ann Virgilio, coor- dinator; Tanimie Griffin, secretary; Alex Griffin; Michael Griffin; and Lore Stiles, president of the Germania Verein of Inverness. Michael and f Alex are sons of Kenneth Griffin, a mem- ber of the 690th, cur- rently serving in Afghanistan. Special to the Chronicle - 1 1-11.-.n----1-11-17/*X4-i-ill WFDNI,,SDAY,, LJii- 2%, 2005 13At CmTus CouNTY (FLI) CHrRONICLE .............. IM/ ........... COMMUNITY CITRUS COUNTY (FL) CHRONICLE C" 1- Cr. T JTTVV1 .4A WEDNESDAY, JUNE 29, 2005 Quiet Quali Fans For Over 25 Years! DAN'S FAN CITY Avilbl-20 C m eria ay 271SW oleg. R Ov r 0, oc ti ns(o U 19 N xtto Sta sj ( n a .way Pl za Natinwie 35-68-326 35-237699 www .da sfancity* comi -A Sofas 9 Recliners Dinettes Coffee Tables End Tables * Entertainment Units Mattresses 'V i~ilftii ^wMRHUBB SKIDMORE'S FURNITURE 168 HWY 41 N. / P.O. BOX 340 / INVERNESS, FL 34451 (352) )726-5037,, UJ HRS:9-5.30 MON. FRI. 9 5:00SAT :',; .. ". ., .., * Special to the Chronicle ,St. Petersburg's Northeast High School Class of 1955 had its 50th reunion June 3 at the Trade Winds Island Grand Resort on St. Pete Beach. Attendees from Citrus County are shown. Front row, from left are: Jeanette (Hale) Touchberry, Sandra (Belcher) Ross, Tanya (Boyden) Carlson, Shirley (Zeigler) Patton; back row: Larena (Hardy) Davis, Joyce (Keel) Greene, Rodney Carlson. It was interesting, as only one or two knew the other ones lived here in Citrus County. All had a wonderful time. Inverness organizes patriotic evening Special to the Chronicle The city of Inverness invites the public to attend the Sunday fireworks display presented by Falcon Fireworks. This year, we hope to present an evening to remember how fortunate we are for our free- dom, by paying tribute to those who are serving in our Armed Forces, protecting and preserving our precious freedom. The fireworks display at dusk just keeps get- ting better and better, so bring lawn chairs or blankets and plan to attend the festivities Sunday. For more information or to make a donation toward the fireworks, contact the city of Inverness Department of Parks and Recreation at 726-3913. Donations can also be mailed to 212 W Main St, Inverness, FL 34450. NEW FURNnIURE ARRIVING DAILY Clearance Sale in Progress Now See these great values today! We Define Florida Living S629-0984 LEISUG E 315- State Rd 200 0 ,la 5 Eagiez Ne'st FURNITURE FOR FLORIDA ir,,n | I S 17th St PIar Now 2 Locations r.- H- 2002 S. Wh St. Quality & Value Since 1974 Fruitland Park Qs co5 718-0629-WCRN CITRUS COUNTY PLAT REVIEW TEAM July 6, 2005 9:00 AM Lecanto Government Building 0i 3600 West Sovereign Path Room 117 Lecanto, Florida 34461 Contact person: JOANNA L. COUTU, AICP, CHAIRMAN (527-5259) 1. CALL TO ORDER 2. OLD BUSINESS 3. NEW BUSINESS LR-05-20 Application for a Lot Reconfiguratiop by Ivy Van Norman on behalf of Paul Straubinger, located in Section 05, Township 20 South, Range 17 East MSP-05-08 Application for a Minor Subdivision Plat by Luann Baker, located in Section 06, Township 17 South, Range 18 East. PLT-05-29 Application for a Replat-Substantially Similar Plat Fernandes Addition (Lots 8 & E 1/2 of 7, Block B-231, Oak Village, Sugarmill Woods) by Tami Adams on behalf of Manuel J. and Jeannie Fernandes, located in Section 32, Township 20 South, Range 18 East PLT-05-13 Application for a Final Plat Brentwood Townhomes Phase III by William Lanigan on behalf of Brentwood Farms Limited Partnership, located in Section 23, Township 18 South, Range 18 East PLT-05-30 Application for a Replat-Substantially Similar Plat Rich Subdivision by William Lanigan on behalf of James Rich, located in Section 36, Township 18 South, Range 17 East PLT-05-32 Application for a Replat-Substantially Similar Plat Flamingo Point Subdivision by John L. Johnson, located in Section 7, Township 18 South, Range 17 East PLT-05-33 Application for a Preliminary Plat Parking Area, Inverness Highlands Unit 5 by Patrick L. Henson on behalf of Citrus County Department of Public Works, located in Section 36 Township 18 South, Range 19 East SV-05-02 Application for a Street Vacate by O.C. Cook, located in Section 15, Township 20 South, Range 20 East 4. OTHER BUSINESS: Approval of Minutes of June 15, 2005. Class of 1955 ERA makes donation WALTER CARLSON/For the Chronicle A donation was made recently by ERA America Realty and Investments to All Children Sertoma Therapy Center for $3142. The funds were raised at the ERA benefit "Shake It Up For Kids," which took place recently at Chateau Chan Sezz Restaurant In Inverness. Members of ERA American Realty and Investment who sold the most tickets were also honored. From left are: Don Maltezo, realtor, 16 tickets; Lou Miele, realtor, 45 tickets; Anita Fuss, realtor, 40 tickets; Heather Rilkonen, audiologist; Tommy Long, realtor, 55 tickets; Sylvia Ameen, director Capital Campaign for All Children; Mellsa Wortman, speech pathologist; Cheryl Sheets, director; Genia Paterackl, office assistant; Dennis Pilon, ERA sales manager; and C.J. Dixon, broker/owner. Not shown, JackIe Davis, realtor, 12 tickets and Debe Johns, realtor, 12 tickets. UNIQUE FANS! PALM .. "' ~: A PALM!- SL'IO FANS ,.. -_1 HUGE SELECTION! %-"AIIW UiN A I LPGA Womr gets attend P, .- . men'ss golf some ti n r .1 E! : ; i ' - -:, : I -O. j,\ ,c . '-, r;Z : I JUNE 29, 2005 ',,,, *:r, :,r~ l.li,.,r, ,r.- ,:|T ..... .... .... ,-.^*^ : ,^;. .B^.^ ^ ,:-: :. .. ." 1. H XMiP' D 4b M* - - ow- ' Semifinals set wm * #mom a amMm a l. 'mulllla Nwnllmw oMmmom mm am f W& - a. eg.. eSan. a 0 a a a - fp S an e ai - ag te C a. ...........! ... S::IJ ,, Iiii Si I| it' Copyrighted Materia a. ...- o. o Syndicated Cintent ,, ... ... pow aMNWd Available from Commercial News Provders 41MM rn-0sM S *Ma f -"nwm 0 soom L "::: : I a* - .. * -: C. * *s - i. a -- a.. : . m, ij- -W :: Me Rays lose to Jays ijfe i. -A. mmm fb o fht o mmbeeal mmo m m -Moae en- Bucks make 'Hi Bogut top pick I. .. .. .KU: '="J "- o-L J ^^^I "0a,-- ... . 4*l.. -- **-a -,n m- aa ama .ae a.w..m. a --NM 4w- -f Tine to perform I - .SxitnLsh aNoI I Spma str N., 11 '1*'1> H B ^J ^ *aM "' "" '`~ ~'' *'~"~"" ~ O-W-1-4 .:iffSf:. 2B WEDNESDAY, JUiNE 29, 5 tlJ Y< p ........... .. i ___ Copyrighted Materiad paglm mme aa -gg ma ome ~ eamea @hmm a *M MM f 4 t0M usAo MLB Braw s 3yndiledCaontent Mrn. .. Available from Commercial News Providers A- % I w o a e ._ A qw lll l alH~t eiMb 1a.h . .*i. ONOWN NMWAM mIII qlmw eo m- m. ..m nus ,mdoa n -hmm ..-. .t.- .//-./ qagmgl ll * aI m M e a- *n wmw w 4aI bMl -.,. .o. , i S mgmlm w 4amp - eAmOa m MILB SCOREBOARD OP Houston Pittsburgh Cincinnati San Diego Arizona' Los Angeles San Francisco Colorado z-first game was a win AMERICAN LEAGUE Tuesday's Games Cleveland 12, Boston 8 Baltimore 5, N.Y. Yankees 4, 10 innings Chicago White Sox 2, Detroit 1 Toronto 3, Tampa Bay 1, 11 innings L.A. Angels 5, Texas 1, 11 innings Minnesota 11, Kansas City 8 Seattle at Oakland, 10:05 p.m. Wednesday's Games Toronto ITowers. L.A. Angels at Texas, 2:05 p.m. Seattle at Oakland, 3:35 p.m. Cleveland at Baltimore, 7:05 p.m. Blue Jays 3, Devil Rays 1, 11 Innings TORONTO r TAMPA BAY ab rhbi ab r hbi Jhnson If 6 01 1 Crwfrd If 5 0 2 0 Rios rf 3 00 0 Lugo ss 4 1 0 0 Ctlnotto If 2 00 0 Huff dh 5 0 2 0 Gross If 0 00 0 Cantu 3b 4 0 1 1 VWells of 5 13 0TLee lb 5 0 1 0 Hlnbrn lb 5 00 0 Hollins cf 4 0 0 0 AHill 3b 4131 Gomes rf 4 0 1 0 Zaunc 3 01 0 THallc 3 000 Adams pr 0 00 0 Munson ph 0 0 0 0 Hkbyc 0 00 0 Cashc 0 000 Mnchnodh 3 00 0 NGreen 2b 4 0 1 0 OHudsn 2b 3 11 0 JMcDId ss 5 02 1 Totals 39311 3 Totals 38 1 8 1 Toronto 000 001 000 02- 3 Tampa Bay 100 000 000 00- 1 Cantu reached first on catcher's interfer- ence. E-Zaun (5), Crawford (2), Gomes (2), Waechter (3). DP-Toronto 2, Tampa Bay 2. LOB-Toronto 10, Tampa Bay 7. 2B- VWells 2 (13). 3B-Gomes (1). SB-Lugo (21). CS-Huff (4). S-Huckaby, Menechino. IP H RERBBSO Toronto Halladay 9 7 1 1 1 7 MBatista W,4-0 2 1 0 0 1 1 Tampa Bay Kazmir 61-3 6 1 1 4 6 Waechter L,3-6 42-3 5 2 2 1 3 WP-Kazmir. Umpires-Home, Phil Cuzzi; First, Ed Rapuano; Second, Jerry Crawford; Third, C.B. Bucknor. T-2:56. A-8,545 (41,315). Braves 9, Marlins 1 ATLANTA FLORIDA ab rhbi ab r Itbi Furcal ss 5 22 0 Pierre cf 4 0 ,0 Jhnson If 5 33 1 LCstillo 2b 2 0 0 0 MGiles 2b 41 2 2 Cbrera If 4 0 2 0 AJonescf 402 1 CDIgdol b 4 1 1 1 JuFrco lb 4 11 3 Lowell3b 3 0 0 0 JEstdac 5 02 1 L Duca c 4 0 1 0 BJordn rf 5 12 0 Conine rf 3 0 0 0 Brnero p 0 000 AGnzlz ss 4 0 0 0 Btemit 3b 4 01 1 Willis p 2 0 0 0 JoSosa p 2 00 0 Redling p 0 00 0 Orr ph 1 00 0 LHarrs ph 1 00 0 Grybsk p 0 00 0 Resop p 0 0 0 0 Boyerp 0 00 0 Bumpp 0 0 0 0 Foster p 0 00 0 Lngrhn rf 1 11 0 Totals 40916 9 Totals 31 1 6 1 Atlanta 201 100 104- 9 Florida 000 100 000- 1 DP-Atlanta 2, Florida 1. LOB-Atlanta 7, Florida 7. 2B-AJones (12), JEstrada (19). 3B-Johnson (1), JuFranco (1), BJordan (1), Pierre (7). HR-MGiles (7), CDelgado (15). SB-Furcal (27). SF- MGiles, JuFranco. IP H RERBBSO Atlanta JoSosaW,4-1 6 4 1 1 2 2 Gryboski 1 0 0 0 1 0 Boyer 2-3 1 0 0 1 1 Foster 1-3 0 0 0 0 1 Bernero 1 1 0 0 0 0 Florida Willis L,12-3 7 11 5 5 1 3 Riedling 1 0 0 0 0 1 Resop 2-3 44 4 0 0 Bump 1-3 1 0 0 0 0 Umpires-Home, Bill Hohn; First, Gerry Davis; Second, Doug Eddings; Third, Bruce Dreckman. T-2:40. A-20,129 (36,331). Orioles 5, Yankees 4, 10 Innings NEW YORK BALTIMORE ab rhbi ab r hbi Jeter ss 5 11 0 BRbrts 2b 4 32 1 Cano 2b 4 22 1 Bigbie If 3 1 1 1 Shffield dh 4 00 0 Tejada ss 4 0 2 1 ARod 3b 3 00 1 RPlmo lb 4 1 1 2 Matsui If 4 13 2 Gbbons dh 4 0 1 0 Posada c 4 01 0 SSosa rf 4 0 0 0 JaGbi lb 1 00 0 Matos cf 4 0 1 0 TMrtnz lb 1 00 0 Gomez 3b 4 0 1 0 Sierra rf 401 0 GGilc 2 0 0 0 Wmackcf 301 0 Mrreroph 1 0 0 0 BWllmscf 1 000 Fasanoc 1 0 0 0 Totals 344 9 4 Totals 35 5 9 5 New York 201 001 000 0- 4 Baltimore 100 002 010 1- 5 No outs when winning run scored. AMERICAN LEAGUE East Division W L Pct GB L10 44 32 .579 7-3 43 34 .558 1/2 z-3-7 39 38 .506 51/2 z-4-6 39 39 .500 6 5-5 27 51 .346 18 4-6 Central Division W L Pct GB L10 51 24 .680 z-8-2 42 33 .560 9 4-6 41 34 .547 10 z-6-4 36 37 .493 14 5-5 25 51 .329261/2 1-9 West Division W L Pct GB L10 47 29 .618 z-9-1 38 37 .507 8/2 z-2-8 35 40 .467 11/2 8-2 33 41 .446 13 z-5-5 NATIONAL LEAGUE East Division W L Pct GB L10 45 31 .592 6-4 43 34 ,..558 2/2 z-8,2 38 36 .514 6 5-5 39 38 .506 61/2 z-2-8 38 38 .500 7 5-5 Central Division W L Pct GB L10 48 28 .632 z-6-4 39 36 .520 8'/2 5-5 35 41 .461 13 z-6-4 34 40 .459 13 z-8-2 34 41 .45313/2 z-4-6 30 46 .395 18 4-6 West Division W L Pct GB L10 42 35 .545 z-6-4 39 38 .506 3 4-6 36 40 .474 51/2 3-7 30 44 .40510/2 z-3-7 25 49 .338151/2 z-4-6 Home 22-12 23-16 24-18 20-16 19-22 Home 27-12 23-17 19-17 18-18 15-21 Home 24-14 21-16 22-15 19-20 Home 27-10 24-12 21-17 23-16 23-15 Home 24-14 20-17 21-15 24-13 17-19 23-19 Home 25-15 20-17 20-17 .17-22 20-18 NATIONAL LEAGUE Tuesday's Games Atlanta 9, Florida 1 Washington 2, Pittsburgh 1 N.Y. Mets 8, Philadelphia 3 Chicago Cubs 2, Milwaukee 0 St. Louis 2, Cincinnati 1 Houston at Colorado, 9:05 p.m. San Francisco at Arizona, 9:40 p.m. San Diego at L.A. Dodgers, 10:10 p.m. Wednesday), 10:10. E-Cano (8), Gordon (1). DP-New York 1, Baltimore 3. LOB-New York 3, Baltimore 5. 2B-Matsui (23), BRoberts (20). HR-Cano (6), Matsui (1,0),:BRoberts (13), Bigbie (4), RPalmeiro (12): SB- Womack (19). S-Bigbie. SF- ARodriguez. IP H RERBBSO New York Wang 7 7 3 3 '0 3 Gordon 2 1 1 1 1 4 StantonL,1-2 0 1 1 1 0 0 Baltimore Ponson 8 9 4 4 2 3 BRyan W,1-1 2 0 0 0 0 1 Stanton pitched to 1 batter in the 10th. Umpires-Home, Jim Joyce; First, Laz Diaz; Second, Dana DeMuth; Third, Marty Foster. T-2:48. A-47,465 (48,290). Indians 12, Red Sox 8 CLEVELAND BOSTON ab rhbi ab. Szmore cf 3 40 0 Damon cf 5 Blake rf 5 33 1 Rnteriass 4 Hafnerdh 5 23 6 DOrtizdh 5 VMrtnz c 6 01 2 MRmrz If 2 Brssrd Ib 4 02 1 Millar lb 4 Biliard 2b 5 01 0 RVazqz pr 0 Gerut If 5 01 0 Olerud Ib 0 Crisp If 0 1 0 0 Varitek c 5 Boone 3b 5 11 1 Payton rf 5 Peralta ss 5 13 1 Yukilis 3b 4 Mueller ph 1 o Bilhorn 2b 2 r hbi 1 2 0 2 1 1 1 3 1 1 1 2 0 2 1 000 111 0 1 0 1 1 1 1 1 1 I 0 0 1 1 1 Totals 43121512 Totals 37 813 8 Cleveland 210 011 025- 12 Boston 010 025 000- 8 E-Renteria 2 (15). DP-Cleveland 1. LOB-Cleveland 10, Boston 10. 2B- Blake 2 (12), THafner 2 (20), Gerut (7), Renteria (14), Varitek (16), Youkilis (6), Bellhorn (19). HR-THafner (13), Boone (8). SF-MRamirez, Bellhorn. IP H RERBBSO Cleveland CILee 51-3 .7 5 5 3 4 Rhodes 1-3 2 3 3 1 0 MillerW,1-0 21-3 4 0 0 1 1 Wickman 1 0 0 0 0 0 Boston WMiller 52-3 7 5 5 4 4 MMyers 2-3 1 0 0 0 1 Timlin 1 3 2 2 0 0 - FoulkeL,5-4 12-3 4 5 5 2 2 HBP-by Miller (Millar). Umpires-Home, Larry Young; First, Eric Cooper; Second, Fieldin Culbreth; Third, Marvin Hudson. T-3:37. A-35,445 (35,095). Mets 8, Phillies 3 PHILA NEW YORK ab rhbi ab, r hbi Rollins ss 5 00 0 Reyes ss 4 1 0 0 Mchels cf 3 12 1 Cmeron rf 5 1 2 1 BAbreu rf 5 00 0 Beltran cf 5 1 2 1 Thomelb 3 10 0 Floyd If 3 1 1 0 Burrell If 3 00 0 Piazza c 4 2 2 3 Utley2b 4 01 0 MrAnd 2b 3 1 1 0 DaBell 3b 4 13 2 Wright 3b 4 1 1 1 Lbrthal c 4 00 0 Daubch lb 2 0 0 1 Tejeda p 2000 Zmbrno p 1 000 Gearyp 0 00 0 Offrmn ph 1 0 1 1 Chavez ph 1 01 0 HBell p 0 0 0 0 TImaco p 0 00 0 Ring p 0 0 0 ToPerz ph 1 00 0 Diaz ph 1 0 0 0 Fultz p 0 00 0 Graves p 0 0 0,0 Totals 353 7 3 Totals 33 810 8 Philadelphia 000 100 011- 3 New York 002 042 00x- 8 E-Rollins (8), Lieberthal (5), Wright (13). DP-Philadelphia 1. LOB- Philadelphia 10, New York 7. 2B- Cameron (16), Beltran (17). 3B--Beltran (1). HR-Michaels (3), DaBell (4), Piazza (9). SB-Michaels (2). S-Zambrano. IP H RERBBSO Philadelphia Tejeda L,-1 4 3 2 2 5 4 Geary 1 5 4 4 0 1 Telemaco 2 2 2 2 0 2 Fultz 1 0 0 0 0 0 New York Zambrano W,4-6 5 4 1 1 3 7 HBell 11-3 1 0 0 0 0 Ring 2-3 0 0 0 0 1 Graves 2 2 2 2 0 0 HBP-by Zambrano (Michaels 2). Balk-Tejeda. Umpires-Home, Ted Barrett; First, Terry Craft; Second, Alfonso Marquez; Third, Brian Knight. T-3:09. A-39,898 (57,369). Away Intr 22-20 12-6 20-18 8-10 15-20 11-7 19-23 8-10 8-29 3-15 Away 'Intr 24-12 12-6 19-16 8-10 22-17 15-3 18-19 '9-9 10-30 9-9 Away Intr 23-15 12-6 17-21 9-9 13-25 10-8 14-21 10-8 Away Intr 18-21 12-6 19-22 7-8 17-19 10-5 16-22,7-8 15-23 5-10 Away Intr 24-14 10-5 19-19 6-9 14-26 8-7 10-27 7-8 17-22 5-7 7-27 7-8 Away Intr 17-20 7-11 19-21 8-10 16-23 5-13 13-22 6-12 5-31 6-9 a.e a *, I CITRUS COUNTY (FL) CHRONICLE SPorsT 4%n ITT- ?Q ?Of)S i * .. x*h :i.W .Af CITRUS COUNTY (FL) CHRONICLE BASKETBALL 2005 NBA Draft Selections At New York Tuesday, June 28 ."~ First Round .1 1. Milwaukee, Andrew Bogut, c, Utah. On the Al 2. Atlanta, Marvin Williams, f, North Carolina. 3. Utah (from Portland) Deron Williams, BAS g, Illinois. S4. New Orleans, Chris Paul, g, Wake 1 p.m. (ESPN) MLB Baseball C Forest. Sox. From Fenway Park in Boston 5. Charlotte, Raymond Felton, g,. North 7 p.m. (ESPN) MLB Baseball N Carolina. Orioles. From Oriole Park at Cam 6. Portland (from Utah), Martell Webster, (FSNFL) MLB Baseball Atlanta Sg, Seattle Prep. (FSNFL) MLB Baseball Atlanta 7. Toronto, Charlie Villanueva, c, Dolphins Stadium in Miami. (Live) Connecticut. (ESPN2) MLB Baseball San Fr 8. New York, Channing Frye, f, Arizona. Diamondbacks. From Bank One E State. G 10. L.A. Lakers, Andrew Bynum, c-f, St. 3:30 p.m. (GOLF) Golf U.S. Wo Joseph's HS, Metuchen, N.J. Third Round. From Cherry Hills Vi 11. Orlando, Fran Vazquez, f-c, Unicaja 7:30 p.m. (GOLF) Golf U.S. Wo SMalaga (Spain). 7:30 p.m. (GOLF) Golf U.S. WV 12. L.A. Clippers, Yaroslav Korolev, f, Final Round. From Cherry Hills Vi CSKA Moscow. SO S, 13. Charlotte (from Cleveland through 2:30 P.M. (62 UNI) Futbol Cop Phoenix), Sean May, f, North Carolina. 2:30 p.miii. (62_ UN rutuul Cpa 14. Minnesota, Rashad McCants, g, Final Brasil vs. Argentina. (En Vivt North Carolina. TE 15. New Jersey, Antoine Wright, g, Texas 8 am. (ESPN2) Tennis Wimble A&M. 16. Toronto (from Philadelphia through the All-England Lawn Tennis and Denver and New Jersey), Joey Graham, f, England. (Live) (CC) Oklahoma State. 10 a.m. (2 NBC) (8 NBC) Tenni Mex. ndiana, Danny Granger, f, New Quarterfinals. From the All-Englan 18. Boston, Gerald Green, f, Gulf Shores in Wimbledon, England. (Live) (C( Academy (Houston) HS. 1 p.m. (ESPN2) Tennis Wimble 19. Memphis, Hakim Warrick, f, the All-England Lawn Tennis and Syracuse. 20. Denver (from Washington through England. (Live) (CC) Orlando), Julius Hodge, g-f, N.C. State. TRACK 21. Phoenix (from Chicago), Nate 6:30 p.m. (SUN) Triathlon Publi Robinson, g, Washington. 22. a-Denver, Jarrett Jack, g, Georgia Sarasota (Taped) Tech. , 23. Sacramento, Francisco Garcia, f, Louisville. 24. Houston, Luther Head, g, Illinois. 7. Oregon State 46-12 3 25. Seattle, Johan Petro, c, Pau Orthez 8. Tennessee 46-21 6 (France). 9. Cal State Fullerton 46-18 t9 26. Detroit, Jason Maxiell, f, Cincinnati. 10. Mississippi 48-20 t9 27. a-Portland (from Dallas through 11. Georgia Tech 45-19 10 Utah), Linas Kleiza, f, Missouri. 12. Arizona 39-21 12 28. San Antonio, Ian Mahinmi, f, STB Le 13. Rice 45-19 13 Havre (France). 14. Clemson 43-23 14 29. Miami, Wayne Simien, f, Kansas. 15. Miami 41-19 15 30. New York (from Phoenix through San 16. Florida State 53-20 16 Antonio), David Lee, f, Florida. 17.,Southern California 41-22 17 S"Second Round 18. Louisiana State 40-22 18 31. Atlanta, Salim Stoudamire, g, 19. Long Beach State 37-22 19 Arizona. 20. Alabama 40-23 20 32. L.A. Clippers (from Charlotte), Daniel 21. Missouri 40-23 21 S Ewing, g, Duke. 22. Mississippi State 43-22 22 33. New Orleans, Brandon Bass, f, LSU. 23. Coastal Carolina 50-16 23 34. Utah,. CJ Miles, g, Skyline HS, 24. Pepperdine 41-23 24 r Dallas. 25. South Carolina 41-23 25 35. a-Portland, Ricky Sanchez, f, IMG NL BOXES Academy, Bradenton, Fla. 36. Milwaukee, Ersan Ilyasova, f, Ulker Nationals 2, Pirates 1 Istanbul (Turkey). PITTSBURGH WASHINGTON 37. L.A. Lakers (from New York through ab rh bi ab r h bi Atlanta and Charlotte), Ronny Turiaf, f, Lawton rf 4 00 0 Wlkrsn cf 4 0 2 0 Gonzaga. Snchez 3b 400 0 Spivey2b 4 0 1 0 38. Orlando (from Toronto), Travis 4 1 3 0 JGilen rf 2 1 1 0 Dinner, g, Marquette. ..fWardlb 4 01 1 Cast3llia3b3110 39. LA. Lakers von Wafer, g, Florida Wa 401 1 Castilla 3b 3 1 0 0 State. Doumitc 3 00 0WCderolb 2 0 0 1 40. Golden State, Monta Ellis, g, Lanier st 2b 3 00 0 Wdero lb 2 0 0 (Miss.) HS. 41. Toronto (from Orlando), Roko-Leni JWisn ss 3 00 0 CGzmn ss 3 0 0 0 Ukic, g, KK Split (Croatia). Fogg p 2 00 0 Dres p 2 0 0 0 t,. 42. Golden State (from L.A. Clippers TRdmn ph 1 00 0 Blanco ph 1 0 0 0 :through New Jersey), Chris Taft f, Snell p 0 O0 CCrdro p 0 050 0 .,., Pittsburgh- Totals 321 5 1 Totals 26 2 5 '1- 43. New Jersey, Mile Ilic, c, BC Reflex ttsburgh 100 000 000- 1 (Serbia & Montenegro). Washington 000 200 00x- 2 44. Orlando (from Cleveland), Martynas E-Fogg (3), JGuillen (4) DP- Andriuskevicius, c, Zalgiris (Lithuania). Pittsburgh 1. LOB-Pttsburgh 5, 45. Philadelphia, Louis Williams, g, Washington South Gwinnett HS, Snellville, Ga. 5. 2B-Bay (22), Mackowiak (11), Spivey 46. Indiana, Erazem Lorbek, f, Climamio (12), JGuillen (16), Byrd (5). CS- Bologna (Italy). Wilkerson (5). S-Byrd. SF-WCordero. 47. Minnesota, Bracey Wright, g, IP H RERBBSO Indiana. Pittsburgh 48. Seattle (from Memphis), Mickael Fogg L,4-4 6 4 2 1 1 2 r Gelebale, f, Real Madrid (Spain). Snell 2 1 0 0 1 2 49. Washington, Andray Blatche, f, South Washington Kent Prep, Syracuse, N.Y. Drese W,2-1 8 5 1 1 0 4 50. Boston, Ryan Gomes, f, Providence. CCordero S,26 1 0 0 0 0 0 51. Utah (from Chicago through HBP-by Drese (Doumit), by Fogg Houston), Robert Whaley, f, Walsh U. (JGuillen). PB-Schneider. )* 6' 52. Denver, Axel Hervelle, f, Real Madrid Umpires-Home, Larry Poncino; First, (Spain). Lance Barksdale; Second, Chris 53. Boston (from Sacramento), Orien Guccione; Third, Angel Hernandez. Greene, g, Louisiana-Lafayette. T-2:11. A-35,828 (45,250). 54. New York (from Houston), Dijon CubS 2, Brewers 0 Thompson, G, UCLA. Cubs 2, Brewers 0 C. 55. Seattle, Lawrence Roberts, f, MILWAUKEE CHICAGO O Mississippi State. ab rhbi ab r hbi 56. Detroit, Amir Johnson, f Westchester BClark cf 4 00 0 CPttson cf 4 0 0 0 HS (Calif.) Weeks 2b 4 00 0 NPerez ss 4 0 0 0 57. Phoenix (from Dallas through New BHall ss 2 00 0 DeLee lb 4 1 1 1 . .. Orleans), Marcin Gortat, f-c, RheinEnergie Hardy ss 1 00 0 ARmrz 3b 2 1 0 0 Sr - Koln (Germany). CaLee If 3 00 0 Barrett c 3 0 0 0 3. 58. Toronto (from Miami), Uros Slokar, f, Ovrbay lb 3 01 0 Burnitz rf 3 0 1 0 Snaidero Udine (Italy). Helms 3b 3 00 0 Dubois If 2 0 1 0 59. Atlanta (from San Antonio), Cenk Jenkins rf 2 00 0 HIndsw If 0 0 0 0 Akyol, g, Efes Pilsen (Turkey). DMiller c 3 01 0 Hrst Jr 2b 3 0 1 1 4,' 60. Detroit. (from Philadelphia through DDavis p 2 01 0 Zmbrno p 3 0 0 0 Utah and Phoenix), Alex Acker, g, Drgtn ph 1 00 0 Dmpstr p 0 0 0 0 Pepperdine. Bttlco p 0 00 0 a-Traded rights to Portland for'rights to Totals 280 3 0 Totals 28 2 4 2 Leiza (No. 27) and Sanchez (No. 35). Milwaukee 000 000 000- 0 Chicago 011 000 00x- 2 BASEBALL E-BHall (8), ARamirez (7). DP- Milwaukee 1, Chicago 3. LOB-Milwaukee 4, Chicago 4. HR-DeLee (23). S; Baseball America Top 25 IP H RERBBSO DURHAM, N.C. The final top 25 Milwaukee ,'.. teams in the Baseball America poll with DDavis L,9-7 7 4 2 2 2 9 .i'- : records and previous ranking (voting by Bottalico 1 0 0 0 0 1 the staff of Baseball America): Chicagod Record Pvs Zambrano W,5-4 8 3 0 0 3 6 1.Texas 56-16 5 DempsterS,12 1 0 0 0 0 0 2. Florida 48-23 7 WP-Zambrano. 3. Tulane 56-12 1 Umpires-Home, Mike DiMuro; First, 4. Baylor 46-24 4 Mark Carlson; Second, Joe West; Third, 5. Nebraska 57-15 2 Brian Gorman. S' 6. Arizona State 42-25 11 T-2:18. A-39,574 (39,538). WEDNESDAY, JUNE 29, 2005 3B S I Angels 5, Rangers 1, 11 Innings .'- _LOS ANGELES TEXAS -i- : -''-' I l '( (i ab rhbi ab r hbi A .' .'., .-. :Figgins3b 5 11 0 Mathws rf 5 0 1 0 I Erstad lb 5 22 0 MYong ss 5 1 2 1 IVGrero rf 3 11 1 Txeira lb 5 000 0 R W AV 'ES GAndsn If 5 11 4 Blalock 3b 4 020 W WtW,, |,, JRivra dh 5 00 0 ASrano 2b 5 0 0 0 -- ~ = -~ Izturis ss 5 02 0 Mench If 5 0 2 0 - DVnon cf 4 00 0 Hidalgo dh 4 0 0 0 IEBALL JMolnac 5 00 0 Nixcf 4 0 0 0 leveland Indians at Boston Red AKndy 2b 3 02 0 Brajas c 4 0 2 0 in /I i\ tC.\ C)Totals 405 9 5 Totals 41 1 9 1 Los Angeles 100 000 000 04- 5 lew York Yankees at Baltimore Texas 100 000 000 00oo- 1 den Yards in Baltimore. (Live) (CC) DP-Los Angeles 1, Texas 2. LOB-Los Braves at Florida Marlins. From ancisco Giants at Arizona Ballpark in Phoenix. (Live) (CC) 3OLF omen's Open Championship - illage, Colo. (Taped) (CC) omen's Open Championship - llage, Colo. (Taped) (CC) )CCER Confederaciones 2005: la Gran o) ENNIS don Men's Quarterfinals. From Croquet Club in Wimbledon, s Wimbledon Men's nd Lawn Tennis and Croquet Club C) don Men's Quarterfinals. From Croquet Club in Wimbledon, AND FIELD x Family Fitness Weekend. From Cardinals 2, Reds 1 CINCINNATI ST. LOUIS ab rhbi FLopez ss 4 12 0 Eckstin ss Aurilia 2b 4 01 0 Edmnd cf Casey lb 4 02 0 Pujols lb Randa 3b 3 02 1 RSndrs If WPena rf 401 0 Rolen 3b Merckr p 0 00 0 GrdzIn 2b Dunn If 4 00 0 Tvarez p LaRue c 3 00 0 Isrnghs p Romno cf 3 00 0 Tguchi rf Vlentin ph 0 00 0 YMlina c Olmedo pr 0 00 0 Mulder p Clausen p 2 00 0 Thmps p EEcrcn ph 0 00 0 King p Belisle p 0 00 0 Nunez 2b JaCruz rf 1 00 0 ab r hbi 3 01 0 4000 3 1 20 3 1 1 2 3000 3 0000 0000 3000 2000 2000 0000 0000 1 000 1 0 0 0 Totals' 321 8 1 Totals 27 2 4 2 Cincinnati 100 000 000- 1 St. Louis 200 000 00x- 2 DP-St. Louis 2. LOB-Cincinnati 8, St. Louis 3. 2B-Randa (18). HR-RSanders (16). SB-Olmedo (1), Eckstein (7). CS- YMolina (2). IP H RERBBSO Cincinnati Claussen L,4-5 6 4 2 2 1 6 Belisle 11-3 0 0 0 0 0 Mercker 2-3 0 0 0 1 0 St. Louis Mulder W,9-5 61-3 7 1 1 3 5 Thompson 1-3 1 0 0 0 0 King 2-3 00 0 0 0 Tavarez 2- 2-3 00 0 1 Isrnghs S,22 1 0 0 0 1 2 Umpires-Home, John Hirschbeck; First, Kerwin Danley; Secotnd, Jim Reynolds; Third, Wally Bell. T-2:34. A-38,640 (50,345). AL BOXES Twins 11, Royals 8 KANSAS CITY MINNESOTA ab rhbi ab r hbi DJesuscf 400 1 ShStwrt If 4 2 3 3 Berroass 5 00 0 Wllams 3b 2 01 1 Long rf 4 12 1 Rivas 2b 2 1 2 1 Brown dh 4 12 0 LFord dh 5 0 1 0 Stairs lb 4 12 0 THnter cf 3 0 1 2 Teahen 3b 3 11 0 JJones rf 3 1 0 0 Grffnno 3b 1 00 0 LeCroy 1b 4 0 1 0 Buckc 4 12 1 Mrneaul b 1 1 1 1 Costa If 4 23 3 Cddyer2b 3 3 1 0 Gotay 2b 4 12 0 Rdmnd c 3 2 3 2 JCastro ss 2 0 0 0 MRyanph 1 1 1 1 LRdrgz 2b 0 0 0 0 Totals 37814 6 Totals 331115 11 Kansas City 011 132 000- 8 Minnesota 120 400 31x- 11 DP-Kansas City 2, Minnesota 3. LOB- Kansas City 3, Minnesota 8. 2B-Brown (14), Stairs (10), Buck (8), ShStewart (14), LFord (17), Redmond (4). HR-Costa (2), Morneau (10). SB-THunter (18), JJones 2 (9). CS-THunter (5). S-JCastro. SF- DeJesus, THunter. IP H RERBBSO Kansas City Howell MWood Sisco L,1-2 Nunez Jensen Minnesota CSilva Mulholland Crain W,7-0 Romero JRincon Nathah S,20 31-3 6 5 5 2 5 2 2 1 0 2 2 2-3 3 1 1 1 1 1 1 5 10 6 6 1-3 3 2 2 12-3 0 0 0 1-3 0 0 0 2-3 0 0 0 1 1 0 0 HBP-by MWood (THunter). Umpires-Home, Andy Fletcher; First, Bob Davidson; Second, Paul Schrieber; Third, Mike Reilly. T-2:53. A-19,422 (46,564). r, Philadelphia, 18; Looper, New York, 15. Angeles 6, Texas 9. 2B-Erstad (20), VGuerrero (16). HR-GAnderson (9), MYoung (11). IP H RERBBSO Los Angeles Washburn 7 Shields 2 Donnelly W,6-2 1 FRodriguez 1 Texas Wasdin 8 FCordero 2 Loe L,0-1 0 BShouse 0 Benoit 1 Loe pitched to 3 7 1 1 0 3 1 0 0 1 1. 1 0 0 0 2 5 1 1 2 2 2 3 3 1 0 1 1 1 0 0 batters in the 11th, BShouse pitched to 1 batter in the 11th. HBP-by Washburn (Blalock). PB- JMolina. Umpires-Home, Brian O'Nora; First, Ed Hickox; Second, Gary Cederstrom; Third, Tim Welke. T-3:16. A-27,159 (49,115). TRANSACTIONS BASEBALL American League LOS ANGELES ANGELS-Designated OF Curtis Pride for assignment. Recalled INF Robb Quinlan from Salt Lake of 'the PCL. NEW YORK YANKEES-Assigned CF Melky Cabrera to Columbus of the IL and OF Matt Carson to Trenton of the Eastern League. SEATTLE MARINERS-Recalled C Miguel Olivo from Tacoma of the PCL. Optioned C Rene Rivera to San Antonio of the Texas League. TAMPA BAY DEVIL RAYS-Activated LHP Trever Miller from the 15-day DL. Optioned RHP Tim Corcoran to Durham of the IL. TEXAS RANGERS-Activated RHP Joaquin Benoit from the 15-day DL. Optioned C Gerald Laird to Oklahoma of the PCL. National League ARIZONA DIAMONDBACKS-Activated OF Luis Terrero from the 15-day DL. Optioned OF Scott Hairston to Tucson. CHICAGO CUBS-Recalled INF Ronny Cedeno from Iowa of the PCL. Sent INF Enrique Wilson outright to Iowa. CINCINNATI REDS-Recalled INF Ray Olmedo from Louisville of the IL. PITTSBURGH PIRATES-Placed LHP Oliver Perez on the 15-day DL. Recalled OF Nate McLouth from Indianapolis of the IL. Can-Am League GRAYS-Released LHP Juan Rodriguez. NEW JERSEY JACKALS-Signed RHP Joel Bennett and INF Elvis Corporan. Central League EL PASO DIABLOS-Released C John Caruso. SAN ANGELO COLTS-Signed 1B Eric Davis. Golden Baseball League SAN DIEGO SURF DAWGS-Released C Cole Cicatelli. YUMA SCORPIONS-Signed OF Eric Johnson. Northern League WINNIPEG GOLDEYES-Signed C Al Corbeil. Released C Russ Jacobson. BASKETBALL National Basketball Association CLEVELAND CAVALIERS-Traded; F Jiri Welsch to Milwaukee for a 2006 sec- ond-round draft pick. PHILADELPHIA 76ERS-Extended qualifying offers to C Samuel Dalembert, G Willie Green and F Kyle Korver. Continental Basketball Association CBA-Named Kris Kamann director of media-public relations. FOOTBALL National Football League CINCINNATI BENGALS-Waived QB Josh Haldi. NEW ENGLAND PATRIOTS-Signed KR Chad Mortoh, G Bryan Anderson, LB Ryan Claridge and QB Matt Cassel. NEW YORK JETS-Announced the retirements of LB Mo Lewis and LB Marvin Jones. WASHINGTON REDSKINS-Signed CB Eric Joyce. Claimed WR Jamin Elliott off waivers. Released WR Pedro Holiday. HOCKEY National Hockey League DALLAS STARS-Signed Dave Tippett, coach, to a two-year contract extension through the 2006-07 season and Rick Wilson, associate coach, Mark Lamb, assistant coach and Andy Moog, assistant- goaltending coach, to one-year contract extensions. TORONTO MAPLE LEAFS-Signed Pat Quinn, coach, to a contract extension. Central Hockey League AUSTIN ICE BATS-Signed LW Jason Ruff. RIO GRANDE VALLEY KILLER BEES- Traded the rights to D Jason Tessier to Bossier-Shreveport for the rights to D Kevin Wilson. ECHL COLUMBIA INFERNO-Signed D Steve Burgess. LAS VEGAS WRANGLERS-Named Billy Johnson president and chief operat- ing officer and Danielle Lucero, Sarah Roberts and Vicki-Lynn Tacke senior account representatives. -lb qb GO- a A ~C -- -- -4 o- a a 1ba a 4 dp mo 411L so- 0 - C 41 -.0 .a-me- q-a. Sg --on Mo - -mm -.0 - D ~.- _ .0t a -a ~ C .0 qb age .0-a low m - - 0 .-o m -- 4ab -40- -,wo a-aw- 401b- .--40 .-. .-M . q -glo m o -00 -0-41 C - 41- -Odom Cw C 4b. Q-.0 a .b ~ -mm 411P 4 .0 .No.0 0 -. - -C .0.. - 0 --a 0 0~ - C .0.0 C. . 0.. - .0 op dom 4 am-- 0. - 41h. a __ - e - a -%. 41.- 0w 4W q 0- Gb .. -4b 0- - -00 dC-- 4w- w q Rb s.- *.1 d . ft o- 0 IV qm . a*4- .-0 a - - .0 0 .0- 0. . - P-b f- - -C 0 f - -.0 C --C S - .0.0 C - - a.- - - -a b-a ~ .* -S * -~0-~ .0 - - * - - . - .- --- Coiyrighted Matera" - ft -.1;- Syndicated Content - ~0 C _____ a a - - .0 S 0 --a. - - - 0 0 - a Available from Commrcia News Provders 0. - Qa 0 .0 * C- a- ~.0 ft, 0 0 0O - .0 0 .0 -.0 a - .0- .0 a .0 - - q.0 V_ ___^I 1 .p>-rrs 4B -- Q am- -lb - - Q * ^ "W In. qw. _ 7. - * 1 CITRus CouNTY (FL) CHRONICLE 4B WEDNESDAY, JUNE 29, 2005 7 ate d NACAR 0. a - - -e - - 0 .0 -- 4' op ! C 0 0.~ a - - 0 -.0 0 - a * *0. - 0. -0 0. - 0. 0. .0. -- - -~ 0. - * 0. -a '0 '0 0. 0. - 0. - - S '0. 0.. ~ 0. - ~ '0 0.-0 0.. 0. 0. 0. 0. - 0. 0. 0. - a 0. - a 0.- ~ 0 .0. 0.. .~ 0. ~ - -~0. '0 - 0.~ - -'0.~ 0. -~ q 0.. P - alm Am - - *0 - 0. - - ~. 0. 0. *~ - - -- - .0. 0. .0. *~0.~ 0. - 0. 0. - '0 0. '0 - *-0 ~~0. 40 p a0. up up up ~ ma come m w410-do u 4b M 4b4 0do GM MeOw Mil a- - - .0 = a 0.- a ~0 a- a - 0 * -0. .0. 0 - 0. 0. a- 0. 0.- 0. - 0.. -0~ - - - a-0. - a -. -- 0. - -. 0.-.0 0.-- a - 'Tkr = "I'o 0 * 0. 0. -'0 0 0. - up- 0. - - - 0. "0 -0. = - - - up up- 0.e SCopyrigtedMaleri SSyndicated Conent 0. *.- 0. 0- - 0. 0. - B dW. 0, 0.- -0.-a 0. 1 11 1A 1 0 - up- *0. - a- - 0 w - 00. goo- 0. NOW 0. 9 0. 0. - - .~~0. ~ - 0. 41b -Now 400- 4b- W 0- - 41 m-ffw a -. - 0. -411D go e o- Q soft0. --Nb ARM. q- 400100M -dim 0o 0 41. ~040. 0. up . to rifuwAI fand flxxw S 4. - up - -a - a -~ 0. 0. a 0. a - 0 .w - --0.Eb - a - 0..- 0. 0. .m m - * . lo w ft 0. 0. ..-a .dg- =- w 0. --gab 0.- - ,4v 4b. M0. - 0 - B 00 0. -- - o p0. 0 .0 - -4b * - 0.*- 0. --0. -~- - B. 0. 0.'~0 - - -a- - - . 0.~~ - 0.. - - - 0. S 0. 0. 0 0. * - - 0. 0. a C * - - 0.- ~ - 0. - '0. - 0. 0~ - --db - --a *0 -04w 0. 0. 0. a - * a 0. a - - a 0. - - -- Available from commercial News Providers - ,Mjdiehn * - - 0. 0. - 0. - * 0. - -. Np :>.,s -I' -k-3 IRlllrry - Ar- c .... 8 v 4 - 40 * 40P-.. - mmmm q- - - a 04w ~dim 0.- b . 0.~- 0. 41b 0. Of - 0 up410 -.0.4b - lM ft. 4w- o --a .1m- 0b.- - .0 -0- ' W N I'ESDAY JUNE 29, 2005 www chronicleonline.com GolfBRIEFS Twisted Oaks golf tournament will aid needy veterans The Citrus County Veterans Foundation is looking for play- ers for its four-man best ball golf scramble July 23 at the Twisted Oaks Golf Course in Beverly Hills. Tee time will be 8 a.m. with a shotgun start. The price is $60 and is due by July 8. Individuals and groups short of four will be combined to make four-man teams. The entry fee includes golf and cart, beverage tickets, a barbecue lunch, and cash ,prizes for first, second and third place. There will also be door prizes, three closest of the pin prizes and a free gift for all players. Proceeds from the touma- ment will be used by the foun- dation for grants to be awarded to needy veterans. Those wishing to sign up should send a check or money order payable to Citrus County Veterans Foundation, 3600 W. Sovereign Path, Suite 180, Lecanto, FL, 34461. For more information, call 527-5425. Rainbow Springs hosts Junior-Adult tourney For the fifth year, Junior golfers and their adult partners will challenge the Rainbow Springs Golf and Country Club layout in the 2005 Rainbow Springs Junior-Adult Tournament presented by Rainbow Springs Limited and Rainbow Springs Homebuilders Inc. This year's event will be Saturday, July 16, and will fea- ture a two-person Pinehurst fore mat starting at 8:30 a.m. Junior golfers from ages 6-18 are invit- ed to play in the event with an adult golfer. The entry fee is $45 per team, which includes greens fees and cart fees, range balls, tee gift, refresh- ments, trophies and prizes, and an awards luncheon after golf. Guests are invited to the lunch- eon for $11.25 per person. There will be a minimum of four flights and a maximum of 'five flights based upon number of entries. The field is limited to the first 60 paid teams. Call the Rainbow Springs Pro Shop at (352) 489-3566. Entry deadline is 6 p.m. Sunday, July 10. Kiwanis Junior Golf Championship set for Aug. 13 at Rainbow The Kiwanis Club of Dunnellon is pleased to pres- ent the upcoming 2005 Kiwanis Junior Golf Championship. All junior golfers, boys or girls, ages 5- 18 are eligible to compete in one of eight different age groups. The competition will be on Saturday, Aug. 13, in Dunnellon at Rainbow's End Golf Club and Rainbow Springs Golf and Country Club. The younger golfers, girls ages 5-9 and boys ages 5-7 and 8-9, will play three holes at Rainbow's End Golf Club. Nine holes at Rainbow's End will be the distance for girls ages 10-13 and 14-18 and boys 10-12. Rainbow Springs Golf and Country Club will host the boys 13-15 and 16-18 age groups for nine holes. Entry fee is $10 per con- testant, which includes golf, range balls, tee gift, refresh- ments, long drive contest and the Awards Luncheon at Rainbow Springs Golf and Country Club following the tournament. Guest meal tick- ets may be purchased in advance for the luncheon for $8.25 per person. Entry blanks for the tourna- ment are available at area golf courses or may be obtained by calling Rainbow's End Golf Club, (352) 489-4566, or Rainbow Springs Golf and Country Club, (352) 489-3566. Entry deadline is 6 p.m. Sunday, Aug. 7. From staff reports Future wide SLCopyrifghted Material w N M. Ih i o I I ff f.. . . -- -- - Local w . .. .. CITRUS HILLS The weekly tournament of the Citrus Hills Men's Golf Association for June 22 was a "Team Low Net" event, with A, B, C and D flight players on each team. The winners were: First place: Dick Brown, Ed Griffin, Charlie Brooks, Jim Ryan Second place: Walt McCoy, Bob Kimball, Charlie Fairbanks, Dennis Scribner Third place: I.J. Pyles, Joe Matt, Bob Prince and a blind draw PLANTATION INN Monday Nine-Hole Points Bob Struck, 5, Wayne Larsen, +4, Sou Cioe, +3, Dock Letterman, +3, Kevin Shields, +2, Rich DeBrusk, +2, Pat Fitzpatrick; +1. Thursday Nine-Hold Points Charles Grumbling, +4, Bob Oakes, +3, Lou Cioe, +3, Dave Tyson, +3, Bob Pridemore, +3, Bill Knox, +3, Norm Hastings, +3, Bob Walsh, +2, Dock Letterman, +2, Larry Carlson, +2, Mike McCraine, +2, Dave Stidd, +2, Joe Cioe, +1. Saturday Points Front/Back Front: Hugh O'Neil, +7, Rob Mreton, +4, Dave Tyson, +3, Bob Walsh, +2, Dwight Brown, +2, Cathy Moreton, +1. Back: Bob Struck, +4, Hugh O'Neil, +3, Joe Cioe, +1, Dan Taylor, +1, Rob Moreton, +1. SEVEN RIVERS The Men's Golf Association of Seven Rivers Golf and Country Club played a Two Man Best Ball Net on June 23. First Flight First place 57 Winston Harpster, Ren Renfro Second place 63 Bob Cox, Joe Cox Third place 64 Paul Owen, Werner Krupp (Tie Match of Cards) Second Flight First place 57-Al Silliman, Ken Hoffman Second place 58 Bob Campbell, Don Drake Third place 59 Walt Oberti, Brian Enright (Tie Match of Cards) Closest to pin No. 7 Brian Enright, No. 11 Ren Renfro Seven Rivers Women's Golf Association played a Low Gross Low Net tournament on June 22 and the winners were: First Flight Low gross: Linda Travis First place low net: Phyllis Pike Second place low net: Cory Adams Third place low net: Shirley Krupp Second Flight Low gross: Flore Roberts First place low net: Mary Parent Second place low net: Ann Henery Third place low net: Jan Jeck Third Flight Low gross: Gemma Herzog First place low net: Sie Bussinger Second place low net: Pat Hares Third place low net: Phyllis Panczel Niners low gross: Kathy Donovan Low net: Lane Parker. SOUTHERN WOODS The Southern Woods Men played Team Quota (flights) on June 22. Flight 1 First place: John Bacis, Ray Pozezinski, Gary Cooper +14 Second place: Bob Ingerick, Jim Heister, John Holden +8 Flight 2 First place: Peter Shaw, Bill Holland, Bob Chadderton, Tony Colucci and Jack Rutledge, Dave Goddard, Bill Long, Dave Greer +8 Low gross: B,)b Arrigo, Art Anderson 78 Low net: Bob Ingerick 64 PINE RIDGE On June 22, Little Pine Ladies Golf Association had 49 participants and the game of the day was Mystery Partner. Patty Berg Flight First place: Jean Lawton/Jackie Reiss - 57 Julie Inkster Flight First place: Nancy Barron/Cheryll Sedlock -45 Second place: Angie Catloth/Kay Fitzsimmons 53 Nancy Lopez Flight First place: Terry Demate/Kay Kreiger - 53 Second place: Carmen Faber/Diane Joyner 55 Annika Sorrenstam Flight First place: Joan Nichols/Betty Colburn - 58 (Match of Cards) Closest to the pin No. 2 Terry Demate, No. 3 Joan Minnelli, No. 4 Merry Guinn, No. 9 Jackie Reiss. Closest to the line No. 6: Kathy Carpenter. Birdies: No. 2 Terry Demate, No. 8 Alice Arena. The game of the day for June 29 is Best Six of Nine Holes. I next week with the Ford Senior Players Championship at the TPC of Michigan in Dearborn. The Senior British Open is July 21-24 at Royal Aberdeen, followed by the U.S. Senior Open at NCR Country Club in Kettering, Ohio. ... Dana Quigley, the 1997 winner, is playing his 263rd consec- utive event. Tour leaders: Victories, Thorpe,, ~9~4~L~BB~B~""%"P~~ PGA TOUR Western Open Site: Lemont, I0l. tour- naments. per- cent.. ... No. 2 Cristie Kerr will face Lindsey Wright in the first round. ... Kim, set to open against Sophie Gustufson, earned the final spot in the 64-player field with her victory Sunday.... The top 60 players on the money list after the Rochester LPGA qualified for the tournament, Japan's Ai Miyazato secured a spot as the Japan LPGA money leader and slumping South Korean star Se Ri Pak and Japanese amateur Shinobu Moromizato received sponsor invitations.... After single rounds Thursday and Friday, the third round and quarterfinals will be played Saturday and the semifinals and final are set for Sunday. ... The Jamie Farr Owens Corning Classic is next week in Sylvania, Ohio, followed by the Canadian Women's Open at Glen Arbour in Nova Scotia.). Last year: Jim Thorpe successfully defended, holding off Bobby Wadkins, Andy Bean and Wayne Levi by a stroke. Last week: Mark McNulty won the Bank of America Championship in Concord, Mass., beating Tom Purtzer with a birdie on the second hole of a play- off. Don Pooley was eliminated on the first extra hole in the tour's record fourth consecutive playoff. Notes: In 2003, Thorpe matched the tour record with a 10-under 6Q in the sec- ond round en route to a one-stroke victo- ry over Bob Gilder. ... The tournament moved to Eisenhower Park two years ago after 15 years at Meadow Brook ... Walter Hagen won the 1926 PGA on the Red Course, then part of the Salisbury Country Club. ... Peter Jacobsen is mak- ing his first senior start since tying for sixth in the Senior PGA Championship in late May. The 51-year-old Jacobsen missed the cut last week in the PGA Tour's Barclays Classic a week after tying for 15th in the U.S. Open ... The tour begins a stretch of three straight majors M* W INNNWWW M M CITRUS COUNTY (FL) CHRONICLE GolfLEADERS PGA Tour Statistics Scoring Average 1, Phil Mickelson, 69.09. 2, Tiger Woods, 69.11. 3, Luke Donald, 69.17. 4, Vijay Singh, 69.21. 5, Jim Furyk, 69.30. 6, Ernie Els, 69.75. 7 (tie), Tom Lehman and Kenny Perry, 69.83. 9, Scott Verplank, 69.84. 10, David Toms, 69.85. Driving Distance 1, Scott Hend, 318.4. 2, Tiger Woods, 308.8. 3, Brett Wetterich, 308.6. 4, Hank Kuehne, 306.4. 5, Scott Gutschewski, 303.9. 6, Kenny Perry, 302.4. 7, Ernie Els, 301.7. 8, Brandt Jobe, 301.6. 9, Davis Love III, 300.9. 10, John Elliott, 300.6. Driving Accuracy Percentage 1, Nick O'Hern, 81.3%. 2, Fred Funk, 76.3%. 3, Omar Uresti, 74.1%. 4, Gavin Coles, 74.0%. 5, Bart Bryant, 73.5%. 6, Scott Verplank, 72.8%. 7, Brian Davis, 72.7%, 8, Paul Goydos, 72.2%. 9, Billy Mayfair, 71,9%. 10, Olin Browne, 71.8%. Greens In Regulation Pct. 1, Vijay Singh, 71.8%. 2, Sergio Garcia, 71.5%. 3, Tiger Woods, 71.0%. 4, Kenny Perry, 70.8%. 5, Billy Mayfair, 70.3%. 6, Joe Durant, 70.0%. 7, Jim Furyk 69.8%. 8, Robert Allenby, 69.3%. 9 (tie), Chad Campbell and Luke Donald, 68.8%. Total Driving 1, Kenny Perry, 47. 2, Lee Westwood, 71. 3, Billy Mayfair, 83. 4, Joe Durant, 93. 5, Charles Warren, 96.6, Vijay Singh, 100. 7, Mark Calcavecchia, 111. 8, D.J. Brigman, 112. 9, Joey Sindelar, 116. 10, Carl Paulson, 117. Putting Average 1, Ben Crane, 1.704. 2 (tie), Billy Andrade, Chris DiMarco and Joe Ogilvie, 1.722. 5, Arjun Atwal, 1.725. 6, David Toms, 1.727. 7 (tie), Scott Verplank, Paul Goydos and Tim Clark, 1.729. 10, Phil Mickelson, 1.730. Birdie Average 1, Tiger Woods, 4.65. 2, Phil Mickelson, 4.63. 3, David Toms, 4.35. 4, Billy Andrade, 4.06. 5, Fred Couples, 4.05. 6, Vijay Singh, 4.03. 7, Scott Verplank, 4.00. 8 (tie), Ernie Els and Tim Clark, 3.98. 10, Jim Furvk. 3.95. Eagles (Holes per) 1, Brent Geiberger, 84.0. 2, Joey Snyder III, 88.4. 3, Brian Davis, 94.0. 4, Lee Westwood, 100.8. 5, Vijay Singh, 103.5. 6, Tag Ridings, 110.3. 7, D.J. Trahan, 110.6. 8, Billy Mayfair, 111.3. 9, Aaron Baddeley, 112.5. 10, Joe Ogilvie, 113.4. Sand Save Percentage 1, Luke Donald, 74.1%. 2, Pat Perez, 65.9%. 3, Brian Davis, 64.3%. 4, Tim Clark ,64.0%. 5, Jose Maria Olazabal, 62.5%. 6, Stephen Ames, 62.4%. 7, Retief Goosen, 61.9%. 8, Phil Mickelson, 61.1%. 9, Steve Flesch, 61.0%. 10, Phillip Price, 60.5%. All-Around Ranking 1, Vijay Singh, 232. 2, Billy Mayfair, 265. 3, David Toms, 289. 4, Retief Goosen, 294. 5, Tiger Woods, 313. 6, Mark Calcavecchia, 340. 7, Ernie Els, 341. 8, Luke Donald, 357. 9, Phil Mickelson, 359. 10, Jim Furyk, 362. LPGA Tour Statistics Scoring 1, Annika Sorenstam, 69.24. 2, Cristie Kerr, 70.86. 3, Lorena Ochoa, 71.00. 4, Rosie Jones, 71.17. 5, Natalie Gulbis, 71.46. 6, Juli Inkster, 71.53. 7, Paula Creamer, 71.67. 8, Candle Kung, 71.69. 9, Carin Koch, 71.71. 10, Hee-Won Han, 71.73. Rounds Under Par 1, Annika Sorenstam, .765. 2, Rosie Jones, .583. 3, Lorena Ochoa, .533. 4, Cristie Kerr, .523. 5, Natalie Gulbis, .519. 6, Carin Koch, .476. 7, Juli Inkster, .472. 8, Christina Kim, .451. 9, Jennifer Rosales, .444. 10, Dorothy Delasin, .442. Eagles 1, Annika Sorenstam, 7. 2, Laura Davies, 6. 3 (tie), Helen Alfredsson, Pat Hurst and Aree Song, 5. 6, 6 tied with 4. Greens in Regulation 1, Annika Sorenstam, .726. 2, Heather Bowie, .714. 3, Dawn Coe-Jones, .692. 4, Cristie Kerr, .686. 5, Janice Moodie, .681. 6 (tie), Lorena Ochoa and Christina Kim, .678. 8, Jennifer Rosales, .676. 9, Hee- Won Han, .674. 10 (tie), Maria Hjorth and Natalie Gulbis, .672. Top 10 Finishes 1, Annika Sorenstam, .778. 2, Lorena Ochoa, .667. 3, Rosie Jones, .600. 4, Cristie Kerr, .583. 5 (tie), Gloria Park and Juli Inkster, .500. 7, Mi Hyun Kim, .462. 8, Heather Bowie, .455. 9 (tie), Natalie Gulbis and Catriona Matthew, .429. Driving Distance 1, Annika Sorenstam, 271.6. 2 (tie), Sophie Gustafson and Brittany Lincicome, 268.9. 4, Laura Davies, 263.5. 5, Maria Hjorth, 262.5. 6, Heather Bowie, 262.4. 7, Isabelle Beisiegel, 261.7. 8, Lorenra Ochoa, 260.9. 9, Jean Bartholomew, 260.7. 10 (tie), Catherine Cartwright and Melinda Johnson, 260.2. Sand Saves 1, Patricia Meunier-Lebouc, .696. 2, Annika Sorenstam, .619. 3, Jeong Jang, .579. 4, Soo-Yun Kang, .571. 5, Dorothy Delasin, .563. 6, Angela Jerman, .552. 7 (tie), Stephanie Louden and Leslie Spalding, .545. 9, Paula Marti, .538. 10, Hee-Won Han, .535. Birdies 1, Natalie Gulbis, 181. 2, Lorena Ochoa, 177. 3, Cristie Kerr, 166. 4 (tie), Paula Creamer and Jeong Jang, 159. 6, Catriona Matthew, 158. 7, Gloria Park, 155. 8, Christina Kim, 152. 9, Young Kim, 151. 10 (tie), Hee-Won Han and Annika Sorenstam, 145. Driving Accuracy 1, Rosie Jones, .831. 2, Ji Yeon Lee, .825.3, Mi Hyun Kim, .821.4, Tina Fischer, .820. 5, Joanne Morley, .814. 6, Hilary Lunke, .805. 7, Meena Lee, .801. 8 (tie), Angela Stanford and Nancy Harvey, .798. 10 (tie), Leta Lindley and Celeste Troche, .796. Putting Average Per Round 1, A.J, Eathorne, 28.27. 2, Vicki Goetze- Ackerman, 28.54. 3, Mhairi McKay, 28.67. 4 (tie), Angela Jerman and Mi Hyun Kim, 28.69. 6, Juli Inkster, 28.70. 7, Rosie Jones, 28.75. 8, Lorena Ochoa, 28.76. 9 (tie), Deb Richard and Danielle Ammaccapane, 28.83. Putts Per Green (GIR) 1, Juli Inkster, 1.73. 2 (tie), Annika Sorenstam and Lorena Ochoa, 1.74. 4 (tie), Mhairi McKay and Cristle Kerr, 1.76., 6 (tie), Beth Daniel and Paula Creamer, 1.77. 8, Catriona Matthew, 1.78. 9, 8 tied with 1.79. Champions Tour Statistics Scoring Average 1, Mark McNulty, 69.54.2, Dana Quigley, 69.61. 3, Tom Jenkins, 69.80. 4, Morris Hatalsky, 69.89. 5, Wayne Levi, 70.07. 6, Mike Reid, 70.10. 7, D.A. Weibring, 70.11. 8, Craig Stadler, 70.13. 9, Jerry Pate, 70.17. 10, Bruce Fleisher, 70.24. Driving Distance 1, Dan Pohl, 301.3. 2, Tom Purtzer, 295.9. 3, R.W. Eaks, 294.6. 4, Keith Fergus 292.2. 5, Gil Morgan, 290.5. 6, Craig Stadler, 289.9. 7, Hajime Meshiai, 288.0. 8, John Jacobs, 287.1. 9, Lonnie Nielsen, 286.9. 10, Mark Johnson, 286.4. Driving Accuracy Percentage 1, John Bland, 84.8%. 2, Hugh Baiocchi, 81.6%. 3, Wayne Levi, 81.0%. 4, Doug Tewell, 80.8%. 5, Joe Inman, 80.0%. 6, Ed Dougherty, 79.5%. 7, Ed Fiori, 79.1%. 8, Tom McKnight, 78.5%. 9 (tie), Hale Irwin and Allen Doyle, 77.6%. Greens In Regulation Pct. 1, Tom Jenkins, 76.2%. 2, D.A. Weibring, 74.9%. 3, Mark McNulty, 74.3%. 4, Tom Purtzer, 73.8%. 5, Bruce Fleisher, 73.6%. 6, Raymond Floyd, 73.4%. 7, Wayne Levi, 73.3%. 8 (tie), Hale Irwin and Jerry Pate, 72.2%. 10, Dave Barr, 72.0%. Total Driving 1, Keith Fergus, 29. 2, John Jacobs, 37. 3, Dana Quigley, 39. 4 (tie), Bob Gilder and Mark James, 41. 6, Brad Bryant, 44. 7, Wayne Levi, 47. 8, Gil Morgan, 48. 9, Ed Dougherty, 49. 10, Jim Thorpe, 50. Putting Average 1, Dana Quigley, 1.739. 2, Morris Hatalsky, 1.748. 3, Mark McNulty, 1.759.4, Jim Thorpe, 1.760.5, Don Pooley, 1.761. 6 (tie), Mark James and Bruce Lietzke, 1.764. 8, Ben Crenshaw, 1.765. 9, Lonnie Nielsen, 1.766. 10, 2 tied with 1.767. Birdie Average 1, Craig Stadler, 4.46. 2, Mark McNulty, 4.29. 3, Jim Thorpe, 4.15. 4, Mark James, 4.11.5, D.A. Welbring, 4.08. 6, Des Smyth, 4.03. 7, Dana Quigley, 3.98. 8, Jerry Pate, 3.97. 9, Rodger Davis, 3.94. 10, Wayne Levi, 3.93. Eagles (Holes per) 1, Tom Jenkins, 67.1. 2, Gary Koch, 75.6. 3, Gil Morgan, 85.5. 4, Craig Stadler , 86.4.5, Dana Quigley, 92.3. 6, Mike Reid,, 93.0. 7, Keith Fergus, 105.0. 8 (tie), Tom .Purtzer and Jim Ahern, 108.0. 10, Mark Johnson, 114.0, Sand Save Percentage 1, Rodger Davis, 64.3%. 2 (tie), Isao Aoki, Morris Hatalsky and D.A. Weibring, 57.1%. 5, Howard Twitty, 56.3%. 6 (tie), Ed Fiori and Mark McNulty, 54.9%. 8, Mike Sullivan, 53.8%. 9, Dana Quigley, 53.3%. 10, Don Reese, 52.5%. All-Around Ranking 1, Dana Quigley, 75. 2, Mark McNulty, 119. 3, Wayne Levi, 129. 4, Morris Hatalsky, 138. 5, D.A. Weibring, 145. 6, Hale Irwin, 150. 7, Mark James, 153. 8, Tom Purtzer, 162. 9, Rodger Davis, 172. 10, Craig Stadler, 174. PGA Tour Money Leaders 1. Vijay Singh 2. Tiger Woods 3. Phil Mickelson 4. David Toms 5. Kenny Perry 6. Jim Furyk 7. Fred Funk 8. Chris DiMarco 9. Padraig Harrington 10. Sergio Garcia 11. Justin Leonard 12. Adam Scott 13. Luke Donald 14. Retief Goosen 15. Davis Love III 16. Peter Lonard 17. Bart Bryant 18. Ernie Els 19. Billy Mayfair 20. Joe Ogilvie 21. Tim Clark 22. Ted Purdy 23. Stuart Appleby 24. Scott Verplank 25. Tim Petrovic Money $5,683,475 $4,800,290 $4,251,253 $3,339,463 $2,814,246 $2,416,669 $2,393,425 $2,356,929 $2,288,406 $2,277,598 $2,226,563 $2,175,394 $1,935,041 $1,833,215 $1,716,396 $1,682,184 $1,632,274 $1,588,635 $1,570,635 $1,523,587 $1,506,666 $1,503,315 $1,440,339 $1,429,700 $1,374,480 26. Tom Lehman 12 27. Darren Clarke 8 28. Greg Owen 15 29. Stewart Cink 16 30. Chad Campbell 16 31. Mike Weir 15 32. Jose Maria Olazaballl 33. Tim Herron 16 34. Charles Howell III 16 35. Geoff Ogilvy 16 36. Rod Pampling 15 37. Jonathan Kaye 16 38. Zach Johnson 18 39. Fred Couples 13 40. Lucas Glover 15 41. Sean O'Hair 16 42. Kevin Na 19 43. Billy Andrade 16 44. Joe Durant 15 45. Bo Van Pelt 20 46. Mark Hensby 14 47. Shigeki Maruyama 15 48. Arron Oberholser 16 49. Aaron Baddeley 15 50. John Daly 15 51. Jeff Sluman 16 52. Scott McCarron 14 53. James Driscoll 17 54. Brandt Jobe 14 55. Brett Quigley 18 56. Rory Sabbatini 17 57. Bob Tway 15 58. Mark Calcavecchia15 59. Pat Perez 18 60. Brian Davis 14 61. K.J. Choi 14 62. Kevin Sutherland 15 63. Arjun Atwal 9 64. lan Poulter 15 65. Brad Faxon -17 66. Robert Allenby 18 67. Bob Estes 15 68. Jerry Kelly 1.7 69. Tom Pernice, Jr. 19 70. Ryuji Imada 16 71. Vaughn Taylor 18 72. Woody Austin 17 73. Nick Price 11 74. Fredrik Jacobson 17 75. John Senden 17 76. Steve Elkington 12 -171 lit. ,. Copyrightled Material Syndicated Content Amm qw O *0 Available fr om Comercial News Providers REDUCED INITIATION FEE Seven Rivers Golf & Country Club We have recently reduced our initiation fee to $1,500. Seven Rivers is a private membership country club with 18 hole golf course, swimming pool, tennis courts and newly renovated clubhouse. If you are interested in becoming a member, come try our course for only $20 (includes lunch and cart) call 7956192 for details. Guests must play wilh .member. : '" :; I I* I I I 1 I' I "- IIII-*- I I I 1[11 "- -" -' SOFF with 1/2 cart I Morning Rate $2453 1604 $1415 Good for up to 4 p eople plus tax, before Noon. plus tax, after Noon. plus tax, after 4:30pm Junior Golfer FREE With Paying Adult Prices Effective Jul1, 2005* ires Ju31, 2005 ccc Sf .4.A- 4 4555 E. Windmill, Hwy. 41 N. I7f26.- 1-461 E.Inverness Summer Rates Participating in Effective May 1st Summertime Plag Card TOURNAMENT SCHEDULE FORMAT Week prior to tournament, Practice Round Available. 36HoleStroke play "Best Ball" 2-Person Teams with Handicap 6 A N N U A L Ip (Cart& starting time required) cart fees: $12.00 Team divided into flights * .Sat., July 2nd Sun., July 3rd I st Round 2nd Round according to "Team Handicap" Tee Times From Tee Times 8:30 A.M. (Gross & Net Divisions In All Flights) 8:30 to 11 A.M. Shotgun (Starting times for Saturday will be available on Thursday) $7 DIVISIONS FOR MEN & WOMEN Includes: Cart & Fees, QfNVERNESS Lunch on Saturday. Buffet Breakfast on # Sunday, Prizes, Special Events. 3150 S. Country Club Drive, Awards Sunday. Inverness, FL 34450 For Tournament Information OrTo EnterYourTeam...Call John Kelly 637-2526 6B WEDNESDAY, JUN $1,363,421 $1,299,120 $1,222,293 $1,212,618 $1,164,579 $1,146,471 $1,138,648 $1,105,862 $1,096,852 $1,083,117 $1,082,220 $1,061,333 $1,043,469 $1,034,137 $1,018,947 $988,580 $978,397 $971,335 $930,586 $899,685 $895,579 $865,384 $847,584 $805,982 $789,806 $787,547 $776,364 $768,439 $764,445 $744,538 $739,473 $738,154 $732,936 $714,346 $711,804 $708,530 $688,675 $686,701 $681,560 $675,526 $665,609 $658,105 $647,504 $627,018 $621,718 $616,578 $614,686 $602,047 $599,455 $593,999 $593,545 P ESEIRVE Golf Club "Experience One of Nature's Finest" COOL JULY RATES 1900o Till noon $1500 after noon includes cart & tax No other discounts available with this offer. Rates are subject to change without notice. Dress Code Enforced (No Jeans) Email: [email protected] Southwest Of Ocala On SR 200 11.5 Miles From I-75 (352) 861-3131 Sandwedge Cafe MHfklfast L.".ch "qDinner' 7-7 Modh $at 7-3 Sunday : OPENTO Ask about THE PUBLIC, the Golfer's 861-7071 TE2 0 ! _s~------ ----- ------- ------ - - Qr 7nne :: .=Ii: r li: ',, .r, '-- ... :" WEDNESDAY JUNE 29, 2005 CCPR offers summer fun Special to the Chronicle Citrus County Parks and Recreation is offer- ing the following summer programs for chil- dren: Annual Summer Youth Camp for ages 6 to 12 runs from now sec- ond child per week, $46 third or more child per week). A $15 registration fee per child (non-, refundable) and first week's fees are due at reg- istration. Includes a variety of indoor/outdoor games, board games, sports, arts and crafts and two field trips per week T-shirt included in the initial registration fee. The Neighborhood Outreach Program runs from now through July 22 at Citronelle Park, Floral Park, Hernando Park and Beverly Hills Community Park (Due to lack of participation, the Neighborhood Outreach Program in Wesley Pet care may require information hodgepodge A Middle English word, hotchpot, leads us to today's pet article. Hotchpot was bor- rowed by those Middle English folks from the Old French word for "stew." Quite a stretch, you might be thinking. Well, here goes: hotchpot is the derivative word for our word, "hodgepodge," and that is what I have for you today. A hodgepodge is a "mixture of dissimilar ingredients," according to the American Heritage Dictionary. In this day of thousands of timesaving inven- tions, there are two that are indispensable for the pet owner. The first is a good hand-held vac- uum cleaner. I am quick on the draw with mine and can rival any old-time gun- slinger. They can't be beat S~ or cleaning around the S. cat litter box. Litter .- tracked from the litter box area to every corner of the house is a real hassle; this S solves the problem quickly and easily. A battery-pow- Kyleen Gavin ered version plugged in PET right where your cats take care of business will save TALK you energy and time. I believe it is a better solu- tion than sweeping, as no dust is generated. A cousin to the hand-held vacuum is the hand-held carpet cleaner. I am a recent convert to this little beauty. In fact, my daughter gave me a "Spot Lifter Power Brush," and I had no idea how much help it would be. I have been house training three puppies, and accidents are part of the process. My new toy takes care of every single one quickly and efficiently It has a plug- in cord, which, by the way, is wonderfully long. The cleaning solution has some miracle stuff in it that takes spots away right before your eyes. I am sure there are other brands and names. Some time ago, I wrote of the destruction of a I also begin the 10 a.m. rule now. No one goes outside unless it is important. Kyleen Gavin Barbie doll by my Jack Russell puppies. While I wrote the article "tongue in cheek," apparently a few readers did not care for my metaphor. I meant no offense by that article or any other I write, and I trust that readers can continue to know that. The dreaded heat of summer is here. Remember this critical imperative: pets and hot cars do not mix. Please don't leave your pet in your car for even a quick trip into the store. As little as 15 minutes can spell death for him. Be sure to pro- vide extra water for him; even inside pets are stressed by the heat Air-conditioning dries out the air in your house, too. I double the amount of water bowls from now until the weather cools off. I also begin the 10 a.m. rule now. After that morning cut-off time, no one goes outside unless it is really important. Of course, if a storm comes through and temporarily cools things off, then outside playtime is briefly OK They quickly become used to the routine, and I don't worry about overheating. Enjoy the summer, it won't be that long before cooler weather prevails! ---- Kyleen Gavin is a professional pet sitter. She lives in Hernando with her husband three dogs and three cats. She can be reached at 746-6230 or e-mail her at Kyleen@earthlinknet. Jones Park has been relocated to Beverly Hills Community Park at 997 W Roosevelt Blvd. in Beverly Hills.) Free activities, such as arts and crafts, group/individual activities, group games and various sports for ages 6 to 12 are offered. This is a great opportunity for children to get outside, interact with other children and just have some fun. The programs will meet from 9 a.m. to noon Monday through Friday. The Open Gym Program will be offered from now through July 22 at Crystal River High School, Citrus High School and Lecanto High School. This program is free of charge and is available to children ages 13 to 17. Each child participating will need a parent or legal guardian to sign a waiver form prior to partici- pating in the program. Call Citrus County Parks and Recreation at 527-7677. Any person requiring reasonable accommo- dation at any program because of a disability or physical impairment should contact the Citrus County Parks and Recreation office 72 hours prior to the activity. Dedicated r, The Kings Bay Association is proud to announce that Saralynne Schlumberger was award- ed the first scholarship given to the Academy of Environmental Science by the association in recog- nition of students who take an interest in the environment and contin- ue studies in that field. Schlumberger reads her winning essay, "The Way It Was," to Kings Bay Association members. Special to the Chronicle $500 scholarship News NOTES Buttonwood Bonsai Club to meet July 9 Buttonwood Bonsai Club will return to its regular meeting place after two months of "on- the-road" meetings, an annual picnic in May and a trip to Vero Beach in June. Its regular meeting will be at 9:30 a.m. Saturday, July 9, at the First Presbyterian Church, 1501 S.E. U.S. 19, Crystal River. July's meeting will focus on cutting off and finishing up some crape myrtle air layers that were applied early last spring by the members. There will be a few extras available for those who weren't there at the applying, and for visitors. As usual, the meetings are open to the public and visitors are welcome. Call President Sandi Seeders at 563-0221 or Clay Gratz at 563-2156. Yoga schedule set during July Yoga at the Historic Crystal River Train Depot at 109 Crystal Ave., Crystal River, is scheduled as follows during July: 6 to 7 p.m. Thursday. / 9 to 10 a.m. Saturday. Classes are appropriate for 8 years and older and are multi- level. The cost is $5 per class. Bring a mat or towel and wear comfortable clothes that allow for easy physical movement. All certified instructors. For more information or direc- tions, call 563-6535 or 795- 3710. Inverness Elks slate month's activities The Inverness Elks Lodge 2522 will have its monthly meet- ing at 8 p.m. Tuesday, July 26. There will be an Independence Day Picnic from 3 to 5 p.m. Sunday, July 3. The cost is $7. The Tiki Bar will open at 1 p.m. The Annual Pig Roast will be from 3 to 5 p.m. Sunday, July 17, at the cost of $10. The fish fry will be from 5 to 7 p.m. Wednesday, July 20. Friday evening dinners will be from 5:30 to 8 p.m. with live music from 7:30. July 8 is the usual Friday prime rib dinner.. U Send photos and infor- mation to Pet Spotlight, c/o Citrus County Chronicle, 1624 N. Meadowcrest Blvd., Crystal River, FL 34429. Special to the Chronicle A $500 scholarship was awarded to Kevin Garcia, left, from David Heinz, Heinz Funeral Home, Inverness. Garcia will be attending CFCC in Lecanto. Beverly Hillis Fishing Club 2. 5 . Special to the Chronicle Although the Beverly Hills Fishing Club meetings do not take place during June, July and August because many of our snowbirds have left for the summer, Pat Dick, our new activities chairman, arranged a trip on the beautiful St. Johns River from historic Sanford. The St. Johns River Is nestled among graceful live oak and cypress trees. The ship The Romance winds north to Jacksonville and the Atlantic Ocean. Eagles and ospreys were spotted while sitting on the outdoor deck after an enjoyable gourmet dinner. Approximately 40 fishing club members danced and listened to music while gliding down the St. Johns River. Recent graduate Special to the Chronicle Mr. and Mrs.. James L. Tress of Beverly Hills are proud parents of Mrs. Julianna Tress Amato, who graduated with honors May 21 from Camden County College In New Jersey, receiving an associate In science degree for teaching special education children. She also belongs to Phi Theta Kappa. I I r- CITRUS COUNTY (FL) CHRONICLE 2CWEDNESDA TrruNia 209.2005 InESTAURANW DQINE IN QNLY1 MONDAY Shrimp Ptrmaglana with side of pasta plus dinner salad & bread...... $9.95 TUESDAY AII-Yo rCan Eat Spaghetti............. 49 WED./TIURSDAY L"14 Ch Pizza Larg Antlpasto n Hot larile llos (Serves 3-4) ...............................$...........5..................... 9 5 THURSDAY Naked Lasagna Panigliana plus garden salad & bread....... .. $7.495 10 Prime B Rib Eorg urs. NMte $10.95 Lg. Cheese Pizz. L o rgeAntipast , Hot garlic rolls (serves 3-4 .......... .91 2 pounds of Steamed Grab Legs with choice of pasta plus garden salad..................oS"95 I pound for................................ $10.95 Fried Catfish with French Fries or baked po ulaj5 and bread...... ...... ...... ................... .... SATURDAY Chicken Caclatort with choice of pasta pl de salad & bread ............ .............. S. Baked Stuffed Fleunder with choice of pasta plus garden salad & bread *$895 Homestyle Itailan Meat Loaf with pasta plus garden salad & bread................... 4 All Earlv Bird Specials Include Super On Hwy.491 in the Beverly Hills Plaza SUN. 12 NOON. -9 P.M. MON.- THURS. II A.M.- 9 PM. FRI.&SAT. II A.M.TO 10 P.M. 746-1770 Stuffed Shells o Manlctti soup or fresh garden salad ..................7.49 Veal Papmigiana w i of pa chke ofsoup ofre Ardealad $7.49 Cheese or Meat Raleoll with meathall;choke of soup or fresh grdensalad $7.49 #4 Medium Cheese Pizza w&th I topp PLUS soup or fresh garden dad. 7.49 2 People $10.49 with 2sous or 2 fresh garden salads Chicken Cutlet Parmiglana vAthsildeofpast&vegeable,choleofsaidorSsoup ....749 Baked Ziti with Meatball plus salad or soup with choice of dressing ............ $7.49 Chicken CGrdon Bleu with side of pasts & veg. choice osop or fresh garden salad or Stuffed Fleunder wfdrIes & vesrido pasta. Soup or fresh garden salad................... $ 49 g#8 Eggplant Parmigiana with side ofpas & vgetablechoe of salador rsoup*... 4 r cla. Bad. rCoffee.Tea Or Soft D rink. dyLUNCH SPECIALS 5 Weekly Planner DillonSPE IAL 352-795-5866 MONDAY Country Fried Steak Whipped Potatoes, Vegetable and Roll .............4.95 TUESDAY Grilled Pork Loin N Gravy Whipped Potatoes, Vegetable and Roll...$4.95 WEDNESDAY Spaghetti with Meat Sauce and Garlic Roll.................................... 3.95 THURSDAY Deep Fried Chicken Breast Whipped Potatoes and Gravy Vegetable and Roll.............................................. ................................. 4.95 FRIDAY Fish Fry (All You Can Eat) French Fries, Cole Slaw and Bread.........84.95 SATURDAY Rib Eye Steak French Fries, Vegetable and Roll..............................8....6.95 SUNDAY Roasted Turkey N Dressing Whipped Potatoes, Gravy, Vegetable and Roll............................................................................. 5.55 With any Dhmnner Order add a slice of pie (your choice) for only 1.75 No Substitutions or Changes Without Extra Charge. 589 SE US Highway 19, Crystal River, FL 34429 PLANTATION INN t. r ~ China First Buffet 10% OFF TOTAL BILL Covw Good At Bo.t i i..n!-E.. ,,m 715105 ( USHwy".19 BKFC CRYSTAL RIVER 618 S.E. Hwy. 19 (352) 705-5445 NEW ITEMS (WEiKENDS ONLY): t ALL YOU CAN EAT Snow Crab Legs, Oysters, Shrimp 736 GrovrdClvelnd Bvd. Hihwy44, rsa ie I 32-7959081 Imp. Pasta Italian Cheeses Imp. Olive Oils Italian Coffee Roasted Chick Peas Fava & Lupinl Beans Italian Taralll Imp. Wine Vinegar * SItalianFoods Wholesale Warehouse an more 3 & I PRICES GOOD THRU 7/02/0 I Fresh DRYSAUSAGE CHUBS HUMMEL HOT DOGS ITAUAN | Mozzarella Extra L at Cas SAUSAGEe Trays S $4.69/Ib). ot& f8or9"&A Beef HOT OR Mace Buyers, Hostess Gift, Famy Leonr Mascarpe & Skinless & Cocktail Franks SWEET Italan Foods Wholesale Warehouse and mKie 2, asabs. RICES GOOD TRU$2.19/B.02/05 SMontino Taranto 5 PfS~gane ea aItalian Sausage Pattes No mI J SLaMonica ScungillH $7.99/28 oz. Lobster Slipper Tails $19.75/2 Ib. bag s Chopped Clams $5.47/28 oz. Seafood Medly $2.99/I Ib. bag Calamari $6.95/2 '/2 lbs. Cleaned/Frozen Mussels Marinara $2.39/Ib. Frozen Imported Locatelli Cheese $6.99/lb. SHRIMP Raw Shell On $ 1.95/2 lbs. 21/25 ct. Imported Pecorino Romano $3.77/lb. &rated free Cooked cleaned peeled eveied $13.85/2 26/30 ct. Imported Parmesan-Romano Blended French Swiss Cheese $4.97/lb. 5 Grated Cheese $3.99/lb. Casaro Fontina Cheese $5.95/lb. * PugliaPomace Olive Oil $1L97/gal. Leoni Pizza Sliced Pepperoni $1.77/li lb. 1 Gem Extra Virgin Olive Oil $17.47/1 cod prs Pepperoni Links $4.49/lb. | Cannoli Shells- Lg. & Small Leoni Baked Eggplant Cutlets $7.95/3 lbs. Cannol Cream $6.57/1 '/ lb. tube Imported from Itaynocchi$1.98/b. poate or chise Full line of Italian Espresso reg. & decaf Black Dried Cured OlIves $2.89/lb. Red Kidney Beans 2/$ 1.00 Italian Green Marinated Olives $3.77/ib. JUST IN! Anginetti& kItalan Pizzekle Italian Hero's Lg. or Small Cookie Now available Wednesdathru SaturdN o 4115 Lamson Ave. Spring Hill 352-684-9211 IFRESH ITALAN BREAD I en * Italian Cookles Anisette Toast. Come experience our underwater specials! featuring: salmon, grouper, crab cakes, shrimp, & more! Live Entertainment Fri/Sat Nites at the Tiki The Port Hotel & Marina 352-795-3111 Join Us after a game golf at Lakeside lpr,,,.,..r.Li/nch Menu Lun. h nll N, ,r. n,, J r I .a Ihl .1 m n der Valk Subs o Omelet i 13 ceggqi illy cheese Spare rinb .:.; 'steak snrdwi.h HrS d.:.q gus Burger fish ,lel uxe Buriger Crilled sjnd dichez, Pear suups Plr'n i Bistro A Menu pei:zers- Smmoked ,ln.jIr, prina.:i n ip ups hi Salad) Oni.:.n oup Lo:bsier Bisque STuna sten,.alad tree's Sides flet minjri.r. Pc'r tenderloin Salmon Turna tea. Crouperr ilei pen days oi it'ek ftr lhinlch t inizer, the Bistro at Iain ,hr lialk WE ARE MEMBERS ONLY! Membership is only $1000 for 5 years lV n der Valk -and you'll receive 5 free drinks 637-1140 9 and istro Happy Hour 5 to 7pm Located on the 18th hole of Lakeside Golf Course, Hwy. 41 between Inverness and Hernando 9301 W. Ft. Island Trail, Crystal River For information please call 352-795-4211 , 711- -3 oan FS d&o ENSDY lr >,ZV; I r a , e 10 11 NI .r-W NLNaFw `` - -:, I - - 119 I ('mxw Cntllr .Ll tHJ rEN ,UE 0 jMiPP7 WAaEm *CAFE' | Under New Management Mon. Friday Breakfast Special 2 Pancakes, 2 Eggs 2 Bacoior-Sausage Saturday All You Can t Chicken Wings 16 6g ne NEW HOURS Sun. Wed. 6 am 2 pm Thurs. Sat. 6 am 8 om Thursday Special All You Can Eat Spagheti 4W eatballs Friday Special All You Can Eat Fish Fry $5.95 Now Offering Kids Menu Try oar otker tiL.V44 secMI ANNOUNCING NEW HOURS Starting June Th New -Summer Hours 12.8 prn m N Monday Sunday unday $4.75 all day buffet 04mescica/z 0 0 d, OF Sworausbard -IUM I 1314 U.S. Hwv. 41 N. (NEXTTO LONG JOHN SILVE) Inverness 341-0222 Sunday 5:330Aa-2:0PM g 111 .11 s O n s WEDNESDAY AU. YOU CAN EAT o Moe's Fried Chicken s5.99 Buy One Dinner Get One FREE with drink 11-8:00 pm Expires: 7/6/05 FRIDAY ALL YOU CAN EAT Fried Fish 65.69 11a m-1m 1 IA A R o:MA RTII ARI SFriday Night Saturday Night July In* July 2" "Wind of Fate' Jimmy Buffet Tribute Wednesday Thursday Midnight Johhnny Rick Dahlinger Trio MiN -_ _-M . I- I wdnnkou ,.,,i-, 5 0 4.1 19 1 ... .....-...... .. 75-,2 00A, Fun & Winning Place to Be HO &R ADY3 LARGE Em RO ZAJ Is"8 a 1500Cary Ou0 l We've Remodeled With A New, Bright, Shiny Interior! ew Equipment Pizza-now Hotter &.Fresher Than Ever Little Caesars Pizza Large 4 Topping Pizza............. ............ 899 Large 5 Topping Pizza.............................. $999 Large 6 Topping Pizza......................... $10 Large 1 Topping Pizza..............................$599 Large 2 Topping Pizza........................... 9 Large 3 Topping Pizza............................... $799 Delivery Specials Also Avaclable 10 Wings $499 Italian Cheese Bread $399 Crazy Bread w/sauce -------------------------------------------------------------------------------------------------- CRYSTAL RIVER King's Bay Shopping Center Hwy. 19 795-1122 WE DELIVER INVERNESS * Limited Delivery Area, $10 Minimum Purchase Citrus Center/Next to Citrus Cinema Hwy. 44 344-5400 0,-7-a reoing to see the ireworks? Stop by acind; pick up pizza! r~~~~~~=e F1 i?1iE-1~~4iW-A I ~1 :1 mr_ riy imi.in V I I I WEDNESDAY, JUNE 29, 2005 3C Crraus CouNTY (FL E TA~jj4A&L rm 3 mu m u v m '- Wi ill S Z 00 -*..N WCITRUS CEOUN (FL) CHRON King's Bay Rotary Club BRIAN LaPETER/Chronicle The King's Bay Rotary Club recently elected new officers and directors. From left are: Phil Noll, director; Julle Kidder, director; Robert Mock, treasurer; Carolyn Calfee, past president; Mike Gudls, director; Shelby Weingarten, director; Hugh McElvey, direc- tor; Roger Proffer, president; Susan Kirk, director; Galen Clymer, director; Robert Boleware, vice president; and Judge Mark Yerman. CASINO STYLE MACHINES Win a Special Gift Match Play Day! S7,m-4anm see clerk for details Live Entertainment Mon & Tues Night Madness li0 0a]e M1i Thurs Night Double Play Match V MW Fri Night from 7pm-2am SaaSat Night s-Membership Is FREEI fpe gdthtor Sun Night "Tribute to Elvis" COMPLIMENTARY MEALS Lumoh 12-2 Dinner 7-9 "I V I O'-T.I-Y W -1A IIYOI M WIN A Magnavox DVD/CD Player *Ask for game details when you arrive. July 4th Weekend * One player given away Sat., Sun & Mon. (3 DVD/CD players in all) * 1st person to get 5,000 points each day receives a free DVD/CD player plus their winnings * Every Wed. Night Free Gifts For The Ladies * Every Thurs. Night Free Gifts For The Men SPrizes Galore SPrize Drawings Everyday .Newest Machines In Town * Free Food, Snacks & Drinks Must Be 18 To Play SSpin And Win * Clean And Smoke Free Video Tyme Too Game Room 4980 S. Suncoast Blvd. 2 miles South of Homosassa on Hwy 19, on the right 3 Miles North of the Sugarmill Woods Entrance 628-6109 Open Mon. Thurs. 9 am-Midnight Fi r .i o + nA q -jt +n 0..rim- -?? i+rqrii Nn rm 't i MIln~ Lanes Summe ow Bowling SFmily And Enjoy 2 v2 Hours of l Tng, Laser Lights, Music & run f Rock 300 SATURDAYS Ing2 Shifts r es 8:15pm-10:45pm PEN JULY 4 $27.50/Lane S OON TIL 8 P.1 l:15pm-l:45am v ng d Rese actions Suggested $25.00/Lane MANATEE 795-4546 '/L--1 AN S 7715 GULF-TO-LAKE Hi W es 1-1/4 MILES E. OF 19 ON R1 CRYSTAL RIVER- SunCruz PORT RICHEY C*A-S*I.N*0 Cruise with us on the 4th of July and receive a FREE GIFT* Available on All Cruises! *While Supplies Last. Over 300 Slotsl BlacliJacki Dicel 3 Card Poker! Roulettel Let-It-Ridel And Morel High Speed Shuttles Depart Several Times a Dayl 9:30 AM, 11:00 AM. 3:30 PM, 7:00 PM 727-848-DICE 800-464-DICE i -if fW i i i --- -- - - $5.00 IN SLOT TOKENS FREE FREE BOARDING! I (WHEN YOU PURCHASE $10.00 IN SLOTTOKENS) OR A FREE $10.00 FREE PARKING! TABLE MATCH PLAY! FREE FOOD AND DRINKS S-- Limit One Coupon Per Person Per Cruise. I WHILE GAMBLING! Coupon Required. Expires 06/30/05 CCC LOCATED IN PORT RICHEY, NEXT TO HOOTERS Casino reserves the right to cancel, change, or revise ths promotion at any time without notice. S1/2 Ib. W Butterfly Shrimp Hours: Sunday -Thursday II a.m.- 10 p.m., Friday & Saturday I I a.m. Midnight (352) 344-4545 1674 N. Hwy. 41 Inverness, FL Come Listen to Live Music Fridays & iunaays LocalArtist Every Wednesday -' "",WTWILIGHT FEATURES Sunday, Tuesday, Wednesdays (week of 6/24-6/29) Long island 1/2 Duc .Baked Chicken Pot Roast topped wl w/Blackberry Potatoes/Veggles Lingonberry Sauce BBQ Sauce Salad $10.95 $8.95 $9.95 Tour of Italy Starting Thursday. June 16. and through September, The Cypress Room will be offernng a "Tour of Italy" each Thursday from 4-9pm. Regional dishes from Northern Italy to the boot heel will be featured. AMONG THIS WEEKS OFFERINGS Zuppa Primi PlattI (Entrees) Dessert Pasta Fagioli Di Lamon Gnocchi De Patate ala Piemonte Zabione con Bacche Chicken Scallopini ala Pesto Strudel Di Mele *Antpast (Appetizers) Spezzatino D'Angiello alia Giorgio Tiramisu U.S. 19 North To Citrus Avenue 352-795-4046 Turn West on Citrus (toward the River), Left on N.E. 5th 114 N.E. 5th Street Crystal River, FL FORMS AVAILABLE * The Chronicle has forms available for wedding and engage- ment announcements, anniversaries, birth announcements and first birthdays. * Call Linda Johnson at 563-5660 for copies. Citrus County Fair Association awards WALTER CARLSON/For the Chronicle Members of the Citrus County Fair Association recently awarded four scholarships. The funds for the scholarships were raised by the tractor pull. From left are: David LaPerle, director, chairman for tractor pull; Tyler VanVoorthuiJsen, recipient; Katie Thelen, recipient; Alyhsa Shelton, recipient; Carrie Kreisle, recipient; Kelly Roof, Miss Teen Citrus County; Ellen King, Miss Citrus County; and Nell Mayberry, president of Citrus County Fair Association. -1 Onu~s CouNTY (FL) CHRolvicLE COMMUNITY At pn-F.rA-TNE2.20 Cims CUNY (L)CHRNILE hT'T~A1N1~F1%T EDNSDA TNE 9.200 5 WEDNESDAY EVENING JUNE 29, 2005 A: AdelphiaCitrus B: Bright House D: Adelphia,Dunnellon : Adelphia, Inglis A B DI 6:00 6:30 7:00 7:30 8:00 8:30 9:00 9:30 10:00 10:30 11:00 11:30 H News 368 NBC NewsEnt Tonight Acess Psychic Detectives (N) Law & Order "Ain't No Law & Order Publish and News Wimbledon WEI 19 19 19 Hollywood 'PG' 1977 Love"'14' 1 7523 Perish"'14' 95310 8410981 Update (N) WEDUBBC World Business The NewsHour With Jim Roadshow Cooking American Masters "Sweet Honey in the Movie: **, "Touching the B a 3 3 News 'G' Rpt. Lehrer 9 5165 FYI Under Fire Rock: Raise Your Voice" 'PG' 2962 Void"(2003) Nicholas Aaron 10523 5 5 5 5 813 Rpt. Lehrer N) 53875 FYI Under Fire Rock: Raise Your Voice" 'PG' 36610 Story'G' 43320 41165 WFLA 8 News 1523 NBC News Ent. Tonight Extra(N) Psychic Detectives (N) Law & Order"Ain't No Law & Order "Publish and News Wimbledon BC 8 8 8 'PG' [] 'PG' 55233 Love" '14' [ 75097 Perish" '14' 78184 7753078 Update (N) WFTV News 9 ABC Wid Jeopardy! Wheel of Supernanny "Gorbea Dancing With the Stars Lost White Rabbit" (n News Nightline B 20 20 20 2610 News 'G' ] 3894 Fortune 'G' Familv 'PG' 12879 'PG' 1 11813 Stereo) 'PG, L,V' 6392815 13136707 WSP News 7392 CBS Wheel of eopardy! 60 Minutes Wednesday The King of Yes, Dear CSI: NY "Creatures of the News Late Show 10 10 10 1 Evening Fortune 'G' 'G 7788 199691 Queens 'PG'61455 Night"'14, V' 5 12542 8192897 wFT i. News [ 131964 A Current King of the That '70s Stacked The Inside "Everything News 34788 M'AS'H MA'S*H FO- 13 13 Affair 'PG' Hill PGL' Show 'PG' 'PG, D,L' [ Nice" (N) '14 L,V' 'PG'31418 'PG'24097 WCJB News 90349 ABC Wid Ent. Tonight Inside Supemanny "Gorbea Dancing With the Stars Lost "White Rabbit" (In News Nightline AB1 11 News Edition Family"'PG' 9 42349 'PG' ] 55813 Stereo) 'PG, L,V' [ 2579691 85402900 WCL Richard and Lindsay Wninng in Christians & Stepping Bill Purvis Lie Today Jourey The 700 Club 'PG' [ Live From Liberty IND 2 2 2 2 Roberts 'G' 8725368 Life Jews Stones Real Time 'G'6943748 8720813 8211146 2568833 WFS News 89271 ABC Wid Access The Insider Supernanny "Gorbea Dancin With the Stars Lost"White Rabbit" (In News Nightline AB B 11 11 ,News Hollywood 76707 Family" 'PG' 9 13829 'PG' [e20165 Stereo) 'PG, L,V' 9 2792233 50783558 WMWill & Grace Will & Grace The Nanny Just Shoot Movie: "Meet Wally Sparks"(1997) Rodney Fear Factor Climbing a The Nanny Cheers'PG' IND 12 12 12 12 '14' '14, D' 'PG'61962 Me'14' Dangerfield, Debi Mazar. 73271 blimp. 'PG' C 69078 'PG' 38610 22287 WTTA Yes, Dear Eve Every- Every- Seinfeld Beauty and the Geek (N) Smallville "Gone" (In News 1410287 Seinfeld Yes, Dear I 6' 6 6 6 'PG, L Raymond Raymond 'PG' 'PG' [ 1324436 Stereo) 'PG, D,V' C 'PG' 'PG, D' WTOG The Malcolm in The Friends 'PG' Eve 'PG' Eve 'PG, L' Veronica Mars "Silence of The King of The King of Friends 'PG' Frasier 'PG' LND 4 4 4 4 Simpsons the Middle Simpsons 9 8233 9610 9 5417 the Lamb" 'PG, L' 55271 Queens Queens 27900 22639 CFY 6 Patchwork Citrus County A Few Minutes With Cross Inside Medically Circuit Court U-Talk Winner's Patchwork M 16 16 16 119097 Matters Court 430165 Points Business Speaking 79558 Circle 33349 WOGX Friends'PG' That'70s King of the The That '70s Stacked The Inside "Everything News (In Stereo) i A Current Malcolm in f13 13 [ 4078 Show'PG, Hill'PG,L' Simpsons Show'PG 'PG, DL' [ Nice (N) '14 L,V' [ 16368 Affair (N) the Middle WAC Variety 3981 The 700 Club 'PG' Victor Love a Child Marvin This Is Your Sid Roth Praise the Lord ] 24829 2 21 21 644610 Morgan 'PG' 8184 Jackson Day'G' 19417 EA 1 1515 Noticias 62 Noticiero Inocente de Ti 344900 Apuesta por un Amor La Madrastra 340184 Don Francisco Presenta Noticias 62 Noticiero S15 1 05702 Univisi6n 'PG' 320320 'PG' 343271 -612813 Univisi6n [Wxx) Shop '11 |Shop 'il News 17338 Family Feud Doc "Queen of Denial" (In Sue Thomas: F.B.Eye Diagnosis Murder (In Home News PAX 17 You Dro You Dro 'PG' Stereo)'PG' 973233 "Mind Games"'PG'93097 Stereo)'PG 96184 Videos 8755639 -54 48 0 5 5 City Confidential 'PG' [l American Justice Movie: * "Superman: The Movie" (1978) Christopher Reeve. crossing Jordan "As If By A&E 54 48 54 54 505523 Superman learns of a plot to destroy the West Coast. 124610 Fate" '14' C9 841962 A 55 64 5 5 Movie: ** "Missing in Action 2: The Movie: * "48 HRS."(1982, Comedy-Drama) Movie: *** "Nighthawks" (1981) Sylvester SBeginning" (1985) Chuck Norris. 622639 Nick Nolte, Eddie Murphy. c 627184 Stallone, Billy Dee Williams. 656418 ( The Crocodile Hunter The Most Extreme 'G' c] Buggin' With Ruud Corwin's Quest (N) 'G' Miami Animal Police'PG' Buggin' With Ruud ) 52 35 5 Diaries 'G' 8727726 8214233 "Housemates"'G' 8210417 9 8213504 "Housemates"'G' BRAO he West Wing "H.Con- The West Wing (In BlowOut'14' 9 146320 Queer Eyefor the ports Kids Moms & I Want to Be a Hilton'PG' .7 17 172" 'PG' 9 503691 Stereo) 'PG' E 160900 Straight Guy'14' 166184 Dads (N)'PG' C 169271 9 865078 I 27 61 27 "CHiPs."'14, D,L,S' Presents '14'97829 Presents Presents 'MA'69261 'MA'82078 91726 iM 98 45 989 CMT Music 399894 Dukes of Hazzard 75639 Jimmy Buffett Uncut: 60 CMT 40 Greatest NASCAR Moments 54146 Dukes of Hazzard 64707 ______ 4_Minutes Special I EI 95 60 160101 Even Bigger El News (N) Dr. 90210 101 Even Bigger 101 Even Bigger Party at the Life Is Great Howard Party at the (T 5 Celebrity Oops! 699097 'PG 353523 100374 Oo Celebrity ps 322788 Celebrity Oos335252 PalmsStern'14, Palms E TN 9665 Dr. Timothy Presence- Daily Mass: Our Lady of EWTN Live 6452875 Religious The Holy Solemn Mass of Sts. Peter and Paul 5287875 96 6 9 9 Lord the Angels 6476455 Catalogue Rosary FM 29 52 29 2 7th Heaven "I Really Do" Smallville "Prodigal"'PG, Movie: *** "The Breakfast Club" (1985) Whose Whose The 700 Club 'PG' 9 A 29 29 G' 794455 L,V' 9 319788. Emilio Estevez, Moll Rincwald. C 322252 Line? Ln 389374 King of the Kingof the Cops'14, V' Cops'14V' Cops14, Cops14, V' Cops14, V' Cops'14, V 30 Days "Muslims and 30Days "Muslims and (F 1 30 0 30 Hill 'PGL' Hill'PG, 3056610 4905707 3145558 3051165 6192542 7599261 America"(N) 6459788 America" 1817184 H V 23 57 2323 Weekend Landscaper Curb Appeal House Kitchen I Want Thatl Weekend Landscaper Curb Appeal What You Design on a Painted i 23 57 23 Warriors s "Hunters'G' Trends Warriors s (N) Get Dime 'G' House SWild West Tech "Train Modem Marvels "The UFO Files 'PG' C Modem Marvels "Edison Automaniac "Death Cars" History Hogs'PG' 9 HFiST) 51 25 51 51 Tech"'PG' C 4349748 Arch"'PG' C 6554287 6467707 Tech" (N) 'PG' 6470271 'PG, L' 9 6553558 1815726 IF 4 38 Golden Girls Golden Girls Movie: ** "In the Name of the People" (2000, Movie: "In My Sister's Shadow" (1999) Nancy Golden Girls Golden Girls I%) Am anda424Drama) Scott Bakula. 'PG, L,V' B (DVS) 884964 McKeon, Janet Leigh. 'PG, LV' CC 334097 (N K 28 Amanda All Grown Fairly Jimmy SpongeBob Unfabulous Full House Fresh Fresh The Cosby Roseanne Roseanne 28 36 28 28Up'Y' Oddparents Neutron I'Y7' ] 'G'529078 Prince Prince Show 'G' 'PG'524523 'PG'121610 SC 3 1 59 31 31 Stargate SG-1 Movie: ** s "Tremors" (1990, Horror) Kevin Movie: **4 "Tremors II: Aftershocks"(1996) Movie: *** "The t_ ] 9 "Disclosure"'PG' 8911982 Bacon, Fred Ward, Finn Carter. 2767815 Fred Ward, Christopher Gartin. 6140894 Lost Boys" 5682875 World's Wildest Police CSI: Crime Scene CSI: Crime Scene Movie: "Mortal Kombat Annihilation" (1997, World's Most Amazing l 37 43 37 37 Videos 'PG' .985271 Investigation '14, LV' investigation '14, DLV' Adventure) Robin Shou. BC 715829. Videos '14' c 214320 9 3 19 4 Seinfeld Seinfeld Every- Every- Every- Every- TheRealGilligan's Island TheReal Gilligan's Island Sex and the Sex and the 4923 PG, D 'PG'421962 Raymond Raymo Ra Raynd d Raymond (N)885146 (N)888233City'14, .City'14, 53 Movie: ** "Sweethearts" (1938) Jeanette Movie: s* "Earth vs. the Flying Fairy Tales 69172252 Harryhause Movie: "Mighty Joe iMacDonald, Nelson Eddy. 2 1325165 Saucers" (1956) 2171962 n oun" 199 6895455 3 3 5 5 Monster Garage 'PG' American Chopper'PG' One Step One Step MythBusters 'PG' Top Gear (N) '14, L' One Step One Step C) 53 34 510455 258078 Beyond (N) Beyond (N) 247962 257349 Beyond Beyond 50465050 Clean Sweep "Sports of In a Fix "Romantic While You Were Out (N) Amazing Medical Stories Amazing Medical Stories While You Were Out'G' All Sorts" 'G' 987639 Bungalow" 'PG'618962 'G'627610 'PG' 614146 '14' 617233 216788 48 133 48 48 Charmed (In Stereo) '14, Law & Order "Under the Law & Order "Gunshow" Law & Order "DWB" 'PG' Movie: * "Road House" (1989, Drama) Patrick T4833 L,V' [ 978981 Influence" 'PG' 616504 '14, L' 625252 9 (DVS) 612788 Swayze Kell Lynch Sam Elliott. 903542 ) 9 54 9 9 Most Haunted Journeys Cures of New England World Poker Tour Six players fight for a slice of the $11 million prize pool. (N) World Poker Tour 'PG' '54 PG' 9 8815542 'PG' 9 4509287 'PG' 1261813 1252165 S 47 32 47 1 7 Movie: ***s "Jurassic Park" (1993) Sam Law & Order: Special Law & Order: Special Law & Order: Special Law & Order: Special A 47 32 4 Neill, Laura Dern. C 242879 Victims Unit'14' 896252 Victims Unit 14' 883788 Victims Unit '14' 886875 Victims Unit '14' 485320 FW in 18 18 18 Home Will & Will & ill & Grace Home Movie: *t "Rambo it" (1988) Sylvester WGN News at Nine (In Becker'PG' Becker'PG, W 18 18 1 mprovemen'14' '14, D' mproveme Stallone, Richard Crenna. 144962 Stereo) C 163097 512829 D.L' 136078 WEDNESDAY EVENING JUNE 29, 2005 A:Adelphia,Citrus B: Bright House D:Adelphia,Dunnellon 1 Adelphia, Iqglis ABD I 6:00 6:30 7:00 7:30 8:00 8:30 9:00 9:30 10:00 10:30 11:00 11:30 46 40 46 46 Lizzie Sister, That's So That's So Movie: "Go Figure"(2005, Drama) Jordan Hinson, Zack & Sister, That's So That's So 46404646 McGuire 'G' Sister 'G' Raven 'Y7' Raven 'G' Whitney Sloan, Cristine Rose. 'G' c1 159894 Cody Sister 'G' Raven 'Y7' Raven 'G' SMA*S*H M*A*S*H Walker, Texas Ranger Walker, Texas Ranger Movie: ** "The Outsider"(2002, Western) Tim Daly, Naomi M*A*S*H S '7,68 'k G'.'/ 'PG" : '14, V' 8230271 'PG, V' C 8216691 : Watts, Keith Carrading.'14, SV' ] 4977368 'PG" O -- odviet "Head of State"(2003) Real Sports (In Stereo) The The The .0 The Entourage Six FeetUnder "Time Chris Rock. 9C 51333252 'PG' C 486542 Comeback Comeback Corieback Comeback 'MA' 243271 Flies" 'MA' [ 203788 Movie: ** "Double Bang" (2001) Movie: *** "Die Hard With a Vengeance" (1995, Drama) Movie: **5 "Man on Fire" (2004, Crime Drama) ____ William Baldwin. 5033368 Bruce Willis, Jeremy Irons. (In Stereo) N, 86320261 Denzel Washington. C 993542 97 66 9 7 9 Viva La Viva La Direct Effect (In Stereo) Room Room Made "BMX" Aspiring Made (N) 'PG' 412829 The Real World "Austin" 66 97 Bamrn 'PG, L' Bam 'PG' 'PG' 413558 Raiders Raiders BMX biker. 'PG' 339542 '14' C9 189356 G The Dog The Dog Taboo: Outcasts 'PG' Tycoon Toys "Tanks" 'G' Megastructures "Kansai Megastructures Tycoon Toys "Tanks" 'G' Whisperer Whisperer 9057726, 9033146 Airport' 'G' 9046610 "Autobahn" 'G' 9056097 4720523 62 Alias Smith and Jones 'G' Gunsmoke "Miss Kitty" Gunsmoke "Harpe's Sam Peckinpah's West: Legacy of a Movie: * "Two Rode i ) 1665784 'PG' 9783504 Blood" 'PG' 9792252 Hollywood Renegade '14' 7857982 Together" (1961) C9 1670184 43A 42 4343 Mad Money 9860813 Late Night With Conan eBay Effect: Worldwide Mad Money 7458900 The Big Idea With Donny eBay Effect: Worldwide OI') 43 42 43 43 M6 O'Brien '14' C 7436788 Obsession Deutsch Obsession CN)N 40 29 40 40 Lou Dobbs Tonight 9[ Anderson Cooper 360 9 Paula Zahn Now CB Larry King Live CC NewsNijht With Aaron Lou Dobbs Tonight 154813 892436 801184 881320 Brown c] 891707 490252 NYPD Blue "A Sudden Cops 'PG, Cops '14, V' The Investigators '14' Forensic Forensic Psychic Psychic Mastermind The (O 25. 55 25 25 Fish"'14, D,V' ] D,V' 3235146 7430504 Files (N) Files'PG' Detectives Detectives s Takedown PAN 39 50 39 39 House of Representatives 6412078 Prime Time Public Affairs 558455 Prime Time Public Affairs I' 1 549707 FNC 44 37 44 44 Special Report (Live) [E The Fox Report With The O'Reilly Factor (Live) Hannity & Colmes (Live) On the Record With The O'Reilly Factor S44 37 44 44 9810010 Shepard Smith C 1] 96132875 CC 6152639 Greta Van Susteren 8062207 M- C 42 L414242 OThe Abrams Report Hardball S 6232829 Countdown With Keith The Situation With Tucker Scarborough Country Hardball 9 2662261 1898344 Olbermann 61.45349 Carlson 6151900 EsPN 33 27 33 33 SportsCenter (Live) cc MLB Baseball Teams to Be Announced. (Subject to Blackout) (Live) [] 943287 Baseball Tonight (Live) SportsCenter (Live) Lc lg 965981 11N619165 307558 2 34 ,28 3434 Arm Arm Wimbledon Today at Wimbledon Marquee match from Wimbledon. (N) MLB Baseball Teams to Be Announced. (Subject to 34 28 34 34 Wrestling Wrestling 4125875 Blackout) (Live) 9 1347287 The Sports Marlins on MLB Baseball Atlanta Braves at Florida Marlins. From Dolphins Stadium in Best Damn Sports Show The Sports Best-Sports FN 35 3935 35 List Deck (Live) Miami. (Subject to Blackout) (Live) 990610 Period 783875 List 36 31 Everyday Triathlon Inside the HEAT 79417 College Football 1990 Florida at Alabama. From Sept. 15, 1996. Inside the HEAT 388417 Breaking, SSportsman680233 Weapons he PlusCode number pri gram is for use with the G tem. If you have a VCR w ture (identified by the VCR Plu all you need to do to record nted next to each pro- PlusCode number, cable channels with the .emstar VCR Plus+ sys. If you have cable service, please make sure that the convenient chart pr i term, please contact your TL - 1._ ^ 1:--^. ^ .- X I n f,_1_,1_, _. ^ :_ ;:_ 4." _^ C ,, J, _A /,,( /-/ __ 7-^ -7n WJUF-FM 90.1 WHGN-FM 91.9 WXCV-FM 95.3 WXOF-FM 96.3 National Public Radio Religious Adult Contemporary Adult Mix 'T~t9 @W~.-4v eb - I*. -OM 4oa." 460.-m - ow No - w "I-- "EM dow 41 ft v -.4 mm.- .- ~-4- WRGO-FM 102.7 WIFL-FM 104.3 WGUL-FM 106.3 WRZN-AM 720 ** * * Oldies Adult Mix Oldies Adult Standards * A A A * . S S 0 8~ 0 F * * TT T -.6 --d ---. qm-a- - qm * 0 0 * .0* . . * * t - -e i0. guide channel numbers using inted in the Viewfinder. This in your VCR user's manual. ns about your VCR Plus+ sys- r VCR manufacturer. Workin gets cludy ian Florida w Coyrighted Material S SyndicaedContent dob- A *w* h. Sl MONO Available from Comnmercil News Providers --.gap * w~ now ftwmm Sv w0Mom a W O - - Mb 0 O~qdw 41mo* o Local RADIO J -j~5Lh W"~ I S I 4 * * - * 0 WEDNESDAY, JUNE 29, 2005 SC ENTERTAINMENT CITRUS COUNTY (L) CHRONICLE - 4 0 Q Wo 401M Aollm I> pw fl TirrWE -2 2-C CCYso (L H O S 8' low - in- do 0 - - a 4-a-h - .. - a - ~- 0 JkJ6 4j4 -W as km f P.1119 10 - p a S * * 0 AP w40% do dos m *' Ii Iii ai qb a 46 0 ' 0 * -0 -* - - Available from Commercial News Provders 40i 0N . in S 41 GO 4, - -1W, 4w am 4 S, 4w. fib a*At 0 - - "4 3^ `] *1^ 1*7Nd - ~ in a - w O ft o f rwa Io 0 k. 16iL6 Today's MOVIES = V I- 0 * w 1~ rxi~ V7m'a% I - -b4mm 40m Citrus Cinemas 6 - Inverness Box Office 637-3377 "Bewitched" (PG-13) Noon, 2:25, 4:55, 7:25, 9:55 p.m. "War of the Worlds" (PG-13) 12:45,3:45,7:15,10:05 p.m. "Herbie: Fully Loaded" (G) 12:10, 2:30, 4:50, 7:30, 10:10 p.m. "Batman Begins" (PG-13) 12:30, 3:40, 7, 10 p.m. "Mr. and Mrs. Smith" (PG- 13) 12:40, 3:50, 7:05, 9:50 p.m. "Madagascar" (PG) 12:15, 2:35, 5, 7:10, 9:15 p.m. Crystal River, Mall 9; 564-6864 "War of the Worlds" (PG- 13) 12:15, 12:45,4,4:30,7, 7:30, 9:45,10:15 p.m. "Bewitched" (PG-13) Noon, 2:20, 4:50, 7:40, 10 p.m. "Herbie: Fully Loaded" (G) 12:05, 2:25, 4:45, 7:10, 9:35 p.m. Digital. "The Perfect Man" (PG) 6:50, 9:50 p.m. "Batman Begins" (PG-13) 12:30, 4:15, 7:20, 10:25 p.m.. "Adventures of Shark Boy: (PG) 12:10, 2:20, 4:30 p.m., "Mr. and Mrs. Smith" (PG- 13) 12:20, 4:25,7:20,10:05 p.m. "The Longest Yard" (PG-13) 12:25,4:35,7:50,10:25 p.m. "Star Wars: Episode IIl" (PG-13) 12:40, 4:05, 7:05, 10:10 p.m. "Fat Albert" (PG) 10:06 a.m. "Babe: Pig in the City" (G) 10:06 a.m. p. 4. "w- 0ot 4 om- m a - 40M -- "M40-004D- *M D t 0 mo-ft -W a a. -lo a b- - o- in a M.- a 40M o w a a ---q- -m 4- a . * 4 m i - qml a am a qm_-W-mp ou-om . a- 411m swa - a a Times subject to change; call ahead. 4mmmt orp0 qb46M 0* ow -soft 00 40 b 400 4v- o.a -a- mmmftawM indb dim 0ot q 40 -a ao-a - dol ml -ON -O MM w 41 4 am~ftm .0-am m- 4m 4w- 40-W 00 a a4w D 40 d- --mo. awom in inea am olm qw --.. _-m- ____w qm- _____ a sob a a iopn qwl -wm m- q a mD m a - 7 4blom - b '. n 0, K' Ii. 40a L r.I CITRUS COUNM(FL) CHRONICLE 6C WEDNESDAY. JuNrrE 29,20 COMICS - .m 4@W "I-- dm 0 4" -n UP Alm _ ___--t~, , q.r 6 Lines for 10 Days! 2 items totaling 1 -'150...................5 $151 -$400............. 050 401 -800.......... 15... $801 $1,500..........20 Restrictions apply. Offer applies to private parties only. All ads require prepayment. CAards VISA Be sure to check your advertisement the | first day it appears. We cannot be responsible for more ,than one incorrect insertion. Adjustments are made only ' for the portion of the ad that is in error. Advertisements may be canceled as soon as results aid obtained. You will be billed only for the dotes the ad actually appears in the paper, except for specials. Deadlines for cancellations are the same as the deadlines for placing ads. .. .. SPECIALNOTICESPA N D A ANI 109 SRC6A NIML*AAI 40 1401bs, any race, Write to or visit 316 NE 2nd, Lot 12, Crystal River 34429 Honest, SWM, 5'10, 170 lbs, brown hair & eyes, Smoker, that has It all except a slim SWF 49-62 yrs young to share It with. 613-5825 LETS SMELL THE ROSES TOGETHER! Seeking attractive Lady 40-55 who enjoys dining out & weekend trips out of town. Looking to together & wants the nicer things In life. Hills, by himself, looking for soul mate, 35-47, female New in the state. Er.J,:., ...aiS r.g on the beach, movies, travel,, etc. Call (352) 746-1659 ; FFree ** FREE SERVICE** Cars/Trucks/Metal Removed FREE. No fitle OK 352-476-4392 Andy Tax Deductible Receipt *WANTED* Dead or Alive. Vehicle Removal No title okay. (352) 563-6626 or 697-0267 Akita, 1 /2 yr. old, male, neutered, free to good home, w/ fenced yard. (352) 344-9768, 212-6679 COMMUNITY SERVICE The Path Shelter Is available for people who need to serve their community service. (352) 527-6500 or (352) 794-0001 Leave Message FREE SIse by Side Frlde, needs door hinge. (352)341-1456 FREE 2 YR OLD BOXER MIX male, neutered, great with kids. To good home, (352) 560-7124 FREE ADORABLE KITTENS 7 wks old and mother.. to good home (352) 795-6350 FREE DOMESTICATED and loving white bunny, 8 months, almost housebroken, (352) 563-4169 FREE FIREWOOD (352) 628-7226 FREE GROUP COUNSELING Depression/ Anxiety (352) 637-3196 or 628-3831 FREE KITTENS (352) 726-7837 FREE LOVE BIRD (352) 563-1646 FREE LOVEABLE KITTENS TO GOOD HOME, 7-wks old, (352) 726-4534 FREE REMOVAL OF Mowers, motorcycles, Cars. ATV's, 628-2084 KITTENS PURRFECT PETS spayed, neutered, ready for permanent loving homes. Available at Elleen's Foster Care (352) 341-4125 THE HOME STORE a Habitat for Humanity of Citrus County Outreach, is seeking Donations of use- abe building materials, home remodeling and decorating items, furniture, and Appliances. No clothing please. Volunteers are needed hIthe Home Store. Store hours are: 9am-5pm Mon-Sat, Call The Home Store 3685 Forest Drive Inverness (352)341-1800 for further Information. Lau MIX, O lmos, UI. DIK,. & White, needs fenced yard. Not good w/sm. children. (352) 489-6572 evenings. PUPPIES FREE to Good Home, approx. 12 wks. old, lsm. female, 1 med. male. Call for info 1 352-287-9094 RARE CHIPPEWA HUSKY free to good home, Very Large dog. (352) 527-1118 Sweet & Playful this DHS Blk. Tiger Stripe, Is 8 mo. old, spayed, all shots. Free to good home. (352) 212-1312, after 6:30p TO GOOD HOME Catahoula Cur (Leopard Dog), male, 3 mos old. Needs room to romp and run. 726-7355 rescuedoetcomIh 249-1029/aids, dogs are tested for heartworm and all shots are current -e 0 TOMATOES! 0 MARTINS' U PICK Hwy 44 E to CR 475 N Oxford (Closed Sundays) ficf\ sfi r Anqn- BOYS DOG -Grayish white Australian Shep, w/blk. markings, 1 blue eye, Lost Sat. vic. SR 486 & Pine Ridge. REWARD (352) 634-5395 LOST Cat,. Long Hair, Siamese. Last seen In Cardinal & S. Ridge Pt. (352) 628-5312 SOLDIER'S DOG MISSING Citrus Springs area. 8 yrs old, male, black & brown mixed breed. Answers to "Patton" $500 Reward (352) 489-6306 2 LG. DOGS, mixed, electronic fence box on collars. Found 6/25 Crystal River. (352) 220-6064 FOUND MAN'S WATCH In Homosassa Call to Identify (352) 628-2119 Found Ring, in Big lots parking lot call to Identify. (352) 344-8933 :-C= Annonceent ALAN NUSSO BROKER Associate Real Estate Sales Exit Realty Leaders (352) 422-6956 *CHRONICLE* INV. OFFICE 106 W. MAIN ST. Courthouse Sq. next to Angelo's Pizzeria Mon-Fri 8:30a-5p Closed for Lunch 2pm-3pm CITRUS UNITED BASKET SUMMER BLOWOUT BAG SALE JUNE 29 9am-2pm 103 Mill Ave. Inverness (352) 344-2242 REAL ESTATE CAREER Sales Lic. Class $249. Now enrolling 8/2/05 CITRUS REAL ESTATE SCHOOL, INC. (352)795-0060. BILLING CLERK Must be detail oriented and able to multi-task computer skills In Invdicing and spreadsheets required. Full time position w/benefits. Please fax resume to 352-795-0134 CHIROPRACTIC OFFICE FRONT DESK Must be energetic, aggressively friendly '& very organized. Full time with benefits. Email Resume: nbccl@ earthlink.net CLERICAL POSITION For busy company, good customer service & phone skills a must. Computer skills needed Apply in person Nature Coast Title 659 NE Hwy 19 Crystal River NO PHONE CALLS F/T Administrative Assistant High Energy Admin. Asst. needed for fast paced design firm. Ideal candidate possesses good computer skills Is OUTGOING and a quick learner. Must be able to answer good customer service and multi task. Fax Resume To: 352-564-4110 JOBS GALORE!!! EMPLOYMENT.NET P/T & F/T DATA PROCESSING CLERK Keypunch or other numeric experience preferred. Will consider training you If you can use a 10-key adding machine by touch. Must understand debits & credits, be detail oriented & good w/ figures. May, assist w/ statement rendering. Will work HAIR STYLIST FT/PT $400 Sign on Bonus Call Lisa: 637-7244 $500 Sign-On Bonus CNAs FULLTIME 11-7 Benefits Include: Shift Differential Experience Pay Vacation Sick Pay Holiday Pay 1 Personal Day Heath/Dental Ins. 401K Paid Life Ins. Apply In Person Crystal River Health & Rehab. 136 N.E. 12th Ave. Crystal River 795-5044 EOE DFWP A+ Healthcare Home Health Agency PRNM LPN's & RN's for PEDIATRICS PRN C.N.A.'S/HHA'S INVERNESS *CNA/HHA'S Immediate Work All areas of Citrus Co. Competitive Rates (352) 564-2700 CARING INDIVIDUAL Male & female. MIn. 2 years Exp. working with developmentally disabled. Reliable transportation. Sumter & Citrus Co. area. FT/PT, days, evenings & weekends Call MOVING MOUNTAINS (352) 637-9001 CHIROPRACTIC ASSISTANT Exp. In collections, billing, front desk & , physical therapy. PT, 312 days/wk. Fax a complete resume to 352-795-0803 CORRECTIONS - JUVENILE Cypress Creek Juvenile Offender Correctional Center, a residential program for 96 high and maximum risk males committed to the Dept. of Juvenile Justice Is recruiting for Juvenile Corrections Officer. Supervise and malrtain custody of male offenders In a secure and con- trolled atmosphere. Must be 21, have a satisfactory back- ground screening and complete required talking In accordance with DJJ rules and regulations. Apply In person at: Cypress Creek 2855 W. Woodland Ridge Dr. Lecanto, FL DENTAL OFFICE STERILE. TECH P/T MON. WED. FRI. AM Will Train. Apply 259 E. Highland Blvd. Inv. ----m q SFOR DIRECTIONS TO A NEW AND D CHALLENGING CAREER AS A CERTIFIED Apply in Person: (No phone calls please) Crystal River Health & Rehab 136 N.E. 12th Ave. Crystal River, FL Receive paid training, great benefits, excellent work environment and compettitive pay NORTHPORT HEALTH SERVICES ll-l--J FULL TIME CNA's 3-11 & 11-7 PT LPN's 7-3 & 3-11 For ALF. Slgn on Bonus Paid by experience, Benefits after 60 days Vacation After 90 Days. Apply In Person: Brentwood Retirement Community Commons Build. 1900 W. Alpha Ct. Lecanto 352-746-6611 DFWP/EOE Your World CHEONICSLE ww,.chr rink1eon[rne c'm EARN AS YOU LEARN CNA Test Prep/CPR Continuing Education 341-2311/Cell 422-3656 EXPERIENCED I DIETARY COOK I I Apply in person to: I Crystal River Health & Rehab 36 N.E. 12thAve. Crystal River EOE LPN's CNAs JOIN THE TEAM We are expanding our services. Now accepting applications for 3-11 and 11-7 shift. Fjll Time and Part Time. We offer: New Wage Scale *Medlcal/Dental Insurance *Tuition Reimbursement Bonuses *Baylor *Shift Differential *Pay for Experience Apply In person Arbor Trail Rehab 611 Turner Camp Rd Inverness EOE MEDICAL ASSISTANT For family practice office. Call (352) 341-1050 or Fax resume. to (352) 341-1744 PHYSICAL THERAPY ASSISTANT Busy Chiropractic office seeks energetic, self motivated people person. Fax Resume & Salary Requirements to (352) 637-5947 REHAB THERAPY MANAGER WANTED Ortho, practice seeks FT manager for PT and OT. Fax resume to 352-563-2135. RN Needed for elementary school In Sumter County. Contracted Services position. Leave message at (352) 793-2315 ext. 203 RN/LPN7-3 S Apply at: SCypress Cove Care SCenter, 700 SE 8th SAve. Crystal River (352) 795-8832 L -m -a inm J i RN'S/LPN'S ALL SHIFTS Apply In person to Surrey Place 2730 W Marc Knighton Ct. Lecanto LIC INSURANCE AGENT Wanted, exp. agent, w/ 220/218 licences, Salary + commission & benefits package Mike Bays State Farm Insurance PART-TIME association. Responsibilities Include A/R, A/P, payroll, Including quarterly and annual general ledger through financial statements. Minimum working environment, Please send resume to Property Manager at 5690 W. Pine Ridge Blvd., Beverly Hills, FL or fax to (352) 746-0875 REAL ESTATE CAREER Now enrolling 8/2/05 CITRUS REAL ESTATE SCHOOL, INC (352)795-0060 ALL POSITIONS Aoplv In Person HOMOSASSA RIVERSIDE RESORT 5297 S. Cherokee Way, Homosassa ASSIST TO OWNER Must have cooking, bartending and ordering skills. FULL TIME COOK (352) 447-5572 or 447-4470, Inglis *Banquet Cook *Line Cook *Bartenders EXPERIENCED ONLY Apply to Food and Beverage Director at the Park Inn, 628-4311 EXP. COOKS Wanted. Homosassa area. (352) 628-1161 EXP'D LINE COOKS SERVERS, DISHWASHERS & BARTENDERS Must be 18 Crystal River Ale House 1610 SE Paradise Cir. HUNGRY HOWIE'S PIZZA & SUBS Now Hiring for our newest locatic in Dunnellon. F/T, P/T inside store, Delivery Drivers Please apply at Hungry Howies 3601 N. Lecanto Hwy Beverly Hills Taking applications daily. Opening In mid-July. LOCAL PKG. & DELIVERY DRIVERS person before 10am, M- Fat 211 N. Pine Ave., Inverness, FL HIRING FRIENDLY SERVERS Frankle's Grill (352) 344-4545 P/T COOK Wanted, will train. (352) 527-2600 RELIABLE EXP. SERVERS Good Attitude a must. We offer top pay, benefits, Full or part time Apply in person Citrus Hills Golf & Country Club. ,505 E Hartford Street Citrus Hills (352) 746-6855 TOP PAY FOR TOP EMPLOYEES Servers, Line Cooks & Bartenders. exp. only. Apply at TG Berry's Crystal River MalliopNidE 1624 N Meadowcrest Blvd. Crystal River, FL 34429 Qualified applications must undergo drug screening, EOE $$$ SELL AVON $$$ FREE gift. Earn up to 50% Your own hrs, be your own boss. Call Jackie I/S/R 1-866-405-AVON Enjoy Working with People? Immediate Opening for PART-TIME SALES- REPRESENTATIVE WITH established territory . with great potential for growth. Base salary plus commission. Please FAX resume to: (352)854-9277 or e-mail to tjenkins@ chronicleonline.com REAL ESTATE CAREER Sales Lic. Class $249. Now enrolling 8/2/05 CITRUS REAL ESTATE SCHOOL, INC. _ (352)795-0060. Van Wants YOU!! Nature Coast 352-795-0021 $$$$$$$$$$$$$$$ LCT WANTS YOU!! $$$$$$$$$$$$$$$$$ Immediate processing for OTR drivers, solos or teams, CDLA/Haz. required Great benefits 99-04 equipment Call Now 800-362-0159 24 hours ALUMINUM HELPER $8/hr 352-400-1085 ALUMINUM INSTALLER Looking for experienced but willing to train motivated person. Construction experience helpful Driver's License A Must CMD INDUSTRIES 352-795-0089 ALUMINUM INSTALLER Must.have Florida driver's license, hourly or piece rate. Exp. preferred, but will train. Framing exp. helpful. Apply today & start tomorrow. 352-726-6547 Apartment Maintenance PT Resume or apply: Inglls Villas 33 Tronou Dr. Inglis F34449 Ph: 352-447-0106 Fax: 352-447-1410 ..- -..----- AUTO MECHANIC For busy shop, Exp. Req. must own tools. Apply In person. 1621 N. Lecanto'Hwy Lecanto AUTO TECH ASE preferred. Drivers LUc. a must. Tools required. Salary nego. w/Exp. Nice, well equip. shop. 352-341-4040 AUTOMOTIVE TECHNICIAN Busy shop, competi- tive pay. Call Brian (352)726-1828 or Lee (352) 563-5130 BONDED SEPTIC TANK, INC. *SEPTIC TANK INSTALLER/OPERATOR *PUMP TRUCK DRIVER/OPERATOR *YARD WORKER/HELPER Drug Free Workplace (352) 726-0974 Mon-Fri. 8am-4pm CABINET SHOP .Sander Needed 352-795-5313 CARPENTERS Looking for lead man, to run a framing crew. Vehicle & benefits Incl. (352) 634-0432 CERTIFIED OR HIGHLY EXP'D SPRAY TECH Apply in Person at: 920 E Ray Street Hernando Or call 344-2400 *CLASS B DRIVERS NEEDED ROOF LOADING EXPERIENCE, PHYSICAL LABOR INCLUDED Excellent Pay And Benefits. Bradco Supply 1-800-829-7663 DFWP DRIVER NEEDED OTR driver needed for. local company to work the tri-state area. Must - have clean Class A Lic. & flatbed exp. Please call Craig, 352-302-9586 DRIVERS Class A, B or D. Dicks Moving (352) 621-1220 ELECTRICIAN APPRENTICE Immediate openings Will train If necessary Gaudette Electric lhc. Apply In person or on-line www,Gaudette Electric.com Or call 352-628-3064 ELECTRICIANS Will Pay Top Dollar for Dependable Electricians. Insurance, 401KY Holiday Pay. Ocala/VIllages Work (352) 748-4868 I I I r- WFDNEsDAY, JUNE 29, 2005 7C CrrRLus CouNTY (FL) CHRONICLE C I VIANON ii .e S". 104.ManS.,IvrnsFL345 0 164 N MedowrestBlv., rysal Rver FL Als vie yo r a onine t w w~c roncleo l~ie~c m m 34429 M n .L- F i._ __-_ __m n Fri. _ _ _ _-__ _m CLASSIFIED CITRUS COUNTY (F) CHRONICLE CLASSIFIED 8C WEDNESDAY,JUNE 29, 2005 Trade B E^ Trades ELECTRICIANS NEEDED (352) 341-2004 EXP. DUCT HELPER Willing to trainHelper vacations. Call 795-3042 for further info. F&H Contractors EXP. FRAMER WANTED Top pay and benefits, The Villages Area. (352) 307-9671 or 352-516-6563 EXP. FRAMERS/ CARPENTERS With tools and trans- portation. Local work, 352-302-3927 EXP'D PAINTER 5 years minimum. Must have own tools & transportation: (352) 302-6397 EXPERIENCED DUMP TRUCK & TRACTOR TRAILER DRIVERS Class A or B License (352) 795-7170 NEED HELP Call AA Hotline 352-621-0599 or www. ncintergroup.com 352-697-1421 V/MC/D r AFFORDABLE, I DEPENDABLE I | HAULING CLEANUP. I Trash, Trees, Brush I Appl. Furn, Const, I SDebris &Garages 352-697-1126 Prep-Inc. Mr Bill's Landscaping No Job Too Big or Small. Tree Work and Land- scaping.l" (352) 476-9730 Uc#000783-0257763 & Ins. Exp'd friendly serve, Lowest rates Free .,,in.,. 352-860-1452 ESL/LANGUAGE ARTS TUTORING Call Jeslca (352) 634-4115 AFFORDABLE PC REPAIR PC repair/upgrade and TRAINING. senior discounts. Try the rest then the best. Web pages built 4 less Call Trent @ 352-382-7989. AN EXP. FRAMER & LABORERS NEEDED (352) 637-3496 FLOOR CARE/ CUSTODIAN P/TA Shift Varies, 23/hrs per week Experience required. Multi function job. Energetic, organized & caring Individual w/ good customer service skills. Apply at: Barrington Place 2341 W. Norvell Bryant Lecanto, Fl FRAMERS & LABORERS Wanted. Must have own transportation. (352) 527-2600 V'Chris Satchell Painting & Wallcovering.AII work 2 full coats.25 yrs. Exp. Exc. Ref. Lic#001721/ Ins. (352) 795-6533 AFFORDABLE PAINTING WALLPAPERING & FAUX Lic, 17210214277 & Ins. (352) 697-1564ike Anderson Painting Int/Ext Painting & Stain- ing, Pressure Washing also. Call a profession- al, Mike (352) 628-7277 PAINTING & PRESSURE WASHING Int/ Ext. 20 yrs. exp. Free est. (352) 621-1206 or 697-3116 ROYAL PAINTING & POWER WASHING. Cleaning & odd Jobs Ref avail, 352-527-0322 Affordable Boat Maint. & Repair,) WILL CARE FOR YOUR LOVED ONES In Mv Dunnellon VChris Satchell Painting & Wallcovering.All work 2 full coats.25 yrs. Exp. Exc. Ref. Lic#001721/ Ins. (352) 795-6533 AFFORDABLE PAINTING WALLPAPERING & FAUX Uc. 17210214277 & Ins. (352) 697-1564 CLEANING. Reliable, affordable, Weekly, bi-weekly, monthly Joy, 352-266-8653 cell HOMES & WINDOWS Serving Citrus County over 16 years. Kathy (352) 465-7334 PENNY'S Home & Office Cleaning Service Ref. avail., Ins., Uc. & bonded (352) 726-6265 FRAMERS/SUBS NEEDED SPiece rate. Call 352-341-5673 or cell 407-709-2122 FRAMING CARPENTERS & HELPERS NEEDED Transportation Req. (352) 422-5518 GUTTER INSTALLERS MUST HAVE CLEAN DRIVER'S LICENSE. Willing to Traini Call:(352) 563-2977 INSTALLERS Ceramic, Carpet, Wood & Vinyl Top Quality, Top Dollar, Call: 877-577-1277optlon 5 INSULATION INSTALLER Experience preferred, will tralnl ust be ambitious. Class D Florida driver's license required. Benefits., Call Crystal River Office at: (352) 795-2559 efr edwl tan us b abiios Window Washing Home or Business (352) 795-6659 Additions/ REMODELING New construction Bathrooms/Kitchens Uc. & Ins. CBC 058484 (352) 344-1620 ROGERS Construction Additions, remodels, new homes. 637-4373 CRC1326872 TMark Construction Co. Additions, remodels & decks, Uc. CRC1327335 FL RESCREEN I, Llc. Ins. (352) 795-3026 AUGIE'S PRESSURE Cleaning Qualitfy. Lic, #2251 422-4308/344-1466 AAA HOME REPAIRS Maint & repair prob- lems Swimming Pool Rescreen99990000162 352-746-7395 r AFFORDABLE, I DEPENDABLE I HAULING CLEANUP. Trash, Trees, Brush, I Appl. Furn, Const. I Debris & Garages | 352-697-1126 fc--- --""- J If DONE! Movlng.Cleanouts & Handyman Service Uc. 9990000665 (352) 302-2902 EXP. FRAMERS ONLY (352) 726-2041 Bam-4pm Manufacturerof A/C grilles, registers and diffusers has Immediate openings. *Production Workers for day and night shift available. Entry Level Mia Welders for day and night shift Apply in person to Metal Industries, 400 W. Walker Ave., Bushnell, FI 33513 or call Rhonda Black at 352-793-8610 for more details. Excellent benefits package, 401k with company contributions. DFW, EOE Get My HusbandOut Of The Housel Custom woodwork, furniture repairs/refinish, home repairs, etc. Lic. 9999 0001078 (352) 527-6914 Home Repairs & Maint. Quality Workmanship Lic99990001061 (352) 621-3840 NATURE COAST HOME REPAIR & MAINT. INC. Offering a full range of servlces.Lic.0257615/ins. (352) 628-4282 Visa/MC PAUL/Moblle & decks, Lic. CRC1327335 Citrus Co (352)302-3357 X/CHEAP HANDYMAN CLEAN UP/HAULING "FREE" SCRAP REMV 344-1902 AC 23082 JT'S TELEPHONE SERVICE Jack & Wire Installation & repair. Free esti- mates: CALL 527-1984 GENERATOR INSTALLATIONS CITRUS ELECTRIC INC. ER13013233 (352) 527-7414 I WILL REPLACE YOUR LIGHT OR/AN with a fan with light starting at $59.95 Lic#0256991 (352) 422-5000 # #l A-A-A QUICK PICK UPS & hauling, Garage clean-outs, tree work. Reasonable. 302-4130 r AFFORDABLE, I DEPENDABLE I I HAULING CLEANUP. STrash, Trees, Brush, I Appl. Furn, Const, I I Debris &Garages L 352-697-1126 All of Citrus Hauling/ Moving items delivered, clean ups.Everything from A to Z 628-6790 GOT STUFF? You Call We Haul CONSIDER n DONE Moving.Cleanouts. & Handyman Service Lic. 99990000665 (352) MAINTENANCE WORKER Wlld BEACH FENCE Free est., Lic. #0258336 (352).628-1190 813-763-3856 Cell DALLAS McCRADY Free Estimates. All Types 20 yrs exp. AC#27453 (352) 795-7095 GO OWENS FENCING All types of Fencing, Comm./Residentlal, Free Est. 628-4002 JAMES LYNCH FENCE All kinds of fences. Free estimates. (352) 527-3431 Stack Underground Sprinklers: Installation & Service, Honest, Reliable, Uc & Insured. Low Pricest CL#2654 (352) 249-3165 * John Gordon Roofing Reas. Rates. Free est. Proud to Serve You. ccc 7325492. 628-3516 Lics.Ins. (352) 527-9247 RIP RAP SEAWALLS & CONCRETE WORK Llc#2699 & Insured, (352)795-7085/302-0206 ROB'S MASONRY & CONCRETE tear out Drive & replace, Slab, Lic.1476 726-6554 F-S Additions/ REMODELING New construction Bathrooms/Kitchens SLic. & Ins. CBC 058484 (352) 344-1620 DUKE & DUKE, INC. Remodeling additions Lic. # CGC058923 Insured. 341-2675 TMark Construction Co. Additions, remodels & decks, Lic. CRC1327335 Citrus Co (352)302-3357 AM SIDING INC. Soffit, Fascia, & Siding, Home Improvement. 352-489-0798, 425-8184 CERAMIC TILE INSTALLER Bathroom remodeling, handicap bathrooms. Lic/Ins. #2441 634-1584 PLASTERERS PERMENTANT Positions or Weekends $16/hr. (352) 302-1240 PLASTERERS & LABORERS Local work, benefits, vacation pay, must have transportation. (352) 302-0894 B & F STUCCO After 5pm. Iv. msg. PROFESSIONAL DRIVERS WANTED Will train. Must have clean CDL w/ 2 years driving exp. Good attitude, hard working & dependable need only apply. 24/6 shift. Good Pay. Long Hours. Call 352-489-3100 PROFESSIONAL PAINTERS Needed. (352) 634-2407 ROOFERS Commercial & Sheet Metal. Exp. equals Top Pay. 1-877-596-1150 (352) 225-1407 ROOFERS Experienced. Must have own tools & transport. Drug free work place. Call (352) 637-3677 BUSHHOGGING, Rock, dirt, trash, trees, lawn service, &driveways. Call (352) 628-4743. D&C TRUCK & TRACTOR SERVICE, INC. Landcl aring, Hauling S8 Grding. Fill Dirt, Rock, Top Soil & Mulch. Lic, Ins.(352)302-7096 FILL DIRT, ROCK, TOP SOIL. Small (6-yard) loads. Landclearing Call 352-302-6015 FILL, ROCK, CLAY, ETC. All typoes. L. insured. (352) 795-9956 All Tractor Works, By the hour or day lx Clean Ups, Lot & Tree Clear- ing, Fill Dirt, Bush Hog, Driveways 302-6955 Excavation & Site Dev BJL Enterprises Lic. #CGC062186 (352) 634-4650 HAMM'S BUSHHOG SERVICE. Pasture Mowing, lots, acreage. (352) 220-8531 VanDykes Backhoe Service. Landclearlng, Pond Digging & Ditching (352) 344-4288 or (352) 302-7234 cell CALL CODY ALLEN for complete lawntree & hauling services (352) 613-4924 Lic/Ins D's Landscape & Expert Tree Svce Personalized design, Cleanups & Bobcat work, Fill/rock & Sod: 352-563-0272 Mr Bill's Landscaping No Job Too Big or Small, Tree Work and Land- scaplng. 352-220-4393 A DEAD LAWN? BROWN SPOTS? We specialize In replugging your yard. Lic/ins. (352) 527-9247 Affordable Lawn Care $10 and Up. Professional & Reliable Call 352-563-9824 Bill's Landscaping & Complete Lawn Service Mulch, Plants, Shrubs, Sod, Clean Ups, Trees Free est. (352) 628-4258 CALL CODY ALLEN for complete lawn,tree & hauling services (352) 613-4924 Lic/Ins DETAIL YARD CLEAN John Hall Lawn Maint. Free est. Lic, & Ins. (352) 344-2429 DOUBLE J STUMP GRINDING, Mowing, Hauling,Cleanup, Mulch, Dirt. 302-8852 .p. Trades c.n /Skills LAWN CARE WORKERS NEEDED Also Termite & PC Tech/ Sales. (352) 726-392IJ EXPANDING BUSINESS Need new customers Citrus Hills, Pine Ridge, SMW. (352) 527-2701. MOWING & PRESSURE WASHING Drives, Sidewalks, Patio, Very reasonable rates. 352-257-5658 MARK'S LAWN CARE Complete Full Service, Hedge Trimming (352) 794-4112 MIKE CORNWELL Lawn & Garden Service Cuts $10 & up. LIc. & ns. & Ins.(352) 637-1904 COUNT"' _-- ALAN NUSSO BROKER Associate Real Estate Sales Exit Realty Leaders (352) 422-6956 RAINDANCER Seamless Gutters, Soffit Fascia, Siding, Free Est, Lic. & Ins. 352-860-0714 DIRTY ROOF? Low Pressure Chemical Roof Cleaning. Call For Est. (352) 212-0876 r- EXP'D MASON & MASON TENDER 746-9807-mall [email protected] *STUCCO CREW LEADER *PLASTERERS *LABORERS *LATHERS *STONE MASONS Wages negotiable. Call for immediate employment 746-5951 WANTED SOLID SURFACE COUNTER TOP FABRICATORS 18 yrs or older. Heavy lifting. Must be reliable. Apply In person DCI Countertops, Shamrock Ind. Park 6843 N. Citrus Ave. (Rt 495) ' Crystal River, FL WANTED: 1,000 SIGN ON BONUS FOR *A/C LEAD INSTALLER Your tools, clean license. Well estab- lished local company. Year round work. Great pay. Co. vehicle. Call for details & appt. (352) 860-2522 LIc. & Heavy Lifting Required Gardners Concrete 8030 Homosassa Tri. Exp. Service Tech SWIMMING POOLS CITRUS, must have own truck, excel, pay, Call Jeff 727-599-6155 EXPERIENCED EQUIPMENT OPERATORS Needed for large Construction Company with lots of work. 401K health & vacation, Call 352-797-3537 EOE/DFWP F/T SEWING MACHINE OPERATORS *P/T SALES Call for Appt. Mon - Fri 9am -5pm (352) 628-5980 FLEXIBLE P/T CLERK Apply in person, Coastal Station, 1017 SE Hwy. 19 Crystal River Your World i 9- riaenln Ciuis ,ed we cnronicieorin, com C.-LGenea FRAMERS Local-Steady 352-302-3362 WRECKER DRIVER Experienced ONLY need respond. Benefits offered. Apply in person at: Scally's Lube & Go, 12059 N Florida Ave. (next to Front Porch Restaurant), Dunnellon. 860-0550 or 489-6823 $7.75 AFTER 90 DAYS. LADSAP 920 E.Ra S. .erand KEY TRAINING CENTER lop-low L '.ZA HELP OTHERS BECOME INDEPENDENT BY USING YOUR LIFE EXPERIENCES. WORKWITH DEVELOPMENTALLY DISABLED ADULTS. BACKGROUND CHECKS AND EMPLOYMENT HEALTH PHYSICAL WILL BE REQUIRED FOR POST-JOB OFFER EMPLOYEES RESIDENT MANAGER ASSISTANT: FIT & PkT position in a group home setting in the Inverness area. Responsible for assisting , Developmentally Disabled adults with daily living skills. 'HS DiplomaIGED required, TRANSITIONAL LIVING COACH: PXT position. Experience preferred. Work with Developmentally Disabled adults with living skills in an apartment setting. HS DiplomalGED required. (FkT) M-F 12:00 noon - 8:00pm, some weekends, flexibility with schedule required. SUBSTITUTE INSTRUCTOR ASSISTANT; PIT on call position working in a classroom or workshop setting assisting Developmentally Disabled adults with learning skills. HS DiplomaXGED required. BUS DRIVER: P/T position transporting developmentally disabled adults to Key Training Center. CDL Class B with P endorsement license with clean driving record required. THRIFT STORE CLERK: P/T position available performing a variety of retail store clerical functions including display of items, donation processing, sales and customer assistance. Lecanto and Inverness store locations. LIFEGUARD: P/T position, 10 20 hours per week, days and hours vary week to week. Lifeguard credentials required. Starts at $10.00 per hour. HS Diploma/GED required. COOK: P/T Entry level position, 24 hours per week, days vary. Experience with quantity food preparation and therapeutic diets helpful. HS Diploma/GED required. APPLY AT THE KEY TRAINING CENTER BUSINESS OFFICE HUMAN RESOURCE DEPT. AT 130 HEIGHTS AVE. INVERNESS, FL 34452 OR CALL 341-4633 ITDD: 1.800-545.1833 EXT. 3471 E -EDE' Advertise Here for less than you think.!! Call Today! 563-5966 Copyrighted Matera / SyndatedCnt. CAREER OPPORTUNITY! Laboratory Assistant/ Trainee. Potential full time with tuition reimbursement. No experience necessary. High school diploma or equivalent required Please reply to the: Citrus Co Chronicle 1624 N. Meadowcrest Blvd. Blind Box #857 Crystal River, FL 34429 I1 IT~.Y-mffa ^ m FLOOR CARE/ CUSTODIAN P/T, Shift Varies, 23/hrs per week Experience required. Multi function job. Energetic, organized & caring Individual w/ good customer service skills. Apply at: Barrington Place 2341 W. Norvell Bryant Lecanto, Fl FULL-TIME POSITIONS Are available for drug-free, 18 and up people who are up to the challenging job of roofing. No exp. needed. Apply at Boulerice Roofing 4551 W Cardinal St. Suite 4, Homosassa JOBS GALORE!!! EMPLOYMENT.NET LABORER Experienced preferred for Gas Piping. Will train right applicant. Clean Drivers License Apply in person only. 4280 N. Suncoast Blvd. Crystal River (1/2 ml N ofCR Mall) No Phone Calls LABORER Help wanted, apply at 8189 S.Florida Ave. Floral City between 8 am 3pm 32 hr, work week Mon Thurs. LOT PERSON/ DRIVER FT Male or Female' w/computer skills pre- ferred, must have clean I driving record. Pay based on qualifications Please fax resume or qualifications, 746-7736 Maintenance person All types of maintenance work, cleaning & repairs.. Must have own tools & transportation. Please call (352) 795-1101 MANAGER Retirees preferred t6 manage 55+ mobile' Park home park, cottages & marina on Lake Hernando. Duties cutting grass, renting boats & light maintln exch. for RV or mobllehome space. Cable, Utl. & cash. 1-541-535-3620 NEEDED CONCRETE WORKERS Layout/form, Placers, Finishers, Block Masons, Tenders & Laborers Competitive pay, Call 352-748-2111 NIGHT AUDITOR F/T, Apply in person COMFORT INN Crystal River, FL. I I . 'rITRUS COUNTY (FL) CHRONICLE LABORER FIRE For Concrete CASHI Pumping Needed. HELl (352) 585-2898 HE REAL ESTATE CAREER Citrus Sales Uc. Class $249. (35; Now enrolling 8/2/05 LIN CITRUS REAL ESTATE SCHOOL, INC. Ap (352)795-0060. Golf 7395 W RESIDENTIAL P PLANNER/ " ESTIMATOR DE Seeking an experi- (352 enced Individual to assist homebuyers with the selection and pricing of options. Located In the Ocala area, over ADV 100 homes construct- A ed each year. Good This n opportunity for advancement and benefit package. not I Send resume In word doc format to ads t [email protected] or Fax to 352-489-4126 b EOE, DFWP emj EL offeari ROOFERS/ SHINGLERS cau '" Exp Only. Paid resp Vacations, Benefits. emplc 352-347-8530 REAL E SHEET METAL Sales L WORKERS & Nowe CITRUS LABORERS SCF (352 Needed for growing company. No experience needed, paid vacations, benefits, paid holidays, bonuses. Plenty of overtime AB available. Apply at GO Gulf Coast .' Metal Products In Rooks Industrial 60 Ven( Park, Homosassa, Allf (352) 628-5555 800 AIN START YOUR CAREER NOW F 2 station Earn while you learn. $5,000. Inverness Dental Lab MAKE: seeks Indlv. for difficult, Selling high-stress profession. Serious Start at the bottom, 1 (88 earn your way up. Only hard-working, highly motivated Indlv. need apply. (352) 341-4919 1 S *STUCCO MON CREW LEADER Exp. R.E S PLASTERERS toborr *LABORERS purch Invest .*LATHERS Secure *STONE MASONS C Wages negotiable. 727 Call for immediate 352 employment 746-5951 TAXI DRIVERS Wanted, fill-in drivers. L Non smoking, non "LIVE Drinking. Must have Clean police record. For Upc S Call Joe 287-9207 1-80 TELEMARKETER Antiq I I A The Citrus *SA County Hwy. 4 ' Chronicle PREV PART TIME Lrg, c furn.,c J TELEMARKETER crystal NEEDED ford, c | .Jewe 15hrs "git per week, dudley 5pm-8pm. DUDLE Monday thru I 1 A(35 Friday 12% Bu Experience in 2% disc telephone L d i sales and customer Burgund service a must. 4 match Applications are cel, con being accepted 6 atthe Citrus County Chronicle 1624 N Meadowcrest Blvd I Crystal River I Apply in person Musi or fax resume and cover letter to Joe (3 564-2935 EOE Drug screening , for all final = a p p lic a nts IA + )NICiJ Hydro si Pricing. L -- J. (352)572 WE BUY HOUSES SPA, Ca$h........Fast I Never 352-637-2973 Retail $ 1homesold.com $1425., WELDERS SPJ like ne Needed for 24 Jke Communication iinitaJ Industry. Some travel. gtal Good Pay & Benefits, (94 O/T. Valid Driver's (94 Ucense required, DFWP 352-694-1416 Mon-Fri WINDOW By D TREATMENT Sta INSTALLER Other (35; r Clean, dry, able to work alone, must be ' motivated, willing to train. Valid driver's * License with some 2 WI construction type exp, 2W $9 per hr. start. (352) 895-1400- .(35- FAITH BASED MENS ADMINISTRATOR Pastoral qualities a bonus, Evenings. (352) 527-6500 CIA)NICLE 'time ---- r* ** ** WORK TENT ER & FLOOR P NEEDED & Marion Co 2) 464-3752 IE COOK Seven Rivers Country Club N. Pinebrook St. KITCHEN ELI HELP Q) 637-5555 VERTISING NOTICE: newspaper does knowlingly accept hat are not onaflde ployment Wings. Please use ition when 'onding to byment ads. STATE CAREER Ic. Class $249. rolling 8/2/05 S REAL ESTATE IOOL, INC. )795-0060.. SOLUTE LD MINE!' ding Machines or $10,995. 0-234-6982 #B02002039 OR SALE n Beauty Salon (352) 628-6262 20K A MONTH Art & Loving It. Inquiries only. 8) 661-3995 IEY WANTED , Investor seeks 'ow money to ise rehab and stment prop. d by 1st Mtg. all Martin -Ain1do-99/ arlilefudge.com omlng Auctions 0-542-3877 --- -^ '1 ue & Collect. AUCTION T. JULY 2* S. Fla. Ave. 1-S, Inverness IEW: NOON TION: 6 PM llect, antique oriental rugs, il Incl. Water- olins, stamps, I iry,.,plano's, ars & more. Web: www. sauctlon.com EY'S AUCTION ) 637-9588' 67 AU2246 I lyers Premium ;. cash/check y Velvet Settee, hlng chairs, ex- d. $2,000. (352) 628-9409 960 Stan lal BB Card. $50, 152) 344-9502 SPAS, INC. pas- wholesale 5 person, $1695. -7940/351-9935 5 PERSON, used. Warranty. $4300. Sacrifice (352) 346-1711 A/HOT TUB ew, 5 person, ets, cabinet, LED, loaded, sell. $1,495 ) 234-3394 SPA'S reamMaker ting as low s $1,195. models Aval, Q) 398-7202 NDOW A/C'S 100 each 2) 637-4567 .5p ni -nL REFRIGERATOR & STOVE, good condition, $500 or best offer. (352) 726-6856 25" RCA w/remote Exc. cond. Used 5 mos. $75. (352) 628-7934 A/C & HEAT PUMP SYSTEMS. New In box 5 & 10 year Factory Warranties at Wholesale Prices 2 Ton $827.00 3 Ton $927.00 4 Ton $1,034.00 Install kits available or professional installation also availl Free Delivery -ALSO POOL HEAT PUMPS AVAILABLE LIc.#CAC 057914 Call 746-4394 APPLIANCE CENTER Used Refrigerators, Stoves, Washers, Dryers, NEW AND USED PARTS Visa, M/C., A/E, Checks 6546 Hwy.44W, Crystal River. 352-795-8882 ESTATE BY WHIRLPOOL electric dryer, 4 cycle, 3 temps. 2-yrs old $175 abo (352) 637-4613 KENMORE STACKED washer dryer combo, white, like new, used less than 1 yr. Over $900 new Sell for $350 (352) 249-1016 KENMORE WASHER AND DRYER 2 years old. Moving and cannot take. $400 352-466-1017 RANGE w/ Self cleaning oven, GE, white w/ black glass door, exc. cond, $150. (352) 795-1127 REFRIGERATOR GE, Ice maker, glass shelf's, good cond, $75, (352) 860-1570 Refrigerator, Magic Chef, almond, Stove, Almond, Both for $150. (352) 637-3403 Upright Freezer small, works good. $60. (352) 344-2606 Vacuum, Hoover, Self- propelled, Wind Tunnel, like new, $149. Firm (352) 746-6284 WASHER & DRYER (352) 628-4321 WASHER & DRYER $125/both (352) 628-4140 Washer & Dryer 1 yr old $250 for pair (352) 503-3104 WASHER & DRYER Exc, cond. like new, $250 90 day guar. Free del.& set up 352-797-6090 WASHER & DRYER, Excellent cond. Clean $150 for both (352) 341-3000 WHIRLPOOL DISHWASHER Runs great, changeable color panel, $75 (352) 726-9151 WHIRLPOOL REFRIG. w/lcemaker, like new, $450. STOVE & Ant Auec& osecr t AUCTION *SAT. JULY 2. 4000 S.Fla. Ave. Hwy.41-S, Inverness PREVIEW: NOON AUCTION: 6 PM Lrg. collect, antique fun., oriental rugs, crystal Incl. Water- ford, coins, stamps, Jewelry, piano's, guitars & more. See Web: www. dudleysauction.com DUDLEY'S AUCTION (352) 637-9588 1667 AU2246 12% Buyers Premium 2% disc. cash/check 13" JET PLANER/MOLDER 2 sets of knives, $435 (352) 634-4500 FRAMING GUNS, saws & yard tools (352) 563-1801 Pressure Washer 2200PSI Honda Engine, Barely used. $225. (352) 220-6011 Seats. Paid $30 new will sell for $150 (352) 726-9825 PORTABLE TV with VHS, Fun TV 5.6 screen with remote control. Unit hangs on the back of front seats, adapter for video games. Paid $250 new, will sell for $100 (352) 726-9825 Stereo, Kenwood tuner/ cassette Yamaha 5 discchanger' Sony Speakers, w/stands, $125.(352) 464-0800 TV, Sony 27", Trinitron color, picture n picture, remote, manual, Exc. cond. Paid $600 Sell $100. (352) 527-3331 -U Extension Ladder 20', Werner Class 1A, Fiberglass, 300lbs cap. Uke new, $135. (352) 564-9665 LUMBER 24 Treated used, 2 x 4, 10Oft. long $36. 36 Untreated 8ft. 2 x 4's, 8ft. L $27. (352) 795-4384 COMPUTER, complete w/monitor, mouse & keyboard, Internet ready. $100. (352) 564-1564 CRYSTAL WIND Repair, upgrade, networking. On-site & pick-up services. (352) 746-9696 DIESTLER COMPUTERS Internet service, New & Used systems, parts & upgrades, Visa/ MCard 637-5469 Starl6g 17" Monitor, $85, Victor Adding Machine, $35. (352) 726-5158 GOOSNECK TRAILER hitch, 3-car hauling trdller, new tires and new tie downs, (352) 795-6911 PATIO FURNITURE Chaise Lounge, reclining chair, ottoman, all PVC construction $150 (352) 726-9503 Porch Rocking Chair, Cypress, large. Cost $318. Asking $150. (352) 726-2721 PVC PATIO FURN. Rd. Table, 5 Cush Chairs, Ottoman $399. 352-563-2500 SWING Wicker Swing $75.00. Girls bike w/ helmet $25.00, (352) 795-2825 2 4-DRAWER COMPLETE Captain's beds $75 each (352) 527-0936 2 COMPUTER DESKS $45 & $125 SOFA & CHAIR, greenish (352) 637-2032 5 PIECE BEDROOM SET Antique. Pecan wood. All hand dovetailed. $200. (352) 527-2280 2-PC. LIVING ROOM SECTIONAL blue & white striped, w/covers & pillows, coffee table, SOFA, pastel colors, $300 obo takes all Call for appt. (352) 637-4892 i "MR CITRUS COUNT" u n ALAN NUSSO BROKER Associate Real Estate Sales Exit Realty Leaders (352) 422-6956 Bedroom Set, full sz. custom made, black lacquer, mirrored back unit, dresser & 7 lights make up table $1,000. BEDS BEDS BEDS Beautiful fact closeouts. Nat. Advertised Brands 50% off Local Sale Prices.Twln BUNK BED.w/computer desk underneath $250 KITCHEN TABLE, wood 2 wood bar stools, $150 (352) 726-8596 Din. Rm Table Glass top 48 x 78", w/ bamboo Dining Room Set Solid Wood, Honey Pine, Inc. trussel table w/ 2 leaves, 6 chairs, lighted China, Server, $500. Very good Cond, (352) 795-3959 DINING ROOM TABLE, med. oak, 6 chairs, 1 yr old $350 (352) 613-0849 or 422-1026 ENTERTAINMENT CENTER 27" TV and cabinet $100.00, Bike $35,00 (352) 795-2825 Entertainment Center Light Cherry, 74H x 44W, 35" TV Inc. $800 080. (352) 422-3875 Executive Home -MOVING, Two off white Sofas w/ bulyon fringe never used, $1500/obo both.(352)302-4469 FULL BED, triple dresser, 2 night stands, $175 (352) 489-1002 Glass Top End Tables & Cocktail Table. $160. Set (352) 746-9897 INDUSTRIAL steel desk, $20, Office chair, $15. (352) 746-5988 KING SIZE BED Mattress & box spring. $100. (352) 726-6805 King Water Bed, soft side w/ tubes, excel, cond, $250. Patio Set, white table w/4 chairs/cushions & umbrella w/ base $75. (352) 795-I 321 LANE RECLINING SOFA and loveseat, light pattern, like new, $500, WALL UNIT, cream, brass & glass, $100, Pine Ridge (352) 746-1661 LARGE SECTIONAL COUCH, Includes recliner & queen sleeper, good shape, $400 (352) 344-3439 LIGHTED CHINA HUTCH, 2-pc. w/curved glass, real wood, $600 Match- ing server, w/fold down extensions, $300. 2 Matching cushioned arm chairs, $200, Mahogany high boy 7 drawer dresser, real wood $500 (352) 527-0763 CLASS: Large Sectional Sofa, w/ built In fold out tray & 2 recliners, pastel colors $750.atter 2pm or leave message (352) 637-3753 LOVELY COUNTRY cottage style sofa & loveseat. Pink & burgundy roses w/country plaid pillows, great cond. $550. 352-341-5890 LOVESEAT, SOFA, upholstered carmel color. Uke new, $300. All wood etegere, $50. (352) 746-7264 MATCHING SOFA & loveseat, off white, green floral, great cond. $500 (352) 637-4567 Moving Sale, 3 sets all wood dressers, large Items. (352) 628-9037 OAK DOUBLE DOOR rounded glass cabinet with glass shelves, 60'H, 45"W, 18" D $350 IMITATION WOOD & GLASS CABINET glass shelves, 70"H 23W 12"D $50 (352) 637-3095 OAK DRESSER, $75 Or Best offer, SECTION SOFA, multi colored Exc. cond, like new. Must see. $200 (352) 746-3542 Sectional, 2 piece, full size hidda bed (never used), beige, $200 (352) 634-4329 SELECT COMFORT MATTRESS, KlngsIze, -$150 (352) 344-1657 Sofa black, soft leather $300. (352) 795-4532 Sofa & Loveseat Blue Plaid, very good cond. $200. 2 TV Stands, 1 is dk grey, 1 blk, $20 ea exc. cond. (352) 249-1252 SOFA Beautiful, like new,. county French Style, pale yellow, $400. (352) 527-8043 SUGARMILL WOODS Moving Sale. Living room set; set of brass tables; 2 lamps, $725 obo (352) 287-1139 (352) 476-6644 TWIN BEDS, dresser & night stand, $450. (352) 344-8126 WINGBACK CHAIR Excellent condition $50. (352) 726-8567 5 HP CRAFTSMAN ChIlpir/Shredder Dark Wood Locking Gun Cabinet, $90 (352) 726-9954 FREE REMOVAL OF Mowers, motorcycles, Cars. ATV's, 628-2084 Husky Lawn Mower $65. Weed eater trimmer, runs like new KUBOTA G5200, Garden Tractor, 3 cyl. diesel, 44" cut, low hrs, runs like new, extra parts $2,500. call before 9pm (352) 726-0980 LIKE NEW EXMARK 13HP Kaw, 36" ECS controls, new bagger, never Installed, $2,500 (352) 860-1416 Riding Lawn Tractor, Craftsman, 1982 w/ 42" Deck, $200. (352) 564-4598 Riding Mower John Deere, w/ dump cart, L10, auto, 42", 44hrs, Exc, cond, $999. (352) 628-0145 Snapper Rider, 33", 14.5HP, new blade and tune up ready to run. $550. obo, Yard-man 5HP 22" gas trimmer, needs wdrk $60. (352) 697-3124 1 extra large, Staghorn Fern, $300. 1 Sm. Staghorn Fern $50. (352) 746-0743 ANGEL TRUMPETS, peach, pink & yellow one gal, pots, $10 (352) 637-2147 Braided Fichus Tree $35. (352) 489-2098 DUNNELLON Thur.,Fri. & Sat., 8-5pm Furn., appliances, power & hand tools, antiques, lots of misc. 22925 SW 117th St. FLORAL CITY Moving Sale. June 30 thru July 2. Lots of Items. Everything must go, 7225 S. Withlaoopka Dr 3 Wheel Scooter Sierra, $300; Jet III Pride, $1500, (352) 628-4569 INDOOR OUTDOOR PACESAVER RF Scout power wheelchair with charger & cover $1,500 obo (352) 527-0763 LIFT RECLINER CHAIR Brown. Excellent condition, $500 (352) 527-3276 LIFT CHAIR Exc. cond. Taupe Mlcroflber Suede. $400. (352) 726-6805 Pride Legend 3 wheel scooter, $800. Burr automatic Platform Scooter lift $700. (352) 746-14 16FT GALVANIZED BOAT TRAILER, never used $400 4x8 UTILITY TRAILER, $300 (352) 726-8013 464-1631 (cell) 24' ft ROUND ABOVE ground pool. Uner is only 1 yr old. $500 - you remove. (352) 563-0466 or 697-2181. Aquariums 30 Gal., $15 50 Gal. $25 Good Cond, Not Equip. (352) 628-2613 CARPET 100's of Rolls left from carpet Inst. Many colors 352-341-2146 CARPET FACTORY Direct Restretch Clean * Repair Vinyl Tile * Wood (352) 341-0909 (352) 637-2411 Chest Freezer $275. Ab Scissor Exerciser $300. 352-476-3192 CHEST FREEZER Excellent condition $85 (352) 726-2459 CUISINART FOOD PROCESSOR, $50. Jack LaLanne juicer, $60 (352)726-1296 Doll House, wood w/ 6 rooms & accessories. Classic furn & house. $300. (352) 795-5884 Down Sizing 1850 Brass Bed, full, beautiful design weighs 2001bs., very beautiful $750. obo. Hand carved 4 panel dressing screen $250. Other antiques for Sale, Sm. Chest Freezer, like new, and more (352) 527-8499 FOR SALE: '71 Harley 1000 Sport motorcycle, $2700. '89 NIssan P/U, $500. '94 Ford P/U, $2300. '86 Trans Am, rebuilt, $8000 obo, '94 boat trailer, $400. GOT STUFF? You Cal We Haul CONSIDER IT DONE Movlng,Cleanouts, & Hangman Service (382) 302-2902 Household Items, electronics & misc. unfinished wooden chest, 2 sm. televisions, cd player, sewing ma- chlne, two lap top, chimlnea, ladles golf clubs, tire rims & refrig- erator (352) 746-6760 I WILL REPLACE YOUR LIGHT OR FAN with a fan with light starting at $59.95 Llc#0256991 (352) 422-5000 JVC 32" 2 tuner, D series, exc cond. $275 (352) 746-9348, Iv. msg. Louver bl-fold wooden door, new, $30. or cell 212-8294 MOSSBERG 12 gauge shotgun, $250 ORNATE ANTIQUE BRASS BED, $450 (352) 726-1048 MOTORCYCLE HELMET, full face, size Ig, exc. cond. $50. OFF WHITE, LEATHER NATUZZI COUCH and love seat, $300 for both ORTHOPEDIC BOOT $100 (352) 249-1010 oven GE, almond w/ blk, glass door. $150. Sm, computer table & chair $25. ea. (352) 527-9330 Sewing Machine, Singer older, Heavy Duty $125 (352) 637-6917 SOD ALL TYPES Installed and delivery avaliable.352-302-3363 Swimming Pool, Intex Easy set up, 16R x3.5 D, new w/extras $100,. (352) 628-9266 After 5pmr TANNING BED Wolff, sunquest, 16 bulb, like new, come see it working $850. obo 352-613-3004 TELESCOPE Refractor, 234power, 60mm, altazimuth, $85. Rarely used. In original box w/ tripod (352) 249-1090 Washer Whirlpool, used 2 weeks, Warr 03/06, $300 OBO.Computer, HP Pavilion 6360 HP upgrades, lots of extras $375 OBO 352 447-1582 GAZELLE CARDIO GLYDER, as on TV, $55 (352) 341-3000 NORDIC TRACK SKI MACHINE Great cardio machine $125, (352) 637-0210 Treadmill, LIfestyler, works well. $75. (352) 220-6011 Welder Universal Gym, 1000 Ibs of free weights like new, $500. (352)563-1801 '01 MURRAY off-road GO-CART. EXC. COND. $900.. 352-422-2634 American 180, 155 Round .22 Cal, Pre Ban, Mint, $600. Lulgl Franchl 12 gage $400.(352) 302-4199 Black Diamond Ranch 3 D Viewers of the Quarry Course, 3 for $20. (352) 464-2861 Bowflex w/ leg extension equipment $800. firm (352) 628-1345 COLT, AR 15, Pre Ban, .223 w/M-16 Marksman Scope, Elite model 8-mags, mint cond. $1,650. (352)302-4199 GOLF CART E-Z Go. Good condition, $1400. (352) 527-3698 GOLF CLUBS Precept C/B forged irons. 3-PW $250. Adams Tight Lies, 3-SW, $150. (352) 527-8622 Norinco, AK-47, Pre Ban, 4 mags, Mint. $425. 1-75 Round drum $100 352-302-4199 POOL TABLE New, 8 ft, 1" Italian Slate, leather pockets, Life Time Warranty. $1,295 (352) 597-3140 '95 EXPRESS Encidsed trailer, used In Fla. only. Single axle, 12'Lx5'Wx6', swing doors, $1500/obo (352) 476-1835 HOMEMADE FLATBED 7x14, heavy duty, 6 bolt pattern rims, $350, (352) 621-1241 or (727) 432-3426 VW BEETLE DIESEL 5 speed, wanted to buy. (352) 447-6281 NOTICE Pets for Sale In the State of Florida per stature 828.29 all dogs or cats offered for sale are required to be at least 8 weeks of age with a health certificate per Florida Statute. Dachshund, mini, long hair, 9 wks old, health cert., shots & papers $375 (352) 382-7796 Free to good home. Aklta, 1 V2 yr. old, male, neutered, need fenced yard. (352) 344-9768, 212-6679 Free, Two Adult Cats Inci, very mellow anl- mals, (352) 344-3589 9-5 M-F or 344-2691 weekends. Gold Crown Conure w/ new cage, 3 yrs old, $125, (352) 489-2098 HAND-FED COCKATIELS Don't bite and super affectionate. Variety of colors 45.00-60.00 (352)465-8193 Humanitarians of Florida Low Cost Spay & Neuter by Appt. Cat Neutered $15 C LSpoysd $25 Doa Neutered & Spayed start at $30 (352) 563-2370 ANTIQUE UPRIGHT EARLY 1900'S PIANO Gustafson Still stays In tune $350 obo 352-476-4908 LESSONS: Piano, Guitar, etc. Crystal River Music. 2520 N. Turkey Oak Dr. (352) 563-2234-A712 S9 weeks old, 4 Females 1 Male. 795-2590 or 476-5780 SIAMESE Seal blue lynx flame, mixes, 8 months & up $80-125, neutered shots tested microchip 352-476-6832 G---- FOR RENT 2 Stalls, 6 ac,, 4 stalls, 10 ac. Across from State Forest, (352) 628-0164 One APHA Mare, One AQHA Mare, both with fold and rebred. Will separate (352)726-4090 (352)212-2934 Reg. Qtr. Horses For Sale. Foundation 4 yr. olds + 3 yr. olds (352) 346-3478 Alpacas Males 2 aelded. 1 breeding. All for $1900 352-628-0156 BABY CHICKENS, Road Island Red's from $2 to $4 each, Laying Hens $7 each (352) 564-2829 Goat, 3/4 Bore, 1 yr old, proven stud, $100 OBO. (352) 795-7513 2 & 3 BEDROOM HOMES Pool, wonderful neigh- borhood. Reasonable. (352) 447-2759 2 Bdrm., fully furn. MH all Util. Incl. Nice clean, quiet park. short/long term, (352) 564-0201 Cr. RIV./HERNANDO Sale/Rent, Unfurn. & Furn. 2/2, No pets, lst, Ist, dep. 352-795-5410 CRYSTAL RIVER 2/1, fenced, C/H/A. Porches, $500. (352) 795-7162 CRYSTAL RIVER 3 bdrm, C-H/A. Private lot. No pets. $500 mo.+ 1st, 1st. $500 sec. 352-795-2096/422-1658 DW 2/2 new carpet, paint, No pets, no smoking $525/up, Homosassa, 628-4441 HOMOSASSA 3/2 Irg, DW, 1 blk E. of 19, 2-mi S- Home Depot 1st, last, sec, No pets. 352-637-1142 220-1341 HOMOSASSA DW, 3/2, CHA, $175/wk $700/dep. 207-651-0923 INVERNESS 2 bedroom, 2 bath $550 mo. 1st, last, $300 sec. (352), 344-9225 INVERNESS Lakefront 55+ Park. Fish- ing piers, affordable living 1 or 2 BR. Screen porches, appliances, Leeson's 352-637-4170 -U $FUNDING NOW AVAILABLE through aided program for eager hard-working families with Incomes from 19K-89K per year. Funda are limited, so hurry. Call for details, 352-490-7420 2 Bedroom MH, on Homosassa River Canal, newly remodeled, turn. Ig. fenced yd., great lo- cation no water access $89,000. 352-398-6786 $500 DOWN PAYMENT gets you Into 3,4,5 bed- room home on any land, anywhere Land/Home specialist on site everyday, Call for details 352-490-4403 1998, 2/1, $52,000 100 x 100 lot, City Water, near wal-mart & lowes, own. fin. $7,000 down, $500. mo. 2510 E. Jupiter St. Inverness (352)465-4013 (352) 220-3784 cell 2005 3BD/2BA on 1/2 ac. wooded lot. Turn-key . deal. $995,00 down and $489.00 per mo. Hurry only 1 at this pricel 352-490-7420 2005 4BD/2BA on 1 ac. cleared lot. Turn-key deal, $995.00 down and $599.00 per mo. Call for details 352-490-7420 CAN'T PROVE YOUR INCOME? Go thru our stated Income program no proof necessary. Guaranteed financing w/approved credit. Call for detallsI 352-490-7420 DOUBLEWIDE 3/ 2, 2 car attached carport, 1296 sq.ft. open floor plan, glassed In sun room, new floors throughout. $86,000 (352) 228-1163, after 5pm FIRST TIME BUYERS PROGRAM, $500. DOWN will get you Into your very own land/home pkg anywhere In state. Call for details while there's still time. 352-490-7420 LAND & HOME 1/2 acre homesite country setting. 3 bedroom, 2 bath New Home with warranty. Driveway, deck, stainless steel appliance pkg. Must see, only $518.45/mo WAC. CALL 352-621-9181 2 Bedroom MH, on Homosassa River Canal, newly remodeled, turn. Ig. fenced yd., great lo- cation no water access $89,000. 352-398-6786 2/2, 14X60 on 1+ SECLUDED ACRE. Very close to river and El DIablo Golf Course. $75,000. (352) 726-1997 or (352) 266-6785 Beautiful 3/2 on 1/2 acre In great school district, $2,000 and $650 mo. (352) 795-6085 Great Country Setting 3/2 on 2 acres In the Mini Farms. Easy to Qualify. $4,000 down and $560 mo. (352) 795-1272 INVERNESS 1/4 acre corner well, elec. septic, w/Flx-R-UP, $29,990 (352) 637-5675 Just what you've been looking for. New 4/2 on 5 acres. Zoned for agriculture. Horses Welcome. $6,000 Down $750 mo, (352) 795-8822 MOBILE ON CANAL 2/2, carport, sunroom fully turn,, sheds, bass boat & trailer, $67,900 (352) 465-3999 or 302-0297 New Land Home Packages Available. Many to Chose from. Call today for approval. Low down and low monthly payments. 1-877-578-5729 OWNER MUST SELL! New 3 bedroom, 2 bath on 1/2 acre. Great warranty, the best 352-621-011 '- SAVE $1000'S - NEW & PREOWNED Manufactured homes and Modulars. Easy qualiflying even with bankruptcy. Call 1-800-870-0233 2/2 PALM DW In 55+ OakPond Pk, Inverness Screen rm, ceiling fans, laundry rm, carport, Handicap access. Club house, pool, fishpond, $44,500. 352-344-5535 Crystal River Village 2002, 1,280 sq. ft., 3/2 w/40' carport, den, sun porch, attached workshop, all appliances $69,900 (352) 795-6495 MANUFACTURED HOME In nice park, DoublewIde, all updated amenities, 44-E, Inverness $55,000 (352) 527-4832 Park Model TOP-OF-THE-LINE FI BEVERLY HILLS PINERIDGE POOL HOME MILLION DOLLAR VIEW. DIRECTLY ACROSS FROM EQUESTRIAN CENTER. BACKS UP TO 28 MILES OF RIDING TRAILS. 2 BEDROOM, 2BATH, 2 CAR GARAGE, WOODBURNING FIRE- PLACE. RENT WHILE U BUILD. CALL TONY MOUDIS, OWNER LICENSED AGENT, NO FEE'S.. 352-212-3019. Rabble Anderson LCAM, Realtor 352-628-5600 managmentarouo. aom I- WEDNESDAY, JUNE 29, 2005 9C _-U Copyrighted Material-- iynadcated Content r- 0 O Advertise Here for less than you think!!! Call Today! 563-5966 CrrRUS COUNTY (FL) CHRONICLE ' 10C WEDNESDAY, cc-Uprmet '04 New 3/2/2 Concrete Stucco Homes 1806 sq. ft. own at $895. down and $625. mo, No credit needed 1-800-350-8532 Crystal Palms Apts 1& 2 Bdrm Easy Terms. Crystal River. 564-0882 CRYSTAL RIVER 2/1, garbage, water Incl., no pets $475 mo. + sec.(352) 228-0525 HERNANDO 1/1 $395. 1st, last & sec, 352-527-0033 or Iv. msg. INGLIS VILLAS SNewly Renovated* Affordable Rental Apartments 1, 2,& 3 bedroom, available Immediately. Rent Is based on your Incomell Located on SR40 one block East of US 19. Only 7 minutes from Crystal Riveril M W F 2PM 5PM T TH 10AM 7PM (352)447-0106 Equal Housing Opportunity INVERNESS I & 2 Bdrms $360-$500. clean quiet area. 1st, last & Sec 352-422-2393 Crystal Palms Apts 1& 2 Bdrm Easy Terms. Crystal River. 564-0882 CRYSTAL RIVER Apt w/Attached Office All util./malnt. Included $800. (352) 422-3261 -e CRYSTAL RIVER Prime Shared Office location. $250 mo. Contact Kristi (352) 634-0129 HWY 19, N Hmassa. approx 450sq.ft. 2 rm. office. $600/mo. Incl, e/ec. (352) 628-7639 CITRUS HILLS Townhouse 2/2/2, Furn. 352-746-0008 CITRUS HILLS $729/mo. 561-213-8229 CITRUS HILLS Unfurn. villa, 2/2/2, available Aug. 1 352-527-8002 CRYSTAL RIVER 3/2, $1100 mo. 1stlast, security. References (352) 257-8769 INVERNESS 2/2, Condo, long term lease, 55+, $795. 1st., Ist,, sec., plus electric, available July 1, (352) 637-5200 PRITCHARD ISLAND 2/2, waterfront condo pool, tennis, fishing $850. mo 352-237-7436 HOMOSASSA/ CRYSTAL RIVER 2/1, with W/D hookup, CHA, wtr/garbage Incl. $500mo., 1st, Last & sec. No pets. 352-465-2797 sw Daily/Weekly Monthly Efficiency $600-$1800/mo. Maintenance Services Available Assurance Property Management 352-726-0662 Beverly Hills 2/1/1 Lg Fl. rm, W&D, DW, mi- cro, furn/unfurn, secl. 302-1370 or 795-9048 CITRUS COUNTY Water front & Non- Water Front Rentals Ranging from $1000- $2200. ma. Contact Kristi (352) 634-0129 Homes from$199/mo! 4% down, 30 yrs. @5.5% 1-3 bdrm, HUDI Listings 800-749-8124 Ext F012 3 1960 SPIVEY TER, INV. 2/2/1, $650/mo. Brkr. owner (352) 220-4355 2/2/2 POOL HOME Rock Crusher area $ 950, 1st, last & security. (352) 795-4093 2 Large BR/2 BA Family Room, Newer appliances, CHA, garage. $750 2 BR/1.5 BA Eat-in kitchen, family room, newer appliances, garage, CHA. $750 Call 746-3700 Real Estate Agent AVAILABLE JULY. 1/1 Duplex, $325, Homosossa; 3/2/2, New Citrus Springs $775 2/2/1 Villa Meadow Crest, $850; 4/2/2, New, SMW, $1,400. River Links Realty 628-1616/800-488-5184 BEVERLY HILLS 1/1, den, $650/mo, 1st, last, security. Lease re- quired. 352-563-0447 BEVERLY HILLS 2/2/1 Fl. Rm. Scr. Rm 352-746-4673/464-2514 CITRUS HILLS 2/2 on 1 acre,$750 mo. (786) 553-2577 i BEVERLY HILLS 2/2/1 Looking for Roommate $375 mo.+ 1/2 until. 352-476-3720 FLORAL CITY Roommate to share home with pool, $400.+ 352-726-7774 or 422-7992 or ro.net INVERNESS Looking for roommate, nice houseLake Hen- derson, close to town, $450. mo, Incl. power & cable, non smoking 228-2658 2 Bdrm., fully furn. MH all Util, incl. Nice clean, quiet park. short/long term. (352) 564-0201 Beverly Hills 2/1/1 Lg Fl. rm, W&D, DW, mli- cro, furn/unfurn, secl, 302-1370 or 795-9048 JUNE 29, 2005 CITRUS HILLS 3/2/2 Citrus Hills $1200 3/2/2 Laurel Rdg $1300 Townhomes & Condos 2/2/1 Brentwood $900 2/2 Citrus Hills $850 Greenbrar Rentals, Inc. (352) 746-5921 CITRUS SPRINGS 2/1-Y2/1, Irg. Fla. Rm, Furn. $850 Unfurn. $800 1st, last, security. (352) 746-9436 CRYSTAL RIVER 3/1 remodeled. $700 mo. + Sec.No pets. (352) 228-0525 CRYSTAL RIVER Completely Remodeled in Quiet Country Setting! Spacious 2bdrm/2bath with Great room-style living area Is perfect for those who need room to stretch out and enjoy the peaceful surround- Ings of Sleepy Oak Courtl Each unit boasts brand new laminate flooring thru-out kitchen, dining and living areas, with new carpet in both bed- rooms, tool Laundry room w/washer/dryer hook-ups and extra storage, tool Come see the beauty of Sleepy Oak Court. Rentals starting at $795 mo. S*OPEN HOUSE- * June 25 thru 30th. Call Kim DeVane, 562-244-9114 Dunnellon 3 & 4 Bdrm. Homes on Rainbow Rvr. or Lake Rouseau. Fum. 2 bdrms. also avail, short term Ruth Bacon 9-2 Mon Fri Only (352) 489-4949 Larson Realty DUNNELLON Rainbow Lakes Estates Spacious, 4/2/2, w/ Ig. sunroom, In lovely Pines area. Treed lot, workshop. Immediate occupancy (352)527-3953 FLORAL CITY 1 Bedroom. $500 mo, 352-726-9420 HERNANDO 2/1 Open water access, Remodeled $850 mo. 1/2 acre 352-302-7428 HERNANDO 3/1, 2 story, yard, First Last Sec. $600 302-3927 HOMOSASSA 3/2/1, Fresh Paint, Inside & out, just off 19, $825/mo. 352-628-7526 954-984-1523 HOMOSASSA Lg. 2/2/2, new paint, & carpet, big lot, homes only neighborhood. $850/mo. 352-628-7526, 954-984-1523 HOMOSASSA Rock Crusher area. 2/2/2, like new cond. $750 + sec, No pets. On Hesse Ct. Call Matt, 228-0525 Meadowview 2/2/1 w/ pool $995, mo Please Call: (352) 341-3330 For more info. or visit the web at: citrusvlllages I e1Bntls0com PINE RIDGE 3/2/2 Great Home on Wooded Lot. Avail Now. Call 352-746-5614 PINE RIDGE 4/2/2, $1,000/MO. New. (561) 827-2024 SUGARMILL WOODS Home & Villa Rentals Call 1-800-SMW-1980 or AVAIL NOW CHAZ 2/2 Unfurn, Covered boat slip, Immac. $750 3/2/2, pool, Crystal River, $1375 River Links Realty 628-1616/800-488-5184 CRYSTAL RIVER 1/1 w/dock. Furn. $700 + utilities. No smoklngli 129 Paradise Pt #4 352-422-6883 INVERNESS 200FT water 3/2 on 1AC $850 mo. 1 yr, lease, 352-344-1444 586-1505 PUBLISHER'S NOTICE: All real estate advertising In this newspaper Is sub- ject to Fair Housing Act which makes it illegal to advertise "any prefer- ence, limitation or dis- crimination based on race, color, religion, sex, handicap, familial status or national origin, or an intention, to make such preference, limitation or discrimination." Familial status includes children under the age of 18 living with parents or legal cus- todians, pregnant women and people securing custody of chil- dren. ,,, C,,,OU "IMR CITRUS COUN " ALAN NUSSO BROKER Associate Real Estate Sales Exit Realty Leaders (352) 422-6956 ACROPOLIS MORTGAGE *Good Credit *Bad Credit/No Credit *Lower Rates *Purchase/ Refinance *Fast Closings Free Call 888-443-4733 SOLUTIONS FOR TODAY'S HOMEBUYER FAMILY FIRST MORTGAGE Competitive Ratesll Fast Pre-Approvals By Phone. Slow Credit Ok. Purchase/Ref. FHA, VA, and Conventional. r Down Payment Assistance. r Mobile Homes Call for Detailsl Tim or Candy (352) 563-2661 ic. Mortgage Lender EQUAL HOUS1x(G OPPORTUNITY, 6 Unit Shopping Plaza on 2.5 Acres, N. or Crystal River. Room for addition units. 5 yrs old, $450,000. (352) 527-1096 PSO ZONING Over 1900 sq. ft, bldg on .42 acres. Located on Hwy 44 across from Meadowcrest. Previously residential, large rooms, enclosed garage with a/c, fenced yard. $350,000 as Is, please call 352-257-9049 for Information. 4/2/1 Lg. Kit, DR, Fam. Rm, Liv. Rm, on oversize lot on Golf Course, Inground pool, land- scaped. New roof, $199,000. 352-465-7697 BY OWNER, 2/3/2, 2500 sq.ft, fenced yard, living rm, open kitchen w/ breakfast bar, formal dining rm, FL rm com- plete, covered patio & deck $159,900, (352) 447-5154 or (352) 362-8576. GREAT LOCATION & CHARMING Close to entrance, 2bed/1 bath, carport, new paint & carpet, florida room, privacy fenced backyard, Perfect starter or Investment home. $89,900. 352-637-2973 NEW HOME, 3/2/2. Tile baths, nice area 1528 living. $175,000 (352) 628-0100 'Your Neighborhood REALTOR' call Cindy Blxler REALTOR 352-613-6136 cbilxlerl 5@tamoa Craven Realty, Inc. 352-726-1515 4 Years New, 2160 Sq. Ft. under air, reduced to $323,900. 3 car gar. 352-746-2137 or 352-586-8342 '04 New 3/2/2 Concrete Stucco Homes 1806 sq. ft. own at $895. down and $625. mo. No credit needed 1-800-350-8532 BY OWNER 2003, 3/2/2, fenced, 1 acre. 15x30 pool 2934 W. Beamwood Dr. $309k, Open house, Sat. & Sun. 352-400-1552 c Ull u l lnu vvllllllm A Pine Ridge Resident REALTOR 352-422-0540 dwlllmsl@tampa bay.rr.com Craven Realty, Inc. 352-726-1515 Pine Ridge Estates 1 Acre N SULTANA. TER cross st. Pine Ridge & Carnation $10000. 352-746-3983 RUSS LINSTROM HAMPTON SQUARE REALTY, INC. rllnstrom@ dlgltalusa.net 800-522-1882 (352) 746-1888 Thinking of Selling Your home? Visit: v=lue.com '04 New 3/2/2 Concrete Stucco Homes 1806 sq. ft. own at $895. down & $625. mo.. Beautiful 4/3/2 Caged Pool End of quiet cul-de-sac Beautifully landscaped $239,900 (352) 746-7970. HORSE LOVERS Next to Withla, Horse trails, 15 ac, 3/2 w/fam. rm, Lg. Scrn, pool, 5 stall barn w/tack. $625,000 Will Divide (352) 628-4915 New, 3/2/2, scrn, lanal sewer, water, Crystal Glen Estates, $212,900. pre constructionprice. 800-414-5256 CITRUS REALTY GROUP 3.9% Listing Full Servlce/MLS Why Pay More??? No Hidden Fees 20+Yrs. Experience Call & compare $150+Milllon SOLD111 Please Call for Details, Listings & Home Market Analysis RON & KARNA NEITZ BROKERS/REALTORS CITRUS REALTY GROUP (352)795-0060. Cy'21, J.W. Modron, R.E., Inc 726-6668 637-4904 Citus ill FP. Homes 6 MO. OLD 3/2/2 Over 2300 sq.ft. 1 ac., lots of upgrades. Huge Master bath w/jetted tub. 897 W National St. $279,900 (352) 400-1863 A beauty that has It All 3/2/3, solar heated pool, Jetted tub, 2127 sf., bit. 1996, 1 acre, 4 sliders open to huge la- nal, gas FP, a must see, $279,000. 352-220-3897 BY OWNER, custom 3/2/3, pool, 1 acre, top quality throughout Thousands below replacement cost $450K (352) 527-2749. CONDO, Beautiful 2/2 In Country Club/Golf Community., carport, vaulted ceilings. $139,000. (561)213-8229 FREE REPORT What Repairs Should You Make Before You Sell?? Online Email debble@debble rector.com Or Over The Phone DEBBIE RECTOR Realty One homesnow.com LINDA WOLFERTZ Broker/Owner t ' HAMPTON SQUARE REALTY, INC. Ilnddw@ tampabay.rr.com 800-522-1882 (352) 746-1888 Oaks Golf Course 3/3/2 Pool Home, lots of closets & oak trees, best location. $379,000. (352) 527-7275 Terra Vista Golf Course Pool Home 3/3/2 Separate Inlaw suite. New In 2003 $395,000 352-527-9973 See Byowner.coam 3/2 POOL HOME 12x36 screen porch. Private, close to Whispering Pines Park. Lot next door Included, $135,000,(352) 726-6779 3/2/11/2, w/fireplace, scrn, porch, on 2 large lots, w/ newer appli- ances. Must see to appeclate. $139,900. (352) 637-2013 4/2.5/2 CUSTOM HOME Built 1996, 5600 Sq. Ft. on 5 wooded acres. Split plan with Pool, Spa, Fireplace and many other ameni- ties. 3 miles to down- town.By Appointment only, $409,000.00 (352) 344 0455 Leave Message. HIGHLANDS Desirable 2/2/1 spllt plan, newly renovated, new roof & AC, $119,000. 726-7181 JACKIE WATSON Steve & Joyce Johnson Realtors Johnson & Johnson Team Call us for all your real estate needs. Investors, ask about tax-deferred exchanges. ERA American Realty and Investments (352) 795-3144 Thinking of Selling Your home? Visit: valuec0m Kivtxm"vtN*uniy z years old, custom built, 3/2/2. Screened porch, beautifully landscaped. A must see @ $239,000 (352) 621-4661 Spotted Dog Real Estate (352) 628-9191. f HOME FOR SALE On Your Lot, $94,900. 3/2/1 w/ Laundry Atkinson Construction 352-637-4138 Uc.# CBC059685 SELL YOUR HOME Place a Chronicle Classified ad 6 lines, 30 days $49.50 Call 726-1441 563-5966 Non-Refundable Private Party Only ,Some Restrictorns May owpplV) Thinking of Selling Your home? Visit: yalue.pmm 2.17 ACRES 2/1 needs work. Access Lake Apopka via Orange State Canal from backyard. 10520 E. Trails End Rd. $75K (352) 302-5351 2/2/2, w/2 car carport, 1400 s.f. living. C-H/A, 1/2 acre. Asking $129,900 Open house Sun.1-4. 7646 E. Savannah Dr. (352) 637-2407 or 220-1570 cell LAKEFRONT, 4/3/4 Approx. 2600 Sq. ft. liv. area, situated on beau- tiful landscaped 1 3/4 acre lot w/ azaleas, ca- mellia's, and fruit trees. Located in floral City priced to sell at $339,000. Call for appt. (352) 344-0062 or (727)543-1989 BEAUTIFUL 2005 triple wide log cabin mobile home, tape & textured, On hill,121/2 acres. 3 Ds on land.Asking $375,000 (352)795-3012/795-3311 JUST LISTED SECLUDED & WOODED Beautiful 3/2 w/office on 1.5 acres. Pond, approx 2000 sq/ft com- pletely remodeled 2-WBF's, New appliances the works, GotOurHome.com or SELL FOR TOP DOLLAR! Deborah Infantine EXIT REALTY LEADERS (352) 302-8046 Vic McDonald (352) 637-6200 Realtor My Goal Is Satisfied Customers REALTY ONE ; Outstanding Agents ' Outstanding Results (352) 637-6200 '!ofCore ALAN NUSSO BROKER Associate Real Estate Sales Exit Realty Leaders (352) 422-6956. Custom, 3/2/2, w/ workshop, 1 acre, 2500 sq ft, central Vac, Security system, cath cell. many upgrades, Loc. across from water, $240,000 352-489-3477 FREE REPORT What Repairs Should You Make Before You Sell?? Online Emall debble@debble rector.com Or Over The Phone 352-795-2441 DEBBIE RECTOR Realty One homesnow.com CYPRESS RUN 2/2, CONDO, new carpet, fresh palnt, roof, AC 2003, encld. laoral, $130,000. to see Call Claudla 6 8pm 352-382-5474 for Info. Call Pam (954) 927-3166 WAYNE CORMIER I- 111 Here To Helpl Visit: waynecormler.com (352) 382-4500 (352) 422-0751 Gate House Realty '04 New 3/2/2 Concrete Stucco Homes 1806 sq. ft. own at $895. down and $625. mo. No credit needed 1-800-350-8532 "MR CITRUSCOUNTY' CEDAR KEY 1 week + bonus week. $3000 obo. (352) 212-5277. GOSPEL ISLAND 3/2/2 Lakefront Home, Over 1800 sf. of living, 100 feet of lakefront with fenced yard. Up- grades throughout. 7410 East Allen Dr. (352) 344-9007. Call for webslte address to view pictures and details. $349,000. Lake Hernando Canal 3 BR, 2 bth. Dock, NEW See webslte: http// wwwiplxeldustmaaIqlc. com/mstewart htm or call 352-341-41210aft 5. Licensed R.E. Broker Th Leading Indep. Real Estate Comp. f Citrus, Marion, Pasco and Hernan- do Ai Waterfront, Golf, Investment, Farms & Relocation t - Excep, People. Except'nal Properties Corporate Office 352-628-5500 properties.com Randy Rand/Broker Thinking of Selling Your home? Visit: YOUR OWN PIERI All tile 2/2, single floor, quiet Villa In the Island Condos, reduced to $295K Furn/unfurn. Fin. Avail, (352) 795-6721 WE BUY HOUSES & LOTS Any Area or Cond. 1-800-884-1282 or 352-257-1202 (352) 726-9369 WE BUY HOUSES Any situation Including SINKHOLE. Cash, quick closing, 352-596-7448 WE BUY HOUSES Ca$h.......Fast I 352-637-2973 Ihomesold.com St., side street on both ends, high, dry, cleared & seeded. Large oaks,' new well, new fence & cross fenced. Owner finance avail. $135,000. (352) 628-3098 CLASSIFIEDS C4" itrfus o c= Homes^B SEARAY 10 ; '78, 19Y2 ft, 165 merc. cruise, w/ trailer, new Interior excel cond. $3,500. (352) 795-6901 SPORTSCRAFT .* $4995. 20'11" fiberglass I/O. 3795 S. Suncoast, Homosassa - C= Citrus County Land 10 ACRES, Lecanto, wooded, homes only. Possible owner finance. Withlacoochee Forest access. Best offer. (352) 212-9522 Acre, Celina Hills, E. Marcia St. great area By Owner $54,900. 954-444-3854 1/2 ACRE CORNER Pine Ridge Estates. Very wooded. Princewood Street. $101K Tim, (303) 960-8453 1/2 ACRE, Celina Hills next to Citrus Hills. Very nice neighborhood, $59,000. 795-6226 days. (352) 527-0648 eves ATTENTION INVESTORS/BUILDERS 70 Vacant Citrus Springs Res. Lots for Sale, $34,900 each. Package Deal Avail. (954) 728-9381 Citrus Springs Lot, less than 1.5 ml from Pine Ridge Country Club on Elkcam. $32,000.OBO. Call Jim 352-726-7705 KENSINGTON ESTATES at end of cul-de-sac, on Foster Ct. 1/ acres, (352) 637-4919 WANT A BETTER RETURN ON YOUR MONEY? CONTACT US. Jr COMMERCIAL LOTS 227FT frontagel Hwy. 41-N zoned GC, clear- ed. Has city water & trees, $99,900 (352) 465-3999 or 302-0297 1 1/4 ACRE LOT N. ODYSSEY DR. CRYS. RVR IN CRYS. MANOR $99,800 rillalberto hotmall.com 2 MOBILE HOME LOTS 100x 100, on Jupiter & Dawson, city water, own. fin. $25,000. ea. 352-465-4013, or 352-220-3784 cell In inverness Highlands, River Lakes & Crystal River,. From $16,900. Call Ted at (772)321-5002 Florida Landsoure Inc CITRUS & MARION COUNTIES Many Lots In many areasI $18,000 & Upi Great investments Call Ted at 1-772-321-5002 Florida LANDSOURCE CITRUS HILLS/ PRESIDENTIAL ESTATES beautiful, level, heavily treed acre. No agents, $68,500 ea. (352) 400-0489 PINE RIDGE 1.1 AC. LOT On Cul de sac near golf course, $99,900. (352) 400-1567 PINE RIDGE 1.25 acre partially wooded lot on quiet street. $98,900. (352) 527-1123 WAYNE CORMIER W*"*J Condos cr) For Sale We need Clean used Boats .. NO FEES II,450.(352) 464-1616 CANOE Old Town square back, never In water, $475 (352) 476-1543 Cape Horn 16', Unslnkable w/ 75hp Mariner OB, trailer, trolling motor & many accessories, very good cond. Asking $5500 OBO.(352) 628-5069 CHASSAHOWITZKA "Cricket Boat" L 24', B 9', flat tunnel boat, 85HP 2002 Suzuki & 15HP Yamaha, $8500. (352) 382-1735 CRISCRAFT 1960, 55" Constellation, 3 state room, twin 871 Detroit, radar & GPS, Great live aboard or cruiser, $89,900 OBO , Will trade fat land. Possible Financing. - (352) 344-4288 (352) 302-7234 DELHI TERRY '79, w/'85 150HP Mariner trailer, fishflnder, ilvewell, $1,750 obo 352-344-9928 422-6902 FINAL CLOSEOUT SALE on new galv. & alum, boat trailers, prices Below Dealer's cost. WON'T LAST!! Call for pricing. *Monroe Sales* (352) 527-3555 Mon-Fri 9am-5pm GALAXY 20', 1986, cuddy, deep V-hull, 205 HP, V-6, I/O, low hrs. Exc. cond. $6700, (352) 795-7335 HENRY-0 1997,16', CC, 90hp, - Nissan, Garmin, GPS/ Sounder, 2 way radio, Blmlnl, well malnt., Garaged, $4,500. (352) 746-9853 - CONSTRUCTION SALE Here We Grow Againi HURRICANE DECK BOATS 17' to 23' 15'-24' POLARKRAFT JONS 12'-20' POLAR OFFSHORE 21'-23' CLEAN PRE-OWNED - BOATS Crystal River Marine (352) 795-2597 Open 7 Days MALIBU 14ft. V Hull 25H elect. start, low hrs. great boat $2,000. (352) 860-2408 PALM BEACH 2004, 15'3" ,center con-- sole flats boat. 50HP Yamaha w/less than 20 hrs. Performance trailer $8000. (352) 302-5737 PRO-LINE '89, 23' walk-around, cuddy, 140HP Yamaha GPS radio. Exc shape. ' Trdiler. $7,900. (352) 795-0678/634-3930 READY TO FISH - 1988 14' boat, mtr & trlr. Johnson 9.5 Troll mtr, fish finder, many extras. $1800abo: 352-464-1616 SEA LION 14 Ft. fiberglass Fishing Boat, 50HP force motor, F.C. trolling motor, fish finder, w/ trailer $1,900. (352) 726-7239 I U-1 $$$$$ The Boat $$$$$ Consignment Store. We Need Boats, Motors & Trallerst No FeesD52-795-9995 0000 THREE RIVERS MARINE Here To Help! Visit: waynecormier com (352) 382-4500 1960EVINRUDE (352) 422-0751 Gate House Realty COOL N.CAROLINA Mountains, near Asheville, 5.5 acres, Views, trails, private road, close to town $55,000(352) 233-0101 '96 JOHNSON 150 2.2 ACRES on canal to 2 rivers. Partly cleared. New well & pump. Ready to build, $125,000 (352) 233-0101 SEADOO 2000 GTX RFI. 3-seater Serviced for the sum- mer. Runs great. $4500. 527-1043; cell 228-9219 Heights, 3000 s.f. under roof, 3/272, many upgrades, $194,900. (352) 422-4533 Hampton Square Realty, Inc. Let us give you a helping hand 352-746-1888 1-800-522-1882 Marilyn Booth, GRI 23 years of experience "I LOVE TO MAKE HOUSE-CALLS" CITRUS COUNTY (FL) CHRONICLE 15FT 50HP Johnson with trailer, runs good, $800 firm. (352) 726-5329 SUN CHASER 2004, Pontoon, 24 Ft., 60HP Yamaha 4-stroke, Performance Trir., low hrs., + extras $16,000. (352) 596-3823 TRACKER CANOE 17ft., 2 person, aluminum, $200 (352) 563-1096. llv. area slide, queen bedrm. many extras, must sell $16,500. (352) 527-4697 PALOMINO Pop up camper, like new, everything works, A/C, $2850 (352) 726-8579 PROWLER REGAL 1993, 333-1/2FT w/slide out, new tires & brakes, all works $10,000 obo (352) 341-0923 4 Tires, Good year 225x60x16. $40 for all. $15 each. (352) 527-9020 20% OFF Most Items in Stock Richey's Auto Parts (352) 628-3822 35" PROCOMP M/T TIRES Liner $35. Leave. Message (352) 382-8970 Tall Gate Extended, Uke new for Nissan Pickup, 2000-present. Org. $209. Asking $75. (352) 527-1123% SalesSuccess No Fee to Seller 90944W and US19- alrport. 212-3041 FREE REMOVAL OF Mowers, motorcycles, Cars. ATV's, 628-2084 VEHICLES WANTED, Dead or Alive. Call Smitty's Auto L'a 11 a ACURA '91, Legend, low ml., white, 4 DR, leather Int., sun. rf. $4,295. (352) 382-0635, 302-6774 BUICK LESABRE 1993, Smokey Amethyst Well maintained. Low mileage. $2200 (352) 341-0970 CADILLAC 1998, Sedan Deville, Pearl white w/mar. Ithr. Int. excel. cond, $5,800. (352) 382-5309 CARS. TRUCKS. SUVS CREDIT REBUILDERS $500-$I000 DOWN Clean, Safe Autos CONSIGNMENT USA 909 Rt44&US19Alrport 564-1212 or 212-3041 CHEVROLET 2000, Corvette, silver, 31K, exc. cond, ext. (352) 382-4331 CHEVY '90, Lumina Euro, 85k ml., moving, like new, excel. cond., $2,800. obo (352)795-2078 CHEVY MALIBU 1998 205,000 miles, $1500.00, One owner, please call 352-228-7814 CHEVY MALIBU 2002, exc. cond. Low mileage, newly rigged for flat towing, $12,000 (352) 563-5791 CHRYSLER 2002, 300 M, special, luxury sedan, spoiler, Gar. Kept.19,200ml., $16,750, 464-1552 CHRYSLER SEBRING Limited 2004. Exc, cond. Less than 6,000 ml. (352) 726-0318 CLASSY CORVETTE 1984, low mi., 1999, Taurus, 49K. good, cond, owned by older senior, $5,100 (352) 726-6228 FORD Steal $6300, 2002 Focus SE. Mint, Great on gas. 70K+ mi. Contact (352) 249-1121 FORD TAURUS 2001 wagon, 64K ml., great shape, $6,800 (352) 344-2752 HONDA '98, Civic EX, loaded, snroof, AC, 5sd., gas saver,.41mpg, $8500. obo gd. cond 795-6364 KIA '01, Rio, 4DR, PT, AC, new tires. 39,500m1., ex- cel cond. $4,900. obo 352-527-1812, 302-9498 KIA 01, Sephia, white, manual, $3500 FIRM (352) 527-3519 LINCOLN '89 Towncar, Cartier Exc. running cond. Nice ride, clean, dependable, $1,495 (352) 341-0610 LINCOLN '96, Signature Towncar,. Jack NIcklaus, wht. w/ burgundy cloth top, 22-25 mil per gal. 113k ml, excel cond. $5,000. obo (352) 628-3363 Lincoln Town Car 1992. Clean. Good ride, looks good, minor mechanical repairs. $1800. (352) 527-1139 MAZDA 2002, Miata, 11,800k ml., silver ext., 5 spd., pris- tine $16,500. (352) 628-4497 MERCURY 1997, Grand Marquis LS, Presidential, pearl, camel Interior, tow package, 80K, Exc. $5,700 OBO. (352) 362-7941(352) 804-4214 MERCURY 1999 Cougar, black, A/C, radio, $6,000 cash (352) 726-3084 MERCURY '98, Sable, auto trans., cruise control, Ice cold air, good tires, high ml. runs good. $2,500. (352) 220-4927 MUSTANG '00 Conv, Red, all pwr, dual CD/Trape MAXIMA '99, SE, very clean, runs great, sun rf. AC, CD, 5sp. stick, 128k ml. $4400/obo 352-220-2709 OLDSMOBILE 1988 98 Regency needs master cylinder work $600 (352)489-1002 OLDSMOBILE 1996 Delta 88 LSS Garage kept., second owner, always well maintain, $3,000. (352)795-6901 OLDSMOBILE '98, Cutlass, V6, 35k actual mi., body & Int,. very good, $4,000. obo (352) 563-0886 PONTIAC '95 Bonneville. Good cond. Has a '98 eng. & trans. $3950 (352) 795-0063 PONTIAC FIREBIRD 1992 Formula, V-8, T-tops, auto trans, pwr accessories. $2500 obo (352) 465-3942 TOYOTA 2002, Echo, green, 5spd, 2 dr, 54K, $7,900. OBO (352) 344-4497 TOYOTA 2004 Camry, $17,000. 8,300 ml. Call (352) 302-0552 TOYOTA CAMRY '00, silver, loaded, Ithr, alloys, sunroof, exc. cond. 50K ml. (352) 527-3965 COUGAR 1967 289, new brakes & master cylinder, new floor. $1,200 (352) 726-5329 MUSTANG 1968 Coupe. 302 V-8. Automatic. New tires & morel $7200. ~3)2O\ 70A A77a 0 MAZDA B2300 40C ,s ,A o ...................$5,980 '00 DODGE DAKOTA RT 9, V Aweso ............$9,980 '00 RANGER XLT EXT. V ipas ............$9990 '02 DODGE RAM 1500 SLT 4 DR ForstG, Load iNic $15,900 BOX TRUCK 1990 GMC 16' Maintained, good shape, $4500. (352) 422-2821 CHEVEROLT 1984, S10 Sport Model, new engine w/ 9000ml $2,500 OBO, (352) 795-9490 CHEVROLET '02. Silverado 2500, auto, towing package 60k ml. $13,500. (352) 613-7277 CHEVROLET 1994 Silver, Silverado Ext. cab, 1500ml, loaded, Must See. (352) 634-5665 CHEVROLET '85, Pickup, full size, one owner orig '85 title, excel cond. $3,500. (352) 527-8499 CHEVY '97, SI0 Pickup, ext. cab, runs good, body . rough, 150k. V6. AC $1,500. (352) 746-2982 DODGE S1989SportPickup convertible $3,000 (352) 637-0057 FORD '97, F150, Pickup, ext. cab., V6, 5sp., 48k mi. on factory second. motor, $5,800. obo (352) 628-7414 FORD 2001, F150 Lariat,, Ext. Cab, 46K, (352) 726-7809 FORD 2001, Lightning, bick, show rm cond, only 8300ml, garaged, $27,000. 352-560-6186 FORD RANGER 2001 XLT, 4 door, auto, loaded, 98K ml. exc. cond. $6,900/obo 352-422-7910/795-9090 TOYOTA 1984, Pick up, topper, chrome wheels, new clutch, $1,195 OBO. (352) 422-6661 newly $9800 (352) 746-7970 CHEVY SUBURBAN 1981 Air Condition, Power Steering, Power Windows, Power Door Locks, Tilt Wheel, AM/FM Stereo, Single Compact Disc, Rear Wheel Drive, $800.00 fair condition, 454c.l. engine. Call Crickett at 352-382-1439. FORD BRONCO II '86 Eddie Bauer edition, 4 cyl., 4x4, new tires, 100 straps. Will pay up to $500 for used tow dolly. Call (352) 344-8334 leave msg. or call my cell (352) 302-0850. (352) 795-7901 FORD 1989 F-1504x4, V-8 motor, runs great, $2,500 firm (352) 302-2911 FORD BRONCO 1995 Sport. 1 owner, red on red. Loaded, AC, etc.Lke new, $5000 obo. 352-422-5522 CHEVY 1985 HANDICAP VAN W/power lift. $3,000. (352) 628-4569 CHEVY 1986 alum step In van, 26', 6.2 diesel engine. $3500. (352) 344-8389 CHEVY 1987 C20 hhl-top conver- sion van w/elec wheel- chair lift & fold down bed. Runs excellent. $2500obo.352-465-8779 DODGE 1987, 150, fair condition, $800 (352) 489-0962 DODGE 1992, Passenger Van, rebuilt engine '& trans. $1,200(352) 344-9266 S(727) 415-7266 DODGE 2000 hl-top conversion van.19,000K ml. Loaded w/luxuries. $12,500 NEG. (352) 746-5044 DODGE '98, Grand Caravan, dual AC, alloy wheels, 117k ml., $5,250. (352) 637-4206 FORD 2000 E150 XLT. Trailer pkg. Tinted windows, PL PW, rear AC, Run- ning boards. 72,000 ml. Excellent cond. $11,500. (352) 637-4640 FORD '86, F150, runs good, wheel chair lift, $1,000. obo '93, Villager, runs good $1,000. obo (352) 257-1960., bluelooks like a Raptor, $1,895. obo 352 344-5426 GoKart 2003, great cond, 2 stroke, Irg tires, electric . (352) 489-6377 "MR CITRUS COUNW' ALAN NUSSO BROKER RlAssociate Real Estate Sales Exit Really HONDA '05, Shadow, 2,500k ml. many many extra's, factory warranty $5,500. (352) 527-8834 HONDA 2002, 750 Spirit, wind- shield, bags, backrest, like new, $4,500. (352) 794-0060 HONDA '87, Goldwing, 32k org, ml., great shape $4,000. Crystal River (772) 528-6130 - HONDA GOLDWING 1986 Aspincade, runs great, 42K mi. $3300/ obo. (352) 637-5052 leave message. HONDA SHADOW 1985 Dark Red 13,710 Miles, $1500 Good Condition, (352) 563-2584 CLASS HARLEY DAVIDSON New, Fat Boy, silver, 2000ml, $17,200. Negotiable 563-2025 KAWASAKI '03, Vulcan 750, WS, immac. garaged, 8K. must see, $5,200. 352-382-0005 KAWASAKI 1999, KLR 650, 27K. w/ extras runs greatly $2500. OBO (352) 302-8046 KAWASAKI 2003 250 Ninja. Very low miles. $2200. (352) 726-6779 KAWASAKI 2004 Vulcan 1600, low miles, beautiful Paid $10,500, asking $8500. (352) 302-6311 KAWASAKI Four motorcycles $100. 352-422-6128 352-621-0651 Motorcycle Carrier VersahauL 5001b ca- pacity, class 3 hitch $260. (352) 382-7046 SUZUKI '05 Boulevard, 800cc, 700 ml. loaded, w/ac- cess. under warr. Like new, $7,350 726-6351 SUZUKI 738-0629 WCRN PUBLIC NOTICE NOTICE IS HEREBY GIVEN that the Citrus Springs Ad- visory Council will meet on Wednesday, July. 6, Springs Boulevard, Build- ing "B", Citrus Springs, Flori- da, to conduct business of the Citrus Springs Mu- nicipal: Robert A. Johnson, Chairman CITRUS SPRINGS MSBU Published one (1) time in the Citrus County Chroni- cle, June 29, 2005. 739-0629 WCRN PUBLIC NOTICE The Early Learning Coall- flon of the Nature Coast will be facilitating h- f;r-t Trl County Advisory - c1l Meeting -on Tuesday, July 5, 2005, at 10:00 AM. The meeting will be held at the Levy County School Board Office. The address is 480 Morshburn Ave., Bronson, FL 32621. Please contact the Coa- lition office at 877-336- 5437 if you have any questions. Published one (1) time in the Citrus County Chroni- cle, June 29, 2005. 720-0629 WCRN Notice to Creditors Estate of Beatrice S. Costa PUBLIC NOTICE IN THE CIRCUIT COURT FOR CITRUS COUNTY. FLORIDA PROBATE DIVISION File No: 2005CP494 IN RE: ESTATE OF BEATRICE S. COSTA, Deceased. NOTICE TO CREDITORS The administration of the estate of BEATRICE A. COSTA, deceased, whose date of death was March 16, 2004: File Number 2005CP494, Is pending in the Circuit Court for Citrus County. Florida, Probate Division, the address of which is 110 North Apopka Avenue, Inver- ness, Florida 34450-4299. The names and addresses of the personal represent- ative and the personal representative's attorney are set forth below. All creditors of the dece- mands against dece- dent- Ilcation of this Notice Is June 22, 2005. Personal Representative: -s- EDWARD COSTA 30 Arrowhead Road Wrentham, MA 02093 Attorney for Personal Representative: -s- Joseph Mannino Florida Bar No, 282571 SCIARRETTA MANNINO & SETTERLUND 7301-A West Palmetto Park Road, Suite 305C Boca Roton, FL 33433 Telephone: (561) 338-9900 Published two (2) times In the Citrus County Chroni- cle, June 22, and 29, 2005. 73u-utU6 WCRN Notice to Creditors (Summary Administration) Estate of Helen A. Dodge PUBUC NOTICE IN THE CIRCUIT COURT FOR CITRUS COUNTY. FLORIDA PROBATE DIVISION FILE NO. 2005-CP-799 IN RE: ESTATE OF HELEN A. DODGE, DECEASED. NOTICE TO CREDITORS (Summary Administration) TO ALL PERSONS HAVING CLAIMS OR DEMANDS AGAINST THE ABOVE ES- TATE: You are hereby notified that an Order of Summary Administration has been entered in the Estate of Helen A. Dodge, de- ceased, File Number 2005-CP-799, by the Cir- cuit Court of Citrus Coun- ty, Florida, Probate Divi- sion, the address of which is 110 North Apopka Ave- nue, Inverness, Florida 34450; that the assets of the estate consist of only protected/exempt home- stead real property, and that the names and ad- dresses of those to whom it has been assigned by such order are: Robert W. Dodge 806 Usa Run Ct, Kernersvile, NC 72784 Helen Elizabeth Dodge 88 S, Jackson St. Beverly Hills, FL 34465 ALL INTERESTED PERSONS ARE NOTIFIED THAT: All creditors of the dece- dent and persons having claims or demands against the decedent's estate on whom a copy of this notice is served within three months after the date of the first publi- cation of this notice must tile their claims with this Court WITHIN THE LATER OF THREE MONTHS AFTER THE DATE OF THE FIRST PUBLICATION OF THIS NO- TICE OR THIRTY DAYS AF- TER THE DATE OF SERVICE OF A COPY OF THIS NO- TICE ON THEM. All creditors of the dece- dent and other- Helen Elizabeth Dodge 88 S, Jackson St. Beverly Hills, FL 34465 Attorney for Person Giving Notice: BRADSHAW & MOUNTJOY, P.A. -s- Michael Mounfloy, Esq. 209 Courthouse Square inverness, FL 34450 Florida Bar No.: 157310 Telephone: (352) 726-1211 Published two (2) times in the Citrus County Chroni- cle, June 29, and July 6, 2005. 731-0706 WCRN Notice to Creditors (Summary Administration) Estate of Page H. Bastard PUBLIC NOTICE IN THE CIRCUIT COURT FOR CITRUS COUNTY, FLORIDA PROBATE DIVISION FILE NO, 2005-CP-794 IN RE: ESTATE OF PAGE H. BOSTARD, DECEASED. NOTICE TO CREDITORS (Summary Administration) TO ALL PERSONS HAVING CLAIMS OR DEMANDS AGAINST THE ABOVE ES- TATE: You are hereby notified that an Order of Summary Administration has been entered In the Estate of Page H. 'Bastard, de- ceased, File Number 2005-CP-794, by the Cir- cuit Court of Citrus Coun- ty, Florida, Probate Divi- sion, the address of which is 110 North Apopka Ave- nue, Inverness, Florida 34450; that the total cash value of the estate Is ap- proximately $20,000.00 and that the names and addresses of those to whom It has been assign- ed by such order are: Eupha E. Bastard #121 1201 Riva Ridge Ct. Gohanna, OH 43230 ALL INTERESTED PERSONS ARE NOTIFIED THAT: All creditors of the dece- dent and other persons having .claims or de- mands against the- Eupha E. Bostard #121 1201 Riva Ridge Ct. Gahanna, OH 43230, June 29, and July 6, 2005. 732-0706 WCRN Notice to Creditors (Summary Administration) Estate of Maurice R. Potts PUBLIC NOTICE IN THE CIRCUIT COURT . FOR CITRUS COUNTY, FLORIDA .PROBATE DIVISION FILE NO. 2005-CP-577 IN RE: ESTATE OF MAURICE R. POTTS, DECEASED. NOTICE TO CREDITORS (Summary Administration) TO ALL PERSONS HAVING CLAIMS OR DEMANDS AGAINST THE ABOVE ES- TATE: You are hereby notified that on Order of Summary Administration has been entered in the Estate of III ES XEPEPL MAURICE R. POTTS, de- ceased, File Number 2005-CP-577, 24, 2005; that the total value of the estate is NONE (EXEMPTED) and that the names and ad- dresses of those to whom it has been assigned by such order are: KATHY ANN POTTS BISBEE 34263 Sunset Drive Cathedral City, CA 922- Kathy Ann Potts Bisbee33-0706 WCRN Notice to Creditors (Summary Administration) Estate of Jeanne A. Dimitriadis PUBLIC NOTICE IN THE CIRCUIT COURT FOR CITRUS COUNTY, FLORIDA PROBATE DIVISION FILE NO. 2005-CP-811 IN RE: ESTATE OF JEANNE A. DIMITRIADIS, A/K/A IOANNA DIMITRIADIS, DECEASED. NOTICE TO CREDITORS (Summary Administration) TO ALL PERSONS HAVING CLAIMS OR DEMANDS AGAINST THE ABOVE ES- TATE: You are hereby notified that an Order of Summary Administration has been entered in the Estate of JEANNE A. DIMITRIADIS, deceased, File Number 2005-CP-811, 28, 2004: that the total value of the estate is $15,000.00 and that the names and addresses of those to whom it has been assigned by such or- der are: PHOTINI KOELMA 43, Gravias str. 15342 Ag. Paraskevi Athens, Greece- PHOTINI KOELMA34-0706 WCRN Notice to Creditors S Estate of Audrey N. Palmlter PUBLIC NOTICE IN THE CIRCUIT COURT FOR CITRUS COUNTY, FLORIDA PROBATE DIVISION File No.: 2005-CP-614 IN RE: ESTATE OF AUDREY N. PALMITER Deceased,. NOTICE TO CREDITORS The administration of the estate of AUDREY N. PAL- MITER, deceased, whose date of death was FEBRU- ARY 19,- THELMA GRAMS 20371 S.W. 86TH LOOP DUNNELLON, FL 3443121-0629 WCRN Notice to Creditors Estate of Mary L, Cox PUBLIC NOTICE IN THE FIFTH JUDICIAL CIRCUIT COURT OF FLORIDA. IN AND FOR CITRUS COUNTY IN PROBATE FILE NO:. 2005-CP-599 IN RE: ESTATE OF MARY L. COX, Deceased, NOTICE TO CREDITORS The administration of the Estate of MARY L. COX, deceased, File' Number 2005-CP-599,- lic June 22. 2005. Personal Representative: -s- ROBERT W. COX, June 22, and 29, 2005. 735-0706 WCRN Notice to Creditors Estate of Lilian D. Schultz PUBLIC NOTICE IN THE CIRCUIT COURT FOR CITRUS COUNTY, FLORIDA PROBATE DIVISION File No.: 2005-CP-814 IN RE: ESTATE OF LILLIAN D. SCHULTZ, Deceased, NOTICE TO CREDITORS The administration of the estate of LILLIAN D. SCHULTZ, deceased, whose date of death was' MAY 17,- CHARLES D. SCHULTZ 6750 MERLEING LOOP FLORAL CITY, FL 34436' Attorney for Personal Representative: BRADSHAW &.MOUNTJOY, PA. 36-0706 WCRN Notice to Creditors Estate of Joseph Michael Idone PUBLIC NOTICE IN THE CIRCUIT COURT FOR CITRUS COUNTY, FLORIDA PROBATE DIVISION CASE NO. 2005-CP-474 IN RE: THE ESTATE OF JOSEPH MICHAEL DONEE. Deceased. NOTICE TO CREDITORS The administration of the Estate of Joseph Michael Done, deceased, whose date of death was Octo- ber 1, 2004. first publica- tion of this notice Is June 29, 2005. Personal Representative: -s- ELEANOR LAUCK 45 Carnation Drive Cranston, Rhode Island 02920 Attorney for Personal JUNE 2 29, and July 6,. 2005. 737-0706 WCRN Notice to Creditors Estate of Francis X. Coyne Jr. PUBLIC NOTICE IN THE CIRCUIT COURT FOR CITRUS COUNTY. FLORIDA PROBATE DIVISION File No. 2005-CP-818 N RE: ESTATE OF FRANCIS X. COYNE JR., Deceased, NOTICE TO CREDITORS The administration of the estate of Francis X. Coy- ne, Jr., deceased, File Number 2005-CP-818. is pending In the Circuit Court for Citrus County, Florida, Probate Division, the address of which Is 110 North Apopka Ave., Inverness, L 34450. The names and addresses of the personal representa- tive and the personal rep- resentative's attorney are set forth below. All creditors of the dece- dent and other persons having claims June 29, 2005. Personal Representative: -s- LENORE R. COYNE c/o 452 Pleasant Grove Rd. Inverness, FL 34452 Attorney for Personal Representatives: , June 29, and July 6, 2005. 741-0706 KIM- BERLY LEONARD/RANTZ, whose last known mailing address was 12900 E. Trails End Road, Floral City, FL 34436, for purposes of sat- Isfying delinquent rents and related collection costs accruing since April 30, 2005. 29, and July 6, 2005. 777-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-00-4417 YEAR OF ISSUANCE: 1993 DESCRIPTION OF PROP- ERTY: SUGARMILL WOODS CYPRESS VLG LOT 8 BLK 108 DESC IN OR BK 797 PG 778-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-00-4509 YEAR OF ISSUANCE: 1993 DESCRIPTION OF PROP- ERTY, SUGARMILL WOODS OAK VLG PB 10 PG 10 LOT 2 BLK 178 DESC IN OR BK 871 PG 16, I as follows: CERTIFICATE NO: 98-8169 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: HICKORY HILL RETS UNIT 3 LOT 2 BLK 12 DESC IN OR BK 489 PG 310 NAME IN WHICH AS- SESSED: ARTHUR R KELLY AND RONALD W KELLY79-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-07004 YEAR OF ISSUANCE: 1999 DESCRIPTION OF PROP- ERTY: POINT LONESOME UNIT 3 LOT 249 3/12/99 E&1280634. 780-0629 WCRN - PUBLIC NOTICE APPLICATION NO.: 2005-071-6693 YEAR OF ISSUANCE: 1998 DESCRIPTION. OF PROP- ERTY: RIVER LAKES MAN- OR UNIT 3 PB 4 PG 47 LOT 2 BLK 5 NAME IN WHICH AS- SESSED: ROBERT V MON- TANA, ET AL AND MI- CHAEL RYAN Said property being in the County of Citrus, State of Florida. Unles I' By: Bonnie Tenney, Tax Deed Clerk Published four (4) times in , the Citrus County Chronicle, June 8, 15, 22, and 29, 2005. 781-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-005 YEAR OF ISSUANCE: 1999 DESCRIPTION OF PROP- ERTY: POINT LONESOME UNIT 3 LOT 256 3/12/99 E&128063582-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-0 CrmRus COUNTY (FL) CHRONICLE 783-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-0-0148 YEAR OF ISSUANCE: 1999 DESCRIPTION OF PROP- ERTY: RIVERHAVEN VIL- LAGE PART OF TRACT C & PT OF BLK 37 FUR- THER DESC IN OR BK 823 PG 1482 NAME IN WHICH AS- SESSED: RIVERHAVEN ASSOCIATES84-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-078-2223 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPRINGS UNIT 1 PLAT BK 5 PG 89 LOT 23 BLK 69 DESCR IN OR BK 562 PG 1013 NAME IN WHICH AS- SESSED: ALAN E REED, JR AND JONATHAN RE85-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-079 NOTICE OF APPLICATION * FOR TAX DEED NOTICE IS HEREBY GIV- EN: P & G PROPERTIES OF OCALA INC ' the holder of the following certificate hasofiled said cer-. tificate for a tax deed to be issued,,jhereon. The certifi- cate number and year of is- tsuance, the description of the property, and the names in which it was assessed are as follows: CERTIFICATE NO: 98-2245 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPRINGS UNIT 1 PLAT BK 5 PG 89 LOT 20 BLK 81 DESCR IN OR BK 520 PG 778 NAME IN WHICH AS- SESSED: ELBA CAYON IN TRUST FOR RONALD I HERNANDEZ86-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-08038 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPRINGS UNIT 3 LOT 5 BLK 290 DE- SCR IN OR BK 389 PG 28387-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-08180 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPRINGS UNIT 3 PLAT BK 5 PG 116 LOT 6 BLK 314 DESCR IN OR BK 543 PG 1532 NAME IN WHICH AS- SESSED: JEAN CLAUDE SCHWA88-0629 WCRN PUBUC NOTICE APPLICATION NO.: 2005-082-2600 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPGS UNIT 3 PLAT BK 5 PG 116 LOT 5 BLK 327 DESC IN OR BK 740 PG 1453 NAME IN WHICH AS- SESSED: DOROTHY L YOUNG89-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-08366 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPRINGS UNIT 5 LOT 3 BLK 498 DE- SCR IN OR BK 538 PG 1080 NAME IN WHICH AS- SESSED: EUGENE TATOM AND ANNE E TATOM Said property being in the County of Citrus, State of Florida. Unless such certificate shall be redeemed according to law, -tha 'property, described n :,.:r, .:.r.1.1,.: 31 shall be .:.1. i.: ir.. r.,.yr..; t. .a.at r90-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-067 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPGS UNIT 5 LOT 18 BLK 498 DESC IN OR BK 538 PG 1058 & OR BK 781 PG 320 NAME IN WHICH AS- SESSED: JUDITH A BURR91-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-085-2982 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPRINGS UNIT 6 LOT 2 BLK 577 DE- SCR IN OR BK 540 PG 1862 NAME IN WHICH AS- SESSED: PETER LAPPERT92-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-0141 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPGS UNIT 8 PB 6 PG 43 LOT 8 BLK 757 DESC IN OR BK 547 PG 2178 NAME IN WHICH AS- SESSED: FANCIS MAURON Said property being in the County .of Citrus, State- of Florid .,. Unless such cnaI'';al-93-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-0189 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPRINGS UNIT 8 LOT 1 BLK 811 DE- SCR IN OR BK 572 PG 376 NAME IN WHICH AS- SESSED: FRANK BOYLE AND LORRAINE C BOY94-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-088 NOTICE OF APPLICATION FOR TAX DEED NOTICE IS HEREBY GIV- EN: P & G PROPERTIES OF OCALA INC the holder of the following certificate has filed said cer- bi-...;aS ic 3' iax i a to be ,i-u...s Ine ie... Tr,s certifi- cate number and year of'Is- suance, the description of the property, and the names in which it was assessed are as follows: CERTIFICATE NO: 98-3279 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPRINGS UNIT 9 LOT 13 BLK 642 DESCR IN OR BK 569 PG 190 NAME IN WHICH AS- SESSED: MAX QUINTE- ROS AND PATRICIA 'QUINTER95-0629 WCRN PUBLIC NOTICE APPLICATION NO.: 2005-0-2381 YEAR OF ISSUANCE: 1998 DESCRIPTION OF PROP- ERTY: CITRUS SPRINGS UNIT 3 LOT 5 BLK 124 DE- SCR IN OR BK 388 PG 651 NAME IN WHICH AS- SESSED: ELAINE D SM.l- cle, June 25 29, 2005. 515-0630 TU/W/THCRN PUBLIC NOTICE The Citrus County School Board will accept sealed bids for: BID# 2006-8 ELECTRICAL SERVICES Bid specifications may be obtained on the CCSB VendorBId webslte; Automated Vendor Application & Bidder Notification system: Sandra "Sam" Himmel Superintendent, Citrus County School Board Published three (3) times In the Citrus, County Chronicle, June 28, 29, and 30, 2005. TO p lcie your Legal Saveortl'r.gi Irr, rre Chronicle 563-3266 742-0629 WCRN PUBUC NOTICE Notice of Meetings Tuscany Community Development District As required by Chapter 189 Florida Statutes, notice Is being given that the Board of Supervisors of the Tus- cany Community Development District does not meet on a regular basis but will separately publish notice of meetings at least seven days prior to each Board meeting to Include the date, time and location of said meetings. There may be occasions when one or more Supervi- sors will participate by telephone, At the meeting lo- cation there will be present a speaker telephone so that any interested person can attend the meeting at the meeting location and be fully Informed of the dis- cussions taking place either in person or by telephone communication. Any person requiring special accommodations at this meeting because of a disability or physical impairment should contact the District Office at 877-520-7702 Published one (1) time in the Citrus County Chronicle, June 29. 2005. 729-0629 WCRN PUBLIC NOTICE NOTICE IS HEREBY GIVEN that the Citrus County Water & Wastewater Authority (Authority) will meet on Mon- day, July 11, 2005, at 1:00 P.M. or as soon thereafter as possible, in the Lecanto Government Building, 3600 W. Sovereign Path, Room #166, Lecanto, Florida to discuss such matters as may properly come before the Author- ity. This will Include hearings on the following Items: I) the FGUA proposed assessment districts for Pine Ridge and Citrus Springs; and 2) approval of miscellaneous rates for Cinnamon Ridge Utilities. Ordinance 99-07. ANY PERSON WHO DECIDES TO APPEAL A DECISION OF THISAUTHORI- TY AND WASTEWATER AUTHORITY Published one (1) time In the Citrus County Chronicle, June 29, 2005. 728-0720 WCRN PUBLIC NOTICE NOTICE OF SHERIFF'S SALE NOTICE IS HEREBY GIVEN THAT pursuant to a Writ of Ex- ecution issued in the CIRCUIT Court of CITRUS County, Florida, on the 17th day of May, 2005, In the cause wherein CLANTON HOMES, INC., is plaintiff, and DAVID M. BARER AND JULIE K. BARBER are defendants, being Case No 2004-535-CA In said Court, I, JEFFREY J. DAWSY, as Sheriff of Citrus County, Florida, have levied upon all the right, title and interest of the above-named Plaintiff(s). CLANTON HOMES, INC., the following described property, to-wit: LOT 17, BLOCK 3, BEVERLY HILLS UNIT NUMBER ONE, AC- CORDING TO THE MAP OR PLAT THEREOF, AS RECORDED IN PLAT BOOK 3, PAGES 149 AND 150, PUBLIC RECORDS OF CITRUS COUNTY, FLORIDA. STREET ADDRESS: 17 NORTH MELBOURNE STREET, BEVERLY HILLS, FL. And on the 27th day of July, 2005. at 17 North Mel- bourne Street, In the City of Beverly Hills, at the hour of 11:00 AM, or as soon thereafter as possible, I will offer for sale all of the sold plaintiff, CLANTON HOMES, INC., right, title and Interest in the aforesaid property at pub- lic outcry and will sell the same, subject to all prior liens, encumbrances and judgments, if any, to the highest bidders for CASH, the proceeds to be applied as far as they may be to the payment of costs and the satis- faction- LEANNE B. SMOLENSKY (Civil Deputy) Published four (4)-times In the Citrus County Chronicle, June 29, July 6, 13, and 20, 2005. 719-0629 WCRN Notice of Actidn Citlfinanclal Mtg. Co., Inc. vs. Beverly S. Lewis, etalt. PUBLIC NOTICE IN THE CIRCUIT COURT OF THE FIFTH JUDICIAL CIRCUIT OF THE STATE OF FLORIDA, IN AND FOR CITRUS COUNTY CIVIL ACTION CASE NO, 2005-CA-1914 CITIFINANCIAL MORTGAGE COMPANY, INC..,, Plaintiff, vs. BEVERLY S. LEWIS F/K/A BEVERLY S, HELTON; THE UNKNOWN SPOUSE OF BEVERLY S. LEWIS F/K/A BEVERLY S. HELTON;; BEVERLY S. LEWIS F/K/A BEVERLY S, HELTON; THE UN- KNOWN SPOUSE OF BEVERLY S. LEWIS F/K/A BEVERLY S. HELTON; IF LIVING, INCLUDING ANY UNKNOWN SPOUSE OF SAID DEFENDANTSS, IF REMARRIED, AND IF DE- CEASED, THE RESPECTIVE UNKNOWN HEIRS, DEVISEES, GRANTEES, ASSIGNEES, CREDITORS, LIENORS, AND TRUS- TEES, AND ALL OTHER PERSONS CLAIMING BY, THROUGH, UNDER OR AGAINST THE NAMED DEFEND- ANT(S); Whose residence are/Is unknown. YOU ARE HEREBY required to file your answer or written defenses, if any, In the above proceeding with the Clerk of this Court, and to serve a copy thereof upon the plaintiff's attorney, whose name and address ap- pears hereon, on or before July 15, 2005, the nature of this proceeding being a suit for foreclosure of mort- gage against the following described property, to wit: LOT 23, BLOCK L, LAKE TSALA GARDENS ADDITION, AC- CORDING TO THE PLAT THEREOF, AS RECORDED IN PLAT BOOK 3, PAGE 142, OF THE PUBLIC RECORDS OF CITRUS COUNTY, FLORIDA. A/K/A 1795 SOUTH COVE WALK INVERNESS, FL 34450 If you fall to file your answer or written defenses In the above proceeding, on plaintiff's attorney, a default will be entered against you for the relief demanded In the Complaint or Petition. DATED at CITRUS County this 15th day of June, 2005. BETTY STRIFLER Clerk of Courts (CIRCUIT COURT SEAL) By: -s- M. A, Michel Deputy Clerk In accordance with the American with Disabilities Act of 1990, persons needing a special accomnmodation to* participate In this proceeding should contact the ASA Coordinator no later than, seven (7) days prior to the proceedings. If hearing Impaired, please call (800) 955-9777 (FDD) or (800) 955-8770 (voice), 1 .fune 22, and 29, 2005. 726-0629 WCRN PUBLIC NOTICE SECTION 00100 LEGAL ADVERTISEMENT INVITATION TO BID FLORIDA GOVERNMENTAL UTILITY AUTHORITY LEHIGH UTILITY SYSTEM LEHIGH COUNTY, FLORIDA GOLDEN GATE SYSTEM COLLIER COUNTY, FLORIDA Date: June 29, 2005 BID NO. LE0506. LE0518 & GG0503 "Lehlah 2005 Water Well and Uff Station Telemetry Improvements & Golden Gate 2005 Lift Station Telemetry Improvements" Sealed proposals for "Lehigh 2005 Water Well and Lift .Station Telemetry Improvements & Golden Gate 2005 Lift Station Telemetry Improvements" In Lehigh & Collier County, Florida and addressed to the Florida Govern- mental Utility Authority, c/o the FGUA local office at 280 Weklva Springs Rd., Longwood, FL 32779, will be re- celved until 12:30 P.M. Eastern Daylight Savings Time, on the 29th day of July 2005, at which tlme all propos- als will be publicly opened and read aloud. Any bids received after the time and date specified will not be accepted and shall be returned unopened to the Bid- der. A MANDATORY pre-bld conference will not be held. Sealed envelopes containing bids shall be marked or endorsed "Proposal for Florida Governmental Utility Au- thority, Bid No. LE0506, LE0518 & GG0503 and B1d Date 29 July 2005., No bid shall be considered unless It Is made on the Bid Schedule that is Included in the Bid- ding Documents. The Bid Schedule (Section 00410) shall be removed from the Bidding Documents prior to submittal. The Successful Bidder shall be required to fully com- plete all Work to be performed pursuant to this section of the Invitation to bid within 180 calendar days from and after the Commencement Date specified In the' Notice to Proceed.: ARCADIS G&M, Inc. 4307 Vlneland Road, H-18 Orlando, FL 32811 Telephone (407) 835-0266. Fax (407) 835-0267 Copies of the Bidding Documents may be obtained only at the offices of the ARCADIS after payment of $100.00 for each set of documents to offset the cost of reproduction. Return of the documents is not required, and the amount paid for the documents Is nonre- fundable. The following plan room services have obtained copies of the Bidding Documents for the work contemplated herein: Central Florida Builders Exchange 340 N. Wymore Road Winter Park, FL 32789-2855 Telephone (407) 629-2411, Fax (407) 629-9440 F.W. Dodge Reports Inquires Plan Room 320 East South Street Orlando, FL 32801 Telephone (407) 649-7200, Fax (407) 649-7600 Each bid for each project shall be accompanied by a certified or cashier's check or a Bid Bond In an amount not less than five percent (5%) of the total Bid to be re- tained as liquidated damages in the event the suc- cessful Bidder falls to execute the Agreement and file the required bonds and Insurance within ten (10) cal- endar days after the receipt of the Notice of Award. For each project, the successful Bidder shall be re- quired to furnish the necessary Insurance, Performance and Payment Bonds, as prescribed in the General Conditions of the Contract Documents. All Bid Bonds, Performance and Payment Bonds, Insurance Contracts and Certificates of Insurance shall be either executed by or countersigned by a licensed agent of the surety or insurance company having its place of business copy of their Power of Attorney. In order to perform public work, for each project the successful Bidder shall, as applicable, hold or obtain such contractor's and business licenses, certifications, and registrations as required by State statutes and lo- cal ordinances. Before a contract will be awarded for the work con- templated herein, the FGUA shall conduct such Investi- gations, as it deems necessary to determine the perfor- mance record and ability of the apparent low Bidder for each project to perform the size and type of work specified In the Bidding Documents. Upon request, the Bidder shall submit such information as deemed neces- sary by the FGUA to evaluate the Bidder's qualifica- tions. The FGUA reserves the right to reject all Bids or any Bid not conforming to the intent and purpose of the Bid- ding Documents, and to postpone the award of the contract for a period of time which, however, shall not extend beyond 90 days from the bid opening date. Dated this 29th day of June 2005. FLORIDA GOVERNMENTAL UTILITY AUTHORITY Tallahassee, Florida BY: -s- Charles Sweat Director of Operations Published one (1) time in the Citrus County Chronicle, June 29, 2005. 511-05-09 Tammy Sue Stansell Is requesting an amend- ment to the LDCA from Rural Residential (RUR) to Rural Residential (mobile homes allowed) (RUR*). The re- quest Is for property lying In Section 19, Township 17 South, Range 19 East. Further described as Parcel 33400 (Citrus Springs Area) [Citrus Springs Area) A com- plete legal description Is on file In the Department of Development Services Office.iciaI 21, and 29,.2005. 790-0629 WCRN Notice of Action Tahir Ansari v. John H. Maurer, et al. PUBLIC NOTICE IN THE CIRCUIT COURT OF THE FIFTH JUDICIAL CIRCUIT IN AND FOR CITRUS COUNTY, FLORIDA Case File No. 2005-CA-2014 Division: Clvll TAHIR ANSARI, Plalntiff(s), v. JOHN H. MAURER, FREDDIE MARCHESE and ANNA MARCHESE, Individually and as husband and wife, MAUREEN LAND, SYLVAIN R. ROBITAILLE, LAURA J. ION, MARY E. HOLTZ, PENNY J. NEY, PATRICIA A. LEWALL DIANA GAIL NEY, CAROLE FRANCIONI, RITA M. PHILLIPS, JOSHUA L. HOLAYSAN and GRACE S. HOLAYSAN, Individually and as husband and wife, ROGER DE VOS, GUNNEL THUNSTROM. INVERNESS PROPERTIES CORP., a Florida corporation, ERNEST SACCO, JOSEPH SACCO, ROSE COHEN, CHARLES SACCO, JOSEPH SACCO, ARMINIA BELFORT. SADIE PATIENCE, GARY HELSING, a/k/a Gary Holsing, TERRY HARGIS. and GREEN TREE FINANCIAL SERVICING CORPORATION, Defendants. NOTICE OF ACTION TO: JOHN H, MAURER, FREDDIE MARCHESE and ANNA MARCHESE, individually and as husband and wife, MAUREEN LANDI, SYLVAINR. R OBITAILLE, LAURA J. ION, MARY E. HOL1Z, PENNY J. NEY, PATRICIA A. LEWALL DI- ANA GAIL NEY, CAROLE FRANCIONI, RITA M. PHILLIPS, JOSHUA L HOLAYSAN and GRACE S. HOLAYSAN, Indi- vidually and as husband and wife, ROGER DE VOS, GUNNEL THUNSTROM, INVERNESS PROPERTIES CORP., a Florida corporation. ERNEST SACCO, JOSEPH SACCO. ROSE COHEN, CHARLES SACCO, JOSEPH SACCO, AR- MINIA BELFORT, SADIE PATIENCE, GARY HELSING, a/k/a Gary Holsing, TERRY HARGIS, and GREEN TREE FINAN- CIAL SERVICING CORPORATION, If alive, of If dead, their unknown spouses, widows, widowers, heirs, devi- sees, creditors, grantees, and all parties having or claiming by, through, under or against them, and any and all persons claiming any right, title, Interest, claim. lien, estate or demand against the Defendant In re- gards to the following described property In Citrus County, Florida:; PARCEL 1 LOT(S) 1, BLOCK 429, UNIT 4, CITRUS SPRINGS PARCEL ID# 1290562 PARCEL 2 LOT(S) 20,. BLOCK 490, UNIT 5, CITRUS SPRINGS - PARCEL ID# 1300797 PARCEL 3 LOT(S) 25, BLOCK 490, UNIT 5, CITRUS SPRINGS PARCEL ID# 1300835 PARCEL 4 LOT(S) 24, BLOCK 802, UNIT 7, CITRUS SPRINGS PARCEL ID# 1332991 PARCEL 5 LOT(S) 5, BLOCK 734, UNIT 7, CITRUS SPRINGS PARCEL ID# 1326508 PARCEL 6 LOT(S) 4, BLOCK 808, UNIT 8, CITRUS SPRINGS PARCEL ID# 1341302 PARCEL 7 LOT(S) 8, BLOCK 971, UNIT 16, CITRUS SPRINGS PARCEL ID# 1397031 PARCEL 8 LOT(S) 9, BLOCK 246, UNIT 3, CITRUS SPRINGS PARCEL ID# 1255741 PARCEL 9 LOT(S) 24, BLOCK 12, UNIT I, INVERNESS AC- RES PARCEL ID# 1675774 PARCEL 10 LOT(S) 47, AS DESCRIBED IN OFFICIAL REC- ORD BOOK 368, PAGES 636-637, PLEASURE ACRES PARCEL ID# 1188849 PARCEL 11 LOT(S) 38 & 39, BLOCK A, OF HERNANDO CITY HEIGHTS PARCEL ID# 2023627 Notice Is hereby given to each of you that an action to quiet title to the above described property has been filed against you and you are required to serve your written defenses on Plaintiff's attorney, BILL MCFAR- LAND PA., P.O. BOX 101507. CAPE CORAL FL 33910, and file the original with the Clerk of the Circuit Court, Citrus County, 110 North Apopka Avenue Inverness, Florida 34450 on or before July 8, 2005, or otherwise a default judgment will be entered against you for the relief sought In the Complaint. THIS NOTICE will be published once each week for four consecutive weeks In a newspaper of general circula- tion published In Citrus County, Florida. Dated this 31st day of May, 2005. BETTY STRIFLER Clerk of the Court By: -s- M. A. Michel Deputy Clerk -s- Billy Joe Leon McFariand Attorney for the Plaintiff P.O. Box 101507 Cape Coral, FL 33910 Fla. Bar No. 195103 Published four (4) times in the Citrus County Chronicle, June 8, 15, 22, .and 29, 2005. 510 a Variance request. 2. All persons desiring to be heard, to speak for or against, may be heard. V-05-49 Burrell Engilneerina. Inc. for National Recrea- tional Properties is requesting a Variance from the Cit- rus County Land Development Code (LDC). This re- quest is to allow for the creation of new residential lots outside of the Planned Service Area that do not main- tain a minimum width of 100 feet, pursuant to Section 4653, Minimum Lot Requirements for All Uses, of the LDC. The request is for property lying in: Section 21, Township 20 South, Range 18 East; more specifically, Parcel 11000, Homosassa, Florida, (Homosassa Area). (A complete legal description is on file In the Depart- ment of Development Services Office.) Land Use Des- ignation: MDR, Medium Density *Residential (mobile homes allowed), on the LDC Atlas map. tel- ephone (352) 341-6580. For more Information about this application. please .,:-, j.i D.3 Ii ,-r, .r the Department of De..:.I..,.r,,i . ,:- .i -,c . ,:, Chairman Planning and Development Review Board Citrus County, Florida Published two (2) times In the Citrus County Chronicle, June 21, and 29, 2005. 740-0706 WCRN Notice of Action LaSalle National Bank, etc. Dawn M. Conrad, et al. PUBLIC NOTICE IN THE CIRCUIT COURT IN AND FOR CITRUS COUNTY, FLORIDA CASE NO: 2005-CA-1836, AND ANY AMENDMENTS THERETO Plaintiff, vs. DAWN M. CONRAD; DAVID C. CONRAD; UNKNOWN TENANT I; UNKNOWN TENANT II; JEFF J. HECTOR; SHANE S. MURRAY, and any :.[r- j i r-... r 1- ,D: iming iro r.-. :" :. .: r c., Ir,r:..j .r. na u a.-.r..o ,, .r: II-r, al -,.' T . Defendant " NOTICE OF ACTION TO: .. SHANE S. MURRAY 1067 ALBION STREET NW PALM BAY, FL 32907 OR 1062 GULFPORT ROAD SE PALM BAY, FL 32909 OR 1067 GULFPORT ROAD SE PALM BAY, FL 32909 OR 1074 GULFPORT ROAD SE PALM BAY, FL 32909 OR 1166 RAOUL STREET SE PALM BAY, FL 32909 OR 2679 SAN FILIPPO DRIVE SE PALM BAY, FL 32909 OR 566 SKINNER TERRACE SE PALM BAY, FL 32909 OR 1530 DEPEW STREET SE PALM BAY, FL 32909 OR 331 SE INLARWICK STREET PALM BAY, FL 32909 OR 161 ABALONE ROAD NW PALM BAY, FL 32907 OR 1588 ELMHURST CIRCLE SE PALM BAY, FL 32909 OR 389 EMERSON DRIVE NW PALM BAY, FL 32907 OR 600 BRYANT ROAD SW PALM BAY, FL 32908 OR 1351 GINZALROAD NW PALM BAY, FL 32907 OR 1290 GIRALDA CIRCLE NW PALM BAY, FL 32907 OR 11414 HEALEY STREET NW PALM BAY, FL 32907 OR 1141 LAMPLIGHTER DRIVE NW PALM BAY, FL 32907 OR 1582 LOMBARD STREET NW PALM BAY, FL 32907 OR 634 ALTONA STREET NW PALM BAY, FL 32907 OR 1106 LYNBROOK STREET NW PALM BAY, FL 32907 OR 1838 WADENA STREET NW PALM BAY, FL 32907 LAST KNOWN ADDRESS STATED, CURRENT RESIDENCE UNKNOWN And any unknown heirs, devisees, grantees, creditors and other unknown persons a'Snknown spouses claim- ing by, through and under the above-named Defend- ant(s), if deceased or whose last known addresses are unknown, YOU ARE 1 EREBY NOTIFIED that an action to foreclose Mortgage covering the following real and personal property described as follows, to-wit: LOT 10, BLOCK 171, BEVERLY HILLS UNIT NO. 7, accord- ing to the map or plat thereof, as recorded In Plat Book 12, Pages 101 through 105, Public Records of CItrus County, Florida. has been filed against you and you are required to serve a copy of your written defenses, if any, to it on Elizabeth Shannon Pastras, Butler & Hosch, P.A., 3185 South Conway Road, Suite E, Oriando,- Marcia A. Michel Deputy Clerk Published two (2) times in the Citrus County Chronicle, June 29, and July 6, 2005. B&H #224058 Contact Us | Permissions | Preferences | Technical Aspects | Statistics | Internal | Privacy Policy © 2004 - 2010 University of Florida George A. Smathers Libraries.All rights reserved. Acceptable Use, Copyright, and Disclaimer Statement Last updated October 10, 2010 - - mvs | http://ufdc.ufl.edu/UF00028315/00180 | CC-MAIN-2017-30 | refinedweb | 68,906 | 78.45 |
20 February 2013 00:18 [Source: ICIS news]
HOUSTON (ICIS)--The American Chemistry Council's (ACC) global chemical production regional index (CPRI) for January was up by 3.3% year on year, based on a three-month moving average of regional production, the organisation said on Tuesday.
North American production volume for January was up by 1.0% year on year. The ?xml:namespace>
Latin American production volume was up by 2.4% compared with a year ago, with
Western Europe production volume was down by 0.6% year on year, although The Netherlands (6.6%),
Central and eastern Europe production volume was down by 5.4% compared with the same period last year, with
Production volume in the Asia-Pacific sector for January was up by 7.5% year on year, with
Worldwide chemical production rose by 0.3% in January from December, following a similar gain the month before, the ACC | http://www.icis.com/Articles/2013/02/20/9642530/global-chemical-output-gains-3.3-year-on-year-in-january-acc.html | CC-MAIN-2014-41 | refinedweb | 153 | 58.69 |
...one of the most highly
regarded and expertly designed C++ library projects in the
world. — Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Function float_distance finds the number of gaps/bits/ULP between any two floating-point values. If the significands of floating-point numbers are viewed as integers, then their difference is the number of ULP/gaps/bits different.
#include <boost/math/special_functions/next.hpp>
namespace boost{ namespace math{ template <class FPT> FPT float_distance(FPT a, FPT b); }} // namespaces
Returns the distance between a and b: the result is always a signed integer value (stored in floating-point type FPT) representing the number of distinct representations between a and b.
Note that
float_distance(a, a)always returns 0.
float_distance(float_next(a), a)always returns 1.
float_distance(float_prior(a), a)always returns -1.
The function
float_distance
is equivalent to calculating the number of ULP (Units in the Last Place)
between a and b except that it
returns a signed value indicating whether
a
> b
or not.
If the distance is too great then it may not be able to be represented as an exact integer by type FPT, but in practice this is unlikely to be a issue. | http://www.boost.org/doc/libs/1_50_0/libs/math/doc/sf_and_dist/html/math_toolkit/utils/next_float/float_distance.html | CC-MAIN-2015-06 | refinedweb | 198 | 51.38 |
0
I'm trying to do a program that gets the averages of positive and negative numbers in an array that consists of numbers I have to read from a file.txt. I'm having trouble in how to put the numbers in the file.txt into the array and I can't seem to understand how to find the averages of the positive and negative numbers. I did some of the work and they have to specifically be with functions. My file.txt consists of the numbers: 2 17 -5 0 20 15 -16 -3 -2 14 -1 12 1 -5 -100 15 22 -5 68 -13
Here's my code:
#include <iostream> #include <fstream> using namespace std; void ReadList(int Array[ ], int N) { N = 0; ifstream input("file.txt"); Array [ return; } void Avgs (int Array[], int N, int& Ave, int& aveP, int& AveN) { return; } int Large (int Array[], int N) { int max = 0; int lrgst; Array [] = Array[20]; for (int i = 1; i < 20; i++) if (Array[max] < Array[i]) max = i; lrgst = Array[max]; return lrgst; } void Display(int Array[ ], int N, int Ave, int AveP, int AveN, int Max) { int sum; Array [] = Array[20]; for (int i = 0; i < 20; i++) { sum+=Array[i]; Ave = sum/20; cout << "Average:" << Ave << endl; } for (aveP = 0; aveP < 20; aveP++) { sum+=Array[aveP]; aveP = sum/Array[aveP]; cout << "Average of positive numbers is: " << aveP << endl; } for (aveN = 0; aveN < 20; aveN++ { sum+=Array[aveN]; aveN = sum/Array[aveN]; cout << "Average of negative numbers is: " << aveN << endl; } return; }
Edited 6 Years Ago by WaltP: Added CODE Tags | https://www.daniweb.com/programming/software-development/threads/281035/trouble-with-arrays-and-functions | CC-MAIN-2016-50 | refinedweb | 267 | 56.26 |
In this tutorial, we'll use the ZXing (Zebra Crossing) library to carry out barcode scanning within an Android app. We'll call on the resources in this open source library within our app, retrieving and processing the returned results.
Since we're using the ZXing library, we don't need to worry about users without the barcode scanner installed, because the integration classes provided will take care of this for us. By importing the ZXing integration classes into our app, we can make user scans easier and focus our development efforts on handling the scan results. In a follow-up series coming soon, we'll develop a book scanning app where we'll build on the app we created in this tutorial. We'll also add support for Google Books API so that we can display information about scanned books.
Premium Option: QR-Code & Barcode Reader
If you're looking for a shortcut, you can find some ready-made QR code and barcode readers for Android apps at Envato Market.
For example, QR-Code & Barcode Reader uses the camera of a mobile device to read barcodes and QR codes.
The program automatically recognises the type of encoded data, providing a nice preview and various sharing options. It will add a new contact if the QR code is a business card, or it will send an SMS or call someone depending on the encoded data. Search engine selection is ideal for online product search, price and review comparison.
Automation features like bulk scan mode or auto action open wide opportunities for enterprise integration. The project compilation requires the zBar open-source barcode scanning library, which claims to be the fastest among others available on market and is included here.
You can search Envato Market for other options to help you, or get an Android app developed on Envato Studio. Otherwise, read on for the full step-by-step instructions for creating a barcode reader yourself.
1. Create a New Android Project
Step 1
In Eclipse, create a new Android project. Enter your chosen application, project, and package names. Let Eclipse create a blank activity for you, with the name of your choice for both the activity and its layout.
Step 2
Open your main layout file. With the default settings, Eclipse starts your layout with a Relative Layout object, which you can leave as is. Inside of it, replace the existing content (typically a Text View) with a button.
<RelativeLayout xmlns: <Button android: </RelativeLayout>
After the button, add two Text Views in which we will output scanning information.
" />
Add the button text string to your "res/values/strings" XML file.
<string name="scan">Scan</string>
The user will press the button to scan. When the app receives a result from the barcode scanning operation, it will display the scan content data and format name in the two Text Views.
2. Add ZXing to Your Project
Step 1
ZXing is an open source library that provides access to tested and functional barcode scanning on Android. Many users will already have the app installed on their devices, so you can simply launch the scanning Intents and retrieve the results. In this tutorial we are going to use the Scanning via Intent method to make scanning easier. This method involves importing a couple of classes into your app and lets ZXing take care of instances where the user does not have the scanner installed. If the user doesn't have the barcode scanner installed, they'll be prompted to download it.
Tip: Since ZXing is open source, you can import the source code into your projects in its entirety. However, this is really only advisable if you need to make changes to its functionality. You can also compile the project and include its JAR file in your own apps if you prefer. For most purposes, using Scanning via Intent is a reliable and easy to implement options, plus your users will have access to the most recent version of the ZXing app.
In Eclipse, add a new package to your project by right-clicking the "src" folder and choosing "New", then "Package", and entering "com.google.zxing.integration.android" as the package name.
Step 2
Eclipse offers several ways to import existing code into your projects. For the purposes of this tutorial, you'll probably find it easiest to simply create the two required classes and copy the code from ZXing. Right-click your new package, choose "New" then "Class" and enter "IntentIntegrator" as the class name. You can leave the other default settings the way they are. Once you've created this class, do the same for the other class we'll be importing, giving it "IntentResult" as its class name.
Copy the code from both classes in the ZXing library and paste it into the class files you created. These are IntentIntegrator and IntentResult. Refer to the source code download if you're in any doubt about where the various files and folders should be or what should be in them.
You can now import the ZXing classes into your main Activity class.
import com.google.zxing.integration.android.IntentIntegrator; import com.google.zxing.integration.android.IntentResult;
Go ahead and add the other import statements we'll use for this tutorial. Bear in mind that Eclipse may have already added some for you.
import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.widget.Toast;
Feel free to have a look at the content of the two ZXing classes. It's fairly straightforward, but the details of the barcode scanning processing are carried out elsewhere in the library. These two classes really act as an interface to the scanning functionality.
3. Do Some Scanning
Step 1
Let's implement scanning when the user clicks the button we added. In your app's main activity class, the default onCreate method entered by Eclipse should look something like this.
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }
Above this method, add the following instance variables to represent the button and two Text Views we created in the layout file.
private Button scanBtn; private TextView formatTxt, contentTxt;
In onCreate, after the existing code, instantiate these variables using the ID values we specified in the XML.
scanBtn = (Button)findViewById(R.id.scan_button); formatTxt = (TextView)findViewById(R.id.scan_format); contentTxt = (TextView)findViewById(R.id.scan_content);
Next, add a listener to the button so that we can handle presses.
scanBtn.setOnClickListener(this);
Extend the opening line of the class declaration to implement the OnClickListener interface.
public class MainActivity extends Activity implements OnClickListener
Step 2
Now we can respond to button clicks by starting the scanning process. Add an onClick method to your activity class.
public void onClick(View v){ //respond to clicks }
Check whether the scanning button has been pressed inside this method.
if(v.getId()==R.id.scan_button){ //scan }
Inside this conditional block, create an instance of the Intent Integrator class we imported.
IntentIntegrator scanIntegrator = new IntentIntegrator(this);
Now we can call on the Intent Integrator method to start scanning.
scanIntegrator.initiateScan();
At this point, the scanner will start if it's installed on the user's device. If not, they'll be prompted to download it. The results of the scan will be returned to the main activity where scanning was initiated, so we'll be able to retrieve it in the onActivityResult method.
Tip: When you call the initiateScan method, you can choose to pass a collection of the barcode types you want to scan. By default, the method will scan for all supported types. These include UPC-A, UPC-E, EAN-8, EAN-13, QR Code, RSS-14, RSS Expanded, Data Matrix, Aztec, PDF 417, Codabar, ITF, Codes 39, 93, and 128. The ZXing library also includes barcode scanning options that we're not going to cover in this tutorial. You can check the project out at Google Code for more info.
4. Retrieve Scanning Results
Step 1
When the user clicks the scan button, the barcode scanner will launch. When they scan a barcode, it will return the scanned data to the onActivityResult method of the calling activity. Add the method to your main activity class.
public void onActivityResult(int requestCode, int resultCode, Intent intent) { //retrieve scan result }
Inside the method, try to parse the result into an instance of the ZXing Intent Result class we imported.
IntentResult scanningResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
Step 2
As with any data being retrieved from another app, it's vital to check for null values. Only proceed if we have a valid result.
if (scanningResult != null) { //we have a result }
If scan data is not received (for example, if the user cancels the scan by pressing the back button), we can simply output a message.
else{ Toast toast = Toast.makeText(getApplicationContext(), "No scan data received!", Toast.LENGTH_SHORT); toast.show(); }
Back in the if block, let's find out what data the scan returned. The Intent Result object provides methods to retrieve the content of the scan and the format of the data returned from it. Retrieve the content as a string value.
String scanContent = scanningResult.getContents();
Retrieve the format name, also as a string.
String scanFormat = scanningResult.getFormatName();
Step 3
Now your program has the format and content of the scanned data, so you can do whatever you want with it. For the purpose of this tutorial, we'll just write the values to the Text Views in our layout.
formatTxt.setText("FORMAT: " + scanFormat); contentTxt.setText("CONTENT: " + scanContent);
Run your app on a device instead of an emulator so that you can see the scan functioning. Try scanning a book or any other barcode you might have.
Conclusion
In this tutorial, we've run through the process of facilitating barcode scanning within Android apps using the ZXing library. In your own apps, you might want to carry out further processing on the retrieved scan results, such as loading URLs or looking the data up in a third party data source..
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post
| https://code.tutsplus.com/tutorials/android-sdk-create-a-barcode-reader--mobile-17162 | CC-MAIN-2019-35 | refinedweb | 1,711 | 56.05 |
(3)
Abhishek Arora(3)
Prerana Tiwari(3)
Mahender Pal(2)
Deepak Kaushik(2)
El Mahdi Archane(2)
Santosh Kumar Adidawarpu(2)
Mushtaq M A(2))
Ajay Yadav(2)
Maulik Kansara(1)
Archana Saini(1)
Sunday Aregbesola(1)
Sabarish Natarajan(1)
Gowtham K(1)
Dhruvin Shah(1)
Mahesh Chand(1)
Madhan Raghu(1)
Vishwakarma Vijay(1)
Sriram Hariharan(1)
Tapan Patel(1)
Arvind Kataria(1)
Suketu Nayak(1)
Rathrola)
Vincent Maverick Durano(1)
Harpreet Singh(1)
Rakesh (1)
Muhammad Hassan (1)
Anoop Kumar Sharma(1)
Gul Md Ershad(1)
Rahul Saxena(1)
Ismail Hakki Sen(1)
Sean Oliver(1)
Destin joy(1)
Abhishek Jaiswal (1)
Vishal Gilbile(1)
Ravi Shekhar(1)
Abhay Shanker(1)
Resources
No resource found
Using Business Rule For Data Import Validation
Apr 16, 2018.
In this article, we will learn how to use Business Rule for Data Import .
Use INotifyPropertyChanged Interface In WPF MVVM
Mar 20, 2018.
INotifyPropertyChanged is an interface member in System.ComponentModel Namespace. This interface is used to notify the Control that property value has changed..
Getting Started With Azure Service Bus
Dec 26, 2017.
From this article you will learn an overview of Azure service bus and ow to create an Azure service bus namespace using the Azure portal.
Migrate From TFS To VSTS
Nov 21, 2017.
Migrate from TFS to Team Services with the TFS Database Import Service..
Azure Service Bus - Peek-Lock A Message From Queue Using Azure Logic Apps
Oct 26, 2017.
In this article, we will take a look at how you can peek-lock on a message from a Service Bus Queue without actually reading the message from the queue. Migrate Your On-Premises / Enterprise Data Warehouse Into Azure SQL Data Warehouse
Sep 21, 2017.
I will share how you can start migrating your data into the Azure SQL Data Warehouse
SharePoint 2013 - On Premises - Powershell Script To Import Termsets On Given Site From .csv File In Specific Folder
Sep 10, 2017.
In this article I’ll explain how to import multiple termsets using .CSV file from one specific folder..
Import Data Module To Import Data In Azure Machine Learning Studio
Jun 14, 2017.
Import Data Module To Import Data In Azure Machine Learning Studio.
Revisiting Concepts Of JavaScript For SharePoint / Office 365 Developer - JavaScript Namespaces - Part Two
May 31, 2017.
Revisiting concepts of JavaScript for SharePoint/ Office 365 developer - JavaScript Namespaces.
Import Data From Excel To DB Using AngularJS And Web API 2
Mar 26, 2017.
In this article, you will get to know about how to import data from Excel to DB, using AngularJS and Web API 2..
How To Enhance, Edit, And See All Your Photos With Microsoft Photos App In Windows 10
Dec 26, 2016.
In this article, you’ll learn how to enhance or edit, and see all your photos and imported pictures with the Microsoft Photos App in Windows 10..
Static as Namespace in C# 6.0
Aug 16, 2015.
This article explains the new feature in C# 6.0 called Use of static as namespace in C# 6.0..
Understanding Namespaces in C#
Jun 17, 2015.
In this article you will learn about Namespace in C# language.
SharePoint 2013: Exporting and Importing Search Settings
May 24, 2015.
In this article I will explain exporting and importing search configuration settings..
List in C#
Feb 25, 2015.
In this article we will learn about another generic class present in the System.Collection.Generic namespace, List<T>...
MSIL Programming: Part 2
Nov 16, 2014.
The primary goal of this article is to exhibit the mechanism of defining (syntax and semantics) the entire typical Object Oriented Programming “terms” like namespace, interface, fields, class and so).
URL Routing in MVC4
Aug 07, 2014.
We’ll try to demonstrate how the routing works in a MVC4 application. For this we’ll take an example..
About Import-namespace | https://www.c-sharpcorner.com/tags/Import-namespace | CC-MAIN-2018-17 | refinedweb | 640 | 64.91 |
User authentication and authorization is performed by JEA using the JSON Web Tokens (JWT) mechanism. If the client does not yet hold a valid JWT, the Log-on operation must be called to retrieve one. Without a valid JWT, all other transactions will be rejected with HTTP 401 Unauthorized error code.
The user's credential to be sent to the JEA server include the registered email address and the password.
Content-Typeto
application/json", "email": "[email protected]" }
{ "ok": false, "status": "No matching username and password pair was found!" }
Send the check-in command using curl:
curl -H 'Content-Type: application/json' -X POST -d '{"email": "[email protected]", "password": "********"}'
If logged on successfully, an Auth return object with 'OK' status will be received with a new JWT. If the user's email address and the password do not match any record on the server, an Auth Failed object will be returned.
Make sure Requests is correctly installed in your Python environment, and run the following the lines:
import requests headers = {'Content-Type': 'application/json'} body = {"email": "[email protected]", "password": "********"} r = requests.post('', headers=headers, json=body) r.json(), 'status': 'Logged in successfully!', 'user': 'Yi'}
You can then access each field, e.g. the new JWT, using
r.json()['jwt']. | http://www.jeplus.org/wiki/doku.php?id=docs:jea:log_on | CC-MAIN-2020-10 | refinedweb | 211 | 58.79 |
advancedxy + 3 comments
Hi, I don't know whether this is the good place for this question. But I hope I can get some help here.
My first solution for swap even characters in string is below.
def swapString(s:String):String = s match { case "" => "" case _ => s.take(2).reverse + swapString(s drop 2) }
The code results a runtime error for a very long String.
Second attemp:
def swapString(s:String):String = { def swapHelper(acc:String, remain:String):String = remain match { case "" => acc case _ => swapHelper(acc + remain.take(2).reverse, remain.drop(2)) } swapHelper("", s) }
Try to make the tailrec optimization. Time Out
Third attemp:
def swapString(s:String):String = { def swapHelper(acc:List[Char], remain:List[Char]):List[Char] = remain match { case Nil => acc case x :: y :: rest => swapHelper(acc ++ List(y,x), rest) } swapHelper(List(), s.toList).mkString("") }
I thought String.take, String.reverse and String.drop is expensive. And I am aware of string concatenation is a very bad idea. So, I convert String to List. However I still want to make the tailrec optimization. Well this may have to use list concatentation which is also time comsuming. Time out
The pass temp:
def swapString(s:String):String = { def swapHelper(string:List[Char]):List[Char] = string match { case Nil => Nil case x::Nil => List(x) case x :: y :: rest => y :: x :: swapHelper(rest) } swapHelper(s.toList).mkString("") }
I know List append head is O(1). So, throw away the tailrec optimization. And It finally passed. However I don't think this temp is optimal. It will still invole a lot of function calls for very long string.
My questions:
1. scala data structure choosing. How can I choose the best ds? is There any refrences for the internals of scala data structures. 2. For this problem. I really don't like the idea of convert string to list, compute, then covert list back to string. is there any other smarter ways? And tailrec optimizaition! 3. This kind of in-place replace problem is perfect for mutable arrays. can functional programming get a comparable performace (time and space) for this kind of problem?
kitty_codez + 0 comments
I am having the same problem, and keep running into timeout issues with scala on several of these intro problems when doing the absolute simplest and even following the Editorial solution. I think the tests are too harsh on Scala for these if the basic solution for Scala is not going to work, these intro problems should not need such advanced optimizations!
abhiranjanChallenge Author + 0 comments
Reply to @ advancedxy:
- Normal string is java.lang.String. So whenever you append a character in a string of length N, it creates a new string, copy first string and add second character. It is of O(N). Better alternative is StringBuilder, but that will result into non-functional code. You may find some articles at SO also.
- It is the expected solution. String to list of char. Yes tailrec optimization can be done. Try to figure it out. (Hint: You need
reversefunction also).
- That's other way to solve this problem, but not expected one. It will be user's loss if he went for it. Primary goal of this contest/challenge is to lean how to solve problems functionaly.
@ Kitty_codez: (First let me present to you my previous kitty)
.
This problem doesn't use any advance DS. They use simple lists :)
PS: I am not that knowledgeable of scala. Reply was from the perspective of general FP principles.
advancedxy + 0 comments
@ abhiranjan thanks for yout tip. I figured it out for tailrec optimization. I didn't think it over.
marianomacchi + 0 comments
In clojure, using lazy sequences:
(let [testcases (Integer/parseInt (read-line))] (loop [n testcases] (let [input-str (read-line)] (println (apply str (map str (take-nth 2 (subs input-str 1)) (take-nth 2 input-str))))) (if (> n 0) (recur (- n 1)))))
abraham_alcaina + 0 comments
Haskell:
reversePairLetters :: String -> String reversePairLetters [] = [] reversePairLetters [x] = [x] reversePairLetters (x:y:xs) = y:x:reversePairLetters xs testCases :: Int -> IO () testCases 0 = return () testCases n = do str <- getLine :: IO String putStrLn $ reversePairLetters str testCases (n-1) main :: IO () main = do x <- readLn :: IO Int testCases x
Tirex + 1 comment
Can someone give any hint about test 5? Tried about 5-6 different variants on clojure. And all terminated by timeout.
hindol + 0 comments
Don't create too many intermedite string objects. That is the key. The below solution passes all test cases.
(require '[clojure.string :as str]) (defn indices [] (reductions + 1 (cycle [-1 3]))) (defn permute [s] (let [n (count s)] (str/join (map #(nth s %) (take n (indices)))))) (let [input (slurp *in*) [q & strings] (str/split-lines input)] (doseq [s strings] (println (permute s))))
abratashov + 0 comments
Elixir solution of the "String-o-Permute"
defmodule Solution do def permutate(string) do string |> String.codepoints |> Enum.chunk_every(2) |> Enum.map(fn [x, y] -> [y, x] end) |> List.flatten |> Enum.join end def main do IO.read(:stdio, :all) |> String.split("\n") |> Enum.drop(1) |> Enum.map(&permutate(&1)) |> Enum.join("\n") |> IO.puts end end Solution.main
Sort 37 Discussions, By:
Please Login in order to post a comment | https://www.hackerrank.com/challenges/string-o-permute/forum | CC-MAIN-2018-51 | refinedweb | 863 | 68.16 |
Hello,
Uhm I just started to learn C (It is very fun and challenging) however i have one little question. I cant think of a reason to why the function "printf" is posting 2 times?
Here is the code:
I know its very basic (just started learning today). Also if you dont mind answering 2 more little questions, please do.I know its very basic (just started learning today). Also if you dont mind answering 2 more little questions, please do.Code:
#include <stdio.h>
int main()
{
int x;
int y;
int v;
int c;
printf( "Please input a value to test the value of X. {Y = ___ + ( x - 4 )}: " );
scanf( "%d", &v );
x = 13; y = v + ( x - 4 );
do {
printf( "Your answer is: %d\n", y);
getchar();
} while (c != 13 ); /* Not actually sure how to use.... explain please? */
}
1) I could use "for" instead of "do" right? Whenever I do, i cannot get it to work correctly like i can with "do" however i dont know how to use the "while" function, and i cant find a way to leave that out.
2) Could I use the "while" function to return to the top, to redo the equation if the value returns false, and if true, use printf to say "correct" or whatever? Would that be efficent? Is there another way to do the exact same thing?
Here is a guess I made towards this?Code:
int c; /* this is the int value ill assign at the beggining, just included so you know that i declared C as a intiger */
printf( "What is your guess for the value of X?: "
scanf( "%d", &c ) }
if ( c = 13 ) {
printf( "Your Correct!\n" ); }
else {
printf( "Please Try Again, Your Incorrect!" ); /* how would i tell it to return to the top if incorrect? */
} while (c != 13 ); /* Not actually sure how to use.... explain please? I need to tell this to return false, then make it return to the top? Is there a more efficent way? */
getchar();
}
Thanks for reading,
hopefully im not breaking any rules?
~Nerix | http://cboard.cprogramming.com/c-programming/103812-very-basic-double-posting-printable-thread.html | CC-MAIN-2015-35 | refinedweb | 343 | 82.65 |
Django
Django Shell
Using the Django Shell
The django shell is similar to the python shell and lets you test out pieces of code in the interpreter.
The django shell just loads django and all your models and settings as well.
Opening the shell
python manage.py shell
Working with models
Import the model
from App.models import ModelName
Get all records
ModelName.objects.all()
This returns an empty queryset:
[]
It looks like a list but is really a queryset
type(ModelName.objects.all())
Create a new Model
# Create model and set fields m = ModelName() m.title = “Setting Title” m.description = “The Description” m.save()
Can also be done in a single step
ModelName(title=”Setting Title”, description=”The Description”).save()
But you can do this in a single step and return the saved instance (object)
m = ModelName.objects.create(title=”Set Another Title”, description=”hello”) | https://fixes.co.za/django/django-shell/ | CC-MAIN-2019-30 | refinedweb | 146 | 52.26 |
Agenda
See also: IRC log
<DanC> Scribe: DaveB
<_> 26 July agenda
<DanC> 19 July minutes
accepted minutes
Next meeting: next week, chair: DanC, scribe: AndyS
actions in section one of the agenda:
<_> ACTION: EricP clarify which regex lang [DONE] [recorded in]
<_> ACTION: PatH to review new optionals definitions, if any. [DONE] [recorded in]
<_> ACTION: DanC to check after August on SteveH regarding test preparation for publication as WG Note [CONTINUED] [recorded in]
<_> ACTION: DanC to follow up re optional test based on op:dateTime triple [CONTINUED] [recorded in]
<_> ACTION: DaveB to to propose source test to approve [CONTINUED] [recorded in]
<_> ACTION: EricP to finish extendedType-eq-pass-result.n3 [CONTINUED] [recorded in]
<_> ACTION: SteveH to review the relevant test case re: IRI normalization ref [CONTINUED] [recorded in]
<_> ACTION: AndyS to add the above graph test cases (analagous to valueTesting test cases) (don't expect quick delivery) ref [CONTINUED] [recorded in]
comment from july 2004
ref to
<_> IANA mime type registration for "application/sparql-results+xml"
<kendall> is ".srf" better?
<DanC> AndyS: seems OK, though I found one conflict with ".srq"
<kendall> where "better" == "no conflicts"
<kendall> I'm a little bit leery of this conflict w/ some sql systems, but it's not a big deal.
<DanC> (I was thinking .sqr )
<db-scr> Souri arrivesi
<db-scr> DanC - add it to the result draft and get reviewers
<DanC> Scribe: EricP
<scribe> ACTION: DaveB to add mime type to results format [recorded in]
<AndyS> A Google search for filetype:sqr gave no returns
<scribe> ACTION: EliasT to review XML Results mime-type registration [recorded in]
<scribe> ACTION: DanC to review XML Results mime-type registration [recorded in]
<DaveB> it's only 134 words...
<DaveB> lines
<JosD> found and should mean "Unprocessed Microsoft Server Request"
<DanC> 4ish
straw poll: who wants to resolve XML Results mime-type today?
0 want to delay
PROPOSED: that (delegating choice of file extension to the editor) addresses issue resultsMimeType, contingent on review by Elias
RESOLVED, OBJECTIONS: 0, ABSENTIONS: 0
<Zakim> DanC, you wanted to note impact on protocol examples
<DanC> ACTION: KendallC to update protocol spec w.r.t. results mime type [recorded in]
<DanC> How about changing sparqlResults to
<DanC>
<DaveB> cvs 1.45 of rf1 now has mime type section 5
<kendall> I prefer dash to camel case, but don't care about the month droppage.
DanC: Bjoern: '-' separated
namespaces are easier for javascript coders than camel case.
... ... also '-' separated namespaces are more consistent with other W3C namespaces
7-ish prefer '-'
<DanC> PROPOSED: to change the namespace name to (and update rf1 and rq23)
OBJECTIONS: 0
ABSENTIONS: 0
RESOLVED
<kendall> ACTION: KendallC to Check whether the results namespace is in protocol draft; if so, update. [recorded in]
<scribe> ACTION: AndyS to fix rq23 to reflect new results namespace [recorded in]
<scribe> ACTION: EricP to ask for namespace approval and put a document there [recorded in]
<DanC> ACTION: DaveB to update rf1 with new namespace [recorded in]
<DanC> resolution is contingent on director's approval
<DaveB> rf1 cvs 1.46 now has the new namespace
EliasT: atom [#-]-less namespace is ugly when concatonated
DanC: i know of no intention to use with RDF
<DanC> (in irc, who prefers ? )
<kendall> i prefer # to bare "sparql-results"
who prefers a hash?: 3 or 4
who's prefers none?: 0
<DanC> PROPOSED: to change the namespace name to (and update rf1 and rq23)
<DanC> RESOLVED, JeenB abstaining
ABSTENTIONS: jeen
<scribe> ACTION: DaveB integrate advice on ordered and distinct and propose last call candidate for results set spec [DONE] [recorded in]
<_> ACTION: LeeF, SteveH and Jeen to review XML results set format [DONE] [recorded in]
<_> Jeen's review
<_> Lee's review
<_> Steve's review, "Modulo Lee's outstanding points, its fine."
DanC: DaveB has integrated ordering and limits
LeeF: i *think* all outstanding points have been addressed
DanC: I imagine a test case with an attribute from a randing namespace
DaveB: text says "this element here, and there are these attribtutes there" but the schemas could be normative (striking the caveat "these are informative " sentence)
<DanC> "Normativeness of the XML schemas. Pick one?"
<kendall> (I'm planning to use the RelaxNG one in my web framework to validate XML stored in a db...FWIW)
<LeeF> similarly, we have as of yet uncoded plans that will likely use the XML schema
DanC: who wants to make the XSD schema normative?
around 6
<DanC> PROPOSED: to note that the .xsd is derived from the .rng (and therefore, as far as we know, they mean the same thing) and make them both normative
<howardk> daveb: did you get my original email posted to the group?
<DanC> so RESOLVED
DanC: is there a term for "SPARQL Results Format document"?
<kendall> "serialized result set"?
DaveB: could add to section 1 or 2
<DanC> "sparql results document"
<DanC> ACTION: DaveB to choose a term [for "sparql results document"] and define it [recorded in]
<kendall> I'm happy following Dave's lead here.
<kendall> ACTION: KendallC to use Dave's name for a results set doc in the protocol draft... [recorded in]
DanC: i can now test an instance with
a schema validator
... i can now test an instance with a schema validator
... yes or no, take the XML Results Format + actioned cahnges to last call
... LC to end at the same time as SPARQL Query
all are happy with it
<DanC> PROPOSED: to take v1.46 + edits per actions today (plus SOTD) to last call.
<DanC> RESOLVED. Action EricP
<DanC> critical path people are: Dave, DanC, EliasT, EricP
<scribe> ACTION: ericP to publish rf1 [recorded in]
kendall: worried about optimizing for one particular tool (Axis)
AndyS: have eliminated all Axis-isms
<DanC> ACTION: KendallC to add POST binding to protocol doc [recorded in]
kendall: post binding is number one on my protocol doc list
<DanC> ("'patch' is invoved making the xsd from relaxng..."? hmm.)
<DanC> ACTION: KendallC to consider flattening rdf-dataset a la [recorded in]
kendall: I added rdf-dataset only to mirror the prose
<EliasT> re: xsd/relaxng patch. Does it matter if both are independently normative?
<kendall> AndyS: Sorry to have not ACK'd publicly on that message. It's useful, I just lost track of it.
<DanC> ACTION: DanC to investigate having CVS commits send to the WG list [CONTINUED] [recorded in]
<scribe> ACTION: DanC to write SOTD; work with EricP to publish [DONE] [recorded in]
<DanC> SPARQL Query Last Call
<AndyS> Kendall - no problem
DanC: I asked sysreq to do it. they said "done". i haven't seen it work
<kendall> AndyS: yr point 2/ is also on my TODO list already, so ACK that. I'll think about 3/ & 4/
DanC: we now have 4 open issues (from the comments)
<kendall> (My only comment about 5/ is that I wish we had xml serialization of queries so we could POST *that*, but -shrug-)
<AndyS> Err - that's different - I'm asking for a POST HTML form
DanC: editorial comments included ref to ABNF
<DanC> ACTION: DaveB respond to "sparqlResults namespace" comment , after rq23 is updated [recorded in]
DanC: we owe Bjoern an "are you happy?" response
<kendall> AndyS: well, yes, gotcha. We have to POST something, and the only thing we can post now, since it's the only thing we have predefined, is application/x-www-form-urlencoded.
<DanC> I'm noodling on distinguishing "are you happy?" responses
DanC later suggested the prefix [OK?], [CLOSED] indicates an ack to an "are you satisfied" ack
DanC: WG members are welcome to act
on any comment by proposing text to the editor via the WG
... some prefix will indicate a request to close
<AndyS> I just want an HTML forms interface!
<kendall> i don't want one. i guess i was suggesting that if we define a way to post stuff, people can do that from HTML forms or from some kind of automated client. i care about the latter, you care about the former. i don't see a problem?
<AndyS> Quite hard to POST XML from HTML forms :-) without javascript.
<LeeF> So, application/x-www-form-urlencoded.is fine then, right, AndyS?
<LeeF> I don't think the two of you are disagreeing.
<kendall> i was explicitly agreeing, actually. i guess not explicit enough.
<AndyS> LeeF : yes
<AndyS> Thought you were wanting XML in plain HTTP.
<kendall> nope. (well, yes, i said i do want that, but then I said application/x-www-form-urlencoded was good enough for now. :>)
[DanC summarizes]
AndyS: I use java.net.uri . i don't think it does normalization.
<DanC> PROPOSED: to add clarify SPARQL QL spec about base IRI normalization and add tests as per
RESOLVED, OBJECTIONS: 0, ABSTENTIONS: 0
<scribe> ACTION: ericP to add "don't normalize" to rq23 (perhaps supplied in 0096) [recorded in]
<scribe> ACTION: ericP to send [OK?] message to Bjoern [recorded in]
<DanC> Bjoern Hoehrmann
<scribe> ACTION: EricP to add test in 0096 to rq23 tests. label "approved" and ref this meeting record. [recorded in]
<DanC>
<DanC> "application/sparql"
<kendall> My only concern here is making it possible in the future to have an XML serialization of SPARQL queries. Err, I mean, not making it not possible.
<AndyS> text/ ?
<DanC> mime.txt,v 1.2 2005/07/25 15:41:27
<AndyS> UTF-8 vs UTF-16?
<DaveB> no, not text/
<DaveB> then you *do* get into charset issues
<kendall> (Hmm, I guess my concern is moot, thinking about it some more.)
<kendall> I'd prefer "application/sparql-query" to "application/sparql", I think. More specific, more clear.
<kendall> Also symmetric with "sparql-results"
<LeeF> +1 kendall's suggestion
<howardk> +1 as well
<EliasT> +1
<EliasT> file extension? .sq?
<EliasT> as opposed to ".rq"
-> application/sparql-query mime-type registration
<kendall> ACTION: KendallC to add security considerations section to proto draft, under 4. Policy... [recorded in]
mime.txt updated, @@'s added
<kendall> Is ".rq" the conventional extension for RDQL queries?
<LeeF> rq = "RDF query" presumably?
<scribe> ACTION: ericP to update rq23 to include the text of rq23/mime.txt reflect security concearns [recorded in]
<AndyS> We use that in the test suite
<kendall> cool; just wondering
<DaveB> yes all our tests are .rq
<AndyS> It's not in obvious use elsewhere (strangely)
<kendall> i find it a tiny bit confusing, but not a big deal.
<DanC> "SPARQL defines a set of functions & operations (sections 11.1 and 11.2) that all implementations must provide."
<kendall> +1 to DanC's point
<kendall> though I'd slice up the core differently, I think. I don't want to be required to implement all those Fs&Os to be a sparql processor. Am I the only one?
<DanC> DanC: as I wrote earlier, I prefer not to refer to "implementations" at all in the QL spec; I prefer to specify languages, e.g. Core Sparql and extended sparql
11.2.4 Extensible Value Testing
kendall: I don't want to have to implement all (for instance, dates)
<kendall> I *may* just be pointlessly whining here!
kendall: of the functions and
operators
... i'd like the core to be smaller
<DanC> AndyS: if dates are not core, < might not work on them
<AndyS> Integers are harder than dates!
<kendall> but i have clients for integers :>
<howardk> serious andy?
Kendall: dates and strings probably aren't that much work. don't want to make a big deal of it.
<jeen> as a data point: we recently received a code contribution in Sesame for supporting dates. it took the coder about a week to implement (that is, including getting familiar with the sesame code base).
<AndyS> Type promotion needs to be done. 1.5 > 2^^xsd:byte
<DanC> FILTER func:even(?id)
<DanC> 11.2.4 Extensible Value Testing
<AndyS> I used the Xerces code (via Dave Reynolds wrappers) for date comparision, If you have a library, its easy, if not, it is long.
<howardk> right
<AndyS> (I was picky and wanted timezone to be preserved - that was my value add - Xerces turns all to Z)
<kendall> or if you have a library and there is semantic mismatch, but -shrug-
<DanC> bug: (section 11.3)
<DanC> " there is an extension mechanism (section 11.3)"
<DanC> (I recommend you use XSLT to make/check your xrefs)
<kendall> it's pretty much 90 minutes, FYI
<DanC> ACTION EricP/Andy: revise rq23 to remove reference to implementations/engines (e.g. 3.3 Value Constraints -- Definition )
<DaveB> the rf1 abstract also uses impl
<DaveB> uhoh, I gotta go rsn
<DanC> ADJOURN.
<kendall> thx
<DaveB> seems .srx isn't used according to filext.com
<DaveB> or file-ext.com
<DanC> (looking at ) | http://www.w3.org/2005/07/26-dawg-minutes | CC-MAIN-2016-50 | refinedweb | 2,119 | 69.82 |
IRC log of emotion on 2008-07-03
Timestamps are in UTC.
13:54:13 [RRSAgent]
RRSAgent has joined #emotion
13:54:13 [RRSAgent]
logging to
13:54:19 [marc]
zakim, this will be INC_EMOXG
13:54:20 [Zakim]
ok, marc; I see INC_EMOXG()10:00AM scheduled to start in 6 minutes
13:54:44 [Felix]
Felix has joined #emotion
13:54:59 [marc]
agenda+ Discuss first suggestions for specification of Requirement Core 2: Emotion categories
13:55:21 [marc]
agenda+ Date of next meeting
13:56:55 [Zakim]
INC_EMOXG()10:00AM has now started
13:57:03 [Zakim]
+ +49.381.402.aaaa
13:57:05 [Zakim]
+??P4
13:57:34 [Zakim]
+??P5
13:58:02 [Ian]
Marc I can only participate peripherally today
13:58:07 [Idoia]
Idoia has joined #emotion
13:58:12 [Ian]
I am listening on the phone
13:58:19 [Ian]
but I have no speech
13:58:21 [Zakim]
+ +49.892.892.aabb
13:58:29 [marc]
zakim, who is talking?
13:58:39 [Zakim]
marc, listening for 10 seconds I heard sound from the following: +49.381.402.aaaa (19%), ??P5 (90%), +49.892.892.aabb (29%)
13:58:54 [marc]
zakim, I am ??P5
13:58:54 [Zakim]
+marc; got it
13:58:58 [Idoia]
hello
13:59:11 [Christian]
zakim, i am aaaa
13:59:11 [Zakim]
+Christian; got it
13:59:25 [Ian]
right
13:59:27 [Ian]
no mic
13:59:41 [Ian]
I am also in another meeting too
13:59:46 [Zakim]
+??P11
13:59:56 [Bjoern]
zakim, I am aabb
13:59:58 [Zakim]
+Bjoern; got it
13:59:58 [Ian]
zakim I am aabb
14:00:02 [marc]
zakim, ??P11 is Jianhua
14:00:05 [Ian]
oops
14:00:06 [Zakim]
+Jianhua; got it
14:00:12 [Ian]
who am i then?
14:00:19 [Zakim]
+Felix_Burkhardt
14:00:24 [Ian]
zakim i am P4
14:00:36 [marc]
zakim, ??P4 is Ian
14:00:36 [Zakim]
+Ian; got it
14:00:39 [Ian]
thanks
14:00:54 [Felix]
zakim i am Felix_Burkhardt
14:01:10 [marc]
Idoia, can you join on the phone?
14:01:18 [Felix]
zakim, i am Felix_Burkhardt
14:01:19 [Zakim]
ok, Felix, I now associate you with Felix_Burkhardt
14:01:35 [Ian]
she was here earlier
14:02:12 [marc]
ScribeNick: Bjoern
14:02:24 [Idoia]
here we are Nestor and Idoia and we are joining on the phone just now
14:02:43 [marc]
ok we'll wait for a moment
14:03:00 [marc]
next item
14:03:25 [marc]
14:04:48 [Bjoern]
Marc introduces the agenda and asks for other suggestions
14:05:01 [Christian]
Christian has joined #emotion
14:05:03 [Bjoern]
No other suggestions are added.
14:05:27 [marc]
1. First we stated that the simplest form, as used in EARL [2] so far (flat and implicit):
14:05:27 [marc]
14:05:27 [marc]
<emotion category="pleasure"/>
14:05:27 [marc]
has the charm of simplicity, but it has disadvantages:
14:05:27 [marc]
- the markup gives no hint regarding the set of categories to use
14:05:28 [marc]
- if you want to add meta-information (e.g., Meta 1: Confidence) specifically to the category, that is not straightforward to do.
14:07:11 [Bjoern]
Marc discusses issue 1 from the mail of Felix.
14:07:20 [Bjoern]
This is uncontroversial by all.
14:07:25 [marc]
2. An alternative would be
14:07:26 [marc]
<emotion>
14:07:26 [marc]
<category>pleasure</category>
14:07:26 [marc]
</emotion>
14:07:26 [marc]
but the usage of plain text in elements (vs. attributes) is to be avoided because our ML will certainly be used in conjunction with text processing steps and we certainly wouldn't want to be left with the " pleasure " string when all markup gets removed.
14:08:32 [Zakim]
+Myriam_Arrue
14:08:44 [Bjoern]
This item too is uncontroversial.
14:10:30 [marc]
3. We than thought about ways for making it explicit which set of categories is used and came up with three different ideas:
14:10:30 [marc]
3a. Category sets as the name of the element, e.g.:
14:10:31 [marc]
<emotion> <category> <BigSixEmotion name="joy"/> </category> </emotion> or, in a flatter version <emotion> <EverydayEmotionCategory name="pleasure" confidence="0.9"/> </emotion>
14:10:32 [Bjoern]
No controversion by new adds.
14:11:56 [Bjoern]
Marc explains joint advantage of 3a-c.
14:12:18 [marc]
3b. Category sets as the value of a apecial attribute attribute, e.g.:
14:12:19 [marc]
<emotion> <category set="everyday" name="pleasure" confidence "0.9"/> </emotion>
14:12:19 [marc]
3c. Category sets as the namespace of the <category> element, e.g.
14:12:19 [marc]
<emotionml:emotion
14:12:19 [marc]
xmlns:everyday="
">
14:12:20 [marc]
<everyday:category
14:12:21 [marc]
</emotionml: emotion>
14:14:38 [Bjoern]
Felix speaks against 3a.
14:14:56 [Bjoern]
Felix prefers 3b as easiest way.
14:15:34 [Bjoern]
Marc explains that the namespace variant is not necessarily more complex.
14:16:14 [Bjoern]
Marc states that namespace allows easier creation of outside of standard set.
14:16:52 [Bjoern]
Marc states that in 3b this will probably be possible, too.
14:17:26 [Bjoern]
Bjoern states that this is an important feature.
14:18:33 [Bjoern]
Marc stresses usability over technical "cleanness"
14:19:37 [Jianhua]
I prefer 3b too
14:19:57 [Bjoern]
Bjoern asks about certainness to provide sets and make them public in 3b.
14:20:15 [Bjoern]
Jianhua also prefers 3b for its simplicity.
14:20:35 [Bjoern]
Marc suggest providing an URL for this (wrt Bjoern's question).
14:21:02 [Bjoern]
Marc asks if 3b is ok for the moment.
14:21:15 [Bjoern]
This is agreed. It allows moving to 3c later on.
14:21:23 [Idoia]
we also agree with the simplicity of 3b option
14:21:38 [Bjoern]
agrees on 3b.
14:22:17 [Bjoern]
Marc suggests to have 3b as guideline for future items.
14:22:31 [Bjoern]
Marc stresses the importance of this decision.
14:22:45 [Bjoern]
Nobody objects...
14:23:21 [Bjoern]
Including Ian...
14:23:23 [Christian]
Ian?
14:24:50 [Bjoern]
Marc reads list of volunteers and suggests to split items among them for draft versions for discussion.
14:25:15 [Bjoern]
Marc asks if moving quickly like this is ok.
14:25:29 [Bjoern]
Felix agrees.
14:27:01 [Zakim]
+ +95177aacc
14:27:02 [Bjoern]
Marc says that work should be split respecting similarities.
14:27:21 [marc]
zakim, aacc is Catherine
14:27:21 [Zakim]
+Catherine; got it
14:27:30 [cpelacha]
cpelacha has joined #emotion
14:27:46 [Zakim]
+Andy_Breen
14:28:42 [Bjoern]
Marc explains made decisions to newly joints...
14:30:06 [Bjoern]
Felix suggests to discuss this online, first.
14:31:11 [Bjoern]
Marc asks others if they want to join the discussion on splitting requirements specs among volunteers.
14:32:04 [Bjoern]
Marc reminds of next meeting on 31st of July same time.
14:32:07 [Zakim]
-Christian
14:32:09 [Zakim]
-Andy_Breen
14:32:09 [Zakim]
-Catherine
14:32:12 [Zakim]
-Myriam_Arrue
14:32:16 [Bjoern]
People not involved leave...
14:32:19 [Zakim]
-Jianhua
14:32:53 [marc]
zakim, who is here?
14:32:53 [Zakim]
On the phone I see Ian, marc, Bjoern, Felix_Burkhardt
14:32:54 [Zakim]
On IRC I see cpelacha, Christian, Idoia, Felix, RRSAgent, Zakim, marc, Bjoern, Jianhua, Ian, trackbot
14:33:00 [Bjoern]
Marc asks Ian for lifesign.
14:33:15 [Idoia]
Idoia has left #emotion
14:34:53 [Bjoern]
Marc, Felix, and Bjoern discuss split of 13 remaining mandatory requirements.
14:34:57 [Ian]
sorry, switching between 2 meetings
14:35:28 [Ian]
very difficult
14:35:30 [Ian]
yes
14:35:49 [Ian]
ok
14:35:56 [Ian]
right
14:36:05 [Ian]
sounds like a good idea
14:36:11 [Ian]
ok
14:36:13 [Bjoern]
Marc suggests Ian for Links to the rest of the world (1-3).
14:36:18 [Ian]
together is good
14:36:31 [Ian]
my XML knowledge is not great
14:36:31 [Bjoern]
Ian and Felix agree to work on this.
14:37:00 [Ian]
you have to make 1 action item per person
14:37:08 [Ian]
i dont think that works
14:37:23 [Ian]
yes
14:37:34 [Ian]
right
14:37:51 [Bjoern]
ACTION: Felix and Ian to prepare examples for links to the rest of the world before 31st of July 2008.
14:37:51 [trackbot]
Created ACTION-23 - And Ian to prepare examples for links to the rest of the world before 31st of July 2008. [on Felix Burkhardt - due 2008-07-10].
14:37:53 [Ian]
so the same action item for each person
14:40:34 [Ian]
sounds good
14:42:02 [Ian]
again?
14:42:08 [Zakim]
-marc
14:42:10 [Ian]
sorry I missed that
14:42:21 [marc]
oops, did I drop out?
14:42:25 [Ian]
yes
14:42:44 [Zakim]
+??P1
14:42:57 [marc]
zakim, I am ??P1
14:42:57 [Zakim]
+marc; got it
14:43:27 [Ian]
can you explain again, i missed it
14:43:30 [Ian]
sorry
14:43:38 [Ian]
no problem
14:43:50 [Ian]
ah ok
14:43:56 [Ian]
i looked at that one too
14:45:49 [Ian]
ok
14:46:00 [Ian]
bye
14:46:02 [Zakim]
-Felix_Burkhardt
14:46:05 [Zakim]
-Ian
14:46:08 [Felix]
bye bagin
14:46:47 [Bjoern]
ACTION: Bjoern to provide examples for core 1 and core 6 before 31. July 2008
14:46:47 [trackbot]
Sorry, couldn't find user - Bjoern
14:48:19 [bschulle]
bschulle has joined #emotion
14:48:35 [Bjoern]
Bjoern has joined #emotion
14:49:24 [Bjoern]
ACTION: Björn_Schuller to provide examples for core 1 and core 6 until 31.7.08
14:49:24 [trackbot]
Sorry, couldn't find user - Björn_Schuller
14:49:36 [Bjoern]
ACTION: Björn_Schuller to provide examples for core 1 and core 6 until 31.7.08
14:49:36 [trackbot]
Sorry, couldn't find user - Björn_Schuller
14:49:54 [Bjoern]
ACTION: Björn to provide examples for core 1 and core 6 until 31.7.08
14:49:54 [trackbot]
Created ACTION-24 - Provide examples for core 1 and core 6 until 31.7.08 [on Björn Schuller - due 2008-07-10].
14:50:56 [Bjoern]
ACTION: Marc to provide examples for core 3,4,5,7 until 31.07.08
14:50:56 [trackbot]
Created ACTION-25 - Provide examples for core 3,4,5,7 until 31.07.08 [on Marc Schröder - due 2008-07-10].
14:52:50 [Bjoern]
ACTION: Myriam was volunteered to porvide meta 1,2 and global 0 examples due 2008-07-31
14:52:50 [trackbot]
Created ACTION-26 - Was volunteered to porvide meta 1,2 and global 0 examples due 2008-07-31 [on Myriam LAMOLLE - due 2008-07-10].
14:56:07 [marc]
14:58:09 [marc]
ACTION- 2
14:58:14 [marc]
ACTION- 3
14:58:18 [marc]
ACTION- 4
14:59:06 [Bjoern]
Scribe: Bjoern Schuller
14:59:18 [Bjoern]
Chair: Marc Schroeder
14:59:26 [marc]
Present: Felix, Björn, Ian, Christian, Andy, Catherine, Idoia, Nestor
14:59:45 [marc]
Present: Felix, Björn, Ian, Christian, Andy, Catherine, Idoia, Nestor, Jianhua
15:00:05 [marc]
Agenda:
15:00:28 [marc]
Regrets: Enrico, Myriam
15:00:53 [Bjoern]
Meeting: EMO ML discussion
15:01:16 [Bjoern]
rrsagent, make logs public
15:01:24 [Bjoern]
rrsagent, draft minutes
15:01:24 [RRSAgent]
I have made the request to generate
Bjoern
15:04:33 [Zakim]
-marc
15:04:37 [Zakim]
-Bjoern
15:04:39 [Zakim]
INC_EMOXG()10:00AM has ended
15:04:43 [Zakim]
Attendees were +49.381.402.aaaa, +49.892.892.aabb, marc, Christian, Bjoern, Jianhua, Felix_Burkhardt, Ian, Myriam_Arrue, +95177aacc, Catherine, Andy_Breen
15:06:04 [marc]
zakim, bye
15:06:04 [Zakim]
Zakim has left #emotion
15:06:09 [marc]
rrsagent, bye
15:06:09 [RRSAgent]
I see 4 open action items saved in
:
15:06:09 [RRSAgent]
ACTION: Felix and Ian to prepare examples for links to the rest of the world before 31st of July 2008. [1]
15:06:09 [RRSAgent]
recorded in
15:06:09 [RRSAgent]
ACTION: Björn to provide examples for core 1 and core 6 until 31.7.08 [5]
15:06:09 [RRSAgent]
recorded in
15:06:09 [RRSAgent]
ACTION: Marc to provide examples for core 3,4,5,7 until 31.07.08 [6]
15:06:09 [RRSAgent]
recorded in
15:06:09 [RRSAgent]
ACTION: Myriam was volunteered to porvide meta 1,2 and global 0 examples due 2008-07-31 [7]
15:06:09 [RRSAgent]
recorded in | http://www.w3.org/2008/07/03-emotion-irc | CC-MAIN-2015-27 | refinedweb | 2,144 | 69.72 |
Hi.
Can you please suggest me some trick to fit the table to the width od
the document? I think You still did not implement some method or
property so this task could be performed.
Faster respond will be very apreciated.
Thank You in advance.
Hi.
Can you please suggest me some trick to fit the table to the width od
the document? I think You still did not implement some method or
property so this task could be performed.
Faster respond will be very apreciated.
Thank You in advance.
MS Word 2003 has the following setting for this Table | Autofit | Autofit to window.
To make it work in Aspose.Words try the following approach - set RowFormat.AllowAutofit to true and make the cell widths intentionally too big. Here is an example:
builder.StartTable();
builder.RowFormat.AllowAutoFit = true;
builder.Font.ClearFormatting();
builder.Font.Size = 12;
builder.InsertCell();
// intentionally setting cell width too big to allow Word autofit to do the adjustment
builder.CellFormat.Width = WordConvert.PixelToPoint(1000);
builder.ParagraphFormat.ClearFormatting();
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.Write("1st Cell");
builder.InsertCell();
builder.Write("2nd cell");
builder.InsertCell();
builder.Write("3rd cell");
builder.EndRow();
builder.EndTable();
I also ran into the same problem. This approach (very wide cells) does not work, the table does not auto-size at all (try tables with more than 1 row!) If the cells are a just little bit too wide, all rows are autosized correctly, except the first one. (all using Word 2003)
I found some differences in the view mode - if the template document was saved in Normal View, the table is not auto-sized correctly, if saved in Print Layout View, Word does autosize it.
I feel that the Table object should have a TableFormat property which allows the programmer to set the width of the table, the alignment, the indent and the text wrapping.
It would also be very helpful if the DocBuilder at some time returns the Table object it created (e.g. as a return value of StartTable() or EndTable() )
regards,
Alex
Thanks for your proposals on improvement of our API.
I have logged your suggestion on adding TableFormat property to our defect base as Issue #907.
Your suggestion on returning the table node reference in DocumentBuilder StartTable and EndTable methods is logged to our defect base as Issue #906.
We will discuss and maybe add this features in one of our next releases.
Vladimir,
To extend the ide of the DocumentBuilder returning the Table, it might be good to let it return all the objects it creates (where appropriate), e.g. on Write() it returns the Run (I guess it is that what it creates), on WriteLn() it returns the Paragraph, on InsertImage().... etc.
While we are in the request mode :-) ... another request would be to have easy access to the "surroundings" of every object, i.e. the Paragraph, the Bookmark, the Section, etc. where an object is in (where applicable). I needed to get te section where a bookmark is in, to size the table to the margins of the section. I iterate through all sections of the document, and check if my bookmark is in that section... I recently found out that GetAncestor() is there to provide this functionality, but it would be easier to use and to understand have a EnclosingSection property on the Bookmark (or something similar)
regards
Alex
Your point is taken :-) But please mind that changes to API is not something that can be taken lightly. We need time to discuss it and analyze all pros and cons.
We have introduced some of the proposed API changes in the latest Aspose.Words 3.6 which is now available for download.
Most of DocumentBuilder node creation methods (InsertXXX, StartXXX, EndXXX) now return the reference to the newly created node.
We are also considering adding return values to the Write and Writeln methods. In the next release maybe.
Please mind that these methods can create several nodes at once, e.g. Write("Hello\rHello") will create two runs and one paragraph.
Current suggestion is that Write method will return reference to the last of the newly created runs and Writeln will return reference to the last of the newly created paragraphs. That is logged as Issue #959 in our defect base.
If you have any other suggestions we will be grateful if you post them here.
Best Regards,
Has there been any further resolution on this topic: Auto Fitting tables? I would be happy with simply being able to set the width of the table.
Sadly no. TableFormat which would allow that is not available yet. If you provide a more detailed explanation of your task, perhaps I'll be able to suggest a workaround.
Just want my newly inserted table to stretch to the width of the page.
Alas, in this case all I can suggest is to wait for advanced table formatting offered by Aspose.Words.
As Dmitry have already pointed out, we have not implemented Autofit table to our API yet. But you can easily create this method yourself. For this you need to know the page content width:
DocumentBuilder builder = new DocumentBuilder(doc);
Section currentSection = builder.CurrentSection;
PageSetup pageSetup = currentSection.PageSetup;
double availableWidth = pageSetup.PageWidth - pageSetup.LeftMargin - pageSetup.RightMargin;
Then you need to adjust the Cell.CellFormat.Width of the cells in each row. You can do it when building the table. For example,
builder.InsertCell();
// Set first cell to 1/3 of the page width.
builder.CellFormat.Width = tableWidth / 3;
builder.Write("Text1");
builder.InsertCell();
// Set the second cell to 2/3 of the page width.
builder.CellFormat.Width = tableWidth * 2 / 3;
builder.Write("text 2");
Or you can wtite a specialized method that will iterate over all rows in the given table and will recalculate width of every cell in the row proportionally so that it would fit the page width.
Hope that helps,
Is this issue resolved in the latest API? I also want to AutoFit an existing table to the window size.
Hi
<?xml:namespace prefix = o
Thanks for your inquiry. Unfortunately, the issue is still unresolved.
Best regards.
The issues you have found earlier (filed as WORDSNET-352;WORDSNET-581) have been fixed in this .NET update and in this Java update. | https://forum.aspose.com/t/autofit-table-to-document-window/124793 | CC-MAIN-2022-40 | refinedweb | 1,046 | 66.64 |
We’ve heard a thousand times why Dependency Injection is good. We know how to use it: put an @Inject here, an @Singleton there, and now we’re DI knights! But when the bits hit the fan, may the force be with us: we have no idea how these black magic libraries work. We move annotations around, rebuild, restart, revert, and finally tweet to Jake Wharton. DIY: let’s build our own DI lib in 5 minutes, and iterate on it to rebuild key features of Guice and Dagger. No more black magic, not even advanced science. It turns out, anyone can write their own DI lib.
Understanding What’s Beneath the Hood of Dependency Injection (1:40)
public class VisitHandler { private final Counter counter; private final Logger logger; public VisitHandler(Counter counter, Logger logger) { this.counter = counter; this.logger = logger; } public void visit() { counter.increment(); logger.log("Visits increased: " + counter.getCount()); } }
The goal is to understand what’s going on underneath the hood. So we have a class that has a visit handler, it has a counter that can be incremented, and a logger. We now write a Java program that will use this:
public class Counter { private int count; void increment() { count++; } int getCount() { return count; } }
This isn’t very interesting, but we’re looking at the pattern of dependency injection. Writing all that code which is pretty simple here can be very complex in a big app. What’s even harder is that the order in which you need to create things is not always clear. Dependency injection libraries solve that for you, and we do that by creating an object graph.
Creating Object Graphs (3:10)
An object graph is something that can create instances for you. It’s configured – so you pass it a key, and you say I want the thing that is identified with this key X, and it gives you an instance. So here, for simplification purposes, our key here is actually going to be a class literal. And then it’s going to return an instance of that class literal. Okay. So what is object graph? Well object graph is a class that you pass it a key, it returns an instance of that key.
public class ObjectGraph { public<T> T get(Class<T> key) { throw new UnsupportedOperationException("Not implemented"); } }
Let’s look at how we could implement that. All we need to actually make object graph work is two classes. We need a factory interface and we need a linker. The factory is the thing that can create instances for a given key. And the linker is essentially a map of factories. It associates each key with a factory.
public interface Factory<T> { T get(Linker linker); } public class Linker { private final Map<Class<?>, Factory<?>> factories = new HashMap<>(); public <T> void in }
How is the object graph actually implemented? It has a linker. You pass it the key, and you ask the factory for an instance of the object.
public class ObjectGraph { private final Linker linker; public ObjectGraph(Linker linker) { this.linker = linker; } public<T> T get(Class<T> key) { Factory<T> factory = linker.factorFor(key); return factory.get(linker); } }
Get more development news like this
Coming back to the
main, we build the object graph, which means we create a linker, install a bunch of factories on it and then we create an object graph from it.
public static void main(String... args) { ObjectGraph objectGraph - buildObjectGraph(); VisitHandler visitHandler = objectGraph.get(VisitHandler.class); visitHandler.visit(); }
Now on to the meat of the configuration:
private static void installFactories(Linker linker) { linker.install(VisitHandler.class, new Factory<VisitHandler>() { @Override public VisitHandler get(Linker linker) { Factory<Counter> counterFactory = linker.factoryFor(Counter.class); Factory<Logger> loggerFactory = linker.factoryFor(Logger.class); Counter counter = counterFactory.get(linker); Logger logger = loggerFactory.get(linker); return new VisitHandler(counter, logger); } }); linker.install(Logger.class, new Factory<Logger>() { @Override public Logger get(Linker linker) { Factory<PrintStream> printStreamFactory = linker.factoryFor(PrintStream.class); return new Logger(printStreamFactory.get(linker)); } }); linker.install(PrintStream.class, new Factory<PrintStream>() { @Override public PrintStream get(Linker linker) { return System.out; } }); linker.install(PrintStream.class, ValueFactory.of (System.out)); }
Visit handler needs a counter and a logger, to get those, it needs a factory for the counter and a factory for the logger. It asks the linker, then it’s going to get the two instances and then it’s going to create the visit handler instance. The logger is the exact same thing. Get the factory for the print stream.
It then calls print stream factory that gets and creates a linker from it. What’s going on is whenever you try to create a logger instance, it’s going to call the method, and this is going to call into the linker, which creates the factory for the print stream. So just by creating this binding, this configuration, everything is going to work like magic.
Singletons (7:37)
linker.install(Counter.class, new Factory<Counter>() { @Override public Counter get(Linker linker) { return new Counter(); } });
We have a counter instance, and we want to share that counter across the application because we don’t want to have five counters. We wrap the factory into a singleton factory. All it’s doing is caching the call to
get after the first time.
It’s very simple, and not we have a singleton factory. We can see that all it’s doing is when you
get, it says “Oh, do I have an instance? No, okay I’m going to call the real factory.”
We’re going to get two different instances if we ask for two instances of this visit handler, which is a lot of work. But there is a way we can cache the work so we don’t have to do it twice.
We had this factory interface which takes a linker, asks for all the dependencies and then returns an instance. What we can actually do is split that in two methods. One is going to be
link and it’s when you retrieve the factories for the dependencies. And the other one’s going to be
get when you actually create instances.
public interface Factory<T> { T get(Linker linker); } public abstract class Factory<T> { protected void link(Linder linker) { } public abstract T get(); }
So if we look back at the linker – the way things are actually going to work is that instead of just retrieving from the key when you get a factory (install is the same), we’re going to have two maps. Factories and linked factories. With linked factories, we try to find a factory in the linked factory. If it’s not there, we get it from the non-linked factory.
So a linked factory is a factory that has its dependencies satisfied.
Let’s come back to our example. We had this big install where we would get all the factories and then get the instances and then create the visit handler, well we’re going to split that in two now. Linking is going to be where we retrieve the factories, and creating instances is going to be where we… create instances.
If we add a little bit of logging to our linker - when do we get the factory, when do we link the factory - we see that the first time we do
get,
link,
get,
link, etc, but the second time we only get the factory and we’re done. We’ve optimized everything and now it’s faster.
Reducing Boiler Plate (11:35)
How do we reduce boiler plate? It can be done where we load the factories, so we have the list of linked factories.
public class Linker { private final Map<Class<?>, Factory<?>> factories = new HashMap<>(); private final Map<Class<?>, Factory<?>> linkedFactories = new HashMap<>(); public <T> void install(Class<T> key, Factory<T> factory) { factories.put(key, factory); } public <T> Factory<T> factoryFor(Class<T> key) { System.out.println("Get factory for " + key); Factory<?> factory = linkedFactories.get(key); if (factory == null) { System.out.println("Link factory for " + key); factory = factories.get(key); factory.link(this); linkedFactories.put(key, factory); } return (Factory<T>) factory; } }
Here’s where we introduce the magical annotation
@inject, which just adds metadata to the class, to the constructors more specifically. It identifies a specific constructor. If we go back to the code, the load factory, I can look at it at runtime using reflection. I can try to find this
@inject constructor on the key class, and if I find it I can create a reflective factory. I can look for
@singleton annotations on the class and then wrap the factory in a singleton factory. How do you find an
@inject constructor? Well you just get all the constructors and look for the one that’s annotated with
@inject.
public class VisitHandler { private final Counter counter; private final Logger logger; @Inject public VisitHandler(Counter counter, Logger logger) { this.counter = counter; this.logger = logger; } public void visit() { counter.increment(); logger.log("Visits increased: " + counter.getCount()); } }
public class ReflectiveFactory<T> extends Factory<T> { private final Constructor<T> constructor; private final ArrayList<Factory<?>> factories = new ArrayList<>(); public ReflectiveFactory(Constructor<T> constructor) { this.constructor = constructor; } }
Ask for the factory for each parameter of the constructors. So all you need to do is call them in order and then pass, create an area of the arguments and pass it to the constructors here.
So with that, this is our new configuration. The only thing left is to bind
PrintStream to
System.out so there’s no annotation involved here. This is basically Google Guice. There’s a lot more to Google Guice, but this is the same basic way that it works.
The problem is with this, as we saw in the reflective factory is using reflection to detect the dependencies and also to create instances. So if we look at how we originally installed the manual factories, with anonymous classes. This anonymous class here could become a real class that we’re going to generate at compile time. And it’s exactly the same code except we’re going to generate it.
Generating a Real Class at Compile Time (14:34)
We add
$$factory to the name. You’ll notice we need to handle the singletons. So what we’re going to do is we’re going to have a parent superclass that has a singleton constructors param. And then in the generated class, we’re going to pass true or false which is going to say whether this is a singleton or not. And all of that is going to be generated at compile time by looking at the annotations on the class.
public class Logger$$Factory extends Factory<Logger> { Factory<PrintStream> printStreamFactory; @Override public void link(Linker linker) { printStreamFactory = linker.factoryFor(PrintStream.class); } @Override public Logger get() { return new Logger(printStreamFactory.get()); } }
All you need to do is you have the key, which is the name of the class you’re looking for and append
$$factory. The one which is the one we generated. We look for that class. We wrap it into a singleton factory if it’s a singleton and then we return it. Which means all we need to change in load factory is to look for the generated factory by reflection.
public abstract class GeneratedFactory<T> extends Factory<T> { public static <T> Factory<T> loadFactory(Class<T> key) { String generatedClass = key.getName() + "$$Factory"; try { Class<GeneratedFactory<T>> factoryClass = (Class<GeneratedFactory<T>>) Class.forName(generatedClass); GeneratedFactory<T> factory = factoryClass.newInstance(); if (factory.singleton) { return SingletonFactory.of(factory); } else { return factory; } } catch (Exception e) { return null; } } }
This is basically Dagger 0.5, but not 1.0 yet.
Why is it not Dagger 1? There are a few bits missing.
Let’s look at another example. Suppose I have a database manager which needs a database. So I come back to my
main and ask the object graph, “Give me my database manager.” But when I try to run this code it’s not happy - it’s saying “Oh no, I can’t find a factory for database. The database is not annotated with anything. I don’t know what to do with it.”
You forgot the
@inject annotation. It’s only when you actually ask for the database manager instance that you’re going to realize that something’s missing. Imagine you have a server or an app and then it’s only when you get into this screen of the app that it’s going to realize that something’s missing.
So let’s imagine that we had a validate method on the object of operate where we say, “Hey, I actually don’t want an instance but I want to make sure that this will work when I ask for it, and otherwise please throw an exception.” All we need to do to validate is ask for the factory of that key.
Scopes (20:52)
public class TransactionHandler { private final Analytics analytics; private final TaxCache taxCache; private Payment paymentInFlight; private Order order; @Inject TransactionHandler(Analytics analytics, TaxCache taxCache) { this.analytics = analytics; this.taxCache = taxCache; } }
The singleton factory or singleton binding here has a reference to the binding and also keeps cache reference of the transaction handler, because transaction handler is a singleton. This means that as long as I keep the object graph in memory, all of my singletons are going to be kept in memory, which is the point.
If I don’t want the singleton anymore, I want to recycle it.
If you have an object graph that hauls through a transaction handler, the only way to make sure the transaction handler gets recycled is to recycle the object graph. So if it has a reference to a print handler but you didn’t want to get rid of the print handler, now it’s bad because you’re removing the whole thing. What you need to do is have one object graph for the transaction handler, and one object graph for the print handler. That’s great.
It turns out most of the time you actually don’t want two object graphs. You want a hierarchy of object graphs. And as soon as you leave that part of the app, you de-reference the object graph and then all of the instances get garbage collected. We need to update our vocabulary because the things that are in here are not singletons anymore - they are scoped instances, meaning a singleton is supposed to be only one instance ever. But here, if we destroy this object graph, and then create a new one and create a new transaction handler, we actually have two instances of transaction handler. So scoped instances is the new singleton.
Hierarchies (23:30)
We now have a hierarchy. Which means we’re introducing the notion of a parent object graph. And when you ask for something, it’s actually going to ask the parent first. It’s going to ask the parent object graph, “Can you provide me with that instance?” If it can’t then it’s going to ask the current. So you can imagine that when you are at the leaf graph, it’s going to go all the way up, then it goes down and provides that instance.
But if we look at how we implemented linker, our linker doesn’t actually have the ability to say “No, I can’t provide that.” It just tries to load the instance, and that’s not great because we want some singletons to be in the leaf instances and some of them to be in the root instances.
To do this, at compile time we actually have access to all the information, because we have these entry points, the things are on
@moduleinjecticle.
We have these entry points, and we can go through all the dependencies. Which means we know exactly in which module/scope an object is supposed to live. So when we create a sub scope, a sub object graph, we’re actually going to go through the list of injects for the parent of the graph and we’re going to try to load the factory for each of them, which means they’re going to be cached in the link factories. And then we prevent the linked factories from ever being updated again. This means when a child asks for something that the parent has never seen before, the parent is not going to try to load it.
We got rid of the linker. We generate the right factory phrase. And then we need one central place where we are going to assemble everything together and generate the code that is going to be responsible for creating the logger factory, creating the print stream factory. So this was our module before. If you remember at runtime we have a bunch of modules and we passed the modules in the constructor of the object graph, and we created the object graph from that. So instead of doing that, we’re actually going to replace the object graph with a class that’s going to be generated at compile time. And that’s a component.
Implementing
MainComponent (27:55)
public class Dagger_MainComponent implements MainComponent { Factory<PrintStream> printStreamFactory; Factory<Logger> loggerFactory; Factory<DatabaseManager> databaseManagerFactory; Dagger_MainComponent() { final MainModule mainModule = new MainModule(); printStreamFactory = new Factory<PrintStream>() { @Override public PrintStream get() { return mainModule.providePrintStream(); } };
What’s interesting here is how you implement
MainComponent. This is all generated at compile time again. Dagger main component is a generated class that’s going to implement
MainComponent. When we create it, what we actually do is we create an instance of the module. Then we can create a
printStreamFactory that delegates to the provider method of the module. So now we have a field that’s
printStreamFactory. The we can send the logger factory field to the generated logger factory class, and just have it reference to
printStreamFactory which is also filled in this class. Same thing for the database manager factory. And lastly, you can see that when we want to get a database manager instance, we just call the factory.
}; loggerFactory = new Logger$$Factory(printStreamFactory); databaseManagerFactory = new DatabaseManager$$Factory(loggerFactory); } @Override public DatabaseManager databaseManager() { return databaseManagerFactory.get(); }
So all of this is pretty much what the Dagger 2 generates in terms of code. Which means we got rid of the linker, we got rid of the object graph, and everything is much faster. And there is no linking anymore. It’s basically when the component is created, all the factories are created with the right dependencies immediately.
Conclusion
So that’s Dagger 2. I was scared of dependency injection libraries before, and now I’m not anymore. I wanted to show that anyone can really implement their own dependency injection library.
Q&A
- So you’re in a multi-threaded environment, should you, as a developer, take any precautions when using a dependency injection library?
You should absolutely. The way we ignore that problem is by doing all the injection on the main thread. So anytime we require an instance from the object graph, it’s always on the main thread for us on Android. If you’re doing server work, it might be a little bit more tricky. In Dagger 1.0 the generated code for singletons is thread-safe, meaning if two threads try to get a singleton instance at the same time it’s going to do the right thing: The first one that hits it is going to cache it, and the second one that hits it is going to reach into the cache. So that is thread-safe.
About the content
This content has been published here with the express permission of the author. | https://academy.realm.io/posts/android-pierre-yves-ricau-build-own-dependency-injection/ | CC-MAIN-2018-22 | refinedweb | 3,295 | 56.45 |
The WinSock (Windows Sockets) API is a socket programming library for Microsoft Windows Operating Systems. It was originally based on Berkeley sockets. But several Microsoft specific changes were employed. In this article I shall attempt to introduce you to socket programming using WinSock, assuming that you have never done any kind of network programming on any Operating System.
If you only have a single machine, then don't worry. You can still program WinSock. You can use the local loop-back address called localhost with the IP address 127.0.0.1. Thus if you have a TCP server running on your machine, a client program running on the same machine can connect to the server using this loop-back address.
In this article I introduce you to WinSock through a simple TCP server, which we shall create step by step. But before we begin, there are a few things that you must do, so that we are truly ready for starting our WinSock program
#include <winsock2.h>
#includeconio.h and iostream just after winsock2.h
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; cout << "Press ESCAPE to terminate program\r\n"; AfxBeginThread(ServerThread,0); while(_getch()!=27); return nRetCode; }
What we do in our
main() is to start a thread and then loop a call to
_getch().
_getch() simply waits till a key is pressed and returns the ASCII value of the
character read. We loop till a value of 27 is returned, since 27 is the ASCII
code for the ESCAPE key. You might be wondering that even if we press ESCAPE,
the thread we started would still be active. Don't worry about that at all. When
main() returns the process will terminate and the threads started by our main
thread will also be abruptly terminated.
What I will do now is to list our
ServerThread function and use code comments
to explain what each relevant line of code does. Basically what our TCP server
does is this. It listens on port 20248, which also happens to be my Code Project
membership ID. Talk about coincidences. When a client connects, the server will
send back a message to the client giving it's IP address and then close the
connection and go back to accepting connections on port 20248. It will also
print a line on the console where it's running that there was a connection from
this particular IP address. All in all, an absolutely useless program, you might
be thinking. In fact some of you might even think this is as useless as SNDREC32.EXE
which comes with Windows. Cruel of those people I say.
UINT ServerThread(LPVOID pParam) { cout << "Starting up TCP server\r\n"; //A SOCKET is simply a typedef for an unsigned int. //In Unix, socket handles were just about same as file //handles which were again unsigned ints. //Since this cannot be entirely true under Windows //a new data type called SOCKET was defined. SOCKET server; //WSADATA is a struct that is filled up by the call //to WSAStartup WSADATA wsaData; //The sockaddr_in specifies the address of the socket //for TCP/IP sockets. Other protocols use similar structures. sockaddr_in local; //WSAStartup initializes the program for calling WinSock. //The first parameter specifies the highest version of the //WinSock specification, the program is allowed to use. int wsaret=WSAStartup(0x101,&wsaData); //WSAStartup returns zero on success. //If it fails we exit. if(wsaret!=0) { return 0; } //Now we populate the sockaddr_in structure local.sin_family=AF_INET; //Address family local.sin_addr.s_addr=INADDR_ANY; //Wild card IP address local.sin_port=htons((u_short)20248); //port to use //the socket function creates our SOCKET server=socket(AF_INET,SOCK_STREAM,0); //If the socket() function fails we exit if(server==INVALID_SOCKET) { return 0; } //bind links the socket we just created with the sockaddr_in //structure. Basically it connects the socket with //the local address and a specified port. //If it returns non-zero quit, as this indicates error if(bind(server,(sockaddr*)&local,sizeof(local))!=0) { return 0; } //listen instructs the socket to listen for incoming //connections from clients. The second arg is the backlog if(listen(server,10)!=0) { return 0; } //we will need variables to hold the client socket. //thus we declare them here. SOCKET client; sockaddr_in from; int fromlen=sizeof(from); while(true)//we are looping endlessly { char temp[512]; //accept() will accept an incoming //client connection client=accept(server, (struct sockaddr*)&from,&fromlen); sprintf(temp,"Your IP is %s\r\n",inet_ntoa(from.sin_addr)); //we simply send this string to the client send(client,temp,strlen(temp),0); cout << "Connection from " << inet_ntoa(from.sin_addr) <<"\r\n"; //close the client socket closesocket(client); } //closesocket() closes the socket and releases the socket descriptor closesocket(server); //originally this function probably had some use //currently this is just for backward compatibility //but it is safer to call it as I still believe some //implementations use this to terminate use of WS2_32.DLL WSACleanup(); return 0; }
Run the server and use telnet to connect to port 20248 of the machine where the server is running. If you have it on the same machine connect to localhost.
We see this output on the server
E:\work\Server\Debug>server Press ESCAPE to terminate program Starting up TCP server Connection from 203.200.100.122 Connection from 127.0.0.1 E:\work\Server\Debug>
And this is what the client gets
nish@sumida:~$ telnet 202.89.211.88 20248 Trying 202.89.211.88... Connected to 202.89.211.88. Escape character is '^]'. Your IP is 203.200.100.122 Connection closed by foreign host. nish@sumida:~$
Well, in this article you learned how to create a simple TCP server. In further articles I'll show you more stuff you can do with WinSock including creating a proper TCP client among other things. If anyone has problems with compiling the code, mail me and I shall send you a zipped project. Thank you.
General
News
Question
Answer
Joke
Rant
Admin | http://www.codeproject.com/KB/IP/winsockintro01.aspx | crawl-002 | refinedweb | 1,001 | 65.83 |
How to create a Windows service
Let’s create a Windows service - the thing that will run at the background and do stuff. For example, our service will write phrase “ololo” into Event Log.
Creating service
Open Visual Studio and create new Windows Service project:
I named it
SillyService.
The project starts with opened
Service1.cs. Rename it to
Service.cs. Actually, it does not matter, but looks better.
This file can be opened from Solution Explorer in 2 modes:
- Just double click on it and you will get a Design mode. That’s how it’s opened now;
- Or right-click on it and choose View Code - you will get the code of the file.
But now we need Design-mode. Click with right button on any free space of the edit area (it’s all free, because we haven’t added anything yet) and choose
Properties. Edit them like this (just change the
ServiceName):
Now find the sliding Toolbox on the left and drag the
EventLog element from there into edit area of
Service.cs opened in Design mode:
Click on it and choose
Properties. Edit them like this:
From all my experiments I got that
Log and
Source should have different names (and be different from the name of service itself). So, I added
_log and
_source suffixes accordingly.
Ok, that’s done. Now right-click somewhere at free space of the edit area of
Service.cs (still in Design mode) and choose
Add Installer:
A new document will appear in a separate tab containing two elements: serviceProcessInstaller and serviceInstaller, both also available in two modes (Design and View Code). Edit
Properties for both elements like this:
It’s about giving proper names, description and choosing the right authority level (
LocalSystem).
Now let’s create some settings for the service. Right-click on project and choose
Properties:
Go to
Settings tab and click on the only label there (This project does not contain…). The settings file will be created, and it will be displayed as a table. We will create an int parameter there -
timerInterval - which will store a value for timer (how often our service should perform some action):
Save everything and open
Service.cs in View Code mode (right-click on the file in Solution Explorer). We will implement some actual stuff that our service will do, which is to write a text string to the Events Log every 10 seconds:
using System.Diagnostics; using System.Reflection; using System.ServiceProcess; using System.Text; namespace SillyService { public partial class Service : ServiceBase { /// <summary> /// Main timer /// </summary> private System.Timers.Timer timer2nextUpdate; /// <summary> /// Timer interval in seconds /// </summary> private int timerInterval = Properties.Settings.Default.timerInterval; // here you can see how this value is being pulled out from Settings public Service() { InitializeComponent(); // create new Source if it doesn't exist EventSourceCreationData escd = new EventSourceCreationData(eventLog.Source, eventLog.Log); // eventLog instance was created in Service.cs in Design mode, as you remember if (!EventLog.SourceExists(eventLog.Source)) { EventLog.CreateEventSource(escd); } } protected override void OnStart(string[] args) { // using System.Text; StringBuilder greet = new StringBuilder() .Append("SillyService has been started.\n\n") .Append(string.Format("Timer interval (in seconds): {0}\n", timerInterval)) // using System.Reflection; .Append(string.Format("Path to the executable: {0}", Assembly.GetExecutingAssembly().Location)); write2log(greet.ToString(), EventLogEntryType.Information); // timer settings this.timer2nextUpdate = new System.Timers.Timer(timerInterval * 1000); this.timer2nextUpdate.AutoReset = true; this.timer2nextUpdate.Elapsed // what timer's event will do += new System.Timers.ElapsedEventHandler(this.timer2nextUpdate_tick); this.timer2nextUpdate.Start(); } protected override void OnStop() { write2log("SillyService has been stopped", EventLogEntryType.Information); } /// <summary> /// Writing to log /// </summary> /// <param name="message">message text</param> /// <param name="type">type of the event</param> private void write2log(string message, EventLogEntryType type) { try { eventLog.WriteEntry(message, type); } catch { } } /// <summary> /// timer's event /// </summary> private void timer2nextUpdate_tick(object sender, System.Timers.ElapsedEventArgs e) { write2log("ololo", EventLogEntryType.Information); } } }
Build the project.
Installing and launching the service
Now you have 2 files in the
path\to\SillyService\bin\Debug directory:
SillyService.exe- executable of the service;
SillyService.exe.config- settings-file for the service.
There are actually more files there, but you don’t need them. Copy these 2 into some new directory, like
C:\services\SillyService\. By the way, later you might want to use Release build rather then Debug.
Make sure, that Services and Event Viewer applications are closed.
Open command line with administrator rights (or, if you don’t want to deal with command line, use my application), find
InstallUtil.exe path (mine was here:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\) and execute the following:
C:\Windows\Microsoft.NET\Framework\v4.0.30319>InstallUtil.exe c:\services\SillyService.exe
You’ll get something like this:
Sorry for russian text on the screenshots (some UI on my Windows is in russian), but there is nothing important there anyway.
Now you can start the service from Services (
services.msc). Just in case, run Services with administrator rights:
After the start of the service you can open Event Viewer to see your service’s log there:
So, service is running, it will start automatically each time you reboot your computer and it will write a line of text to the Event Log every 10 seconds.
Possible problems
Service might not start and give you some error about not answering. Most probably, that is related to
Source/
Log stuff:
- Check if you’ve set
Local Systemin the
Accountfield of serviceProcessInstaller
Properties;
- Perhaps, you ignored my notice about naming
Logand
Source;
- Some other access problems. Try to set administrator’s credentials at
Log Ontab of service
Propertiesin Services.
If you would like to uninstall service, use the same command, but just add
/u key:
C:\Windows\Microsoft.NET\Framework\v4.0.30319>InstallUtil.exe /u c:\services\SillyService.exe
Sources
The source code of described
SillyService | https://retifrav.github.io/blog/2017/02/06/how-to-create-a-windows-service/ | CC-MAIN-2019-26 | refinedweb | 969 | 50.23 |
Are you using AS2 or AS3?
AS2(if you want the actions to be on the first frame of the timeline where the 'myButton' clip/button exists)
myButton.onRelease = function() {
nextFrame();
}
AS2(if you want to place the actions directly on the button)
on (release) {
nextFrame();
}
AS3(i think)
import flash.events.MouseEvent;
myButton.addEventListener (MouseEvent.CLICK, btnListener);
function btnListener ($event:MouseEvent) {
nextFrame();
}
Hope it helps. This is all untested and I am not totally sure on teh AS3 example.
Thanks, It does help.
AS3 is what was really killing me. I've created another flash file in AS2 and you can assign actions to buttons and everything.
In AS3 as well you can assign actions to buttons and everything too (except graphic symbols which is the same in AS 2 as well).
Well, when I create a AS3 flash file - select a button and open the actions window I get the message 'Current selection cannot have actions applied to it'. I know it's possible but the method is quite different. | https://www.sitepoint.com/community/t/nextframe-and-stop-onrelease/5628 | CC-MAIN-2017-09 | refinedweb | 172 | 65.22 |
Hey everyone.
I'm having a bit of trouble with a programme that I'm writing which requires input from a csv file, the application of an algorithm (the solar position algorithm or spa) using input from each row consecutivey and then outputting the results as another csv file.
I have no problem applying the algorithm to one line, or with inputting and outputting the csv, but I'm having a lot of difficulty knowing how best to write the loop so that it assigns certain columns to elements of my structure when working down the rows of the csv file.
The main problem seems to be converting from an input string value to an int or double which is required as arguments for the functions of the algorithm.
I tried using atoi, but either I don't know how to use it properly or it isn't the best option for what I'm trying to do.
Any help or advice on this would be a huge help with the work I'm doing...
Thanks in advance
Jake
ps I've included the header and spa.c as attachments as well as the csv file as a .txtps I've included the header and spa.c as attachments as well as the csv file as a .txtCode:#include <iostream> #include <fstream> #include <string> #include <vector> #include <cstdio> #include "spa.h" //include the SPA header file #include "spa.c" using namespace std; spa_data spa; void csvline_populate(vector<string> &record, const string& line, char delimiter); int main() { vector<string> row; string line; ifstream in("radiation_budget_data.csv"); //Just the name of the .csv file I'm using if (in.fail()) { cout << "File not found" <<endl; return 0; } while(getline(in, line) && in.good() ) { csvline_populate(row, line, ','); for(int i=0, leng=row.size(); i<leng; i++) spa_data spa; //declare the SPA structure - found in the header file spa.h attached int result; float min, sec; spa.year = atoi(row[2]); spa.month = atoi (row[3]); spa.day = atoi (row[4]); spa.hour = 12; spa.minute = 00; spa.second = 00; spa.timezone = +1.0; spa.delta_t = 67; spa.longitude = atoi(row[8]); spa.latitude = atoi(row[7]); spa.elevation = atoi(row[9]); spa.pressure = 820; spa.temperature = 30; spa.slope = atoi(row[6]); spa.azm_rotation = 0; spa.atmos_refract = 0.5667; spa.atmos_trans = 0.67; //Gates (1980) - between 0.6 and 0.7///////////// spa.ext_flux_d = 1200; spa.function = SPA_ALL; cout << spa.day << ","; cout << endl; } in.close(); cin.get(); return 0; } void csvline_populate(vector<string> &record, const string& line, char delimiter) { int linepos=0; int inquotes=false; double c; int i; int linemax=line.length(); string curstring; record.clear(); while(line[linepos]!=0 && linepos < linemax) { c = line[linepos]; if (!inquotes && curstring.length()==0 && c=='"') { //begin quotechar inquotes=true; } else if (inquotes && c=='"') { //quotechar if ( (linepos+1 <linemax) && (line[linepos+1]=='"') ) { //encountered 2 double quotes in a row (resolves to 1 double quote) curstring.push_back(c); linepos++; } else { //endquotechar inquotes=false; } } else if (!inquotes && c==delimiter) { //end of field record.push_back( curstring ); curstring=""; } else if (!inquotes && (c=='\r' || c=='\n') ) { record.push_back( curstring ); return; } else { curstring.push_back(c); } linepos++; } record.push_back( curstring ); return; } | http://cboard.cprogramming.com/cplusplus-programming/122454-converting-part-vector-string-double-int.html | CC-MAIN-2014-52 | refinedweb | 527 | 70.9 |
HTML export: icons are exported with an absolute path to zim ressource directory instead of being copied when exporting a single page
Bug Description
Hello,
I run a local version of Zim. By "local", I mean that I did not installed Zim through a distribution package but instead I start zim.py directly from the sources directory. I use Zim version from Bazar (revision number is the 450).
When exporting a single page to HTML, icons are not copied in the same directory as the page. Instead, the HTML code points to the location of the icons in my installation directory.
For example, the wiki text:
[*] test
Would translate into the following HTML code:
<p>
<ul>
<li style="
</ul>
</p>
I had a quick look at the code, it seems that the icons are copied only when exporting the complete notebook and are not for a single page export. The proper behavior would be to have the icons copied on both type of export.
Thank you for your hard work!
Regards,
Tony
I have the same issue with latest bzr source.
HTML export can be usefull to show your work on a web server.
If you make little changes to one page, you export this single page and upload it.
In this usecase, you notice the bug.
Regards,
I agree with the stated use case; At work, I use one large notebook. I often need to share a single page with colleagues and I prefer to avoid static methods like email attachments and prefer to use more dynamic methods like exporting html to a web server or network share.
If this is accepted as a bug then I think the fix is a change to exporter.py. Currently when exporting a single page the linker.target_dir is not set. Attached is a possible solution, the only difference is the addition of line 194: "self.linker.
Above I posted a possible solution to the specific bug but another option is a plugin. Two advantages of the plugin:
1) it does not require changing exporter.py
2) it meets my additional requirement for a one button export method (if you typically use the same export settings then the current export wizard has a lot of extra dialogs and clicks).
Attached is the Quick Export plugin.
The plugin is very similar to the print to browser plugin but instead of using the template class it uses the exporter class. This allows for user preferences to configure:
* Format
* Template
* Export Directory
* Resolved Prefix
* Resolve resource links
* Use namespace directory structure
I think this should be fixed directly in exporter. Will have to take a look at your changes to judge if I can merge them as is. Put it on my list.
Regards,
Jaap
Fixed in zim 0.61
I think I agree.
Though I am interested in the use case for single page export -- I myself only use it for printing pages, in which case the absolute link is fine - so I'm interested to hear how others use it.
Regards,
Jaap | https://bugs.launchpad.net/zim/+bug/893633 | CC-MAIN-2017-43 | refinedweb | 509 | 71.44 |
This is an ASP.NET web service for sending e-mail messages. When programming with .NET, sending e-mail doesn't seem to be a complicated task at all, you need only to know two simple framework classes,
MailMessage and
SmtpMail, in the
System.Web.Mail namespace. If you want to attach a file to your e-mail message, then you also need to know the
MailAttachment class.
Suppose the SMTP service is enabled on your machine, here is a C# example of sending an e-mail message with attachment.
MailMessage oMsg = new MailMessage(); oMsg.From = "[email protected]"; oMsg.To = "[email protected]"; oMsg.Cc = "[email protected]"; oMsg.Subject = "Test"; oMsg.Body = "This is only a test"; oMsg.Attachments.Add(new MailAttachment("c:\temp\Test.txt")); SmtpMail.Send(oMsg);
If you copy/paste/modify the above code, all your programs can have e-mail capability and there is no need for any web service as far as e-mail is concerned.
However, there are some advantages in providing e-mail capability in a web service, such as:
My simple e-mail web service has only one method,
SendMail, which can be used to send multiple e-mails with a single call. Please note that you cannot use this web service to retrieve e-mail messages.
To send an e-mail, you need to specify the destination address, the sender address, the list of addresses to copy the e-mail message, the subject line, the message body, and the list of attachment files, etc. Some of the information is not required. Things can get more complicated if you want to send multiple e-mails at once.
Instead of having multiple web methods that take various numbers of parameters, I decided to implement a single method
SendMail that takes only one string parameter and returns a boolean value to indicate success or failure. The string parameter represents an XML document, here is the format:
<EMailMessageList> <EMailMessage> <From></From> <To></To> <Cc></Cc> <Bcc></Bcc> <ReplyTo></ReplyTo> <Subject></Subject> <Body></Body> <Format></Format> <AttachmentList> <Attachment></Attachment> </AttachmentList> </EMailMessage> </EMailMessageList>
The
From element is the sender's e-mail address. The
To element is the destination address, it could be multiple e-mail addresses separated by semi-colons. The same goes with the
Cc and the
Bcc elements. The
ReplyTo element is the e-mail address to be used when replying to this message, it can be different from the sender's e-mail address. The
Subject and
Body elements are obvious.
The
Format element specifies the format of the message body, which can be either
HTML or
TEXT with
TEXT as the default. The
Attachment element holds the full path of a file on the local system. Please note that you cannot attach a file that is not on the server where the web service resides.
As you can see, it is possible to pack multiple e-mail messages in the input string parameter and each message can have multiple attachment files. Here is the C# code that uses the web service to send e-mail (for simplicity, the above XML string is saved in the file EMailTemplate.txt and used as a template for XML document in the code).
// prepare the xml document XmlDocument oDoc = new XmlDocument(); oDoc.Load("EMailTemplate.txt"); oDoc.SelectSingleNode("//From").InnerText = "[email protected]"; oDoc.SelectSingleNode("//To").InnerText = "[email protected]"; oDoc.SelectSingleNode("//Subject").InnerText = "Test"; oDoc.SelectSingleNode("//Body").InnerText = "This is a test"; // send the e-mail message EMailService oWebSvcProxy = new EMailService(); oWebSvcProxy.Url = ""; oWebSvcProxy.SendMail(oDoc.OuterXML);
Please note that
EMailService in the above code is the proxy class generated when you add a web reference for the e-mail service to your project.
Comparing to sending e-mails from individual programs, we may have to write a few more lines of code to use the e-mail web service. However, there are some additional advantages besides the ones listed above. For example, the web service writes all errors and debug information into a trace file. In case of failure, you can see exactly what is happening (what input the user is sending to the web service and what is causing the problem, etc.).
The tracing capability in this web service is similar to my other components posted on Code Project, basically there will be one trace file for each day and the amount of information written to the trace file can be controlled by setting trace level from the web.config file. Also, old trace files will be deleted automatically to save disk space.
To call the web service from C/C++/VB programs, you can use the Microsoft Toolkit 3.0. I also wrote a COM DLL XYSoapClient that uses the SOAP client object from the SOAP toolkit to simplify the code.
Now we have this web service ready, there is always a danger that the service will be exploited and misused. Any program on the same network can call this web service unless you restrict the access to it explicitly.
Access to the web service can be restricted by configuring it from the Windows Internet Service Manager. It is possible to allow only access from the local machine and deny all other requests. You can grant or deny access for a group of IP addresses. You may also use Windows authentication or require a password. I will not go into details here.
The included VB script file InstallEMailService.vbs can ease the pain of installation and configuration. First, you need to unzip the downloaded file into a folder on your machine. Then you run the VB script file, which will popup message boxes to ask you the following questions.
The installation script will automatically create virtual directory for the web service on the website you specified, copy files, and set access permissions.
Thank you for reading my articles and using my tools.
02/09/2004: Updated the install script file. The previous version does not set permissions properly.
General
News
Question
Answer
Joke
Rant
Admin | http://www.codeproject.com/KB/aspnet/XYEMailService.aspx | crawl-002 | refinedweb | 1,004 | 54.63 |
Journal tools |
Personal search form |
My account |
Bookmark |
Search:
... Lambert, 27, seems carved from the gritty asphalt at Hollywood and Vine. "I want to do the pop-star thing," says Lambert, who'...the trick tonight is for the singers to perform the song as free of embellishments as possible, so the tracks of the surviving Idols can... is two steps forward and one back. But thanks to the magic of digital recording, the engineers will piece together a complete song from...
... Would have fresh shapes to the garden and texas vine program . Sits till the seething get up early or...that have made you mp3 to audio cd converter free download . Altered--i forget exactly what. These that ...phone . And french esprit when never sought to free. Over the balustrade and blood as one's self... buble . Then the fantastic shadows a subtle magic there. Lady gwendolen not a saint laurant . ...
... scooter store in ct.
big bus magic school wheel
pro ma system
analysis...dream
pulse watch review
cutting grape vine
white terry cloth
def leppard let...take lyric
minolta pageworks 12 driver
free daily thong
slutty woman
texas ... ky area code
counted cross free leaf pattern stitch
coat lady ...air brush t shirt
download dream free heart make wish
ambien medical ...
...person.com
4.0 acrobat download free reader
poetry of april fools ... program site space
passion picture vine
illinois state skeet championships
the ...
go go planet
art egyptian free pattern
texas family photo
texas ... coating company
pure network support magic
push or aerator
mosaic pool ... pick
texas holdem game download free
florida germain naples toyota
new ...
... policia resultado
norton antivirus software for free download
nebraska secretary of state website
... timetables italy
videos online to watch
magic sticks
classical guitar competition
idaho hiking trail
secrets of the vine
pennsylvania state university library catalog
texas ...
bed breakfast devon sale
monster jam free games
insaniaquarium crack
bill mobile pay...
...1 ch
Captain Beefheart & The Magic Band-Trout Mask Replica-1969...Eicher - Monsieur N 2002
off vine restaurant
Miyavi - Galyuu 2003
defense...Sheila Chandra - ABoneCroneDrone 1996 download free
Chris Spheeris - Worldname 2003 download...Sensations Vol.2 0 download free
Elijah's Mantle - Angels of...online
download Rock - Various Artists - Free 2006
hawaiian lomilomi massage
download...
... usa
Various Artists - Free your mind 2002
download Piano Magic - Seasonally Affective 2001...(Disc 8) album
download Terrorstorm Final free
screenplay formatting word
Underworld - Change The ...russia music
canadian music copyright
Pofta Vine Mincind album
download Michael Thomas Spanish...In Conspiracy With Satan) 2003 download free
autodesk download essential inventor plus
...
...cooperative equipment mountain
sweet autumn clematis vine
smiley high school
episode guide tv ...asphalt control in industrial matter particulate
magic david copperfield clip
airport security in ...mental ray download
air asia booking free ticket
us government jobs in spain...edger
afvc rentals
copperfield david illusion magic magician
hawaii home package panelized
shamrock...
... Ringtones LMAO Edition [www ilovetorrents com] free
application retirement security social
download window ...ViTALiTY download
richard simonsen
pakistani music free downloads
excalibur soundtrack download
Horse Feathers... free
avance logic als4000 driver download
REMEMBERING album
its kingdom magic ...
download Tom Waits - Heartattack and Vine 1975
Windows XP SP3
top ...
...drug information store store walgreen
magic orinda
short term rental dublin... you
means end chain
english free russian
regal cinemas location
dish...soundtrack
antivirus avg download
partition magic rescue disk
wireless internet review...science social
secret of the vine
rapid river lodge and water...kansas.com wichita
show me free jigsaw puzzles online
loteria nacional...
Download Game Magic Vine
Free Download Of Magic Vine
Download Free Magic Vine
Free Magic Vine Game
Free Game Magic Vine
Free Online Magic Vine Game
Free Download Magic Vine
Fruit
Magic Vine Free Online Game
Game Online Magic Vine
Free Download Magic Vine Game
Free Online Magic Vine
Hotel
Free Magic Online Play Vine
It
Play Magic Vine Free
Magic
Play Free Game Magic Vine
Magic Vine Game
Result Page:
1
2
3
4
5
6
7
8
9
for Free Magic Vine | http://www.ljseek.com/Free-Magic-Vine_s4Zp1.html | crawl-002 | refinedweb | 663 | 58.79 |
Hi all C++ gurus
help is desperately needed here...
basically i need to capture 2 user inputs
for example
sentence1: man
sentence2: this is a man
sentence 1 is part of sentence2
sentence1: boy
sentence2: this is a man
sentence 1 is not part of sentence 2
i need to use a while loop (end of sentence 2 or match found)
as well as a if loop to compare first char of sentence 1 to any match char in sentence 2
then use a while loop to test the rest of string 1 string2
i came up with the below code but somehow the loop doesn't work..it will always say sentence is not part of sentence 2 even though i type 2 same words
please help!! :( :(
================================================== ==========================================
Code:
#include <vcl.h>
#include "MT262io.h"
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
int main(int argc, char* argv[])
{
AnsiString first;
AnsiString second;
bool flag = false;
int counter;
int count;
first = ReadStringPr("Enter 1st sentence: ");
second = ReadStringPr("Enter 2nd sentence: ");
int y = Length (first);
int x = Length(second);
while (count == x) //loop through 2nd string
{
if ( first[1] == second [counter]) //to check if first letter of first string matches any char in 2nd string
{
counter = counter +1;
while ( first[2] == second[counter] )
{
flag ==true;
WriteStringCr (" 1st sentence is part of 2nd sentence");
}
}
}
WriteStringCr("1st sentence is not part of second sentence" );
getchar();
return 0;
} | http://cboard.cprogramming.com/cplusplus-programming/76231-finding-similar-words-2-strings-printable-thread.html | CC-MAIN-2015-32 | refinedweb | 230 | 60.01 |
from sympy.core import S, Symbol, Add, sympify, Expr, PoleError, Mul, oo, C from sympy.functions import tan, cot from gruntz import gruntz[docs]def limit(e, z, z0, dir="+"): """ Notes ===== First we try some heuristics for easy and frequent cases like "x", "1/x", "x**2" and similar, so that it's fast. For all other cases, we use the Gruntz algorithm (see the gruntz() function). """ from sympy import Wild, log e = sympify(e) z = sympify(z) z0 = sympify(z0) if e == z: return z0 if e.is_Rational: return e if not e.has(z): return e if e.func is tan: # discontinuity at odd multiples of pi/2; 0 at even disc = S.Pi/2 sign = 1 if dir == '-': sign *= -1 i = limit(sign*e.args[0], z, z0)/disc if i.is_integer: if i.is_even: return S.Zero elif i.is_odd: if dir == '+': return S.NegativeInfinity else: return S.Infinity if e.func is cot: # discontinuity at multiples of pi; 0 at odd pi/2 multiples disc = S.Pi sign = 1 if dir == '-': sign *= -1 i = limit(sign*e.args[0], z, z0)/disc if i.is_integer: if dir == '-': return S.NegativeInfinity else: return S.Infinity elif (2*i).is_integer: return S.Zero if e.is_Pow: b, ex = e.args c = None # records sign of b if b is +/-z or has a bounded value if b.is_Mul: c, b = b.as_two_terms() if c is S.NegativeOne and b == z: c = '-' elif b == z: c = '+' if ex.is_number: if c is None: base = b.subs(z, z0) if base.is_finite and (ex.is_bounded or base is not S.One): return base**ex else: if z0 == 0 and ex < 0: if dir != c: # integer if ex.is_even: return S.Infinity elif ex.is_odd: return S.NegativeInfinity # rational elif ex.is_Rational: return (S.NegativeOne**ex)*S.Infinity else: return S.ComplexInfinity return S.Infinity return z0**ex if e.is_Mul or not z0 and e.is_Pow and b.func is log: if e.is_Mul: if abs(z0) is S.Infinity: n, d = e.as_numer_denom() # XXX todo: this should probably be stated in the # negative -- i.e. to exclude expressions that should # not be handled this way but I'm not sure what that # condition is; when ok is True it means that the leading # term approach is going to succeed (hopefully) ok = lambda w: (z in w.free_symbols and any(a.is_polynomial(z) or any(z in m.free_symbols and m.is_polynomial(z) for m in Mul.make_args(a)) for a in Add.make_args(w))) if all(ok(w) for w in (n, d)): u = C.Dummy(positive=(z0 is S.Infinity)) inve = (n/d).subs(z, 1/u) return limit(inve.as_leading_term(u), u, S.Zero, "+" if z0 is S.Infinity else "-") # weed out the z-independent terms i, d = e.as_independent(z) if i is not S.One and i.is_bounded: return i*limit(d, z, z0, dir) else: i, d = S.One, e if not z0: # look for log(z)**q or z**p*log(z)**q p, q = Wild("p"), Wild("q") r = d.match(z**p * log(z)**q) if r: p, q = [r.get(w, w) for w in [p, q]] if q and q.is_number and p.is_number: if q > 0: if p > 0: return S.Zero else: return -oo*i else: if p >= 0: return S.Zero else: return -oo*i if e.is_Add: if e.is_polynomial() and not z0.is_unbounded: return Add(*[limit(term, z, z0, dir) for term in e.args]) # this is a case like limit(x*y+x*z, z, 2) == x*y+2*x # but we need to make sure, that the general gruntz() algorithm is # executed for a case like "limit(sqrt(x+1)-sqrt(x),x,oo)==0" unbounded = [] unbounded_result = [] unbounded_const = [] unknown = [] unknown_result = [] finite = [] zero = [] def _sift(term): if z not in term.free_symbols: if term.is_unbounded: unbounded_const.append(term) else: finite.append(term) else: result = term.subs(z, z0) bounded = result.is_bounded if bounded is False or result is S.NaN: unbounded.append(term) if result != S.NaN: # take result from direction given result = limit(term, z, z0, dir) unbounded_result.append(result) elif bounded: if result: finite.append(result) else: zero.append(term) else: unknown.append(term) unknown_result.append(result) for term in e.args: _sift(term) bad = bool(unknown and unbounded) if bad or len(unknown) > 1 or len(unbounded) > 1 and not zero: uu = unknown + unbounded # we won't be able to resolve this with unbounded # terms, e.g. Sum(1/k, (k, 1, n)) - log(n) as n -> oo: # since the Sum is unevaluated it's boundedness is # unknown and the log(n) is oo so you get Sum - oo # which is unsatisfactory. BUT...if there are both # unknown and unbounded terms (condition 'bad') or # there are multiple terms that are unknown, or # there are multiple symbolic unbounded terms they may # respond better if they are made into a rational # function, so give them a chance to do so before # reporting failure. u = Add(*uu) f = u.normal() if f != u: unknown = [] unbounded = [] unbounded_result = [] unknown_result = [] _sift(limit(f, z, z0, dir)) # We came in with a) unknown and unbounded terms or b) had multiple # unknown terms # At this point we've done one of 3 things. # (1) We did nothing with f so we now report the error # showing the troublesome terms which are now in uu. OR # (2) We did something with f but the result came back as unknown. # Normally this wouldn't be a problem, # but we had either multiple terms that were troublesome (unk and # unbounded or multiple unknown terms) so if we # weren't able to resolve the boundedness by now, that indicates a # problem so we report the error showing the troublesome terms which are # now in uu. if unknown: if bad: msg = 'unknown and unbounded terms present in %s' elif unknown: msg = 'multiple terms with unknown boundedness in %s' raise NotImplementedError(msg % uu) # OR # (3) the troublesome terms have been identified as finite or unbounded # and we proceed with the non-error code since the lists have been updated. u = Add(*unknown_result) if unbounded_result or unbounded_const: unbounded.extend(zero) inf_limit = Add(*(unbounded_result + unbounded_const)) if inf_limit is not S.NaN: return inf_limit + u if finite: return Add(*finite) + limit(Add(*unbounded), z, z0, dir) + u else: return Add(*finite) + u if e.is_Order: args = e.args return C.Order(limit(args[0], z, z0), *args[1:]) try: r = gruntz(e, z, z0, dir) if r is S.NaN: raise PoleError() except (PoleError, ValueError): r = heuristics(e, z, z0, dir) return rdef heuristics(e, z, z0, dir): if abs(z0) is S.Infinity: return limit(e.subs(z, 1/z), z, S.Zero, "+" if z0 is S.Infinity else "-") rv = None bad = (S.Infinity, S.NegativeInfinity, S.NaN, None) if e.is_Mul: r = [] for a in e.args: if not a.is_bounded: r.append(a.limit(z, z0, dir)) if r[-1] in bad: break else: if r: rv = Mul(*r) if rv is None and (e.is_Add or e.is_Pow or e.is_Function): rv = e.func(*[limit(a, z, z0, dir) for a in e.args]) if rv in bad: msg = "Don't know how to calculate the limit(%s, %s, %s, dir=%s), sorry." raise PoleError(msg % (e, z, z0, dir)) return rv[docs]class Limit(Expr): """Represents an unevaluated limit. Examples ======== >>> from sympy import Limit, sin, Symbol >>> from sympy.abc import x >>> Limit(sin(x)/x, x, 0) Limit(sin(x)/x, x, 0) >>> Limit(1/x, x, 0, dir="-") Limit(1/x, x, 0, dir='-') """ def __new__(cls, e, z, z0, dir="+"): e = sympify(e) z = sympify(z) z0 = sympify(z0) if isinstance(dir, basestring): dir = Symbol(dir) elif not isinstance(dir, Symbol): raise TypeError("direction must be of type basestring or Symbol, not %s" % type(dir)) if str(dir) not in ('+', '-'): raise ValueError("direction must be either '+' or '-', not %s" % dir) obj = Expr.__new__(cls) obj._args = (e, z, z0, dir) return obj | http://docs.sympy.org/0.7.2/_modules/sympy/series/limits.html | CC-MAIN-2017-51 | refinedweb | 1,343 | 70.9 |
From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-12-29 02:08:41
David Abrahams wrote:
> Jonathan Turkanis wrote:
>> Jonathan Turkanis wrote:
>>
>>> Okay, if there are no objections, this is what I'll do.
>>
>> This didn't come out quite right -- I know that Daryle has objected.
>>
>> I guess I mean: given the fact that the namespace-directory
>> convention has already been widely violated, if there are no further
>> objections I'll keep the library in the iostreams directory but use
>> the io namespace.
>
> I didn't see the whole thread, but we ought to try to avoid violating
> the convention any more than it has been. As Boost grows, this
> becomes more important. What's wrong with a namespace
> boost::iostreams? You can always introduce an alias for backward
> compatibility.
Since you didn't see the whole thread, let me quote myself:.
> (ii) there currently are not many declarations in the namespace
"boost::io",
> so there is not much chance of collisions
> (iii) it is a more accurate discription of the library, since the core
> infrastructure is independent of the standard iostreams library and might be
> used without streams, e.g., for async i/o.
);
}
The occurence of boost::io::put in the above example has to be qualified, since
otherwise it will refer to the member function being defined. I worry that
having to use a long namespace name or to introduce a namespace alias in a high
percentage of the examples will make the documentation harder to follow, and the
library harder to learn.
If I have to choose, then, I would much rather use the namespace io and move the
library back to boost/io than use the namespace iostreams.
Jonathan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk | https://lists.boost.org/Archives/boost/2004/12/78129.php | CC-MAIN-2021-21 | refinedweb | 306 | 71.65 |
Using ES6 with Asset Pipeline on Ruby on Rails
Read in 7 minutes
This article has been updated. Read Using ES2015 with Asset Pipeline on Ruby on Rails1, which is now called ES6. The first drafts were published in 2011, but the final specification was released in June of this year.
ES6 has so many new features:
Browsers are implementing new features in a fast pace, but it would still take some time until we could actually use ES6. Maybe years. Fortunately, we have Babel.js. We can use all these new features today without worrying with browser compatibility.
Babel.js2 is just a pre-processor. You write code that uses these new features, which will be exported as code that browsers can understand, even those that don’t fully understand ES6.
Using Babel.js
To install Babel make sure you have Node.js installed. Then you can install Babel using NPM.
$ npm install babel -g
You can now use
babel command to compile your JavaScript files. You can enable the watch mode, which will automatically compile modified files. The following example with watch
src and export files to
dist.
$ babel --watch --out-dir=dist src
One of the features I like the most is the new class definition, which abstracts constructor functions. In the following example I create a
User class that receives two arguments in the initialization.
class User { constructor(name, email) { this.name = name; this.email = email; } }
After processing this file with Babel, this is what we have:
User = (function () { function User() { _classCallCheck(this, User); } _createClass(User, [{ key: 'construct', value: function construct(name, email) { this.name = name; this.email = email; } }]); return User; })(); var user = new User('John', '[email protected]'); console.log('name:', user.name); console.log('email:', user.email);
Note that Babel generates all the required code for supporting the class definition. Alternatively, you can use
--external-helpers to generate code that uses helpers (helpers can be generated with the
babel-external-helpers command).
$ babel --external-helpers --watch --out-dir=dist src
Now all supporting code will use the
babelHelpers object.
'use strict'; var User = (function () { function User() { babelHelpers.classCallCheck(this, User); } babelHelpers.createClass(User, [{ key: 'construct', value: function construct(name, email) { this.name = name; this.email = email; } }]); return User; })(); var user = new User('John', '[email protected]'); console.log('name:', user.name); console.log('email:', user.email);
Using Babel.js with Asset Pipeline
Instead of using Babel’s CLI, some people prefer builders like Grunt or Gulp to automate the compilation process. But if you’re using Ruby on Rails you’re more likely to use Asset Pipeline for front-end assets compilation.
Unfortunately there’s no built-in support on the stable release of Sprockets. But if you like to live on the edge3, you can use the master branch.
Update your
Gemfile to include these dependencies..
//= require_tree . //= require_self
Now if you access the page on your browser, you’ll see an
alert box like this:
If you want the new module system, you still have some things to configure.
Using ES6 modules
ES6' source '' do gem 'rails-assets-almond' end
You also have to configure Babel; just create a file at
config/initializers/babel.rb with the following code:
Rails.application.config.assets.configure do |env| babel = Sprockets::BabelProcessor.new( 'modules' => 'amd', 'moduleIds' => true ) env.register_transformer 'application/ecmascript-6', 'application/javascript', babel end
Finally, update
app/assets/javascripts/application.js so it loads almond.
//= require almond //= require jquery //= require turbolinks //= require_tree . //= require_self almond //= require jquery //= require turbolinks //= require_tree . //= require_self require(['application/boot']);
You have to create
app/assets/javascripts/application/boot.es6. I’ll listen to some events, like DOM’s
ready and Turbolinks’
page load.
import $ from 'jquery'; function runner() { // All scripts must live in app/assets/javascripts/application/pages/**/*.es6. var path = $('body').data('route'); // Load script for this page. // We should use System.import, but it's not worth the trouble, so // let's use almond's require instead. try { require([path], onload, null, true); } catch (error) { handleError(error); } } function onload(Page) { //('page:load', runner);
This script needs a
data-route property property on your
<body> element. You can add something like the following to your layout file (e.g.
app/views/layouts/application.html.erb):
<body data-66 today is a viable option. With Babel you can use all these new features without worrying with browser compatibility. The integration with Asset Pipeline make things easier, even for those that don’t fully grasp the Node.js ecosystem.
There’s a working repository available at Github.
ES6 is also known as ES.Next or ES2015 (this is the official name, defined after I first published this article). ↩
This project used to be called 6to5.js. Read more. ↩
The Go community does this all the time, so maybe is not a big deal. ¯\(ツ)/¯ ↩ | http://nandovieira.com/using-es6-with-asset-pipeline-on-ruby-on-rails | CC-MAIN-2017-04 | refinedweb | 803 | 51.34 |
Closed Bug 1438446 Opened 3 years ago Closed 2 years ago
ipdl
Tuple .h tries to use non-memmovable wstring in ns TArray
Categories
(Firefox Build System :: General, defect, P1)
Tracking
(firefox64 fixed)
mozilla64
People
(Reporter: kats, Assigned: kats)
References
Details
Attachments
(2 files)
Hot off the heels of getting a clang build working on Windows, I tried to --enable-clang-plugin and build with that. It proceeded but eventually failed with what looks like a legitimate error. Build log is attached, but basically the nsTArray at [1] contains a bunch of IpdlTupleElement [2] instances, which are variants that might contain a OpenFileNameIPC [3] struct, which contains a std::wstring [4] (actually it contains a few wstring fields). The clang plugin complains because nsTArray has MOZ_NEEDS_MEMMOVABLE_TYPE [5] but wstring is not guaranteed to be memmove-able. This seems like a legitimate complaint, which makes me wonder why our static analysis builds in automation didn't pick this up. [1] [2] [3] [4] [5]
Thanks for filing, I encountered this last week also, but got distracted and forgot about it.
Product: Core → Firefox Build System
> This seems like a legitimate complaint, which makes me wonder why our static > analysis builds in automation didn't pick this up. Clang versions prior to 7 somehow didn't catch this, probably for the same reason as bug 1492743. This will prevent us from moving Windows static analysis into our primary build tasks. :handyman, would you be able to look into this?
will do
Assignee: nobody → davidp99
Flags: needinfo?(davidp99)
Priority: -- → P1
Oh, on closer look this may be easier than I thought... > The clang plugin complains because nsTArray has MOZ_NEEDS_MEMMOVABLE_TYPE That's just the default implementation of nsTArray_CopyChooser. If you're not memmove-able, you can override it. This might be as simple as `DECLARE_USE_COPY_CONSTRUCTORS(IpdlTupleElement)`.
It turned out to be a little more complicated since IpdlTupleElement is private inside IpdlTuple (i.e. can't forward-declare it), and the DECLARE_USE_COPY_CONSTRUCTORS needs to be outside the mozilla namespace, and yet the DECLARE_USE_COPY_CONSTRUCTORS needs to happen before the array is defined. I had to move the IpdlTupleElement and related things outside IpdlTuple to get it working. I'll put up a try push shortly once I confirm my local build doesn't have any other errors. This error seems fixed, but there's some other error now. My local build is still going...
At any rate, this patch should be ok to go in. Suggestions on how to make it less ugly are welcome.
Attachment #9014112 - Flags: review?(dmajor)
Thanks. FWIW, I prefer this namespace setup anyway.
Comment on attachment 9014112 [details] [diff] [review] Patch Review of attachment 9014112 [details] [diff] [review]: ----------------------------------------------------------------- Seems reasonable. The only other thing I could think of is to use nsString instead of std::wstring in OpenFileNameIPC (see also bug 1447674), but that might be more trouble than it's worth, especially with wchar_t vs. char16_t.
Attachment #9014112 - Flags: review?(jld) → review+
Pushed by [email protected]: Use the nsTArray copy constructor for the non-memmovable IpdlTupleElement on Windows. r=jld
Status: NEW → RESOLVED
Closed: 2 years ago
status-firefox64: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Assignee: davidp99 → kats | https://bugzilla.mozilla.org/show_bug.cgi?id=1438446 | CC-MAIN-2020-45 | refinedweb | 529 | 55.54 |
From: Beman Dawes (beman_at_[hidden])
Date: 1999-11-05 08:51:50
jaakko.jarvi_at_[hidden] wrote:
> ...
>
>The library is currently under a kind of an Artistic License.
>
>Basically it can be used freely for any purpose, commercial or
>non-commercial, it can be changed freely as well.
>The only restriction is, that if changes made to BL are distributed
>publicly, they must be clearly marked at the source, and the
>holder is entitled to incorporate the changes to the original
library.
>
>
>
>My questions are:
>
> Do you find the library would a suiable addition to Boost
repository?
Conceptually, it would be a nice addition. Hard to know the details;
it isn't one of those libraries you can just glance at the header and
form a quick opinion of quality. It certainly looks impressive.
Random thoughts; a test program would help, and could you do the
reference manual is HTML rather than a .ps file? And of course wrap
it in namespace boost, etc.
> Does the license cause problems?
Is there any reason you couldn't just use a simple copyright license
like current boost libraries? I always have a problem with licenses
1) which need a lawyer to know what they say, and 2) where the size
of the license is larger than my attension span. Yours isn't really
horrible, but I also don't see why a simple copyright message
wouldn't do just as well.
Thanks,
--Beman
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk | http://lists.boost.org/Archives/boost/1999/11/0855.php | CC-MAIN-2013-20 | refinedweb | 267 | 75.3 |
How to import JS library to typescript in React Native project
typescript import js file from node_modules
react typescript import js library
import third party js in typescript
react import javascript library
include external javascript libraries in an angular typescript project
how to use javascript library in react native
react native'; import js file
How can I import js library (in my case xhook library) into my react native project written in typescript? Or How can I create typescript header file for external js library?
You can simply use:
const signalrLib = require("react-native-signalr").default
Sharing Code between React Web / Native TypeScript Projects, First include the library source file before the compiled TypeScript file of your project ,using script tag in your HTML file . Next ,In your TypeScript I want to import a js library(react-native-webview-bridge) in my react-native project.but my project use typescript,and the library is js.when i import it, it tips
TypeScript compiles to plain Javascript just like Babel or any other extended Javascript language.
So when you add example
xhook to your project, project owner has already compiled his/her TypeScript code into plain JS and you import it just like any other library.
eg.
import xhook from 'xhook' or so on how library author has specified.
You can see it yourself if you visit xhook's git page you can see compiled code in folder
dist and in
package.json -file, attribute
main points to that file.
TypeScript is not itself language that is runned in browser, but that it is always compiled to plain JavaScript. Hopefully this helps out making a grasp how this works.
edit. seems like
xhookis actually written in CoffeeScript but this same rule applies to it as well.
How To Use External Plain JavaScript Libraries in TypeScript Projects, TypeScript is a superset of JavaScript which primarily provides optional static typing, Complete guide to convert a React Native project to TypeScript We must install typings for React and React Native libraries (typings are definition files. This post uses Microsoft's TypeScript-React-Native-Starter repo as a guide.
As suggested, You can use any ES6/ES2015 notation in typescript. With the new typescript, import will be
import xhook from 'xhook';
Older version:
import * as xhook from 'xhook'
Some module doesnt have type support. You can look for type support as
yarn add @types/xhook
If you dont find type support you can use, node require syntax
const xhook = require('xhook');
For that you may have to declare, require definition like:
declare const require: any;
React Native with TypeScript - Rinto Jose, [TypeScript][ts] is a language which extends JavaScript by adding type definitions, Add TypeScript and the types for React Native and Jest to your project. :
Using TypeScript with React Native · React Native, Luckily, options exist to add stronger types to JavaScript. Today, we're going to look at how to use TypeScript in React Native apps. Once you've tried scaffolding out an ordinary React Native project, you'll be ready to start adding TypeScript. Open App.tsx and modify the import at the top of the file: Learn how to migrate a React app to TypeScript from JavaScript, and take advantage of type safety for more reliable code.
Migrating from JavaScript · TypeScript, If you're looking to convert a React project, we recommend looking at the During our JS to TS migration, we'll need to separate our input files to prevent for managing your project's options, such as which files you want to include, and The issue here is that you likely don't have declaration files to describe your library. While React Native is built in Flow, it supports both TypeScript and Flow by default. Getting Started with TypeScript. If you're starting a new project, there are a few different ways to get started. You can use the TypeScript template: npx react-native init MyApp --template react-native-template-typescript
Using TypeScript With React Native, React Native with TypeScript, linting and Enzyme or React Native Testing In this tutorial, you are going to learn how to set up a React Native project with TypeScript. on how to set up linting, Enzyme and React Native Testing Library. react-native init myapp --template typescript && node myapp/setup.js How TypeScript and React Native works. Out of the box, transforming your files to JavaScript works via the same Babel infrastructure as a non-TypeScript React Native project. We recommend that you use the TypeScript compiler only for type checking.
- See if this helps? github.com/philikon/ReactNativify | http://thetopsites.net/article/50150439.shtml | CC-MAIN-2020-50 | refinedweb | 765 | 58.42 |
Introduction
I have been writing about the application architecture without REST, which includes the underlying architecture using WebSockets and the database-driven architecture. In this post, I will continue the journey to make a serverless application architecture using Firebase and AppRun.
You will see how easy it is to use AppRun's event system with the Firebase stack to develop applications that have the full business logic process capabilities, such as authentication, authorization, request logging, and real-time database, and without REST layer.
Finally, we can make the application a serverless deployment to Firebase.
The Architecture
The example application uses the following technologies:
- Firebase Cloud Firestore as the backend database
- Firebase Cloud Functions for business logic process
- Firebase Hosting to host the frontend
- Firebase Authentication
Firebase is Google's mobile platform that helps you quickly develop high-quality apps and grow your business.
I will focus on the architecture instead of step by step instructions. If you are not familiar with the Firebase suite of products, please visit the docs and search for the tutorials.
The architecture can be summarized in the diagram below.
Let's get into the details.
Event Pub-Sub Using FireStore
The center of the architecture is the Firebase Cloud Firestore. Firestore is a real-time database that keeps your data in-sync across client apps. When one client saves the data, FireStore pushes the data to all other clients.
In the AppRun applications, we use app.on to publish events. If we save the events to FireStore, the events can be handled by other applications. It is the step (1) shown in Figure 1 above.
Firestore also triggers Cloud Functions.
Business Logic Process Using Cloud Functions
Cloud Functions is Google Cloud's serverless compute platform. It runs on the server, not in the client apps. Therefore it is the best technology for business logic processing, authentication, and authorization. Functions are serverless. Functions run on Google's server, so we don't need to provision, manage, or upgrade the server.
The Functions are event-driven (the magic word, I love). Firestore can trigger Functions upon data updates. When we save the events into FireStore, FireStore triggers the Function to handle the events automatically. It is the step (2) in Figure 1.
Real-Time Data Sync Using FireStore.
During the Functions event handling, it writes the updated data back to FireStore (step (3) in Figure 1). FireStore pushes the update to the frontend applications (step (4) in Figure 1). The frontend application listens to FireStore changes and publishes AppRun events for the frontend logic process to run.
Now, the event handling cycle is completed. Let's see it in action with an example.
Example
The example is a ToDo application.
Save Events to FireStore
As usual, in the AppRun applications, we convert the DOM events into AppRun events. E.g., When users click the add button, we publish the //: event.
// in JSX <button $onclick={[add]}>Add</button> const add = () => { app.run('//:', '@create-todo', { title: (document.getElementById('new_todo').value, done: 0 }) }
The //: event handler saves the event into FireStore.
const db = firebase.firestore(); app.on('//:', (event, data = {}) => { db.collection(`events`).add({ uid, event, data }) });
There is a top-level collection, called events in FireStore. We save the user id (obtained using Firebase anonymous authentication), event name (@create-todo), and event parameters (the new to-do item).
FireStore triggers our Function, which is monitoring the events collection.
Handle Events in Functions
exports.updateTodo = functions.firestore.document('events/{Id}') .onWrite((change, context) => { const dat = change.after.data() as any; const { uid, event, data } = dat; const db = admin.firestore(); const todos = db.collection('/users/' + uid + '/todos'); switch (event) { case '@create-todo': return todos.add(data); case '@update-todo': ... case '@delete-todo': ... case '@delete-all-todo': ... default: return; } });
The Function destructs the user id, event name, and event parameters and handles it accordingly, e.g., it adds a new Todo item data into FireStore upon the '@create-todo' event. And so on so forth.
FireStore then pushes the data change to the frontend.
Real-Time Data in Frontend
In the frontend, we subscribe to the onSnapshot of FireStore and publish the AppRun event, '@show-all'.
const db = firebase.firestore(); db.collection(`users/${uid}/todos`).onSnapshot(snapshot => { app.run('@show-all', snapshot.docs.map(d => ({ id: d.id, ...d.data() }))) });
Now, we are back to our AppRun application world, in which you can see the three familiar parts: state, view, and update.
import app, { Component } from 'apprun'; const state = { filter: 0, todos: [] } const add = () => { app.run('//:', '@create-todo', { title: (document.getElementById('new_todo').value, done: 0 }) }; const toggle = (_, todo) => { app.run('//:', '@update-todo', { ...todo, done: !todo.done }) }; const remove = (_, todo) => { app.run('//:', '@delete-todo', todo) }; const clear = () => { app.run('//:', '@delete-all-todo') }; const view = ({todos}) => {...} const update = { '@show-all': (state, todos) => ({ ...state, todos }) }
The Firebase ToDo application shares the same architecture as in the Database-Driven Application Post. They are only different in events. The Firebase ToDo application saves the events to FireStore. The Database-Driven Application sends and receives the events through the WebSockets.
If you are new to AppRun, read the AppRun Book or visit AppRun Docs.
Live Demo and Source Code
You can play with the live demo at
Or visit the project on Github.
yysun / apprun-firebase
A serverless application using Firebase and AppRun
Conclusion
The AppRun event pub-sub pattern looks so simple (just app.run and app.on), yet so powerful. It is not only useful inside the frontend app. It shines more in crossing process boundaries, such as in the cases of WebSockets, Web Workers, Electron Apps, Firebase of course, and more ...
Learn more about AppRun and build event-driven applications.
Discussion (2)
Does the use of Cloud Functions require that the frontend web app is hosted at Firebase?
You can host the front end anywhere you want. | https://dev.to/yysun/serverless-app-on-firebase-using-apprun-1k46 | CC-MAIN-2022-21 | refinedweb | 973 | 60.01 |
How do I end a Tkinter program? Let's say I have this code:
from Tkinter import *
def quit():
# code to exit
root = Tk()
Button(root, text="Quit", command=quit).pack()
root.mainloop()
quit
root.quit()
Above line just Bypasses the
root.mainloop() i.e root.mainloop() will still be running in background if quit() command is executed.
root.destroy()
While destroy() command vanish out
root.mainloop() i.e root.mainloop() stops.
So as you just want to quit the program so you should use
root.destroy() as it will it stop the mainloop().
But if you want to run some infinite loop and you don't want to destroy your Tk window and want to execute some code after
root.mainloop() line then you should use
root.quit(). Ex:
from Tkinter import * def quit(): global root root.quit() root = Tk() while True: Button(root, text="Quit", command=quit).pack() root.mainloop() #do something | https://codedump.io/share/OgqAafAK0BPc/1/close-a-tkinter-window | CC-MAIN-2017-09 | refinedweb | 154 | 69.79 |
Dialog creation
Contents
Introduction
In this page we will show how to build a simple graphical interface with Qt Designer, Qt's official tool for designing interfaces; the dialog will be converted to Python code, then it will be used inside FreeCAD. We'll assume that the user knows how to edit and run Python generally.
In this example, the entire interface is defined in Python. Although this is possible for small interfaces, for larger interfaces the recommendation is to load the created .ui files directly into the program. See Interface creation with UI files for more information.
Two general methods to create interfaces, by including the interface in the Python file, or by using
.ui files.
Designing the dialog
In CAD applications, designing a good UI (User Interface) is very important. About everything the user will do will be through some piece of interface: reading dialog boxes, pressing buttons, choosing between icons, etc. So it is very important to think carefully to what you want to do, how you want the user to behave, and how will be the workflow of your action.
There are a couple of concepts to know when designing interface:
- Modal/non-modal dialogs: A modal dialog appears in front of your screen, stopping the action of the main window, forcing the user to respond to the dialog, while a non-modal dialog doesn't stop you from working on the main window. In some case the first is better, in other cases not.
- Identifying what is required and what is optional: Make sure the user knows what he must do. Label everything with proper description, use tooltips, etc.
- Separating commands from parameters: This is usually done with buttons and text input fields. The user knows that clicking a button will produce an action while changing a value inside a text field will change a parameter somewhere. Nowadays, though, users usually know well what is a button, what is an input field, etc. The interface toolkit we are using, Qt, is a state-of-the-art toolkit, and we won't have to worry much about making things clear, since they will already be very clear by themselves.
So, now that we have well defined what we will do, it's time to open the qt designer. Let's design a very simple dialog, like this:
We will then use this dialog in FreeCAD to produce a nice rectangular plane. You might find it not very useful to produce nice rectangular planes, but it will be easy to change it later to do more complex things. When you open it, Qt Designer looks like this:
Creating the dialog
Qt Designer is very simple to use. On the left bar you have elements that can be dragged on your widget. On the right side you have properties panels displaying all kinds of editable properties of selected elements. So, begin with creating a new widget.
- Select "Dialog without buttons", since we don't want the default OK/Cancel buttons.
- We need 'Labels. Labels are simple text strings that appear on your widget to inform the end user. If you select a label, notice that on the right side there will appear several properties that you can modify such as: font style, height, etc... So lets drag 3 separate labels on to our widget:
- One label for the title
- Another label for writing "Height"
- Another label for writing "Width"
- We now need LineEdits (2 of them actually). Drag two of them on to the widget. LineEdits are text fields that the end user can fill in. So we need one LineEdit for the Height and one for the Width. Here too, we can edit properties. For example, why not set a default value say for example: 1.00 for each. This way, when the user will see the dialog, both values will be filled already. If the end user is satisfied, they can directly press the button, saving precious time.
- Next lets add a PushButton. This is the button the end user will need to press after they've filled both fields.
Note: that we chose very simple controls here. Qt has many more options, for example one could use Spinboxes instead of LineEdits, etc... Have a look at what is available, explore...you will surely have other ideas.
That's about all we need to do in Qt Designer. One last thing, though, let's rename all our elements with simpler names, so it will be easier to identify them in our scripts:
Converting our dialog to python
Now, let's save our widget somewhere. It will be saved as an .ui file, that we will easily convert to python script with pyuic. On windows, the pyuic program is bundled with pyqt (to be verified), on linux you probably will need to install it separately from your package manager (on debian-based systems, it is part of the pyqt4-dev-tools package). To do the conversion, you'll need to open a terminal window (or a command prompt window on windows), navigate to where you saved your .ui file, and issue:
pyuic mywidget.ui > mywidget.py
In Windows pyuic.py is located in "C:\Python27\Lib\site-packages\PyQt4\uic\pyuic.py" For conversion create a batch file called "compQt4.bat:
@"C:\Python27\python" "C:\Python27\Lib\site-packages\PyQt4\uic\pyuic.py" -x %1.ui > %1.py
In the DOS console type without extension
compQt4 myUiFile
Into Linux : to do
Since FreeCAD progressively moved away from PyQt after version 0.13, in favour of PySide (Choose your PySide install building PySide), to make the file based on PySide now you have to use:
pyside-uic mywidget.ui -o mywidget.py
In Windows uic.py are located in "C:\Python27\Lib\site-packages\PySide\scripts\uic.py" For create batch file "compSide.bat":
@"C:\Python27\python" "C:\Python27\Lib\site-packages\PySide\scripts\uic.py" %1.ui > %1.py
In the DOS console type without extension
compSide myUiFile
Into Linux : to do
On some systems the program is called pyuic4 instead of pyuic. This will simply convert the .ui file into a python script. If we open the mywidget.py file, its contents is very easy to understand:
from PySide import QtCore, QtGui.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog) def retranslateUi(self, Dialog): Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) self.title.setText(QtGui.QApplication.translate("Dialog", "Plane-O-Matic", None, QtGui.QApplication.UnicodeUTF8)) ...
As you see it has a very simple structure: a class named Ui_Dialog is created, that stores the interface elements of our widget. That class has two methods, one for setting up the widget, and one for translating its contents, which is part of the general Qt mechanism for translating interface elements. The setup method simply creates, one by one, the widgets as we defined them in Qt Designer, and sets their options as we decided earlier. Then, the whole interface gets translated, and finally, the slots get connected (we'll talk about that later).
We can now create a new widget and use this class to create its interface. We can already see our widget in action, by putting our mywidget.py file in a place where FreeCAD will find it (in the FreeCAD bin directory, or in any of the Mod subdirectories), and, in the FreeCAD python interpreter, issue:
from PySide import QtGui import mywidget d = QtGui.QWidget() d.ui = mywidget.Ui_Dialog() d.ui.setupUi(d) d.show()
And our dialog will appear! Note that our Python interpreter is still working, we have a non-modal dialog. So, to close it, we can (apart from clicking its close icon, of course) issue:
d.hide()
Making our dialog do something
Now that we can show and hide our dialog, we just need to add one last part: To make it do something! If you play a bit with Qt designer, you'll quickly discover a whole section called "signals and slots". Basically, it works like this: elements on your widgets (in Qt terminology, those elements are themselves widgets) can send signals. Those signals differ according to the widget type. For example, a button can send a signal when it is pressed and when it is released. Those signals can be connected to slots, which can be special functionality of other widgets (for example a dialog has a "close" slot to which you can connect the signal from a close button), or can be custom functions. The PyQt Reference Documentation lists all the qt widgets, what they can do, what signals they can send, etc...
What we will do here, is to create a new function that will create a plane based on height and width, and to connect that function to the pressed signal emitted by our "Create!" button. So, let's begin with importing our FreeCAD modules, by putting the following line at the top of the script, where we already import QtCore and QtGui:
import FreeCAD, Part
Then, let's add a new function to our Ui_Dialog class:) self.hide()
Then, we need to inform Qt to connect the button to the function, by placing the following line just before QtCore.QMetaObject.connectSlotsByName(Dialog):
QtCore.QObject.connect(self.create,QtCore.SIGNAL("pressed()"),self.createPlane)
This, as you see, connects the pressed() signal of our create object (the "Create!" button), to a slot named createPlane, which we just defined. That's it! Now, as a final touch, we can add a little function to create the dialog, it will be easier to call. Outside the Ui_Dialog class, let's add this code:
class plane(): def __init__(self): self.d = QtGui.QWidget() self.ui = Ui_Dialog() self.ui.setupUi(self.d) self.d.show()
(Python reminder: the __init__ method of a class is automatically executed whenever a new object is created!) Then, from FreeCAD, we only need to do:
import mywidget myDialog = mywidget.plane()
That's all Folks... Now you can try all kinds of things, like for example inserting your widget in the FreeCAD interface (see the Code snippets page), or making much more advanced custom tools, by using other elements on your widget.
The complete script
This is the complete script, for reference:
# Form implementation generated from reading ui file 'mywidget.ui' # # Created: Mon Jun 1 19:09:10 2009 # by: PyQt4 UI code generator 4.4.4 # Modified for PySide 16:02:2015 # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui import FreeCAD, Part.label_width.setGeometry(QtCore.QRect(10, 50, 57, 16)) self.label_width.setObjectName("label_width") self.label_height = QtGui.QLabel(Dialog) self.label_height.setGeometry(QtCore.QRect(10, 90, 57, 16)) self.label_height.setObjectName("label_height") self.width = QtGui.QLineEdit(Dialog) self.width.setGeometry(QtCore.QRect(60, 40, 111, 26)) self.width.setObjectName("width") self.height = QtGui.QLineEdit(Dialog) self.height.setGeometry(QtCore.QRect(60, 80, 111, 26)) self.height.setObjectName("height") self.create = QtGui.QPushButton(Dialog) self.create.setGeometry(QtCore.QRect(50, 140, 83, 26)) self.create.setObjectName("create") self.retranslateUi(Dialog) QtCore.QObject.connect(self.create,QtCore.SIGNAL("pressed()"),self.createPlane) QtCore.QMetaObject.connectSlotsByName(Dialog) def retranslateUi(self, Dialog): Dialog.setWindowTitle("Dialog") self.title.setText("Plane-O-Matic") self.label_width.setText("Width") self.label_height.setText("Height") self.create.setText("Create!") print("tyty")) class plane(): def __init__(self): self.d = QtGui.QWidget() self.ui = Ui_Dialog() self.ui.setupUi(self.d) self.d.show()
More examples
- Dialog creation with various widgets with
QPushButton,
QLineEdit,
QCheckBox,
QRadioButton, and others.
- Dialog creation reading and writing files with
QFileDialog.
- Dialog creation setting colors with
QColorDialog.
- Dialog creation image and animated GIF with
QLabeland
QMovie.
- PySide usage snippets. | https://wiki.freecadweb.org/Dialog_creation/tr | CC-MAIN-2020-24 | refinedweb | 1,943 | 56.86 |
This is a utility class for replacing a set of force/torques by an equivalent force/torque (defined by the ContactForce class). More...
#include <drake/attic/multibody/rigid_body_plant/contact_resultant_force_calculator.h>
This is a utility class for replacing a set of force/torques by an equivalent force/torque (defined by the ContactForce class).
The equivalent ContactForce consists of the set's resultant force applied at a point
P, together with a torque equal to the moment of the set about
P summed with any torques defined in the set members. Point
P is chosen to minimize the magnitude of the moment of the normal forces (i.e.,
P lies along the "central axis" of the normal forces). Note: only the normal components of the input contact forces affect the location of point
P. Tangential components of the input contact forces affect the set's resultant, but not the calculation of point
P.
For point
P to be a center of pressure (as returned by this class):
n.
F.
Fmust be perpendicular to
n. If these conditions are met,
Pwill be the center of pressure and lie on plane
F, and the minimum moment due to the normal forces will be zero. Note: this class does not rely on a center of pressure existing.
The class is designed to be exercised by a contact response model. As each pair of collision elements is evaluated, the contact model should instantiate a ContactResultantForceCalculator. As each contact point between the elements is processed and a contact force is computed, the details of the contact force are provided to the calculator (via calls to AddForce). Currently, the contact force is defined by four values (see ContactForce):
After all of the forces have been added to the calculator, an equivalent ContactForce (force/torque) can be requested using the appropriate method.
The order in which the forces are added has no impact on the final result.
By default, the contact forces that are added to the calculator are destroyed when the calculator is destroyed. There is an alternative constructor which allows the caller to provide an STL vector which will accumulate the contact information and allow the caller to persist the data beyond the life span of the calculator.
If the set consists of a single contact force, the minimum moment point and resultant force will be the details of that force: i.e., its application point, response force, and pure torque.
For an arbitrary set of forces, there may not be a well-defined center of pressure as with the planar case outlined above. Generally, there is an infinite set of minimum moment points for a set of contact forces; it is a line called the "central axis". Any point on this line will lead to the same minimum moment. The ContactResultantForceCalculator selects one of those points.
We assume that the "ideal" point would be where the line intersects the (deformed) contact surface. Generally, this can't be solved because it depends on a geometric query that is outside the scope of this calculator class. Furthermore, in many cases, it is unnecessary. A point on the surface is good for visualization, but in contexts where only a mathematically meaningful point is all that is needed, then one point is as good as another. That said, the calculator employs a method to cheaply approximate the intersection of the line with the contact surface by doing the following.
The central axis can be thought of as a line defined by a point and direction. The point can be any point on the line. The direction is defined by the direction of the resultant normal force (i.e., the vector sum of the normal components of all forces.) The direction vector defines "positive" and "negative" directions on the line. The force originated from the negative direction and accelerates the body in the positive direction. If we had access to the geometry, the point we would be interested in, would be the intersection of the line and (deformed) geometry that is farthest in the "negative" direction (i.e., closest to the originating source of the contact).
We will approximate this by finding the contact force application point that similarly lies farthest in the negative direction (simply by projecting the application points on the line.) This most-negative projection point will serve as the reported minimum moment point.
This reported minimum moment point can be moved along the central axis by the caller if additional information is available. Movement along the axis preserves its "minimal-moment" property. For example, if the caller had access to the (deformed) geometry, the ray defined by the reported minimum moment point and the resultant ContactForce normal direction can be intersected with the geometry to create an alternate, but equally valid, minimum moment point.
It is possible for all of the contact forces to sum up to a zero resultant. But there may still be a resultant moment, i.e., the forces are "coupled". In this case, the minimum moment point can be literally any point in space. In this case, the ContactResultantForceCalculator defines the minimum moment point to be the centroid of all application points (the "average" application point.) Similarly, the normal direction of this resultant force is likewise meaningless but will be set to the +x direction (i.e., <1, 0, 0>).
Even though the resultant is reported as a ContactForce instance, it should not be construed to mean that the results of the calculator can be meaningfully composed. For example, given a set of contact forces:
S = {f_0, ..., f_n-1}, the result of computing the resultant for the set
S (i.e.,
F = ComputeResultant(S) will not necessarily provide the same answer as would be produced by creating two disjoint subsets,
S_a and
S_b and then performing:
Do not expect
F to be equal to
F_ab.
Instantiated templates for the following ScalarTypes are provided:
Default constructor – no accumulation.
As contact forces are added to the calculator, the force will be added to the set of forces for calculation, but they will be destroyed when the calculator is destroyed.
Accumulator constructor.
This allows the caller to provide a vector into which the contact forces/details can be persisted beyond the life span of the ContactResultantForceCalculator instance. See the various AddForce methods for details on what is placed in the
detail_accumulator.
Adds a new contact force to the calculator.
If the calculator was initialized with a detail accumulator, an instance of PointContactDetail, with this contact force, will be appended to that accumulator.
Adds a new force to the calculator from a contact detail.
The result of ContactDetail::ComputeContactForce will be used in the calculation.
If the calculator was initialized with a detail accumulator, the detail will be appended to that accumulator. Otherwise, the detail will be destroyed at the conclusion of this method invocation.
Adds a new force to the calculator.
If the calculator was initialized with a detail accumulator, an instance of PointContactDetail, with this contact information, will be appended to that accumulator.
Adds a new force with an arbitrary pure torque to the calculator.
If the calculator was initialized with a detail accumulator, an instance of PointContactDetail, with this contact information, will be appended to that accumulator.
Compute the resultant contact force – it's translational force, pure torque, and application point.
The rotational component of this ContactForce is pure torque only. It does not include an
r X f moment term. It will be non-zero due to contributions from sources such as:
- the minimum moment (which may be non-zero in the general case), - the moments induced by the tangential components of the forces shifted to the minimum moment point, and - the sum of the pure torques of the individual input contact forces.
The responsibility of computing the moment belongs to the code that knows what frame the input contact forces are defined and what the origin around which the moment would be induced.
Computes the resultant contact spatial force with respect to a given reference point.
The force part is the summation of all f_i, where f_i is the individual force. The torque part is the summation of all tau_i + (p_i - r) X f_i, where tau_i is the ith pure torque, f_i is applied at p_i, and r is the given reference point. | http://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_contact_resultant_force_calculator.html | CC-MAIN-2018-43 | refinedweb | 1,381 | 53.21 |
:)
- machinehistory
Here is a quick example for sending midi from pythonista. I am using MidiFire to process the messages as discussed here.. My midifire setup to send out midi consists of an osc block connected to an event monitor connected to a midi output block.
import socket # addressing information of target #fill in your ip and port IPADDR = '127.0.0.1' PORTNUM = 8051 # enter the data content of the UDP packet as hex msg1 = bytearray([0x90, 0x40, 0x60]) msg2 = bytes.fromhex('903e70') #or using variable for midi note message midi_message = '903c50' midi_packet = bytes.fromhex(midi_message) #(midi_packet) s.send(msg1) s.send(msg2) # close the socket s.close() | https://forum.omz-software.com/topic/4506/midi | CC-MAIN-2021-04 | refinedweb | 108 | 59.4 |
Sprite to render.
The SpriteRenderer component will render the assigned Sprite.sprite sprite. The rendered sprite can be changed by specifying a different sprite in the sprite variable.
// Example that loads sprites from a texture in the Resources folder // and allows them to be chosen by the selection button.
using UnityEngine;
public class ExampleClass : MonoBehaviour { private string spriteNames = "part_explosion"; private Rect buttonPos; private int spriteVersion = 0; private SpriteRenderer spriteR; private Sprite[] sprites;
void Start() { buttonPos = new Rect(10.0f, 10.0f, 150.0f, 50.0f); spriteR = gameObject.GetComponent<SpriteRenderer>(); sprites = Resources.LoadAll<Sprite>(spriteNames); }
void OnGUI() { if (GUI.Button(buttonPos, "Choose next sprite")) { spriteVersion += 1; if (spriteVersion > 3) spriteVersion = 0; spriteR.sprite = sprites[spriteVersion]; } } }
Did you find this page useful? Please give it a rating: | https://docs.unity3d.com/2020.1/Documentation/ScriptReference/SpriteRenderer-sprite.html | CC-MAIN-2021-17 | refinedweb | 125 | 52.87 |
Virtual Functions - 2014
The code below shows only public members are accessible from outside of the class:
class A { public: int xPublic; protected: int xProtected; private: int xPrivate; }; class B : public A {}; int main(int argc, char** argv) { A a; a.xPublic = 0; a.xProtected = 0; // error: inaccessible a.xPrivate = 0; // error: inaccessible B b; b.xPublic = 0; b.xProtected = 0; // error: inaccessible b.xPrivate = 0; // error: inaccessible return 0; }
The following code shows that the inherited member is accessible within the class. But still even the inherited member accessing outside a class is not allowed (b.xProtected) because the same rule applies to the inherited member: protected member cannot be accessed from outside of a class (inherited member of a parent class remains as a protected member of a child class).
class A { public: int xPublic; protected: int xProtected; private: int xPrivate; }; class B : public A { public: void foo(A *a, B *b) { a->xProtected = 0.0; // error: A::xProtected inaccessible b->xProtected = 0.0; // OK: inherited member this->xProtected = 0.0; } } int main(int argc, char** argv) { A a; B b; b.xProtected = 0.0; // error: inaccessible outside of a class - inherited xProtected b.foo(&a;, &b;); return 0; }
(Note) Non-static protected members of a base class can not be accessed via a pointer or reference to the base class.
The accessibility property of the introduced foo() method from the A type is private in the C type, hence it will not be publicly accessible. This is the case regardless of the fact that the A type is publicly derived and the foo method has public accessibility in A type. The alias created by the using declaration has the usual accessibility for a member declaration.
#include <iostream> class A { public: void foo() const { std::cout << "A"; } }; class B { public: void foo() const { std::cout << "B"; } }; class C : public A, public B { using A::foo; }; int main() { B b; b.foo(); // OK: B::foo() C c; c.foo(); // error: A::foo() or private member in class 'C' return 0; }
When we talk about virtual function or virtual method, it's always in the context of inheritance and polymorphism. It is a function or method whose behavior can be overridden within an inheriting class by a function with the same signature. In other words, the purpose of virtual functions is to allow customization of derived class implementations.
A virtual method is a method whose implementation is determined at runtime based on the actual type of the invoking object. It needs to be declared with the virtual keyword, and the nonvirtual method is the default.
In other words, defining in a base class a virtual function that has another version in a derived class signals to the compiler, "We don't want static binding for this function. What we do want is the selection of the function to be called at any given point in the program based on the kind of object for which is called."
The implication of this: "The virtual call is resolved at runtime because the object cannot know whether it belongs to the class the member function is in, or some class derived from it."
Let's look at our simple examples.
#include <iostream> class A { public: void f() { std::cout << "A::f()" << std::endl; } }; class B: public A { public: void f() { std::cout << "B::f()" << std::endl; } }; class C: public B { public: void f() { std::cout << "C::f()" << std::endl; } }; class D: public C { public: // No f() }; int main() { A *a = new A(); B *b = new B(); C *c = new C(); D *d = new D(); a->f(); // A::f() b->f(); // B::f() c->f(); // C::f() d->f(); // C::f() ((B *)c)->f(); // B::f() ((A *)c)->f(); // A::f() ((A *)b)->f(); // A::f() return 0; }
Because f() is declared as nonvirtual, the invoked method depends on the type used at compile time. So, the invoked method is the method of the pointer type:
((B *)c)->f();
c is a type of B, so it invokes the method of Class B and so on. Also, note that in the call
d->f(); // C::f()inherited C::f() is used because no f() was defined in the class D.
#include <iostream> using namespace std; class Base { public: char* name; // virtual void display() { cout << name << endl; } }; class Derived: public Base { public: char* name; void display() { cout << name << ", " << Base::name << endl; } }; int main() { Derived d; d.name = "Derived Class"; d.Base::name = "Base Class"; Derived* dptr = &d; // standard conversion from Derived* to Base* Base* bptr = dptr; // call Base::display() // output: "Base Class" bptr->display(); return 0; }
If we redeclare f() as virtual in the base class A as the code below:
#include <iostream> class A { public: virtual void f() { std::cout << "A::f()" << std::endl; } }; class B: public A { public: void f() { std::cout << "B::f()" << std::endl; } }; class C: public B { public: void f() { std::cout << "C::f()" << std::endl; } }; int main() { A *a = new A(); B *b = new B(); C *c = new C(); a->f(); // A::f() b->f(); // B::f() c->f(); // C::f() ((B *)c)->f(); // C::f() ((A *)c)->f(); // C::f() ((A *)b)->f(); // B::f() return 0; }
then, the method invoked when we run is the method of the actual object
((B *)c)->f();
Here, because c is object type of Class C, it calls the f() in Class C, C::f().
class Base { public: void f(); virtual void vf(); }; class Derived : public Base { public: void f(); void vf(); }; #include <iostream> using namespace std; void Base::f() { cout << "Base f()" << endl; } void Base::vf() { cout << "Base vf()" << endl; } void Derived::f() { cout << "Derived f()" << endl; } void Derived::vf() { cout << "Derived vf()" << endl; } int main() { Base b1; Derived d1; b1.f(); b1.vf(); d1.f(); d1.vf(); Derived d2; // Derived object Base* bp = &d2; // Base pointer to Derived object bp->f(); // Base f() bp->vf(); // which vf()? return 0; }
The output of the run is:
Base f() Base vf() Derived f() Derived vf() Base f() Derived vf()
The pointer (or reference) type is known at compile time while object type might be determined at runtime. Interpreting a function call in the source code as executing a particular block of function code is called binding the function name.
Binding that takes place during compile time is static binding or early binding. With the virtual function, the binding task is more difficult. The decision of which function to use can't be made at compile time because the compiler doesn't know which object the user is going to choose to make.
So, the compiler has to generate code that allows the correct virtual method to be selected as the code runs. This is dynamic binding or late binding.
In other words, when a request (message) is sent to an object, the particular operation that's performed depends on both the request and receiving object. Different objects that support identical request may have different implementation of the operations that fulfill these requests. The run-time association of a request to an object and one of its operations is known as dynamic binding. This means that issuing a request doesn't commit us to a particular implementation until run-time. So, we can write programs that expect an object with a particular interface, knowing that any object that has the correct interface will accept the request.
Let's look at the output we got.
Other results are as we expected. But the last one is the one that we want to talk more.
If vf() is not declared as virtual in the base class, bp->vf() goes by the pointer type (Base *) and invokes Base::vf().
The pointer type is known at compile time as we discussed above, so the compiler can bind vf() to Base::vf() at compile time. In other words, the compiler uses static binding for nonvirtual method.
However, if vf() is declared as virtual in the base class, bp->vf() goes by the object type, here, Derived and invokes Derived::vf().
In this example, we can see that the object type is Derived, however, there are cases the object type can only be determined at runtime. So, the compiler generated code that binds vf() to Base::vf() or Derived::vf(), depending on the object type at runtime.
In other words, the compiler uses dynamic binding for virtual methods.
In our example, vf() is virtual and the object type is Derived. So, it calls vf() in the Derived class.
Here is a summary for the virtual methods.
- A virtual method in a base class makes the function virtual in all classes derived from the base class.
- If a virtual method is invoked by using a reference to an object or by using a pointer to an object, the code uses the method defined for the object type rather than the method defined for the reference or pointer type. This is dynamic binding or late binding.
This behavior is important since it's always valid for a base-class pointer or reference to refer to an object of a derived type.
- If we're defining a class that will be used as a base class, we should declare as virtual functions the class methods that may have to be redefined in derived classes.
- The run-time selection is the primary advantage of virtual method.
- The disadvantages are that it takes longer to invoke a virtual method and that extra memory is required to store the information needed for the lookup. Virtual function calls must be resolved at run time by performing a vtable lookup, whereas non-virtual function calls can be resolved at compile time. This can make virtual function calls slower than non-virtual calls. In reality, this overhead may be negligible, particularly if our function does non-trivial work or if it is not called frequently. The use of virtual functions increases the size of an object, typically by the size of a pointer to the vtable. This may be an issue if we wish to create a small object that requires a very large number of instances. In reality, this will likely be insignificant when compared to the amount of memory consumed by our various member variables.
- Adding, reordering, or removing a virtual function will break binary compatibility. This is because a virtual function call is typically represented as an integer offset into the vtable for the class. So, changing its order or causing the order of any other virtual functions to change means that existing code will need to be recompiled to ensue that it still calls the right functions.
- A class with no virtual functions tends to be more robust and requires less maintenance that one with virtual functions.
Let's guess the output from the following example. Note that the virtual key word is commented out.
#include <iostream> class Base { public: void f() {std::cout << "Base::f()\n";} // virtual void vf(){std::cout << "Base::vf()\n";}; }; class Derived: public Base { public: void f() {std::cout <<"Derived::f()\n";} void vf(){std::cout <<"Derived::vf()\n";}; }; int main() { Base b; Base *pb = &b; Derived d; Derived *pd = &d; Base *pbd = &d; b.f(); d.f(); pb->f(); pd->f(); pbd->f(); pbd->vf(); return 0; }
Output is:
Base::f() Derived::f() Base::f() Derived::f() Base::f() Base::vf()
However, if we put the virtual back, the output is different.
... class Base { public: void f() {std::cout << "Base::f()\n";} virtual void vf(){std::cout << "Base::vf()\n";}; }; ...
Our new output is:
Base::f() Derived::f() Base::f() Derived::f() Base::f() Derived::vf()
The following sample may not be obvious regarding which method it is calling:
#include <iostream> #include <vector> using namespace std; class A { public: A(int n = 0) : m(n) {} public: virtual int getVal() const { cout << "A::getVal() = "; return m; } virtual ~A() { } protected: int m; }; class B : public A { public: B(int n = 0) : A(n) {} public: int getVal() const { cout << "B::getVal() = "; return m + 1; } }; int main() { const A a(1); const B b(3); const A *pA[2] = { &a;, &b; }; cout << pA[0]->getVal() << endl; cout << pA[1]->getVal() << endl; vector<A> vA; vA.push_back(a); vA.push_back(b); vector<A>::const_iterator it = vA.begin(); cout << it->getVal() << endl; cout << (it + 1)->getVal() << endl; return 0; }
Output should look like this:
A::getVal() = 1 B::getVal() = 4 A::getVal() = 1 A::getVal() = 3
So, actually, the 3rd and 4th calls are the same as the following:
cout << vA[0].getVal() << endl; cout << vA[1].getVal() << endl;
In the code below, the method B::foo is called but with the default argument of 99 from A::foo. A virtual function call uses the default arguments in the declaration of the virtual function determined by the static type of the pointer or reference denoting the object. An overriding function in a derived class does not acquire default arguments from the function it overrides. So, the a->foo() gets the parameter from A::foo(int x = 99) but not from B::foo(x = 77).
#include <iostream> struct A { virtual int foo(int x = 99) { return x; } }; struct B : public A { int foo(int x = 77) { return x; } }; int main(int argc, char** argv) { A* a = new B; std::cout << a->foo() << std::endl; // output 99 return 0; }
Virtual destructor should be defined for a class to ensure that the proper destructor is called if a class is derived from it. An object of the derived class is deallocated using object expression in which the static type refers to the base class.
If a class to be used as a base class, the destructor should be virtual. If a class does not contain virtual functions, that often tells it is not meant to be used as a base class.
Calling a method with an object pointer always invokes:
- The most derived class function, if a method is virtual.
- The function implementation corresponding to the object pointer type (used to call the method), if a method is not virtual.
A virtual destructor works in the same way. A destructor gets called when an object goes out of scope or when we call delete on an object pointer (reference).
When any derived class object goes out of scope, the destructor of that derived class gets called first. It then calls its parent class destructor so memory allocated to the object is properly released.
But, if we call delete on a base pointer which points to a derived class object, the base class destructor get called first for non-virtual function.
The rule of thumb - if we have a class with a virtual function, it needs a virtual destructor. Why?
- If a class has a virtual function, it is likely to be used as a base class.
- If it is a base class, its derived class is likely to be allocated using new.
- If a derived class object is allocated using new and manipulated through a pointer to its base, it is likely to be deleted via a pointer to its base.
Let's look at the example below.
#include <iostream> using namespace std; class Base { public: Base() { cout << "Base Constructor \n" ; } ~Base() { cout << "Base Destructor \n" ; } }; class Derived : public Base { public: Derived(string s):str(s) { cout << "Derived Constructor \n" ; } ~Derived() { cout << "Derived Destructor \n" ; } private: string str; }; int main() { Base *pB = new Derived("derived"); delete pB; }
Output from the run is:
Base Constructor Derived Constructor (Derived Destructor)- Not called Base Destructor
As we see from the output, deleting a base pointer only calls destructor for the base class not the destructor for the derived class.
Base *pB = new Derived(); delete pB;
In the code, pB is a pointer to a base class with non-virtual destructor, and we are trying to delete a derived class object through a base class pointer. The results are undefined. What happens at runtime is that the derived parts of the object never destroyed. But the base class part typically would be destroyed. So, it has a weird object which is partially destroyed.
However, if we declare the vase class destructor as virtual, this makes all the derived class destructors virtual as well.
Let's replace the above destructor:
~Base() { cout << "Base Destructor \n" ; }
with this:
virtual ~Base() { cout << "Base Destructor \n" ; }
Then, the output becomes:
Base Constructor Derived Constructor Derived Destructor Base Destructor
#include <iostream> using namespace std; class Base{ protected: int myInt; public: Base(int n):myInt(n){ cout << "Base Ctor\n"; } virtual void print() const = 0; virtual ~Base(){ cout << "Base Dtor" << endl; } }; class Derived: public Base { public: Derived(int n = 0):Base(n) { str = new char[100]; myInt = n; cout << "Derived Ctor myInt" << endl; } void print()const{ cout << "Derived print(): myInt = "<< myInt << endl; } ~Derived(){ cout << "Derived Dtor" << endl; delete [] str; } private: char *str; }; int main() { Base *pB = new Derived(2010); pB->print(); delete pB; return 0; }
In the example above, the Derived class has a char * member str that points to memory allocated by new.
str = new char[100];
Then, when a Derived object expires or we call delete on the pointer to the Derived object, it's critical that the ~Derived destructor be called to free that memory.
Derived::~Derived(){ delete [] str; }
The output from the run:
Base Ctor Derived Ctor myInt Derived print(): myInt = 2010 Derived Dtor Base Dtor
Look at the line of code below
delete pB;
If the default static binding applies, the delete invokes the Base destructor, ~Base().
This frees memory pointed to by the Base component of the Derived object but not memory pointed to by the new class members.
However, if the destructors are virtual, the same code invokes the ~Derived() destructor, which frees memory pointed to by the Derived component, and then calls the ~Base() destructor to free memory pointed to by the Base component.
So, using virtual destructors ensures that the correct sequence of destructors is called.
Now, let's look at the following example, and figure out what's happening.
#include <iostream> #include <string> using namespace std; struct a { ~a( ) { cout << "~a()" << endl;} }; struct b : public a { ~b( ) { cout << "~b() throw 1" << endl; throw 1; }; }; bool c( ) { a* d=new b; //base pointer pointing to derived object try { delete d; // deleteing derived class } catch( int e ) { cout << "catch e" << endl; return e; } return false; } int main() { c(); return 0; }
The output from the run is simple, and we know why.
~a()
As a quick summary, here is probably the simplest example for virtual destructor of a base class.
Q: Why is the keyword "virtual" added before the person destructor?
class Person { public: Person(); virtual ~Person(); }; class Blogger: public Person { public: Blogger(); ~Blogger(); };
Answer: To ensure that the proper destructor is called if this class is derived from and an object of the derived class is deallocated using object expression in which the static type refers to the base class.
Constructors can't be virtual!
"Creating a derived object invokes a derived class constructor, not a base class constructor. The derived class constructor then uses a base class constructor, but the sequence is distinct from the inheritance mechanism. Therefore, a derived class doesn't inherit the base class constructors, so usually there's not much point to making them virtual, anyway." - from C++ Primer, 5th ed.
When constructing an object, we must specify the name of a concrete class that is known at compile time. For instance,
MyClass *obj = new MyClass();
Here, MyClass is a specific type that must be known by the compiler. There is no binding at run time for constructors in C++.
Again, we cannot declare a virtual constructor in C++. We must specify the exact type of the object to be constructed at compile time. The compiler therefore allocates the memory for that specific type and then calls the default constructor for any base classes unless we explicitly specify a non-default constructor in the initialization list. It then calls the constructor for the specific type itself. This is also why we cannot call virtual methods from the constructor and expect them to call the derived override because the derived class hasn't been initialized yet.
Confused?
Then, let's take a step back, and think about what the constructor is doing regarding virtual something.
Also, we need to know the order of calling constructor to understand the virtual constructor: the constructors are called in order, starting from base class to the more derived class. It must also call member-object constructors along the way.
The following lines are mostly from Bruce Eckel's "Thinking in C++."
If we call a virtual function inside our constructor, only the local version of the function is used. In other words, the virtual mechanism doesn't work within the constructor.
What's the constructor's job?
It is to bring the object into existence. Inside any constructor, the object may only be partially formed - the only thing for sure is that the base class objects have been initialized, but we do not have any info regarding class hierarchy. A virtual function call, however, try to reach down the inheritance hierarchy. It may call a function in a derived class. If we could do this inside a constructor, we'd be calling a function that might touch members that had not been initialized yet, which may cause some unexpected outcome.
When a constructor is called, one of the first things it does is initialize its pointer in the vtable.
However, the constructor does not know whether or not the object is in the base class or other derived classes. When the compiler creates a code for that constructor, it creates a code for a constructor of that class, not for a base class or not for a class derived from it. So the pointer in the vtable it uses must be for the vtable of that class. The pointer remains initialized to that vtable for the rest of the object's lifetime unless this isn't the last constructor call. If a more-derived constructor is called afterwards, that constructor resets the pointer to its vtable, and so forth, until the last constructor finishes. The state of the pointer is determined by the constructor that is called last.
Every constructor is setting the pointer to its own vtable. If it uses the virtual mechanism for function calls, it will produce only a call through its own vtable, not the most-derived vtable.
In summary, unlike destructor, constructor works downward in the class hierarchy: base class to more derived class. Each vtable is for that class only. There is no way to make the virtual mechanism working within the constructor.
Deleting NULL pointers has no effect. Deleting a pointer to a base class which points to a derived object is legal assuming the base destructor is virtual. However, deleting an array of derived objects using a base class pointer is undefined. So, it's unsafe!
struct Foo { virtual ~Foo() {} }; struct Bar : public Foo {}; int main() { Foo* f = new Bar; delete f; f = 0; delete f; Foo* fa = new Bar[10]; delete [] fa; fa = 0; delete fa; return 0; }
Why?
There have been quite a few discussions on this issue. Here is one of the threads on the issue. Base pointer to array of derived objects.
The pure virtual functions are essential to creating abstract classes. They give us a way to declare functions that offer no implementations.
As we recall from previous sections that the keyword virtual allows a function call to connect with appropriate implementation, even when a reference to a parent class is used to make the call. The compiler calls a virtual function indirectly through a function pointer stored in the object.
If we change the virtual function in the Base class:
virtual void vf();
to:
virtual void vf() = 0;
the vf() becomes a pure virtual function.
Suddenly, the Base class becomes an abstract class. Its pure virtual function, vf() marks it as such.
As a result, clients cannot create instances of the Base class, only of classes derived from it.
Putting a pure virtual function in our class tells other programmers two things about the class:
- They cannot instantiate an object of this class - they should create a child class from it.
- They must override all pure virtual functions in the child class, or they will not be able to instantiate the child class.
Here is a little summary for the purpose of virtual functions from Effective C++ by Scott Meyers.
-.
- We must provide a function body for the pure virtual destructor.
While pure virtual destructors are legal in Standard C++, there is an added constraint when using them:
we must provide a function body for the pure virtual destructor.
This seems counterintuitive; how can a virtual function be pure if it needs a function body?
But if we keep in mind that constructors and destructors are special operations, it makes more sense, especially if we remember that all destructors in a class hierarchy are always called. If we do not provide the definition for a pure virtual destructor, what function body would be called during destruction?
Thus, it's absolutely necessary that the compiler and linker enforce the existence of a function body for a pure virtual destructor.
//Interface.h class Interface { public: //pure virtual destructor declaration virtual ~Interface() = 0; };
Then, somewhere outside the class declaration, the pure virtual destructor has to be defined like this:
//Interface.cpp file //definition of a pure virtual destructor; should always be empty Interface::~Interface() {}
- What's the value of.
- Difference between a regular virtual destructor and a pure virtual destruct.
Virtual base classes allow an object derived from multiple bases to share a common base to inherit just one object of that shared base class.
#include <string> using namespace std; class Worker { public: string name; }; class Student: public virtual Worker { public: int studentID; }; class Assistant: virtual public Worker { public: int employerID; }; class StudentAssitant: public Student, public Assistant {};
Now a StudentAssitant object will contain a single copy of a
Here, the virtual key word does not have any obvious connection to the virtual in virtual functions.
How many times is "Base" printed by the program below?
#include <iostream> using namespace std; struct Base { Base() { cout << "Base" << endl; } }; struct d1 : virtual public Base {d1(){cout << "d1" << endl;}}; struct d2 : virtual public Base {d2(){cout << "d2" << endl;}}; struct d3 : public Base {d3(){cout << "d3" << endl;}}; struct d4 : public Base {d4(){cout << "d4" << endl;}}; struct ddd : public d1, public d2, public d3, public d4 { }; int main(int argc, char** argv) { ddd d; return 0; }
3 times.
One time for the first virtual occurrences of Base in the hierarchy and once for each non-virtual occurrences of Base. d1 and d2 together have one. d3 and d4 each have one.
Output:
Base d1 d2 Base d3 Base d4
The following code won't compile because the ambiguity of method print() inherited:
#include <iostream> struct Shape { virtual void print() { std::cout << "Shape" << std::endl; } virtual ~Shape() {} }; struct Box : public virtual Shape { void print() { std::cout << "Box" << std::endl; } }; struct Sphere : public virtual Shape { void print() { std::cout << "Sphere" << std::endl; } }; struct BoxSphere : public Box, public Sphere {}; int main(int argc, char** argv) { Shape* s = new BoxSphere; s->print(); delete s; return 0; }
In this case, we may specify which print() we're using such as Box::print() or Sphere::print():
struct BoxSphere : public Box, public Sphere { public: void print() { Sphere::print(); Box::print();} };
Let's look at the following example:
; } }; int main() { Derived d; d.MethodA(); d.MethodA(4); return 0; }
We may get a compiler error something like this:
'Derived::MethodA' : function does not take 1 arguments
Even though we may not get the error, however, the code has the following implications:
Derived d; d.MethodA(); // OK d.MethodA(4); // Not OK
The new definition defines a MethodA() that takes no arguments. Rather than resulting in two overloaded version of the function, this redefinition hides the base class version that takes an int argument. In other words, redefining inherited methods is not a variation of overloading. If we redefine a function in a derived class, it doesn't just override the base class declaration with the same function signature. It hides all base-class methods of the same name, regardless of the argument signature.
So, if the base class declaration is overloaded, we need to redefine all the base-class versions in the derived class as in the modified code below:
; } virtual void MethodA(int a) { cout << "Derived::void MethodA(int a)" << endl; } }; int main() { Derived d; d.MethodA(); d.MethodA(4); return 0; }
Now, we have an output:
Derived::void MethodA() Derived::void MethodA(int a)
If we redefine just one version, the other one become hidden and cannot be used by objects of the derived class.
This is not related to virtual but it's worth mentioning. Let's look at the following code:
int x = 7; int main() { cout << x; int x = x; return 0; }
When we print out x, it will give us a right value 7, however, at the line int x = x, it won't be executed properly because we are trying to initialize x with unknown x. Actually, at the moment of defining x, it hides the global x, and we no longer sees it.
So, this one wont't work either:
int x = 7; int main() { cout << x; int x; // declaration is fine until we actually try to use it cout << x; // Not OK because x not initialized return 0; }
The following code is fine. We just declare a new array x with the size of global variable x:
const int x = 7; int main() { cout << x; int x[x]; int sz = sizeof(x)/sizeof(x[0]); return 0; } | http://www.bogotobogo.com/cplusplus/virtualfunctions.php | CC-MAIN-2017-34 | refinedweb | 4,965 | 57.71 |
I want to send ftp or telnet commands on the Unix command box. I want to connect to say ftp enter user name and password and then run "ls" command
Here is what I have written so far, code to ftp.
But when I run the program I do not know what has happened? How can I do the next stage like enter "user name" "password" and finally run "ls" command for unix?????????
import java.lang.*;
import java.io.*;
public class RuntimeFTP{
public static void main(String[] arg){
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = { "", "jaguar.wmin.ac.uk" };
try
{
Process child = rt.exec(callAndArgs);
child.waitFor();
System.out.println("Process exit code is: " + child.exitValue() );
}
catch(IOException e)
{
System.err.println("IOException starting process!");
}
catch(InterruptedException e)
{
System.out.println("Interrupted waiting for process!");
}
}
}
rmlc
Thanks this looks very interesting.
I just hope now I can integrate one of these programs into something that I am working on.
Speak to you later,
bye for now
Thank you for the link but the links have not been as fruitful as first anticipated. I would like to study the source code of an ftp or telnet client.
The first link to ftp program the source code is illegible:
Whilst Bruce Blackshaw program at
Has 3 folders and many classes making it very difficult to study the code.
Finally the program at alpha-work does not provide any source code.
I have done my own search on the web but I think I am not a good searcher on the search engine.
I would be greatful for any more more links on ftp or telnet java program with source code, preferably one with easy to understand code.
Thanks in advance.
I want to integrate an ftp program into a program I am working on. I have scoured the net for reusebale code and come across a "t or Linlyn ftp program" which claims is easily integrateable into larger applications. The code is quite small so easy to understand.
The problem is did does not seem to work and gives me errors. I would be grateful if someone could tell me why I am getting the error, here is the error:
C:\My_DL_Dap\ftp in java>appletviewer t.java
Warning: <applet> tag requires width attribute.
java.security.AccessControlException: access denied (java.net.SocketPermission j
aguar.wmin.ac.uk resolve)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt09)
at java.net.InetAddress.getAllByName0(InetAddress.java:890)
at java.net.InetAddress.getAllByName(InetAddress.java:884)
at java.net.InetAddress.getByName(InetAddress.java:814)
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:109)
at java.net.Socket.<init>(Socket.java:118)
at Linlyn.ftpConnect(t.java:326)
at Linlyn.<init>(t.java:236)
at t.init(t.java:83)
at sun.applet.AppletPanel.run(AppletPanel.java:341)
at java.lang.Thread.run(Thread.java:536)
I would also be grateful if someone could try out the propgram and tell me if it works for them, then I could determine if it is because ftp clients are being blocked by my server. The ftp program is very small, here is the url:
1) compile the code
2) fill in everywhere it requests "your-server" "username" and "password"
3) to run appletviewer t.java
Hi,
this is more of a question than solution. I have no experience on this but my doubt is based on my general knowledge of Java and networking. In your code you are calling an external program called and executing it. If my understanding of your requirement is correct then then why do you need this (any advantage?) i.e. call an external FTP program when you can create a socket directly to your FTP host on port 21 for FTP connection and work out suitable code to handle "username" & "password".
String[] callAndArgs = { "", "jaguar.wmin.ac.uk" };
try
{
Process child = rt.exec(callAndArgs);
When you run an external program () then you have to pass on arguments (FTP host address,username,password) to this program and not to the host directly because your java code is not requesting a connection to the FTP host.
Bye
Pankaj
Forum Rules
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center | http://forums.devx.com/showthread.php?137692-More-info-on-simple-program&goto=nextoldest | CC-MAIN-2017-09 | refinedweb | 706 | 59.5 |
Im working on an issue where i need a program to randomly generate numbers and not repeats them. I also need the progam to ask for the users input:
"How many lotto lines do you want to generate"??
So when the user put in 5 - the user gets 5 lines of lotto code
The code i have so far is :
import java.util.ArrayList; import java.util.Random; package javaapplication2; /** * * @author Stirbob */ public class loto { public static void main(String[] arg) { ArrayList<Integer> al = new ArrayList<Integer>(); for(int r = 1; r <= 42; r++) al.add(r); Random ran = new Random(); for(int r = 0; r < 6; r++) { int n = al.remove(ran.nextInt(al.size())); System.out.print(" " + n); } System.out.println(); } }
Please Help??
This post has been edited by macosxnerd101: 19 November 2010 - 09:06 AM
Reason for edit:: Please use code tags. | http://www.dreamincode.net/forums/topic/200989-lotto-with-user-input/ | CC-MAIN-2016-40 | refinedweb | 145 | 65.93 |
Empirical Analysis of Public Key Infrastructures and Investigation of Improvements
- Zoe Wilkinson
- 3 years ago
- Views:
Transcription
1 Network Architectures and Services NET Dissertation Empirical Analysis of Public Key Infrastructures and Investigation of Improvements Ralph-Günther Holz Technische Universität München
2
3 TECHNISCHE UNIVERSITÄT MÜNCHEN Institut für Informatik Lehrstuhl für Netzarchitekturen und Netzdienste Empirical Analysis of Public Key Infrastructures and Investigation of Improvements Ralph-Günther Holz Vollständiger Abdruck der von der Fakultät für Informatik. Thomas Neumann Prüfer der Dissertation: 1. Univ.-Prof. Dr.-Ing. Georg Carle 2. Assoc. Prof. Nick Feamster, Ph.D., Georgia Institute of Technology, Atlanta/USA Die Dissertation wurde am bei der Technischen Universität München eingereicht und durch die Fakultät für Informatik am angenommen.
4
5 Abstract Public Key Infrastructures (PKIs) were developed to address the key distribution problem of asymmetric cryptography. Certificates bind an identity to a public key and are signed by a trustworthy entity, called the issuer. Although seemingly a simple concept, the setup of a PKI is not an easy task at all. Trustworthy issuers need to be guaranteed, and certificates must be issued conforming to certain standards. A correct deployment is needed to ensure the PKI is usable for the parties that rely on it. Some PKIs, like the important X.509 PKI for TLS, were criticised from early on for being poor examples with respect to these aspects. The objective of this thesis is to provide a sound analysis of important PKIs and to analyse proposals for improvements for one of them, X.509. The contributions of this thesis are threefold. In the first part of this thesis, we carry out an analysis of known criticisms of the X.509 PKI and show that they were never addressed well. The approach here is both documental as well as empirical. Furthermore, we provide a survey of incidents in the X.509 PKI, some of which brought it close to failure, and identify their root causes. This analysis allows us to formulate requirements that improvements for the X.509 PKI have to meet. The methodology here is historical-documental. In the second part of the thesis, we apply empirical methods to analyse the status quo for three representative and important PKIs that address different use cases: X.509, the OpenPGP Web of Trust, and the simple key distribution mechanism of SSH. We measure their respective strengths and weaknesses, in particular with respect to deployment, and draw conclusions about the level of security that each PKI achieves in practical use. For X.509, we carried out HTTPS scans of a large number of servers over a period of 1.5 years, including scans from globally distributed vantage points. We also monitored live TLS traffic on a high-speed link of a large network. Our analyses of the thus obtained certification data reveals that the quality of certification lacks in stringency to a degree that is truly worrisome. For OpenPGP, we conducted a graph analysis of the Web of Trust, with a focus on properties such as usefulness and robustness of certification chains. We also analysed the community structure of the Web of Trust and mapped it to social relationships. This allows us to determine for which users, and on which scale, the Web of Trust is particularly useful. For SSH, we carried out several scans over the entire IPv4 address space and collected statistics on host-keys and ciphers used. A number of keys were found to be duplicates, but not due to cryptographic weaknesses. For these, we determined in which network setups they occurred and identified both secure as well as very insecure patterns of use. In the third part of this thesis, we study five representative schemes to improve the security of X.509. In order to describe each scheme succinctly, we first develop a unified notation to capture the essential protocol flows and properties of each scheme. We then analyse its security properties with particular regard to three threat models that we defined for this purpose. A further particular focus is on the deployment properties of a scheme, i.e., which entities need to make changes to implement it. Based on our findings, we identify the two most promising candidates to reinforce X.509. However, all schemes fall short in one respect, namely automatic incident reporting and localisation of the position of an attacker. We thus developed and deployed our own solution, Crossbear, to close this gap. Crossbear allows to detect an ongoing man-in-the-middle attack and initiates a distributed but centrally coordinated hunting process to determine the location of the attacker in the network with a fair degree of confidence. III
6
7 Zusammenfassung Public Key Infrastructures (PKIs) wurden als Antwort auf das Problem der sicheren Schlüsselverteilung in der symmetrischen Kryptographie eingeführt. Zertifikate von vertrauenswürdigen Ausstellern binden einen öffentlichen Schlüssel an die Identität eines Teilnehmers. Der Aufbau einer PKI ist jedoch kein leichtes Unterfangen. Zum einen muss die Vertrauenswürdigkeit der Aussteller garantiert und Zertifikate müssen nach anerkannten Standards ausgestellt werden. Zum anderen müssen die Zertifikate auf korrekte Weise zum Einsatz kommen, um sicherzustellen, dass alle Teilnehmer sie auch nutzen können. PKIs wie X.509 wurden schon früh dafür kritisiert, dass sie in den genannten Bereichen Schwächen aufweisen. Das Ziel dieser Arbeit ist eine umfassende Analyse wichtiger PKIs und eine Analyse von Verbesserungen für eine davon, X.509. Im ersten Teil der Arbeit werden frühere, bekannte Kritikpunkte an X.509 daraufhin untersucht, ob seit ihrer Veröffentlichung Verbesserungen erreicht wurden. Es wird gezeigt, dass das nicht der Fall ist. Der Ansatz enthält sowohl dokumentarische als auch empirische Elemente. Weiterhin wird eine Ursachenanalyse für eine Reihe von kritischen Vorfällen in der X.509 PKI durchgeführt, von denen einige die Sicherheit der PKI beinahe außer Kraft gesetzt hätten. Daraus werden Anforderungen abgeleitet, die Erweiterungen von X.509 erfüllen müssen, um Verbesserungen bewirken zu können. Der Ansatz hier ist vor allem dokumentarisch. Im zweiten Teil kommen empirische Methoden zum Einsatz, um den Status Quo für drei repräsentative und wichtige PKIs zu ermitteln. Diese PKIs decken jeweils unterschiedliche Anwendungsfälle ab. Es handelt sich um X.509, das Open PGP Web of Trust, und die Schlüsselverteilung in SSH. Für jede PKI werden Methoden entwickelt, mit denen die besonderen Stärken und Schwächen der jeweiligen PKI ermittelt werden können. Das erlaubt Rückschlüsse auf die Sicherheit, die die jeweilige PKI bietet. Für X.509 wurde eine große Zahl an Servern über einen Zeitraum von 1,5 Jahren gescannt, zum Teil auch von Beobachtungspunkten rund um den Globus. Zusätzlich wurden Monitoringdaten genutzt. Die Analyse zeigt eine besorgniserregende Qualität der Zertifikate und ihres Einsatzes. Für OpenPGP wird eine Graphanalyse des Web of Trust durchgeführt. Der Fokus liegt auf der Nützlichkeit dieser PKI und ihrer Robustheit gegen ungewollte Änderungen. Zusätzlich wird untersucht, inwiefern sich die Teilnehmer des Web of Trust sogenannten Communities, die sozialen Verbindungen entsprechen, zuordnen lassen. Dies erlaubt es, Rückschlüsse zu ziehen, für welche Teilnehmer das Web of Trust einen besonders hohen Nutzen aufweist. Die Arbeiten zu SSH umfassen Scans, die internetweit durchgeführt wurden. Es werden zum einen Statistiken zu Chiffren und den Schlüsseln erhoben, mit denen sich Hosts in SSH authentisieren. Zum anderen wird eine Analyse von Schlüsseln durchgeführt, die keine kryptographischen Schwächen haben, aber häufig auftreten. Dies passiert vor allem in bestimmten Netzwerkkonfigurationen, von denen einige sehr unsicher sind. Im dritten Teil werden Systeme zur Verbesserung von X.509 untersucht. Dazu wird eine Notation entwickelt, die es erlaubt, die wesentlichen Protokollflüsse und Design- Elemente eines Systems in einheitlicher Weise zu beschreiben. Darauf baut eine Analyse der Sicherheitseigenschaften des Systems auf. Weiterhin wird eine Betrachtung durchgeführt, welche Schwierigkeiten sich bei der Einführung des Systems ergeben können. Mit Hilfe dieser Betrachtungen werden die zwei aussichtsreichsten Kandidaten zur Verbesserung von X.509 identifiziert. Alle betrachteten Systeme haben jedoch einen Nachteil: Sie erlauben keine automatisierte Meldung von Angriffen oder gar eine Lokalisierung des Angreifers. Daher wurde im Rahmen der Arbeit Crossbear entwickelt: Crossbear erlaubt, Man-in-the-middle-Angriffe auf TLS zu erkennen. Als Reaktion koordiniert Crossbear einen verteilten Prozess, der es ermöglicht, die Position des Angreifers mit hinreichender Genauigkeit zu ermitteln. V
8
9 Acknowledgements This work would not have been possible without the invaluable help and steady support of a number of people. I would like to take the opportunity to express my gratitude. My first thanks go to my advisor Dr. Georg Carle, of course, for making it possible for me to carry out my research at his Chair and providing much support and guidance throughout. He also provided much career advice once this thesis was submitted. I would also like to thank Dr. Nick Feamster for being my second referee and Dr. Thomas Neumann for heading my committee. I was very fortunate to have some excellent collaborators, research students, and co-authors to work with. A sincere thank you goes to all of them, in particular Lothar Braun, Oliver Gasser, Peter Hauck, Nils Kammenhuber, Thomas Riedmaier, and Alexander Ulrich. My parents and friends have supported me and believed in me throughout all these years. I cannot begin to say how grateful I am. A very personal thank you goes to my partner Hui Xue for providing moral support and being the wonderful person she is. Finally, I would like to thank some people who proofread my work or who helped to improve it during many discussions: Lothar Braun, Maren Büttner, Nathan Evans, Christian Grothoff, Michael Herrmann, Nils Kammenhuber, Andreas Müller, Heiko Niedermayer, Stephan A. Posselt, and Stephan Symons. VII
10
11 Contents Contents I. Introduction and background 1 1. Introduction Research Objectives Structure of this thesis Note on terminology Publications in the context of this thesis Theory and practice of Public Key Infrastructures The nature of authentication The Key Distribution Problem Key distribution in symmetric cryptography Key distribution in public-key cryptography Forms of Public Key Infrastructures X.509 Public Key Infrastructure Historical development of X Certificate structure CA hierarchy Use of X.509 in TLS The OpenPGP Web of Trust The Secure Shell (SSH) and its PKI model PKI model Protocol flow of SSH Revocation Revocation and scalability Revocation in X.509 for TLS Revocation in OpenPGP Text adapted from previous publications II. Analyses of Public Key Infrastructures Analysis of the weaknesses of the X.509 PKI Investigated questions Criticism of the design CA proliferation: the weakest link Trust and liability Strength of identity verification Summarising view Incidents and attacks against the X.509 PKI Attacks against the X.509 PKI Surveillance Cryptographic breakthroughs Summarising view IX
12 Contents 3.4. Reinforcements to the X.509 PKI The impossibility of direct defence Improving defences Related work Key contributions of this chapter Analysis of the X.509 PKI using active and passive measurements Investigated questions Measurements and data sets Methodology for active scans Passive monitoring Data properties Data preprocessing Host analyses Host replies with TLS Negotiated ciphers and key lengths Certificate analyses Certificate occurrences Correctness of certificate chains Correct hostnames in certificates Unusual hostnames in the Common Name Hostnames in self-signed certificates Extended Validation Signature Algorithms Public key properties Validity periods Length of certificate chains Certification structure Different certificates between locations Certificate issuers Further parameters Certificate quality Related work and aftermath Previous work Later work Summarising view Key contributions of this chapter Statement on author s contributions Analysis of the OpenPGP Web of Trust Introduction and investigated questions Methodology Graph extraction Terms and graph metrics Results Macro structure: SCCs Usefulness in the LSCC Robustness of the LSCC Community structure of the Web of Trust Cryptographic algorithms History of the Web of Trust Related work X
13 Contents 5.5. Summarising view Key contributions of this chapter Statement on author s contributions Analysis of the PKI for SSH Investigated questions Scanning process and data sets Scanner Scanning periods and data sets Enriching data sets Results Protocol versions Server versions Weak keys Duplicate non-weak keys Use of SSHFP Cryptographic algorithms Key lengths Ethical considerations Responsible scanning Sharing data sets Related work Summarising view Key contributions of this chapter Statement on author s contributions III. Strengthening the X.509 PKI Unified notation for X.509 reinforcements Developing a notation for PKI reinforcements Motivation and design goals Design elements Structure of a scheme Sessions and event-driven descriptions List of well-known records List of well-known processes Operators and comments Representation of design elements in the notation Example: certification in the current X.509 PKI and TLS Related work Key contributions of this chapter Proposals to replace or strengthen X Threat models Pinning Choice of TACK as subject to study TACK operation and representation in our notation Assessment of TACK Storing certification information in the DNS DNSSEC Representing DNSSEC in our notation XI
14 Contents Certification Authority Authorization (CAA) CAA operation and representation in our notation Assessment of CAA DNS-based Authentication of Named Entities: DANE-TLSA DANE-TLSA operation and representation in our notation Assessment of DANE-TLSA Notary concepts Choice of Perspectives as subject to study Operation and representation in our notation Simplifications and choices in representation Assessment of Perspectives Public log-based proposals: Certificate Transparency Choice of Certificate Transparency as subject to study Operation and representation in our notation Assessment of Certificate Transparency Assessment of schemes Contributions to security and robustness Issues of deployment Choosing the appropriate candidate Related work Key contributions of this chapter Crossbear: detecting and locating man-in-the-middle attackers Introduction Crossbear design and ecosystem Methodology Intended user base Principle of operation Details of detection and hunting processes Simplifications for the representation in our notation Analysis and discussion of effectivity Attacker model Detection Localisation Attacks against Crossbear Status of deployment and cooperation with OONI Related work Discussion Key contributions of this chapter Statement on author s contributions IV. Summary and conclusion Summary and conclusion Results from Research Objectives Quo vadis? research directions for PKI V. Appendices 237 List of frequently used acronyms i XII
15 Contents Academic resources Books RFCs Further resources List of figures List of tables List of algorithms and listings iii ix xi xv xxv xxvii xxix XIII
16
17 Part I. Introduction and background 1
18
19 1Chapter 1. Introduction It is often said that security is an essential property that should be guaranteed for all electronic communication. With the Internet having established itself as the primary medium of communication, this is now certainly true: the value of communicated information has increased. The need for secure transmission of sensitive financial information (e.g., credit card numbers, bank accounts) is evident. More recently, however, a need to protect messages as a way to ensure personal safety has emerged the Internet has also become a platform for political activity, for collaboration and information dissemination with several countries attempting to exercise control over the activities of their dissidents. Networking protocols and applications are thus rightfully expected to protect critical data. Confidentiality, authentication of communication partner and message origin, as well as message integrity, are aspects of security that can be achieved by cryptographic protective measures. Central to all cryptography is the issue of key distribution, which counts among the hardest problems to solve. Public Key Infrastructures (PKIs) are an important form of key distribution. In a PKI, the goal is to certify a binding between data items. Most commonly, this is the authenticity of a public key, which is expressed as a digital signature on the combination of entity name (identity) and corresponding public key. The issuer of a signature must be a Trusted Third Party (TTP). Analysis of the security of PKIs thus requires to take into account the role and correct functioning of the different entities that are responsible for security-critical operations like identity verification, certificate issuance and safeguarding key material. In this thesis, we analyse the role that PKIs play in protecting Internet communication. Our contributions are threefold. We begin with a systematic analysis of weaknesses of the PKI that is currently the most important one, namely the X.509 PKI as used for the Transport Layer Security (TLS) protocol [94, 97]. We identify fundamental weaknesses in the organisation and structure of X.509, which revolve mostly around the concept of Certification Authorities (CAs) as TTPs. We provide evidence that critical weaknesses continue to persist in the X.509 PKI to this day, and have not been resolved. This will allow us to draw first conclusions with respect to possible improvements. The core of this dissertation consists of an empirical analysis of the three PKIs that are most widely used today. Each PKI serves a different use case. Our primary subject of investigation is once again the X.509 PKI, particularly its use in securing the WWW. By active and passive measurement, we determine how well the X.509 PKI has been deployed and the level of security that it provides. The second PKI we chose is the OpenPGP [93] Web of Trust, a PKI where entities are not servers or hosts, but users wishing to secure their private communication. Due to the nature of this PKI, we use graph analysis to determine to which degree it is useful for its users and which security it provides for them. The third PKI is the False PKI, i.e., a PKI without TTPs, as used in the Secure Shell (SSH) protocol [125]. SSH is an important protocol in network management. Its mechanism of key distribution is different from the other two PKIs, 3
20 1. Introduction and it is thus a very valuable subject to study. As SSH is closely linked to network management practices, these will be at the focus of our analysis, too. The third part of this dissertation chooses the X.509 PKI as its sole subject again. Several proposals have been made to reinforce this PKI, with each proposal serving a slightly different purpose. Based on our conclusions in the first part, we provide an analysis of these proposals and assess how robust they are in the face of attackers of varying strengths. As no proposal addresses the open problem of automated attack detection and reporting, the final contribution of this dissertation describes the design, development and deployment of Crossbear, our tool to detect and locate man-in-themiddle attackers Research Objectives We are now going to outline the Research Objectives of this thesis. There are three overall Research Objectives, which we split into several subtasks. O1: Identifying weaknesses and historical-documental analysis of incidents The goal of the first Research Objective is an analysis of the weaknesses of the X.509 PKI by investigating both earlier criticism of X.509 as well as known incidents. This allows us to draw conclusions what requirements mechanisms to improve the PKI have to meet. In particular, we analyse earlier academic work and determine which criticisms have been brought forward. Against this background, we investigate whether the shortcomings have been satisfactorily addressed and provide evidence for our claims. Since 2001, several attacks have become known that threatened the security of the X.509 PKI. We use a historical-documental approach and analyse the reports from incidents. Our goal is to identify the root causes and determine how, and by which entity, the attacks were detected. Finally, we derive conclusions what kind of improvements would help reinforce the PKI. Our objective is thus split into three tasks: O1.1 To identify weaknesses of the X.509 PKI and determine whether these have been satisfactorily addressed. O1.2 To investigate and analyse incidents, and in particular determine the root causes and how the attacks were detected. O1.3 To derive conclusions which improvements would help strengthen the X.509 PKI. O2: Empirical analyses of PKIs While the previous Research Objective can only provide evidence about a relatively small number of incidents, which furthermore can only be analysed from publicly available sources, the question remains whether systematic weaknesses exist in the PKIs that have been deployed. Having such data would be very valuable as it would allow to mount pressure at entities that operate PKIs to improve the status of their security. Research Objective O2 is thus to carry out large-scale analyses to empirically measure PKI deployment and structure. As the PKIs to investigate, we choose X.509, the OpenPGP Web of Trust, and SSH. Different methodologies have to be employed in this endeavour. The X.509 PKI can be analysed by active scans of Web hosts, by analysis of data from TLS monitoring, and 4
21 1.1. Research Objectives by statistical evaluation of the properties of certificates. As X.509 is tree-structured and essentially all information is public, links between cryptographic entities and their properties are relatively easy to trace. The challenge here is in obtaining the data optimally, over a longer period of time to track changes and in applying the correct statistical methods on large data sets to derive statistically significant conclusions. The OpenPGP Web of Trust, however, is not accessible to the above methodology. While data sets can be obtained from so-called key servers, there is very little information stored with such keys. The whole concept of a Web of Trust is based on storing much information locally, and very little publicly. Therefore, the methodology has to be different: only graph analysis can shed light on the links between entities and their properties. The methodology to analyse the third large infrastructure, SSH, resembles the one for TLS again. However, obtaining data is much more difficult as scans of SSH ports are very often considered hostile in nature by the scanned party. Much care has to be applied to avoid being marked as an annoyance or, worse, a hostile party. Analysis of the data is also slightly different in nature: SSH does not employ certificate chains as X.509 does. Key distribution is practically always managed from a central location. Thus, an important focus must be on identifying issues that arise as a consequence of this particular kind of key distribution and network management. To summarise, the goal of this Research Objective is to derive empirical data about the three most widely employed PKI technologies, analyse it, and derive conclusions with respect to the level of security each technology provides. We formulate the following three tasks: O2.1 To analyse and assess the deployment and use of the X.509 PKI for the WWW, with particular focus on security weaknesses and quality of certification. O2.2 To analyse and assess the OpenPGP Web of Trust, with particular respect to the usefulness and security that the Web of Trust provides for its users. O2.3 To analyse and assess the deployment of the SSH infrastructure on the Internet, with particular regard to issues that may arise from its method of key distribution. O3: Improvements to X.509 and attack detection Research Objective O3 returns to the X.509 PKI for the WWW. We will see from our results in Research Objectives O1 and O2 that there are critical issues to solve, and that the X.509 PKI for the WWW is in a state that makes it infeasible for it to withstand certain attacks, in particular from adversaries on state-level to whom many resources are available. Several proposals have been made by other researchers to improve (or even replace) the X.509 PKI. These must be analysed with regard to several aspects, in particular the improvements they provide and their robustness against attackers of varying strengths. One also needs to consider whether there are serious obstacles that would hinder their deployment. Optimally, an analysis should be carried out using a common framework to describe the important properties of each proposal which we will call a scheme in a formalised way. In particular, it should be easy to identify the participants in each scheme, the actions they need to carry out, the interactions with other participants, and the security of the communication channels over which they occur. 5
22 1. Introduction Another issue that the research community is facing is a true lack of empirical evidence of ongoing attacks. Such data would be very valuable as it would allow to identify the nature of attacks (local or regional, for example) and possibly help derive the identity of the attackers. As no scheme addresses automated attack detection and reporting, we thus set ourselves the design, development and deployment of such a scheme as a further objective. Summing up the previous paragraphs, we thus arrive at the following research objectives. O3.1 To develop a formalised notation to describe schemes to improve the X.509 PKI; to use it to analyse the schemes with respect to the contributions they make to strengthen the PKI, their robustness against attackers, and potential issues with deployment. O3.2 To design, develop and deploy a scheme that is able to detect attacks against the X.509 PKI for the WWW, and to provide data that allows to analyse the nature of these attacks, in particular the location of the attacker. Figure 1.1 provides a summary of our Research Objectives for graphical reference, and shows how each part builds on previous ones Structure of this thesis The structure of this thesis follows the outline of the Research Objectives. We describe it in the following. Chapter 2 introduces the reader to the theory and practice of PKIs. We derive the principal idea from the concepts of authentication and key distribution, both of which we show to be hard problems. This is followed by an overview of the different forms that PKIs may take and present several models and instantiations, particular X.509, OpenPGP, and SSH. Our discussion is structured around the underlying assumptions concerning trust in other entities that are at the core of each model. We also touch on the difficulty of revocation, which is a topic that is often overlooked. Chapter 3 addresses Research Objective O1. We build on previous work to identify critical issues in X.509 and investigate whether these have been addressed (we will see that this was mostly not the case). In the second part of the chapter, we investigate incident reports of the past twelve years in great detail and extract the root causes. Organisational practices, structure of the PKI and technical vulnerabilities will be identified as the primary root causes. Against this background, we derive conclusions which mechanisms may help improve X.509. Chapter 4 begins the empirical contributions that this thesis makes. It addresses Research Objective O2.1. We present the results of our empirical study of the X.509 PKI as it is primarily used, namely in TLS for the WWW. We scanned the hosts on the Alexa Top 1 Million list of popular Web sites and downloaded the X.509 certificates they presented. These scans were carried out over a duration of 1.5 years and also included scans from eight further vantage points on other continents. We complemented our data sets with data we obtained from monitoring TLS connections in the Munich Scientific Network and also included a data set from a third party for reference. We analysed the thus obtained certificates with respect to a number of properties that are crucial for security goals to be achieved. Foremost among these is validity of the certificate chain, especially with respect to information identifying the Web host. We also investigated 6
23 1.2. Structure of this thesis Research Objectives O1 Analysis of weaknesses of X.509 O1.1 Critical issues and evidence O1.2 Analysis of incidents in X.509 O1.3 Deriving conclusions Chapter 3 Chapter 3 Chapter 3 O2 Empirical analyses of PKIs O2.1 Analysis: X.509 PKI for the WWW O2.2 Analysis: OpenPGP Web of Trust O2.3 Analysis: PKI in SSH Chapter 4 Chapter 5 Chapter 6 O3 Defence against attacks O3.1 Schemes to strengthen X.509 O3.2 Attack detection and localisation Chapters 7 and 8 Chapter 9 Figure 1.1. Research Objectives of this thesis, mapped to chapters. Arrows show which Research Objectives deliver findings on which later chapters are based. other properties that are relevant for deployment, like validity periods, certificate chain lengths and cryptographic security. Our results show that the X.509 PKI is in a sorry state: only about 18% of certificates offered by Web hosts were completely valid. We also measured the distribution of certificates over multiple hosts, length of certificate chains, use of algorithms, as well as issues like susceptibility to known bugs. Ours was the first academic study on such a large scale and then the only one to track changes in the PKI over time. As our study concluded in mid-2011, Chapter 4 also includes a discussion of academic work that followed our study, confirmed our findings, and added new aspects. Chapter 5 addresses Research Objective O2.2. The OpenPGP Web of Trust is a structure that is entirely different from the X.509 PKI, which is also reflected in its use (e.g., secure ). We present the results of an investigation of the Web of Trust using graph analysis. We first analysed the Web of Trust s major constituents. Although it is almost two orders of magnitude smaller than the Web of Trust as a whole, the so-called Largest Strongly Connected Component is the most meaningful component to analyse as it directly influences the network s usefulness. We evaluated this property by analysing to which degree users are actually able to authenticate other users. The basis of this was an analysis of the length of certification chains, redundant paths, mutual signatures and the Small World effect that the Web of Trust exhibits. We also investigated how robust the network is to changes like key expiration or the targeted removal of keys. As social relations are an important aspect in assessing a key s authenticity, we also applied different community detection algorithms with the goal of mapping identified communities to social relations. Chapter 6 presents the results of our investigation of the PKI concept in SSH. It addresses Research Objective O2.3. This PKI is markedly different from X.509 as its method of key distribution resembles the direct exchange known from a Web of Trust. 7
24 1. Introduction However, certificate chains are not supported. For our study, we scanned the entire routable IPv4 space on TCP port 22 and downloaded the SSH host keys that we found. In this analysis, recent work by Heninger et al. [35] was our point of departure: the authors had identified critical cryptographical weaknesses and duplicate keys in SSH. We were thus interested whether we could trace such issues to network management practices, i. e., the result of SSH s mode of key distribution. We could indeed identify causes for duplicate keys that are a consequence of network management and provide a list of patterns how such keys may occur. We could also reproduce the results by Heninger et al. and show that the situation has slightly improved since their study. Finally, we also studied the use of symmetric cryptography on SSH servers and the occurrence of older servers on the Internet. Chapter 7 returns to the X.509 PKI and addresses Research Objective O3.1. In order to prepare our analysis of schemes to strengthen X.509, we develop a formalised notation to capture the relevant properties of each scheme within a common framework. Chapter 8 will then make use of the notation and provide the analysis of the proposed schemes. To this end, we define a threat model to describe attackers of varying strength, ranging from a weaker local attacker to a globally active attacker with immense resources at his disposal. The schemes we investigate can be classified by the approach they take. We analyse approaches that are based on pinning, DNSSEC, notaries, and public logs. We assess each scheme with respect to the contributions it makes and its robustness against attackers. A particular focus is on difficulties that may arise when deploying a scheme. Based on our results, we identify the schemes that promise to be the best candidates to reinforce the X.509 PKI. Chapter 9 addresses Research Objective O3.2. Very little is known about manin-the-middle attacks in the wild, possibly because most users would either not know how to detect an attack, or, if they do, where to report it. Our goal is to develop an infrastructure that allows to collect hard data about such ongoing attacks and report and analyse them in an appropriate manner. To this end, we developed Crossbear, a notary-based tool that can detect man-in-the-middle attacks on TLS and report the attacks automatically. While the underlying notary principle is well understood, Crossbear s novelty lies in its aggressive attempt to also locate the position of the attacker. This is achieved by establishing TLS connections to a victim server and tracerouting from a large number of positions in the network. The interception point between poisoned and clean connections yields the attacker s position with a certain level of confidence. We show that Crossbear can achieve good results in determining a poisoned Autonomous System (AS), although its accuracy decreases significantly at the router level. However, we show that Crossbear functions particularly well against the two attacker types it addresses. Chapter 10 provides a summary of our findings and reviews them in the context of each Research Objective. We also identify research directions that would help improve PKIs further Note on terminology Unless otherwise indicated, we use the abbreviation TLS to refer to both the Secure Sockets Layer (SSL) protocol and the TLS protocol. SSL is the predecessor to TLS and uses exactly the same kind of certificates. In the context of our work, there is usually no reason to distinguish between them. 8
25 1.4. Publications in the context of this thesis 1.4. Publications in the context of this thesis The following papers were published in the context of this thesis: Ralph Holz, Thomas Riedmaier, Nils Kammenhuber, and Georg Carle. X.509 forensics: detecting and localising the SSL/TLS men-in-the-middle. Proc. 17th European Symposium on Research in Computer Security (ESORICS), Pisa, Italy, September Oliver Gasser, Ralph Holz, Georg Carle. A deeper understanding of SSH: results from Internet-wide scans. Proc. 14th IEEE/IFIP Network Operations and Management Symposium (NOMS), Krakow, Poland, May
26
27 2Chapter 2. Theory and practice of Public Key Infrastructures This chapter contains text from the sections on related work and background in previous publications. Please see the note at the end of the chapter for further information. In this chapter, we introduce Public Key Infrastructures (PKIs) and explore the forms a PKI may take. Two terms are at the heart of PKI: authentication and key distribution. PKIs are meant to provide a solution for both, and thus we are going to begin with an introduction to these two fundamental terms. In particular, we will see that although one may understand the term authentication intuitively, it is quite difficult to define formally. Furthermore, we show why the problem of key distribution is a very hard one indeed. Against this background, we introduce the concept of Trusted Third Parties (TTPs), which is fundamental for PKIs, and then describe PKI concepts that have proved to be relevant, in particular those that we analysed in our own work (X.509, OpenPGP, and SSH). X.509 will be a particular focus as it is a key subject in our investigations and analyses. These sections will give the reader the necessary background for Parts II and III of this thesis. PKI concepts are often assessed without regard to a problem that is actually essential for their correct operation: key and certificate revocation. We thus dedicate Section 2.7 to this problem and explain revocation mechanisms. This background will prove useful when we analyse compromises of the X.509 infrastructure (Chapter 3) The nature of authentication PKIs play an important role in many cryptographic protocols. Such protocols usually aim to achieve the three goals of confidentiality, authentication and message integrity. Among these, authentication is the essential ingredient in fact, protocols without authentication are rare. Practically all protocols that computer users deal with today feature at least one mechanism to authenticate the end-points of a communication channel. In these protocols, authentication is a prerequisite to secure key establishment and providing an encrypted and integrity-protected channel. Intuitively, authentication is a simple concept: the identity of some other entity is ascertained by means of a proof. However, authentication is actually not so easily defined in a mathematically strict sense. The term is frequently used without a clear definition as Boyd comments in [82, p. 33]. Ferguson, Schneier and Kohno, for example, do not define it at all in their book Cryptography Engineering [85]. Bishop calls it the binding of an identity to a subject in his book on computer security [81], and states that this binding may be established by something an entity knows, possesses, etc. 11
28 2. Theory and practice of Public Key Infrastructures Menezes et al. are more precise when they define entity authentication as [...] the process whereby one party is assured (through acquisition of corroborative evidence) of the identity of a second party involved in a protocol, and that the second has actually participated [...] [87]. This definition states that authentication is a process and that corroboration and evidence are involved. The definition of the evidence remains unclear, however. In fact, many attempts have been made to give a good definition of authentication, but a great number have also left room for interpretation. As Lowe points out in [51], this has repeatedly led to misinterpretations with respect to the formal guarantees a protocol gives, which is particularly problematic in the formal verification of protocols. It is interesting to note that even the RFCs for TLS and the Internet Protocol Security (IPSec) protocol suite [97, 108] do not indicate what their understanding of the term authentication is. To facilitate formal verification of protocols, Lowe, and later Cremers, gave formal definitions of authentication and showed that they establish a hierarchy. Lowe, for example, gave a definition of authentication as injective agreement [51]. The idea here is to define authentication between two parties as an agreement on the values in a set of data items, which is the result of a protocol run in which both parties participated. In [16], Cremers shows that authentication as synchronisation is an even stronger form and at the top of the hierarchy. There is a fundamental link between authentication and the possibility to establish an authenticated and encrypted secure channel between two parties. Consider two entities A and B who wish to establish a secure channel. A necessary condition for them to be able to achieve this goal is that such a secure channel must have been available to them at a previous point in time. In other words, it is not possible to establish a secure channel without already having authenticated credentials. This (intuitively obvious) insight was proved to be correct by Boyd in 1993 [10]. It has an important consequence: the necessary cryptographic material must be distributed between all participants of a particular cryptographic protocol before any authentication can succeed The Key Distribution Problem For two entities to be able to establish a secure channel, they must be in possession of authenticated credentials. Such credentials are usually shared keys (in symmetric cryptography) or previously exchanged public keys (in asymmetric cryptography). The need to distribute keys to the participants in a protocol is known as the Key Distribution Problem Key distribution in symmetric cryptography In the case of symmetric cryptography, all entities need to have pairwisely exchanged shared keys before they can authenticate. With n being the number of participants, the result would be O(n 2 ) keys that need to be exchanged, and all of these exchanges would need to be secure. As a consequence of Boyd s theorem, the only way to do this is out-of-band, i.e., by relying on some other, pre-existing secure channel. A typical real-world solution would be delivery in a face-to-face personal meeting. This quickly becomes impractical, especially when a large number of participants is involved (e. g., a bank and its customers). Given that it is also good practice to regularly replace keys, the costs of key distribution in symmetric cryptography rise quickly. A solution to reduce this overhead is to introduce a Key Distribution Centre (KDC). The KDC is assumed to be trusted by all participants, and it must have securely 12
29 2.3. Forms of Public Key Infrastructures exchanged symmetric keys with each. The idea is now that the KDC can be queried by an entity A for a symmetric key K AB, to use with another entity B. This implicitly guarantees that A can be sure that only B (and the KDC) will be able to read messages on the secure channel. There are schemes that allow the KDC to create K AB in such a way that A can retrieve it and forward it securely to B. There are a number of details to take care of to make the scheme secure. A well-known example of a scheme that uses a KDC is Kerberos [113] Key distribution in public-key cryptography In public-key cryptography, the scalability may seem to be improved as only O(n) public keys need to be published. However, in order to be able to authenticate each other, A and B must have previously exchanged their public keys securely, too, i. e., both must be sure that the respective public key really belongs to the respective other entity. This still requires O(n 2 ) secure key exchange operations to take place. For small domains with relatively few participants, this may again seem quite reasonable. However, consider the case of or the WWW: the number of participants is so large that proper key distribution is infeasible. The solution here is to introduce a PKI. The underlying idea is similar to the KDC, but the mode of operation is different. The key concept is to relieve participants of the need to exchange keys themselves. Rather, they are meant to rely on assertions made by a small set of trustworthy entities the Trusted Third Parties (TTPs). TTPs make assertions which public key belongs to which entity. An assertion is made by cryptographically signing a tuple (I, k), where I is a meaningful identifier for the entity in question, and k is the entity s corresponding public key. This assertion is commonly called a certificate, a term first introduced by Kohnfelder [42] Forms of Public Key Infrastructures Public Key Infrastructures may appear to be a simple concept. However, as we will see in this chapter, creating a practical PKI is not an easy undertaking at all. The essential operation in a PKI is the creation and revocation of certificates. We will call the entity that is responsible for creating a certificate the issuer 1. The issuer s act of applying a digital signature to name and public key creates a cryptographic binding between the two data items that anyone with the issuer s public key can verify. In theory, issuing certificates is a simple (although computationally intensive) task. The problems begin when theory is turned into practice. Before an issuing entity creates a certificate, it has to verify that the entity who wishes to be certified is indeed the entity it claims to be. Furthermore, it must ascertain that the public key presented to it is indeed owned by this particular entity. Consequently, a central question is which entity, or entities, can be trusted to do this job with due care and act as the TTPs. Even with TTPs established, however, there is more to take into account. Most PKIs like X.509 or the OpenPGP Web of Trust use so-called certificate chains. A verifying entity the verifier generally needs to verify a chain from a trusted issuer to the entity whose certificate it wants to verify. In hierarchical PKIs (like X.509), an issuer often wishes to delegate the creation of a certificate for an entity to an intermediate entity. To this end, the issuer creates a special certificate that binds the intermediate s identity, the public key and a boolean value that signals the delegation of certification capacity. 1 The name for the issuing entity varies from PKI to PKI. In X.509, it is usually called Certification Authority. In a Web of Trust like OpenPGP, the term is often endorser. We use the generic term issuer here. 13
30 2. Theory and practice of Public Key Infrastructures Global CA Certified entities Figure 2.1. One global CA that directly certifies entities. The delegated capacity may be delegated again to another intermediate entity, and so on. This process results in a certificate chain that starts at the original issuer and includes one or more intermediate entities. In non-hierarchical PKIs such as Webs of Trust certificate chains develop naturally: every certified entity may also be an issuer. However, it is an interesting question whether (complete) trust into a TTP should also imply trust into the entities to which the signing capacity has been delegated. Assuming full transitivity may often be an unacceptable choice as it does not accurately model real-world trust relationships, and different degrees of trust need to be expressed. This is the realm of trust metrics. A body of literature exists that investigated the different options to compute trust into other entities the works by Maurer [54] or Jøsang [39] are well-known examples. A related question concerns the actual structure that a PKI prescribes, i. e., which certificate chains are possible. Most PKIs follow a certain philosophy that governs to which intermediate entities certification rights may be delegated. Perlman gave an overview of the essential constructions in [61]. The simplest form of PKI could be said to be the strictly hierarchical one with one global TTP, which we show in Figure 2.1. The global authority is called Certification Authority (CA). The CA is responsible for verifying the identity of any entity applying for a certificate, for issuing the certificate, and, if necessary, also revoking it. This structure seems rather idealistic on a global scale: there is no universally trusted organisation that could run the necessary infrastructure, and it is hard to imagine that organisations, corporations, and governments, etc. would be willing to rely on the services of a provider that is possibly located outside their legal reach. Even if such an organisation could be agreed on, numerous practical problems would remain. For example, what would be the agreed common standard that the CA would follow in verifying entities coming from very different legislations? What would its chances be to accurately identify entities like owners of Web sites and avoid mistakes? And finally, who would be in actual control of day-to-day activities, and would there be a guarantee that no abuse of power will ever occur? One way to approach these challenges would be to delegate the task of certification to regionally operating subordinate CAs. This would relieve the global CA from some of its responsibilities. Regionally active entities might also operate more efficiently, with better capacity to carry out tasks like identity verification, due to their knowledge of local practices. As every subordinate CA is a CA in its own right, this would increase the number of attack vectors, however. An alternative would thus be to use so-called Registration Authorities (RAs) instead. These entities cannot sign certificates themselves but are responsible for properly identifying an entity according to local legislation and then for creating a certification request and forwarding it to the global CA. We show this model in Figure 2.2. This restricted form of delegation only removes some of the technical attack vectors, however. The social ones remain: unless the correct operation of RAs can be guaranteed in a meaningful way, attackers may attempt to 14
31 2.3. Forms of Public Key Infrastructures Global CA RA RA RA Certified entities Figure 2.2. One global CA with several RAs. George Bob Nate Paul Charlie Daniel Quentin Emile Ivan Alice Frank Henry Jane Karla Laura Figure 2.3. A Web of Trust is an example of a non-hierarchical PKI. Users sign each others keys and verify the authenticity of other keys using trust metrics. signs obtain certificates via RAs that do not execute their duties carefully enough. This shows that the operational factors in a PKI are as important as its technical basis. Historically, different PKI structures have come into use. The structure used for X.509 on the WWW, for example, is a variant of what we just described above. Perlman calls this structure configured CAs plus delegated CAs [61]. The concept developed from early browsers beginning to integrate the public certificates of CAs and later introducing programmes to which CAs can be admitted. We elaborate on this in the next section. It is interesting to note that, while Perlman s article is from 1999, it already warns of possible attack vectors in this model. We will show in Chapter 3 that this assessment was quite correct. Yet X.509 is one, if not the, dominating standard on the Internet today. A notably different model is a Web of Trust as implemented by, e.g., OpenPGP, where participating entities are free to certify any other entity. We describe this in more detail in Section 2.5. The resulting structure is shown in Figure 2.3. OpenPGP enjoys a certain popularity for encrypted and signed . Thus, we chose it as a further PKI to analyse. We have so far not elaborated on the simplest possible PKI, which we might call the False PKI. Here, public keys are simply distributed among participants by external means, and there are no TTPs nor CAs. While one might argue that this model does not constitute a real PKI at all, it is actually used very often: it is the structure preferred by the popular SSH protocol, which runs on millions of hosts. The security of 15
32 2. Theory and practice of Public Key Infrastructures the structure depends exclusively on the correctness of the key deployment operations. It is clearly a very interesting PKI, and we thus chose it as the third PKI to analyse. A variety of other schemes to structure PKIs exist. Some PKIs attempt to introduce very strong technical constraints that rule which entities a CA is allowed certify. The Domain Name System Security Extensions (DNSSEC), for example, construct a PKI with a single authoritative key for the DNS root zone. Certification is then delegated to subzones and their subzones, creating a tree of CAs. As the DNS is itself a tree of names, each zone can be technically constrained to only issue certificates (really signatures on resource records) to domain names that are in its own zone, with delegations to subzones. DNSSEC did not play a significant part in our empirical analyses as it is not widely deployed yet, but we do return to it when we discuss PKI alternatives in Chapter X.509 Public Key Infrastructure X.509 is a tree-structured hierarchical PKI. It is an ITU-T standard that has been adopted by the Internet Engineering Task Force (IETF) as the PKI for several IETF protocols. X.509 certificates are an integral part of the TLS protocol, which secures application layer protocols like HTTP, IMAP and POP3. The most common use case is authentication of a server, but certificates can also be used to authenticate clients Historical development of X.509 The history of X.509 is well summarised in, e.g., the work by Gutmann [32] and in RFC [100]. We give a brief summary here. The roots of X.509 are found in the hierarchical structure of X.500, an ISO/IEC standard of 1988 intended to be used by telecommunication companies. The intention of the standard was to create a global directory of named entities, with data structured in a hierarchical tree. Different organisations would be responsible for different subtrees. The use of certificates was incorporated to allow users to authenticate to this directory and retrieve data. A CA would be an entity responsible for a subtree, i.e., for issuing certificates to users to allow them to access this subtree. One global CA was to be at the top of the hierarchy. X.509 was the standard that defined the certificate format to be used in the X.500 series of standards. As it turned out, however, X.500 never saw much deployment 3. Furthermore, X.500 required a strict naming discipline. However, as the authors of RFC 2693 [100] note, at the time X.500 was specified, too many different naming disciplines were already in use. When the Internet, thanks to the WWW, began to grow into its role as a major communications infrastructure, the X.509 format was mandated in the new Secure Sockets Layer (SSL) and later Transport Layer Security (TLS) protocols. As these connected hosts on the Internet, which were referred to by their DNS names, some way was needed to securely associate a DNS name with a public key. The role of CAs was filled by companies that offered X.509 certificates for owners of DNS domains. CAs were (and are) expected to carry out checks of domain ownership with due diligence. However, these CA-internal work processes are difficult to assess from the outside, and thus users need to place their trust into the correct working of a CA. In particular, the verification that a requesting party really owns a domain has always been problematic 2 RFC 2693 describes the competing SDSI/SPKI standard. 3 The original X.500 was meant to be used with the ISO/OSI stack of network protocols, which never gained wide support. Adaptations of X.500 protocols to TCP/IP exist, e. g., LDAP [129]. 16
33 2.4. X.509 Public Key Infrastructure as most CAs rely on insecure protocols to carry out this verification. We return to this in the next chapter. More importantly, the notion of responsibility for subtrees was removed in this new X.509 PKI: CAs have no association with DNS zones here. Rather, any CA can issue certificates for domains anywhere in the DNS hierarchy. These activities quickly developed into a successful business model that continues to this day. Since sites could buy their certificates from any CA, operating systems and browser vendors began to ship the certificates of a number of CAs with their products to allow client software and browsers to verify certificates. The inclusion process for new CAs generally depends on the respective vendor. In the case of Mozilla, it is an open forum where inclusion requests of new CAs are publicly discussed. Companies like Microsoft or Apple do not make their decision processes very transparent, although there is some effort to publicly document the outcome, in form of a list of included CAs (e.g., [221]). For quite some time, both the inclusion policies that browsers used as well as the certification practices that CAs followed were largely independently defined. In 2005, the CA/Browser Forum [150] emerged as a collaborative body of browser vendors and CAs, with the goal of releasing normative guideline documents. This forum needed several more years to agree on the first such document, the Baseline Requirements (BR) [148], which took effect on 1 January This document defines the minimal set of common policies that all CAs with membership in the CA/Browser Forum have agreed to implement. The number of CA certificates in browsers has grown for a long time, and it continues to grow. Furthermore, CAs have recently introduced new products, among which Extended Validation (EV) certificates are maybe the most significant ones: these certificates are intended for organisations and are supposed to be issued only after a more thorough evaluation of credentials, e.g., by verifying legal documents. They are generally much more costly than normal domain-verified certificates [7]. Although server certificates have remained a pillar of CA business models, CAs can also issue certificates for persons. A popular example are personal certificates for as defined in the S/MIME standards [118, 115, 116] Certificate structure Figure 2.4 shows the simplified structure of an X.509v3 certificate. Version 3 is by far the most common version that can be found today. The most important fields are the issuer, the subject, the public key (algorithm identifier and actual key) and the digital signature (algorithm identifier and actual signature). A serial number is stored as the reference number under which an issuer has created this certificate. The validity is specified in two fields that act as start and end date. In addition to these fields, X.509v3 introduced a certain number of extensions. Among these, we find a flag that indicates whether this certificate belongs to an entity with CA-like properties, i.e., one that will use its private key to sign other certificates. There are also fields for revocation purposes, e. g., Certificate Revocation Lists (CRLs). The EV field signals the EV status of a certificate. This field is expressed as an Object Identifier (OID): just as they maintain a list of CA certificates, browser vendors also maintain a list of OIDs that they associate with EV status. There are several more fields that we do not mention here e.g., fields indicating the allowed uses of the certificate CA hierarchy Since there is a relatively large number of CAs in the X.509 PKI, it can be viewed as a forest rather than a tree. CAs and subordinate CAs play different roles in the PKI. 17
34 2. Theory and practice of Public Key Infrastructures X509v3 Certificate Version Serial no. Sig. algo. Issuer Validity Not Before Not After Subject Subject Public Key Info Algorithm Public Key X509 v3 Extensions CA Flag, EV, CRL, etc. Signature Figure 2.4. Schematic view of an X.509v3 certificate. Figure 2.5 shows a minimised example. CAs reside at the top of the hierarchy and are all equally allowed to issue certificates to any domain in the DNS hierarchy. They are identified by their own certificates, which they issue to themselves and sign with their own private keys. These certificates are called root certificates. Root certificates, indicated as R x in Figure 2.5, could be used to directly sign endentity certificates (indicated by E x ), and indeed some CAs do this or have done so in the past. However, this means that the private key must be held online and in memory during a CA s operations. This constitutes an attack vector. Thus, it is considered good practice for CAs to issue intermediate certificates from the root certificates. These certificates have the CA Flag set to true and are used in online operations 4. We indicate them by I x. The private key for the root certificate can be stored safely offline in a protected location. The public key certificate can be shipped with browsers and operating systems. If anything should happen to the intermediate certificate s private key, it can be replaced without having to replace the shipped root certificate. In our example, R 1 and R 2 are in the root store (and thus coloured green), while R 3 is from a CA that has so far not been included (coloured grey). Hence a browser with this root store would reject E 7 as an untrusted end-host certificate (and display a warning message to the user). An intermediate certificate may be used to sign further intermediate certificates. These may or may not be controlled by entities that are part of the same organisation as the root CA. Intermediate certificates always increase the number of private keys that must be protected. If they are issued for subordinate CAs, i. e., organisations outside the direct control of the root CA, this is a particularly sore point as an intermediate certificate has the same signing power as any other certificate. Note that this method also removes some control from the client: it is debatable if users would trust all intermediate authorities, assuming they even knew about them the existence of subordinate CAs can only be inferred from close inspection of a certificate chain and investigation of the business relationship of the entities specified in the certificate subjects. An interesting use case for intermediate certificates is cross-signing, where a CA also has a certificate (I 4 ) that has actually been signed by another CA (in this case, via an intermediate certificate). This is useful if the other CA is contained in a root store in which the cross-signed CA is not contained. The thus certified CA essentially becomes a subordinate CA of the issuing CA. If a CA or any of the subordinate or intermediate 4 This method is now required by the Baseline Requirements [148]. 18
35 2.4. X.509 Public Key Infrastructure R1 Root Store R2 CA 3 CA 1 CA2 I1 I 4 I 2 E7 E 1 E 2 I 5 E I 6 E E 5 E6 3 4 Figure 2.5. X.509 certificate chains and root stores. Figure adapted from [37]. I 3 R 3 CAs it cooperates with becomes compromised, the attacker can issue certificates for any domain. Thus, both cross-signing and subordinate CAs can be very dangerous to the PKI system Use of X.509 in TLS The SSL protocol was originally developed by Netscape and later standardised within the IETF as TLS. Since 1999, three versions of TLS have been specified: TLS 1.0 in 1999 [95], TLS 1.1 in 2006 [96], and TLS 1.2 in 2008 [97]. The protocol specifications have been updated over the years to incorporate up-to-date cryptographic algorithms, remove weaknesses, and add extensions. However, the core ideas of the protocol have remained the same. TLS achieves authentication and session key establishment between a client and a server. X.509 certificates are used to authenticate the communicating parties. In the following, we describe the essential steps of TLS, abstracting from the actual RFC. TLS requires two round-trips between client and server for authentication and key establishment to complete. Although the protocols are subdivided in a number of subprotocols, the exchange between client and server can be described as the exchange of four messages. The principal idea is that information relevant for authentication is exchanged in the first two messages (or three for mutual authentication), and the correctness of the initial exchange confirmed afterwards by exchanging message authentication codes over all previous messages. TLS also supports key establishment via a Diffie-Hellman key exchange, which achieves the important property of Perfect Forward Secrecy (PFS). Like most cryptographic protocols, TLS distinguishes between long-term (public) keys and (symmetric) short-term keys (the session keys). The long-term keys are used to establish session keys at the beginning of a communication. PFS means that an attacker can never obtain the session keys for a communication that he has only recorded and for which he obtains the long-term keys only after the communication has already completed. The Diffie-Hellman key exchange is described in [17]. We include the mechanism here in its form with ephemeral values, i. e., non-fixed values. Message 1 TLS begins with a client C initiating communication with a server S. C sends a nonce n C to S, together with a list of cryptographic suites it can support (L C ) 5. The list contains combinations of symmetric ciphers, cryptographic hash functions and key exchange mechanisms. We denote this first message as: C S n C, L C 5 The RFC also uses session identifiers for tasks like session resumption. We omit this here. 19
36 2. Theory and practice of Public Key Infrastructures Message 2 Upon receiving C s message, S will respond to it with its own nonce (n S ). It will select an entry from L C, which we denote as l S. It will add its own certificate and the intermediate certificates (Cert S ). Adding the root certificate of the CA is optional, as it is assumed that this certificate must already be in a client s root store anyway for authentication to succeed. If a Diffie-Hellman key exchange was requested, the server also includes the necessary Diffie-Hellman values (DH S ). A signature must be added to demonstrate knowledge of the private key (corresponding to the certificate) and signal the correctness of the nonces and the Diffie-Hellman values. The server may also include a request for a client certificate. S C n S, l S, Cert S, DH S, Sig S (n C, n S, DH S ) {, req cert} Message 3 Upon receiving the server s message, C will determine whether the certificate is valid. This includes a number of steps and verification of fields in the certificate, described in RFC 5280 [94]. The following steps are the essential ones. The verifier begins by tracing the certificate towards the root: The client verifies that all signatures in the certificate chain are correct. It verifies that each issuer of one certificate is the subject of the certificate further up the chain. All intermediate certificates must have the CA flag set to true. It verifies that the root certificate is included in its root store. It verifies that all certificates in the chain are within their validity period. It verifies that the subject of the end-host certificate corresponds to the entity it wishes to connect to. Verification is often more complicated with many possible paths through the process. For example, certificates may also carry a flag that indicates whether they are intended for securing HTTP or not the client can inspect this field if it is present 6. More importantly, the verification of the subject depends to some degree on the application protocol on top of the TLS connection, or even the user: the application or user must verify that the entity named in the certificate subject is the intended communication partner. For HTTPS, this means that the field Subject Alternative Name (SAN) in the certificate must match the DNS name of the host the client connected to (wild cards are allowed). However, mostly due to historical use, this information is often stored and accepted in the so-called Common Name (CN) in the subject, although this is technically wrong. Some certificates (and all EV certificates) indicate the real-world organisation behind the DNS name, which can be displayed by a browser and verified by a user. In practice, users rarely invest this kind of effort. It should also be noted that there are X.509 extensions whose use requires more verification steps. For example, a certificate of a subordinate CA may be name-restricted, an extension that has only recently come into some use. It means that the certificate carries a restriction that says the corresponding private key may only be used to certify domain names under a certain domain in the DNS hierarchy (e.g., a top-level or second-level domain). The path length extension is a related extension: it defines how many intermediate certificates may occur in a chain. 6 This field is officially called Extended Key Usage and not mandated by RFC 5280 [94]. It is different from the field Key Usage, which refers to the basic operations allowed for this certificate, e. g., encryption or key agreement. 20
37 2.5. The OpenPGP Web of Trust If the certificate chain could be verified to the client s satisfaction, the client will continue with the handshake. It first sends its own certificate (if it was requested). Then, it proceeds to compute its own Diffie-Hellman value, which it also uses it to derive the symmetric key K C,S 7. The client sends its own Diffie-Hellman values (DH C ). If it was asked to authenticate (i. e., the server requested its certificate), it shows possession of its private key as well as the correctness of the Diffie-Hellman values by adding a signature over all message fields that have been sent so far. Finally, it adds a keyed hash value (i.e., a MAC) over all message fields so far. C S {Cert C, } DH C {, Sig(X fields)}, MAC(X fields {, Sig(X fields)}) Here, the term X fields indicates the concatenated fields n C, L C, n S, l S, Cert S, DH S, Sig S (n C, n S, DH S ), potentially req cert, potentially Cert C, and DH C. The MAC is computed with K C,S as the key. Message 4 The server can verify the client s certificate in the same way as described above, although the verification of the subject field may take a number of forms, depending on the server s configuration. Using the value DH C, the server can now compute K C,S and verify the validity of the MAC. This ensures all previous messages were correct. The server confirms that the whole authentication process was correct by sending a final MAC over all previously sent fields, including the signature and MAC sent in the client s last message: S C MAC(X fields {, Sig(X fields)}, MAC(X fields {, Sig(X fields)})) 2.5. The OpenPGP Web of Trust Webs of Trust are a different form of PKI. In this section, we introduce the Web of Trust of OpenPGP, which is a user-centric and self-organised form of PKI. A user in OpenPGP is identified by a user ID, which contains a user-chosen name and address. Every user ID is associated with a public/private key pair, which is stored locally in a data structure that also contains an expiry date. Users issue certificates by signing another key (i.e., user ID and public key) with their private keys. In contrast to X.509, certificates are not verified with reference to a root certificate in a root store but by finding a certification path from the own key to the key that is to be verified as belonging to some entity. This allows practically arbitrary paths (although cycles are not considered). Before using someone else s public key, users must determine the key-entity binding and assess whether it is likely to be correct. Consequently, the question arises which intermediate keys (and users) one should trust, and to which degree, in verifying the authenticity of another key. OpenPGP uses a trust metric to allow users to assess the trust in a key-entity binding. Users store keys of other users in so-called key rings. For these keys, OpenPGP defines two notions of trust. First, introducer trust refers to how much another user is trusted to apply care when verifying an identity. This value is expressed as a string with an associated numerical value, with a higher value signalling more trust. It must be set manually by a user for all keys of other users in his or her key ring. The value is stored locally together with the key (not the user ID). Public-key trust is the degree 7 In practice, one would derive different keys for encryption and message authentication codes, but we simplify this here. 21
38 2. Theory and practice of Public Key Infrastructures to which a user claims to be sure of a key-entity binding himself. This value is again expressed as a string with an associated numerical value. It may be stored as part of the signature. OpenPGP s trust metric is parameterised, and the parameters can be set by the users themselves. The popular implementation GnuPG, for example, uses a default setting that focuses on introducer trustworthiness: this must either be full for all keys on the certification path, or there must at least be three redundant certification paths to the key in question (with all keys on the paths assigned a trust value that is less than full ). No certification path must be longer than five keys, either. Trust in OpenPGP relies on social relations for identity verification. CAs are not forbidden in OpenPGP, however they are merely a very special kind of user. OpenPGP s model can thus be viewed to be more focused on the local environment of a user it is infeasible for a user to determine introducer trust for everyone in the Web of Trust. A user can only make reasonable assessments about keys to which paths are short and lead over social contacts. When talking about the scalability of the Web of Trust, this is important to keep in mind. The exact mechanism of creation of OpenPGP s Web of Trust is not exactly known, but it is commonly agreed that personally established contact between users plays a major role, in particular as there are organised events, the so-called Keysigning Parties, at conferences and meetings. To make keys available to the public, users can upload them to a network of key servers, together with the signatures that they have received for their own key or issued for other keys. The key servers use the Synchronizing Keyservers (SKS) protocol for synchronisation. This protocol implements a gossiping strategy to ensure changes to a key server are propagated quickly. There does not seem to be a formal documentation, although a home page exists for the reference implementation [226]. A snapshot of the data stored on a key server contains a complete history of the Web of Trust: keys cannot be deleted from an SKS server and timestamps of key creation, signature creation, and expiry dates are stored. The open nature of the Web of Trust could lead one to speculate whether largescale attacks on the Web of Trust are possible, where a malicious entity certifies a large number of keys to trick others. However, this attack is much more difficult than it seems. Assume Alice wants to verify a fake key for the identity Bob, which has only been signed by a number of false identities signed by Mallory. Alice must establish a certification path to the fake Bob key using the faked signed keys. These faked keys would only be used in a path search if Alice manually and explicitly sets a trust value for Mallory and the false identities. As setting introducer trust is a manual operation, it is unlikely that Alice would assign the needed trust to unknown entities. Note that the mapping from human users to user IDs and keys is generally not bijective in OpenPGP. It is not uncommon for users to have multiple keys, for example under pseudonyms or for different addresses. This can make it difficult to assess who the real person behind a user ID or key is The Secure Shell (SSH) and its PKI model The SSH protocol started as a replacement for insecure login protocols. It dates back to 1995 [124] and has been a popular tool since its conception. Its versatility and omnipresence make it indispensable for many power users, especially system administrators. SSH is a prime example of using a False PKI without TTPs. The SSH protocol resides on the application layer and provides authentication (of server and client), encryption, and message integrity. It is primarily used for remote shell access to hosts, including infrastructure devices such as routers. SSH is also 22
39 2.6. The Secure Shell (SSH) and its PKI model notable because it provides support for several other protocols that it runs as so-called subsystems over an encrypted connection. Two particularly important examples are secure remote copy (SCP 8 ) and secure FTP (SFTP 9 ). Many implementations of SSH also allow to create secure tunnels for arbitrary application layer protocols. In the following, we will give some background on the PKI model that SSH uses as well as discuss some aspects of the protocol flow PKI model Although the use of X.509 certificates is defined for SSH [106], the most popular method to authenticate a server is based on the so-called host keys. A host key is a public/private key-pair of which the public part is sent during connection establishment. The client needs to have been introduced to this key securely a priori and out-of-band. This is most commonly achieved by administrative control over both client and server, i. e., system administrators store the server s public key on the clients. There is a second accepted method: when a client cannot authenticate a server by its host key, it will display the host key s fingerprint (a hash value) and leave the decision whether to continue to the user. If the user decides to continue, the fingerprint will be stored locally for future reference and comparison, just like in the predistributed case. In later connections, SSH also displays a warning if the server suddenly presents a different key. This concept is variously known as trust on first use, leap of faith authentication, pinning, or key continuity. It is an interesting and mostly unanswered question to which degree the approach taken by SSH works, and what level of security is achieved. First, the key distribution does not scale well, invites human error, and may lead to misconfigurations. Second, it is not clear if common users of a computer have the necessary knowledge to understand their client software warn about an unknown key (or if they do, whether a relaxed attitude may cause them to continue anyway). Ultimately, such questions are intrinsically linked to network management and the methods used for configuration Protocol flow of SSH The SSH protocol consists of several subprotocols [111, 125, 126, 127, 128]. However, the protocol flow of SSH is not so different from TLS and can be described without referring to each subprotocol. Both TLS and SSH first negotiate the methods for key exchange in a first round of message exchanges, in which the server is also authenticated. Authentication of the client happens in the second round of messages, which is also used to cryptographically confirm the correctness of all previous messages. However, authentication in SSH has some aspects that are not shared by TLS. First, the protocol is unusual in that it does not define a strict sequence of messages between client and server. The client initiates the connection with a TCP handshake, and client and server send identification strings and version information but the order of these messages is not defined. In particular, the server may send before the client. This first message exchange is followed by messages to negotiate parameters and cipher suites for key exchange. Again, the order is not defined, but a resolution algorithm ensures that an agreement can be reached. The parties may choose different suites. The server authenticates first with its host-key and proves possession of the private key in a challenge-response exchange. In the second round of messages, the client (or rather, the user) must authenticate to the server. There are several supported options, like passwords or wrappers for 8 SCP was never published as an RFC. 9 SFTP is only specified in an expired Internet-Draft [102]. 23
40 2. Theory and practice of Public Key Infrastructures system-wide mechanisms like Kerberos. Most notably, a user s public key may also have been placed in his home directory by an administrator, which allows login via another (automated) challenge-response process. It is this latter method that contributes to the second interesting aspect of SSH. It has a profound impact on the feasibility of man-in-the-middle attacks. Thanks to the Diffie-Hellman key exchange, an attacker would have to actively exchange Diffie- Hellman parameters. However, SSH is designed to also use session IDs, which must match between client and server. The message exchange is designed in such a way that an attacker can either swap the Diffie-Hellman secrets, or be able to forward the correct session ID to its victims but not both. Tampering with a connection is thus detectable if clients use public-key authentication Revocation Public keys and certificates can be marked as unsuitable for further use. This process is known as revoking a key or revoking a certificate, respectively. There are important reasons to provide this possibility. Key owners might want to replace an older key with a newer, stronger one, and wish others to stop using the old key. For client certificates, the name by which the owner is referred to may have changed, or the owner may not belong to the same organisation any more (if this relationship was indicated in the certificate). There are also more serious reasons: the private key that belonged to a certificate might have been mislaid, lost, or even compromised. This section provides a summary of revocation in PKIs Revocation and scalability Revocation in PKIs is remarkable in that it has a profound impact on the scalability of the entire PKI. This is especially true for hierarchical PKIs, where revocation almost inverses the argument of scalability. For revocation to be effective, a verifier must be able to retrieve status information about the key or certificate before it uses it. The only entity from which reliable information about a key or certificate s status can be retrieved is the issuer. In the case of hierarchical PKIs, there are comparatively few issuers, namely the root CAs and (possibly) subordinate CAs. The number of verifiers is often several orders of magnitude higher. As every verifier must communicate with the issuer, this means effectively that issuers have to deal with a very high load of requests the beneficial effect of PKI, scalable key distribution, is countered by poor scalability in revocation checks. Consequently, a revocation mechanism should attempt to minimise the number of necessary queries. In the following, we are going to present the mechanisms for the forms of PKI we have presented so far, with a focus on the hierarchical X.509 PKI and the Web of Trust that OpenPGP employs. In X.509 at least, there is also a noteworthy difference between theory and practice, which we are going to explore. Interestingly, revocation is practically no concern in the False PKI of SSH: there are no TTPs that could be bottlenecks. As administrators are assumed to have control over both client and server, revocation can be achieved by simply replacing a host key with a new one Revocation in X.509 for TLS Two mechanisms are defined for revocation checks in X.509. The first one, Certificate Revocation Lists (CRLs), is defined in the same RFC as X.509 [94]. It is an offline 24
41 2.7. Revocation mechanism for revocation checks. The Online Certificate Status Protocol (OCSP) is a more recent addition and provides an online way to obtain certificate status information. Certificate Revocation Lists The idea behind CRLs is that CAs regularly issue lists of certificates with status information about revoked certificates. The mechanism is defined in RFC 5280 [94]. A CA may issue several CRLs, each with a different scope (e.g., dividing by revocation reason). Certificates in CRLs are identified by the issuer s identity and a serial number. A full CRL is a list of all certificates that have ever been revoked. CAs may choose to issue so-called delta CRLs: these are incremental updates against a base CRL. A CRL must itself be signed by the CA so a verifier can determine its correctness. It also contains information when the next update is going to be published. The CA may choose between different mechanisms how a CRL can be downloaded or obtained, e. g., via HTTP, FTP, etc. Revoked certificates are listed with additional information. Two items are of particular relevance, although both are optional: invalidity date and reason. The former represents a date from when on a certificate must be considered revoked. This may be a point in time that lies before the actual issuing date of the CRL itself: consider a protocol that involves the use of the private key that corresponds to some certificate, and applies a signature to some timestamped data item as part of the protocol. The invalidity date allows the verifier to determine if the signature was issued while the key was already revoked or not. The reason for revocation can also be given in a CRL; the standard specifies a list of reasons like key compromise or compromise of the CA, but also more mundane reasons like changed affiliations. One issue with CRLs is generally that they can grow rather large some CAs may have many thousands of customers for which they issue several certificates over time. With a potentially large number of CAs in a root store, this would mean that clients would waste considerable bandwidth to regularly download CRLs that contain a list of all revoked certificates instead of the ones that the clients really need information about. Furthermore, CRLs can generally not be downloaded when they are needed, i. e., during TLS connection establishment: this would induce a rather high delay in connecting to a Web site. Thus, the user must accept that revocation information is only updated at certain intervals and that there is a certain time window for an attacker until the next update is published. Online Certificate Status Protocol OCSP is a protocol to retrieve status information about a certificate in an online interaction. OCSP allows to obtain fresh revocation information. It is defined in RFC 6960 [119]. The protocol describes a request-response mechanism between a client and an OCSP server. An OCSP request message by a client may contain queries for several certificates at once. A queried certificate is identified by a 3-tuple, namely a hash over the issuer name, a hash over the issuer s public key, and the certificate s serial number. The idea here is that a serial number is always logged and stored at the issuer, and that it is unique for the given issuer. A nonce against replay protection is an optional part of the request, as is a client signature. An OCSP server (often called responder) is responsible for a particular issuer. In its response to a client, it identifies itself (by name or hash value of its public key), states the time at which the response was generated, and adds a response for each of the queried certificates. The response is signed by the server. It may also include extensions, like a reference to the CRL on which the response is based. 25
42 2. Theory and practice of Public Key Infrastructures There are only three values to express the status of a certificate. It may either be good (i.e., the certificate is valid to use), revoked (the certificate must not be used) or unknown. The revoked status can be expanded with a reason for the revocation and must contain a timestamp. The allowed reasons are exactly the same as in the RFC for CRLs (see above). The revocation can be temporarily or permanent; this can be expressed in the reason. The status unknown is interesting because it is the answer the responder is supposed to send if the certificate in question is unknown to it, for example because it is not from the issuer for which the responder is responsible. This leaves it open to the client to try another resource like a CRL. The RFC does not require clients to abort the connection attempt as we will see in Chapter 3, this can be a dangerous weakness. OCSP Stapling OCSP, in its basic form, suffers from two issues. One is that an OCSP responder can determine a client s browsing habits, which can be a serious violation of privacy. If a client sends an OCSP request every time it visits a new domain, the responder can track it by its IP address. The second issue is performance. The OCSP default mode of operation puts all load onto the OCSP responder, and the load grows with the number of verifying clients, i.e., browsers. In a blog entry [253], Symantec claimed to serve 3.5 billion OCSP requests per day 10. An approach to solve this is the TLS Certificate Status Request extension, also often called OCSP Stapling. It is an extension for TLS that can be part of the handshake [99]. With OCSP Stapling, it is the server s responsibility to obtain a proof that its certificate is still considered valid by an authorised OCSP responder. A server is supposed to obtain a valid OCSP response for its certificate and return it as part of the TLS handshake, immediately after its own certificate. The RFC allows the server to reuse the OCSP response to avoid having to query for every single client connection. OCSP Stapling provides several important benefits. It solves the privacy problem and takes considerable load from the CAs. Web servers can limit themselves to requesting a new OCSP response at certain intervals. Finally, OCSP Stapling also makes the TLS handshake faster as the client does not have to connect to a further party to verify the certificate, saving TCP round-trips and DNS lookups. However, even OCSP Stapling has some shortcomings. A very important one is that the original RFC does not allow to transport OCSP responses for the intermediate certificates in a certificate chain, only for the end-host certificate. This is very unfortunate as intermediate certificates are very common. RFC 6961 is meant to address this but was only published in mid-2013 [114]. Revocation practices in browsers Theory and practice are often two different things, and this is also the case for revocation in X.509. If certificates do not carry information where to find proper revocation information, they are effectively irrevocable, i.e., valid for their entire lifetime. In an investigation carried out by Netcraft [182], a number of mistakes made by CAs are listed. A CA operated by American Express was one example where revocation information was completely lacking. Google s CA (a subordinate CA of Equifax) did not include OCSP URLs, which effectively disabled revocation checks by Firefox as this browser only checks CRLs in the case of EV certificates. For all other certificates, it will carry on normally and establish the connection, without warning. Netcraft stated 10 The blog entry does not specify which CA does this. Symantec owns at least five brand names: Equifax, GeoTrust, TrustCenter, Thawte, and VeriSign. 26
43 2.7. Revocation that this was particularly discomforting as Google s own CRL listed seven certificates with reason key compromised. Google was not the only offender Netcraft had also found such certificates from Symantec, Verizon, GlobalSign, and Microsoft. Browsers do not necessarily carry out revocation checks as intended, either. Netcraft demonstrated the shortcomings of browsers in a blog post in May 2013 [181]. The problem they investigated was a revoked intermediate certificate by RSA. The revocation was meant to be effective immediately. However, as the blog post pointedly remarked, more than a week later nobody had noticed [and] the certificate was still in place [on the server]. The reason was that RSA did not provide an OCSP revocation service and had only put the certificate on a CRL. Even if OCSP had been available, however, Netcraft notes that Firefox does not check the validity of intermediate certificates anyway. Only the browsers Internet Explorer and Opera carried out proper verification checks and prevented access to the Web site. However, browser caching behaviour might still have broken the verification: Netcraft judged most browsers would cache the CRL for six months. Furthermore, as Google engineer Adam Langley points out in a blog post [208], socalled captive portals make it practically impossible to carry out OCSP checks. The term captive portal refers to network setups as they are common in, e.g., hotels, which require users to register before allowing them unrestricted access to the Internet. As wireless access points often do not use encryption, the registration has to be sent via HTTPS to the registration server (which is initially the only host that can be accessed). OCSP requests are generally not forwarded, and thus users cannot identify a revoked certificate. This unsatisfying situation led Google to be the first vendor to change their revocation support in their browsers. Langley announced that Google Chrome would no longer support CRLs nor OCSP in the future. Instead, Google would maintain a list of revoked certificates and distribute these to the browser via their normal software update mechanism [208]. The list would be obtained by scans of CRLs. The obvious question is whether this concept can scale. It is exceedingly difficult even for Google to maintain a complete list of revocations and distribute them. However, it is safe to assume that most users never access large portions of the Web. This means that Google can focus at first on important Web sites, like those on the Alexa Top 1 Million list of popular Web sites [133] in order to deliver a level of protection that is better than the current one Revocation in OpenPGP Revocation in OpenPGP is different from X.509 revocation. First of all, revocation in OpenPGP cannot be carried out by any entity other than the key owner himself otherwise, any malicious participant could mark keys as unsuitable for use by others. To revoke a key, the key owner issues a so-called revocation certificate. This is a simple statement that the indicated public key must be considered revoked and not be used any more, signed with the associated private key. The revocation certificate can then be propagated to all interested and affected parties. Optimally, the revocation certificate should be created right after the creation of the key pair itself, and then stored in a secure location until it is needed. It must never be lost, or revocation of the key is impossible. The fact that key servers never delete keys from the Web of Trust makes this worse. The fact that the revocation certificate must be distributed to affected parties is also a serious problem. While users can inform those they know to use their key, they cannot reach out to unrelated parties who might download the public key from key servers and use OpenPGP s trust metrics to establish a first, marginal trust into the public key. Key servers allow to optimise this as they are able to store revocation 27
44 2. Theory and practice of Public Key Infrastructures certificates, too. Just as in X.509, users would then have to remember to verify that a key has not been revoked every time before using it. Finally, it is worthwhile to think about the damage that a successful attacker can do in OpenPGP and in X.509. In X.509, domain owners generally must register with a CA out-of-band (usually on a Web site) before they can request certificates. This access is usually protected by password, and thus there is a second secure channel available for the domain owner to request revocation of a certificate. Furthermore, as long as this password remains uncompromised, an attacker cannot obtain further certificates from the CA. He is not able to use the private key to certify other entities, either. This is not true in OpenPGP: an attacker in possession of the private key can spread some damage through the network until he is detected. On summary, the security of revocation in OpenPGP depends on the security of the revocation certificate and how fast a key owner is able to distribute it. Despite the flaws in implementation, revocation in X.509 can limit the potential damage. However, one should also note that this issue may not be so devastating if a Web of Trust is used within smaller communities: the possibility of personal contact between users may help mediate the problem Text adapted from previous publications This chapter contains text from the sections on related work and background of the following previous publications: 2011 (reference [73]). 2011 (reference [37]). Oliver Gasser, Ralph Holz, Georg Carle. A deeper understanding of SSH: results from Internet-wide scans. Proc. 14th IEEE/IFIP Network Operations and Management Symposium (NOMS), Krakow, Poland, May 2014 (reference [28]). The contributions to the papers made by the author of this thesis are listed in Chapter 4 (for [37]), Chapter 5 (for [73]), and Chapter 6 (for [28]). Section 2.4 is an extended version of Section 2 in [37]. The author added the sections on history and use in TLS. He significantly extended the sections on certificate structure and CA hierarchy. Section 2.5 is a revised version of Section 2 in [73], with clarifications and details added by the author. Section 2.6 is an extended version of Section II in [28]. The author added the protocol flow of SSH and added details on the PKI model. 28
45 Part II. Analyses of Public Key Infrastructures 29
46
47 3Chapter 3. Analysis of the weaknesses of the X.509 PKI The deployment of X.509 for the WWW began in the 1990s with the first browser vendors adding CA certificates to their root stores. Criticism of this approach can be found as early as the turn of the millennium. From about 2008 on, we also find increasing evidence of successful attacks against the X.509 PKI. This chapter addresses Research Objective O1. The approach we take is historicaldocumental, with empirical elements. We analyse early criticisms and investigate whether these were addressed later. We then investigate reports of known attacks (both successful and unsuccessful ones) and determine the root causes. From this, we derive requirements that mechanisms to strengthen X.509 have to meet in order to be successful Investigated questions In keeping with Research Objective O1, we define the following research tasks. Criticism and mediation We investigate which major criticisms were brought forward, and whether these were addressed. This covers Research Objective O1.1. Incidents and their causes We investigate incidents in the X.509 PKI and determine their root causes. This task addresses Research Objective O1.2. Improvements to X.509 Based on the above findings, we derive which kind of approaches can help mitigate the above identified causes for failures. This addresses Research Objective O Criticism of the design In the following, we describe some major criticisms of X.509 that were brought forward from early on and analyse whether these were addressed CA proliferation: the weakest link The original X.509 PKI envisaged one global CA with many subordinate CAs responsible for clearly outlined portions of the X.500 directory. X.509 for the WWW eliminated this principle: here, any CA may issue a certificate for any domain. When discussing different PKI setups, Perlman identified the critical weakness of this approach in [61]: compromising a single CA is enough to break the entire PKI. Yet CAs in the root store are not the only ones that are trusted. As mentioned in Section 2.3, CAs may employ Registration Authorities (RAs) to identify the entity making a certificate request. Since 31
48 3. Analysis of the weaknesses of the X.509 PKI the identity verification is a crucial step in certificate creation, this means that there are more entities that need to be trustworthy than the size of a root store suggests. This was recognised early on in publications, e. g., by Ellison and Schneier [23], and also in academic talks, e.g., by Chadwick [156]. The obvious CA for an attacker to target would be the one with the weakest protections. As a result, the strength of the entire PKI is equal to the strength of the weakest CA. It is thus an interesting question whether these early criticisms of CA proliferation were addressed or not. One way to measure this is to analyse the development of the root store of a major browser vendor. We chose to do this for the Mozilla Firefox browser, whose source code is publicly available. It takes its root store from the NSS cryptographic library, which it uses for TLS [230]. We downloaded all revisions of NSS from the CVS development branch 1 [233]. This branch holds the root stores between late 2000, when the first certificates were added, and late It is a very good approximation of the state of Firefox s root store over the years 2. For each root store, we determined the number of included root certificates. Our tool suite [200] is an extension of another tool to extract the root store, written by Langley [211]. It allows us to extract the root stores not only from the current Firefox versions, but also from older versions 3. The result is shown in Figure 3.1, which shows the development of the NSS root store since As can be seen, the root store was initialised with only about a handful of certificates. Since then, the number has greatly increased over the years. By December 2010, we find the number to have grown to almost 120. By the end of 2012, it had reached 140 root certificates. Recall that each certificate is associated with a private key that must be protected at all times in order to avoid compromise of the entire PKI. The significance of this count alone is somewhat limited, however. Another interesting question would be how many organisations exist that own root certificates in the root store. This question can be answered with data available from Mozilla the organisation discloses the owners of the root certificates in a publicly available document [231]. As of 7 November 2013, we find the root certificates belong to 65 organisations, which identify themselves via 90 different names in the organisation part in the issuer field of the certificate 4. We also investigated the requests for inclusion of new root certificates, which are also published by Mozilla [232]. We found 41 owners applying for the inclusion of a new root certificate. Seven owners applied for an update of their certificate s status in the root store (e.g., to enable EV treatment). Note that this list also contains already-approved requests, which have just not been added into the source code of NSS. As a note aside, even browser vendors sometimes find it hard to track root certificates across organisational changes (mergers, acquisitions, introduction of new operational procedures, etc.). Mozilla, for example, had to admit in 2010 that they had difficulties determining whether the owner of a root certificate in their root store was still active [273, 238]. The issue could be cleared up within weeks: the company RSA still held the private key, but the certificate had been retired. The case demonstrates the considerable effort that must go into the administration of root stores. 1 cvs -d co mozilla/security/nss/ 2 There is no centrally maintained list which NSS revision was used in which Firefox version, unfortunately. Firefox versions have a different release schedule than NSS and may skip the odd NSS version. However, the root stores are the same and the delay in introducing new CAs into Firefox is too short to be significant for our analysis. 3 Note that this method differs from the one we used in [37] as we count only root certificates that are declared to be used to issue server certificates here. 4 We discounted two certificates where the organisation part was empty. 32
49 3.2. Criticism of the design Number of certificates Figure 3.1. Growth of the NSS/Mozilla root store. Our method can merely estimate a lower boundary on the number of entities that can sign certificates. The root store does not list subordinate CAs, which may be operated by other organisations. One could be tempted to determine the names of organisations from large-scale scans of the HTTPS infrastructure. However, this method has another caveat: it is impossible to tell from an intermediate certificate whether it is used by a subordinate CA or whether it just indicates that a certain RA verified the identity of the subject named in the certificate. For example, it is known that the German association DFN-Verein, which itself operates as a subordinate CA, employs a large number of RAs. These RAs appear in the issuer strings of intermediate certificates issued by DFN-Verein. However, they do not control the cryptographic material: all certificates are issued by the DFN-Verein subordinate CA itself [190]. It would thus be incorrect to count the RAs as entitites that can issue certificates only the one subordinate CA should be counted. Finding The numbers for both certificates and organisations show that CA proliferation has continued over the past decade and there is no sign that it will stop, at least in the short or even medium term. The weakest CA determines the strength of the entire PKI Trust and liability Browser vendors and operating systems decide which root certificates should be included in their root stores. Users as the parties that rely on the correctness of certificates are not involved in these decisions. It is thus an interesting question whether CAs can be held liable for accidents, compromises or mistakes they make. This point was first investigated by Ellison and Schneier in [23] in At that time, PKI practices were far from being standardised, but CAs did already document abstract duties and responsibilities in Certification Practices Statements (CPSs). Ellison and Schneier analysed the CPSes of several CAs. They found that not one of them accepted liability in any form for an issued certificate. Consequently, trust into CAs could be said to be established by browser vendors without a legal way for users to hold anyone accountable for damages. 33
50 3. Analysis of the weaknesses of the X.509 PKI Generally, vendors require security audits according to a standard like WebTrust [171]. Some set additional requirements. Mozilla documents their requirements in [229], Microsoft in [223]. The question is if compliance with an audit is enough to constitute trust in a CA, especially as the audited parties are exactly the parties that pay for the audits. However, PKI practices have moved a step further towards standardisation. The so-called Baseline Requirements of the CA/Browser Forum impose policies on the certification practices of the forum members [148]. With such documents in existence, one way to assess the trustworthiness of a CA is to consider the degree of liability they prescribe: a high liability means that the CA will at least pay damages if any incident should harm the customer. This should give it a strong incentive to adhere to good secure practices. We thus inspected the Baseline Requirements. We found that not very much had changed since Ellison s and Schneier s investigation: the standard continues to allow a CA to disclaim any liability. There is not even a need to mention this in the CPS 5. As of 2013, a separate set of guidelines exists for EV certificates. The guideline document by the CA/Browser forum allows CAs to limit liability to 2000 USD per relying party (e. g., users) or subscriber (e. g., domain owner), and per EV certificate [149, p. 40]. Finding While users are parties that need to rely on the correctness of the PKI, we find that they still cannot hold CAs liable, except in the case of EV certificates. Even then, however, CAs can limit their liability to 2000 USD. Liability is only a small incentive for CAs to operate in a way that makes them more trustworthy Strength of identity verification Ellison and Schneier also expressed concern about what they call a CA s authority [23] based on the fact that CAs certify public keys for domain names without actually having control over DNS registration, and thus being unable to verify the identity of the party requesting a certificate with enough certainty. We analysed current practices, based on the Baseline Requirements and the EV requirements of the CA/Browser Forum. The Baseline Requirements distinguish between the authorisation of a domain owner to apply for a certificate and the verification of the identity of the domain owner in terms of name and address. Concerning the authorisation, the document specifically allows CAs to use to verify that a requesting party is authorised to request a certificate. The address to use may be either taken from the WHOIS, be a standard address like hostmaster prepended to the domain name, or be supplied from the domain registrar as a recognised authority [148, p. 14]. However, still relies on the insecure DNS, which thus represents a weak link in the chain of verification steps to carry out. For certificates where the requester also wishes to add name and address, the Baseline Requirements require out-of-band steps. Examples are attestation letters, site visits or communication with a government agency. This establishes a level of verification between the -based domain-verification and EV certificates. Recall that the latter are intended for organisations only. The respective guidelines for EV certificate issuance are described in a document of their own, and often require contact with entities recognised by a jurisdiction s government for such purposes [149, p ]. Interestingly, contact is cited as one way to communicate with such entities, at least in some cases [149, p. 20]. 5 At the time of writing, the liability clauses remain in effect even for the now-updated version of the BR. 34
51 3.3. Incidents and attacks against the X.509 PKI Finding The guidelines published by the CA/Browser Forum establish (at least) three different classes of certificates. Some certificate types require a relatively thorough verification, which takes contact with government agencies into account. However, the domain-validated certificates still rely on insecure technology during the verification process Summarising view The previous sections demonstrated that a number of weaknesses were known to exist in the X.509 PKI from an early point on. We showed that at least two of them, namely CA proliferation and liability, were not mediated since the academic publications that described them. Concerning CA proliferation, we found that the number of root certificates continues to grow as evidenced by an analysis of the Mozilla root store for the time between late 2000 and end of Furthermore, the number of organisations owning the root certificates is also relatively high, namely about 60 and another 40 organisations are waiting to have their certificates included in the root store. Concerning liability, we analysed the current guidelines for the issuance of certificates that have been agreed upon by members of the CA/Browser Forum. We found that CAs may disclaim any liability, except for the case of EV certificates. However, the liability even in this case is relatively low. We found that the third issue, the use of insecure technology to verify identities, has been addressed only partially and only for a certain class of certificates. On the whole, it is safe to say that developments in the X.509 PKI have been rather slow, with important issues not addressed for many years. In particular, it seems unlikely that the issue of CA proliferation will be addressed in the near future. With CAs having equal certification capabilities, the argument of the X.509 PKI being as strong as its weakest link will continue to hold Incidents and attacks against the X.509 PKI In this section, we take a documental approach: we compile a survey in which we analyse known attacks and incidents against the X.509 PKI. In particular, we will investigate the root causes. To the best of our knowledge, this is the first academic survey covering this topic. Figure 3.2 shows a timeline of events that may serve as a graphical reference. Our results are mostly based on the analysis of publicly available sources (like reports from hackers) and incident reports (from CAs themselves or companies hired to carry out an investigation). We also briefly analyse the extent to which cryptographic breakthroughs endangered the X.509 PKI. We conclude with a relatively new danger to X.509 and TLS: the appearance of devices that allow to carry out mass surveillance Attacks against the X.509 PKI The order in which we present incidents will be only roughly chronological: in some cases, incidents occurred before others but were not disclosed until later, or they occurred but it was not realised then that they were linked to other incidents. We thus sometimes deviate from the chronological order to make such links more transparent. 35
52 3. Analysis of the weaknesses of the X.509 PKI Microsoft code-signing certificates (2001) The first case we discuss gained a certain prominence as it affected Microsoft. The Microsoft Security Bulletin that describes the incident can still be found online [220]. In 2001, the VeriSign CA erroneously issued certificates to an unknown party that claimed to be Microsoft. These certificates could be used to sign code. They were not issued for domain names, thus a man-in-the-middle attack on traffic was not possible. Microsoft stated their real certificates were issued from a different CA and that the rogue certificates would not be accepted by its Windows operating system. Finding The incident showed that it was possible to trick a well-known CA into issuing certificates for the wrong entity. The weakness was the insufficient identity check on part of the CA. It remains unclear at which point in the certification process the mistake was made. Thawte (2008) Attacks on the X.509 PKI began in more seriousness in 2008, marked by a series of proof-of-concept exploits against major CAs. These were carried out by white-hat hackers, i. e., hackers with benign intent. In summer 2008, Zusman announced that he had been able to obtain a certificate for login.live.com, an important site by Microsoft [277]. Combined with a man-in-the-middle attack, this would have allowed him to intercept critical traffic to the site. The attack vector was simple. Zusman exploited the fact that CAs assume certain addresses can only be owned by an administrative contact, i. e., someone with a claim to the domain. As mentioned in the last section, this practice is still allowed by the Baseline Requirements. Examples of such addresses are etc. However, at that time no comprehensive list of such addresses had been agreed upon between CAs and other parties. This was critical in the case of Web mail services, however, as these allow address to be freely registered under the domain name of the service. In this particular case, Thawte 6 viewed as a valid administrative contact. This address was still available for registration. Zusman acquired the address and then bought a certificate for login.live.com. His blog entry implies that he even spoke to Thawte personnel on the phone, who did not notice the high value of the domain name nor thought of additional verification steps. Finding The weakness consisted of a lack of agreement between server operators and CAs which addresses constitute a valid contact. The root of the problem, however, is that contacts are a poor way to assert an entity s ownership of a domain. Comodo (2008) A serious incident in the same year concerned the Comodo CA, a relatively large CA. It was reported by Eddy Nigg, founder of the competing CA StartSSL, in a blog post [236], on 23 December Comodo operates resellers and Registration Authorities that are allowed to verify ownership of a domain name themselves. Nigg found that one of these resellers sent him unsolicited advertisements to buy certificates from them. He tested whether he could get a certificate for mozilla.com, and found 6 Zusman did not immediately announce the name of the CA; he disclosed this information several months later [276]. 36
53 3.3. Incidents and attacks against the X.509 PKI that he could buy the certificate without any verification checks applied at all. He reported this violation of a CA s most basic obligation on his blog and in the newsgroup mozilla.dev.security.policy [235], where Mozilla carries out its root certificate inclusion process. The issue was also discussed in Mozilla s bug tracking system [146]. The entry contains an incomplete description of the rather complicated system of RAs, resellers and subordinate CAs that Comodo operates. Comodo s failure to guarantee their RAs proper functioning raised the question whether their root certificates should be removed from Mozilla s root store. There was no precedent for this. Comodo themselves deactivated the RA. After discussion in the newsgroup and the bug tracker, Mozilla chose to interpret this as sufficient action on Comodo s side. No further steps were taken. Finding The weakness was an RA failing to comply with their duties in spite of contractual obligations. It shows that the model of RAs is dangerous if the RAs cannot also be technically controlled. StartSSL (2008) StartSSL itself was also a victim in The incident was reported two weeks after the previous one, but actually occurred three days earlier. On 20 December 2008, an attacker exploited a flaw in StartSSL s Web interface to issue a number of certificates, among them the domain of the online payment operator PayPal and the CA VeriSign. The latter was caught by StartSSL as the CA maintained a list of domains it considered sensitive. Certification requests for these domains were automatically forwarded to human personnel for manual inspection (but after the issuing process had completed). This second line of defence caught the intruder, and all rogue certificates were instantly revoked. StartSSL contacted the intruder via the address he had given during the registration process it was Zusman, who had also previously tricked Thawte. Zusman reported his success in a blog post [279]. StartSSL documented it in a white paper [261]. We inspected both texts. There is no unambiguous description in StartSSL s report how the attacker managed to break the registration process. Zusman cleared it up in a talk at DEF CON 17 [278] and identified the weakness as Insecure Direct Object Reference. This vulnerability type had been in the Top 10 list of weaknesses compiled by The Open Web Application Security Project (OWASP) just the year before. StartSSL also became the centre of debate in the Mozilla newsgroup. Mozilla decided to keep their root certificate in the root store. Finding The weakness lay in a serious technical vulnerability in the front-end which may have been there for an undetermined period of time. The incident was contained thanks to the CA s defence-in-depth approach, a manual check for sensitive domains. RapidSSL (2010) In 2010, Seifried reapplied the method Zusman had used previously to obtain a certificate from Thawte. His target was the RapidSSL CA (owned by VeriSign). Seifried registered from the Portuguese Web mail provider of the same name and found he could normally buy a certificate for the domain. He documented this finding in a post to the newsgroup mozilla.dev.tech.crypto and an article in Linux Magazine [257, 256]. A bug in the Mozilla bug tracker was consequently opened [212]. It is worthwhile to note here that the attack vector was long-known and had been exploited before. The CA was even aware of it: an entry 37
54 3. Analysis of the weaknesses of the X.509 PKI in Mozilla s bug tracker documented that the CA had promised one year before to disallow such addresses [262]. Technically, however, they were not at fault the grace period that the CA had been given to address the issue was not completely over yet when Seifried carried out his certification request. Finding The weakness was identical to the Thawte incident of However, it also shows that even security-critical organisations like CAs can sometimes exhibit a slow pace of change. Comodo (2011) 2011 could be said to be the year when the X.509 PKI was broken the first time with very serious consequences. On 15 March 2011, a Comodo RA was compromised and the attacker was able to issue rogue certificates. Comodo themselves acknowledged this fact about a week later [159]. The intruder himself posted a letter to Pastebin (a site for sharing text fragments, with anonymous access) and identified himself as a hacker from Iran [164], providing details about the methods he had used to issue the certificates and secret information whose authenticity only the RA could confirm passwords and database names among them. Comodo broadly acknowledged some of these details later [214]. The intruder identified the Italian branch of InstantSSL as the reseller he had broken into. Once on the server, he could decompile a library, which allowed him to determine Comodo s online interface for certificate signing and gave him the access credentials. Note that this means that the reseller was essentially a subordinate CA, not just an RA. The attacker used the credentials to issue nine certificates. High-value domains were among them, e.g., Google, sites of Yahoo, Skype, and Microsoft Live, as well as the Mozilla Add-on site. The latter is of particular note: together with a man-in-themiddle attack, it would allow to trick users into installing forged add-ons, which has the potential to compromise their entire system. The purpose of another certificate, with the subject global trustee, was never ascertained. In two separate posts to Pastebin over the next two days, the intruder presented more details [160, 163]. Shortly afterwards, he released the rogue certificate for Mozilla [162] and indicated that he had compromised at least two more Comodo resellers [166]. Comodo confirmed the compromise of two more RA accounts [132], although this leaves open what kind of accounts were compromised. A blog post by Netcraft later identified GlobalTrust as one compromised RA [234]. Comodo noticed the incident themselves and reacted by revoking the affected certificates. According to their report [159], the certificates were not detected in use, apart from one test on a host in Iran. The company claimed that the attack came from several IP addresses, but mainly from Iran [159]. Comodo also notified other affected parties, in particular browser vendors. The first public notice did not come from Comodo, however, but from Mozilla [240] and the independent security researcher Jacob Appelbaum [137]. He had monitored changes to the source code in the repositories of Chromium (the open-source project behind Google s Chrome browser) and Mozilla and noticed that the two organisations had both blacklisted (roughly) the same certificates in their source code. Upon inquiry, he was told of the incident and agreed not to disclose it until patches had been shipped. Mozilla disclosed the incident on 22 March, Microsoft and Comodo on 23 March. The changes to the repositories had both happened on 17 March. In other words, between the compromise and the fix two days had passed. It took five more days until the incident was finally publicly disclosed. Browser vendors reacted by marking certificates as untrusted as part of their code. Revocation mechanisms like CRLs or OCSP were not sufficient. First, a root of the 38
55 3.3. Incidents and attacks against the X.509 PKI PKI had been successfully attacked. Second, as mentioned in the last chapter, browsers generally do not fail promptly on revocation errors i.e., they do not abort a connection if they are unable to obtain revocation information. If the certificates had only been revoked, an attacker would still have been able to use them if he had been able to suppress CRL or OCSP traffic, too. Apart from removing Comodo s root certificate, blacklisting certificates in code was thus the only way to make the rogue certificates useless for an attacker. Finding The weakness here was of a combined technical and organisational nature. First, a weak link existed in the form of an RA. Second, the reseller s public-facing systems were vulnerable, and the attacker could escalate his privileges to the point where he could issue certificates. Third, the attack showed that there is no clear distinction between RA and subordinate CA the RA account was equipped with access rights to Comodo s signing systems. DigiNotar (2011) The series of incidents culminated in the breach of the DigiNotar CA. DigiNotar participated in the Dutch government s PKI, PKIOverheid, allowing it to issue governmentaccredited certificates. The CA was allowed into the Mozilla root program in May The incident that concerned DigiNotar was investigated by the security company Fox-IT, on whose final report we rely in the following [192]. On 19 July 2011, DigiNotar found a mismatch between their list of issued certificates and records kept in their back office. An investigation yielded that rogue certificates had been issued. In the week that followed, more such rogue certificates were found and also a message from the intruder. DigiNotar revoked the rogue certificates and consulted an external security firm. DigiNotar did not inform browser vendors; the company believed the damage had been contained by revoking all rogue certificates they had found. It turned out that this assessment was wrong. On 27 August 2011, a user from Iran posted a message to Google s Gmail product forum, stating that he was encountering a rogue certificate [145]. His browser, Google Chrome, had given a warning when trying to access Gmail. This was due to a largely undocumented feature in the browser: it contained hard-coded checksums for valid Google certificates. This allowed it to identify the rogue certificate and warn the user. The post to the forum contained the rogue certificate and was later enhanced with traceroute information showing an unusual path to Google s servers. The initial post was soon followed by other reports from Iran. This showed that the incident was not limited to one ISP. Rather, everything was pointing towards a state-level man-in-the-middle attack. DigiNotar learned about this only when it was contacted by the Dutch CERT the next day. The rogue certificate was instantly revoked, and other stakeholders notified. Google published a blog post on the same day [130], stating that they had received several reports about ongoing man-in-the-middle attacks with the fraudulent DigiNotar certificate. They announced their plans to remove DigiNotar from their root stores. Mozilla was informed by Google and also reacted on the same day, shipping emergency versions of their software with the DigiNotar CA disabled [241]. Microsoft reacted in the same way [191]. 7 The DigiNotar root certificate appears for the first time in CVS revision 1.48 of the Mozilla source code, which is from Interestingly, DigiNotar applied for being allowed to issue X.509 certificates for Web hosts, S/MIME, and code signing. Their verification practices for addresses did not meet Mozilla s standards for S/MIME, however, and the trust flags were never enabled in Mozilla. 39
56 3. Analysis of the weaknesses of the X.509 PKI Trustwave discloses industry practice of subordinate CAs for surveillance Türktrust rogue intermediate certificates used to impersonate Google DigiCert Sdn. Bhd. issues weak certificates; used to sign malware DigiNotar compromised ( Comodo Hacker ); rogue certificates issued StartSSL breached; no rogue certificates issued InstantSSL (Comodo RA) compromised ( Comodo Hacker ); rogue certificates issued; more compromised RAs confirmed 2010 RapidSSL performs insufficient identity check Rogue CA certificate created by MD5 collision (Sotirov et al.) Comodo RA issues certificate without identity check StartSSL interface compromised; rogue certificates issued Thawte performs insufficient identity check VeriSign tricked into issuing rogue certificates Figure 3.2. Timeline of incidents threatening the security of the X.509 PKI for the WWW. 40
57 3.3. Incidents and attacks against the X.509 PKI Fox-IT was hired to carry out an investigation on 30 August The company set up a monitoring system to determine whether the intrusion was ongoing. Fox-IT found that DigiNotar s logs had been tampered with, leaving the company without information about the serial numbers in the rogue certificates, and without a way to assess how many rogue certificates had actually been issued. Initially, this also prevented them from sending correct OCSP revocation responses for the rogue certificates as OCSP is a blacklist-based system. Upon further investigation, Fox-IT found that the attacker had begun to breach DigiNotar s network as early as 17 June Firewall logs showed connections to IP addresses in Iran. By 1 July 2011, the sensitive network containing the hosts running the CA software had been compromised. The first successful attempt at creating a rogue certificate was made on 10 July. The investigation showed that all servers that managed CA activities were compromised, with the intruder having administrator privileges and access to databases. Fox-IT could show that the intruder had issued at least 531 certificates, for 140 unique certificate subjects and 53 unique Common Names (e. g., DNS domains). It remains unclear to this day whether more certificates were issued. The last traceable activity of the attacker on DigiNotar s systems was on 24 July Note that this is a full week after DigiNotar noticed the breach and consulted a security firm to contain the incident. Fox-IT found messages left by the attacker on DigiNotar s systems. The attacker claimed to be the same person who had also breached Comodo s RA several months before. He communicated with the public via Pastebin [165] later and for a short time also over a Twitter account [169]. The attacker claimed to come from Iran and act alone [168, 161]. He clarified that he did not work as part of a state-sponsored attack, but acknowledged that he had given rogue certificates to other entities, without stating who they were [167]. The ongoing man-in-the-middle attack was consistent with the attacker s claims, as were Fox-IT s findings of communication with IP addresses in Iran. Among speculations that the Pastebin entries came from an impostor, and not the real intruder, the attacker reacted by using one of the private keys that belonged to a rogue certificate to sign a file [170]. He also claimed to have breached a number of other Comodo RAs, as well as the CA GlobalSign [168, 161]. The last entries on Pastebin are from 7 September and on Twitter from 11 September GlobalSign later confirmed an intrusion, but stated that it had been limited to their Web server [194], and the attacker had only obtained the private key to the Web server s certificate. Mozilla reconfirmed their decision to permanently remove DigiNotar from their root store in early September 2011 [239]. Their decision was based on several factors. First, DigiNotar had failed to notify browser vendors of the compromise and the rogue certificates. This was viewed as particularly bad as certificates had also been issued for addons.mozilla.org. Second, the scope of the breach remained unknown as DigiNotar s log files had been compromised, too. Third, the certificate had been used in a real attack. This made DigiNotar the first CA ever to be removed from root stores for misconduct. Finding The DigiNotar incident is of huge interest as so much is known about how the intrusion occurred. The weakness may, at first glance, seem to be of a purely technical nature: the CA had failed to secure its perimeter. However, the effects of intrusion were quite severe. This points at an organisational problem: it took the CA very long before they fully realised the extent of the incident. 41
58 3. Analysis of the weaknesses of the X.509 PKI StartSSL (2011) StartSSL became a victim again in The incident actually occurred before the DigiNotar case, on 15 June 2011, but was found to be connected to DigiNotar. It became publicly known when the StartSSL homepage suddenly announced that the CA would temporarily stop issuing certificates due to a security breach [197]. The CA stated that no rogue certificates had been issued, and the incident was under investigation. In to a journalist, Eddy Nigg, CTO of the company, said that the attacker had attempted to obtain certificates for the same targets as during the attack on Comodo several months previously. The intruder had unsuccessfully attempted to create an intermediate certificate [195]. In the discussion that followed in the Mozilla newsgroup mozilla.dev.security.policy, Nigg maintained that he was currently not allowed to release further details. The discussion led Mozilla to consider changes in their policy, concerning under which circumstances, and how, CAs were meant to notify other parties in case of security breaches. StartSSL never issued a public incident report. This has remained unchanged at the time of writing and has been confirmed to us in private . However, details about the incident became known in the context of the DigiNotar case. The intruder mentioned in his post on 6 September 2011 that it had been him who had successfully breached StartSSL. According to his claims, he had already connected to a secure hardware module that was central to certificate issuing. However, Nigg himself had been monitoring the device, and noticed the intrusion. The case was made even more mysterious when Nigg posted an entry on the company blog [237]. He disclosed that his business had ended up in a country sponsored cyber-war (sic). The post mentions the attack on Comodo and cites Iran s involvement, but does not disclose further details. It was not followed up. Finding The attack was unsuccessful but aimed at a technical weakness. If Nigg s claim of a cyber war should be the truth, this would be proof that the capacities of countries need to be factored into a threat model for the X.509 PKI. DigiCert Sdn. Bhd. (2012) In 2012, DigiCert Sdn. Bhd. 9 were found to have issued certificates that were in critical violation of acceptable standards and their own CPS [213]. The CA operated as a subordinate CA for Entrust, Inc. They were found to have issued certificates for very short RSA keys (512 bits), which are not considered secure by today s standards. Furthermore, they had issued certificates without the so-called Extended Key Usage extension, which allows the owner to use them for code signing. The certificates did not carry any revocation information, either. The issue was detected when an attacker cracked the key of one certificate and used it to sign malware. Entrust reported the issue themselves to Mozilla and announced they would revoke the intermediate certificate. They stated that Verizon had also cross-certified DigiCert Sdn. Bhd., although it was initially not clear what the exact relationship was [189, 213]. Mozilla decided to blacklist the certificate in question [213, 242]. Microsoft and Google followed [222, 206]. DigiCert Sdn. Bhd. responded themselves in a series of statements [177, 178, 176], in which they confirmed the problem and announced they would seek another audit [178]. At the time of writing, they are not in the list of pending requests at Mozilla [232]. 9 Not related to DigiCert, Inc., which is US-based. 42
59 3.3. Incidents and attacks against the X.509 PKI Finding The CA did not follow its own operational procedures and issued certificates with weak keys and without a relevant extension. The impact was grave as they operated as a subordinate CA, which once again highlights this particular danger. Türktrust (2012) The last incident we discuss concerns a server certificate for *.google.com, which was discovered by Google at the end of This certificate had been issued from an intermediate certificate that had in turn been issued by Türktrust, a CA based in Turkey. Google announced the finding on their security blog [210]. An instance of their Google Chrome browser had blocked the certificate due to the same mechanism that had uncovered the rogue DigiNotar certificate. Google revealed that Türktrust had mistakenly issued intermediate certificates for two organisations instead of what should have been normal server certificates for TLS (this is only controlled by a Boolean flag). Microsoft and Mozilla offered more details [224, 158, 259]. Only one certificate was used to issue the fraudulent certificate for Google s domain. It had been in active use on at least one system. According to Türktrust, the rogue certificates had been issued due to a faulty configuration in August The CA stated that their logs were complete and that their customers had never requested intermediate certificates. However, one customer had deployed the certificate on their firewall system. The explanation was that this was by accident because the firewall would accept any intermediate certificate automatically and switch to an interception mode. While the claim may seem bizarre, it is not completely implausible and was accepted by the vendors. It was reinforced by Türktrust s statement that OCSP traffic for this particular certificate was predominantly received from IPs associated with the domain in question. Microsoft, Mozilla and Google disabled use of the intermediate certificates by blacklisting them. Google announced that they would revoke the EV capacity for Türktrust; Mozilla announced it had halted the inclusion of a new Türktrust root certificate meant for the same purpose. Türktrust continues to be included in their root stores, however. Finding The root causes were the same as in previous incidents subordinate CAs that were not tightly controlled but able to issue arbitrary certificates. In this particular incident, we would like to emphasise the use of the certificates, however: they were used to monitor encrypted connections Surveillance The case of Türktrust highlighted a particularly severe problem: intermediate certificates used on firewalls and routers for the purpose of inspecting encrypted traffic. It was known well before the Türktrust incident that several companies produce devices for such a purpose The Spy Files [135] is a collection of documents with the names of companies and products. It should be noted that some organisations may have a legitimate interest in inspecting traffic that enters and leaves their networks defence against industrial espionage is one use case. While such practices give rise to ethical concerns, it might be possible to resolve these (e. g., by requiring informed consent from employees). The real concern is a different one: such devices might be used by authoritarian governments to carry out mass surveillance against their own populations. This is particularly troublesome due to the fact that so many CAs exist that are subject to very different legislations. Soghoian and Stamm already warned in [67] that governments might compel a CA registered under its jurisdiction to issue an intermediate certificate for surveillance. 43
60 3. Analysis of the weaknesses of the X.509 PKI The decisive question is thus how one can ascertain that inspection devices are not used for nefarious purposes. The simplest way would be for a company to create their own root certificate, install it on the border inspection device, and deploy it to client devices. Since the root certificate is only trusted by clients in the organisation s network, no other Internet users are affected. Practical dangers remain, however, when this is done carelessly. In a blog post, Sandvik and Laurie reported a serious flaw in an inspection device by Cyberoam in 2012 [254] it shipped with a default root certificate that customers could use instead of creating their own one. Unfortunately, certificate and private key were the same across all devices of the same type, and the private key could be extracted as a commenter in the blog post demonstrated [254]. An attacker only had to buy the device in order to be able to read traffic of Cyberoam customers who had not changed the default key. Together with an attack on the Border Gateway Protocol (BGP) as in [199], the attacker would not even need to be in the immediate vicinity of the victim network. An alternative to a self-created root certificate would be to pay a conventional CA to issue a subordinate certificate. CAs exist that offer such certificates. The CA Trustwave, for example, became the centre of attention when they announced 10 that it has been common practice for Trusted CAs to issue subordinate roots for enterprises for the purpose of transparently managing encrypted traffic and that Trustwave has decided to revoke all subordinate roots issued for this purpose [263, 270]. Mozilla, at least, did not welcome such practices and proceeded to explicitly forbid them [274]. Finding Intermediate certificates carry the complete signing power of the root certificate. Instead of compromising a CA, attackers can theoretically just as well buy the certificates they need and then carry out surveillance. Careless deployment of default keys may even enable them to skip this step Cryptographic breakthroughs The number of occasions where the security of X.509 was threatened by cryptographic developments is very small. In fact, there was only one cryptographic breakthrough that had an impact on the PKI: the weakness of the MD5 hash algorithm. Dobbertin showed a way to produce a collision for a modified version of MD5 as early as 1996 [179]. This led to increased efforts to produce collisions in MD5. Wanget al. finally presented such collisions in the rump session of Crypto 2004 [76]. These collisions did not constitute practical attacks yet. However, the pace of development increased drastically: Lenstra et al. presented two different X.509 certificates with the same hash values in 2005 [47]. This attack on the collision-resistance of MD5 was improved by Stevens et al. in 2007 [69]. The authors showed that they could choose input prefixes to MD5 such that two certificates contained different identities yet had the same hash value (a so-called chosen-prefix collision). In 2008, Sotirov et al. [260] finally demonstrated that they could create an intermediate CA certificate from a normally issued end-host certificate, which would be accepted by browsers as legitimate. Effectively, this showed that MD5 was no longer a secure algorithm for digital signatures. Work began to phase out MD5 from TLS implementations. Main-stream browsers continued to accept MD5-signed certificates for much longer e.g., in the case of Mozilla, until 2011 [228]. Finding The number of cryptographic breakthroughs is very small compared to the many incidents that were caused by poor operational practices or technical vulnerab- 10 The original announcement can no longer be found on Trustwave s homepage. It is quoted here from the post to the newsgroup mozilla.dev.security.policy [263], which cites the text from Trustwave s homepage. Reference [270] confirms the correctness of the facts. 44
61 3.3. Incidents and attacks against the X.509 PKI Incident Causes Detection Impact VeriSign (2001) operational unknown minor, if any Rogue CA certificate crypto weakness disclosure none (2007) by attacker Thawte (2008) operational disclosure Mitm possible, (verification) by attacker contained StartSSL (2008) technology disclosure by CA Mitm possible, contained Comodo (2008) operational disclosure by CA Mitm possible, (verification, RA) contained RapidSSL (2010) operational disclosure Mitm possible, (verification) by attacker contained Comodo (2011) technology disclosure by CA Mitm carried out (RA) StartSSL (2011) technology disclosure by CA none, contained DigiNotar (2011) technology attack detected Mitm carried out; by Google PKI failure DigiCert (2012) operational attack detected malware signed (issuance, sub-ca) Türktrust (2012) operational attack detected Mitm carried out (issuance) by Google Trustwave (2012) operational disclosure by CA unknown (surveillance, sub-cas) Table 3.1. Summary of X.509 incidents and attacks since sub-ca is short for subordinate CA. Mitm is short for man-in-the-middle attack. ilities. It shows that the primary concern for X.509 should be the deployment of the PKI Summarising view The incidents we documented in Section 3.3 exhibited a range of causes. We summarise this in Table 3.1. The impact of the incidents varied greatly, and they were detected by different means. In this section, we are going to provide a summarising view. In reference to Research Objective O1.2, there are two questions we ask. First, what were the most common causes (attack vectors) and their impacts? And second, what were the most common ways an incident was detected? Going through Table 3.1, we note that operational practices were the cause in more than half of all incidents: seven of twelve times. RAs and subordinate CAs proved to be weak links in the overall security of the X.509 PKI. In three cases, CAs or RAs failed to execute their duty of identity verification with due care. In two cases, the problem lay in the issuance process (after verification): CAs accidentally issued certificates with wrong values that allowed the certificates to be used for attacks. The impact of these incidents was always low, however: while man-in-the-middle attacks would have been possible, the incidents were mostly contained. Only the rogue certificates that were due to mistakes in issuance had a measurable impact: in one case, malware was signed; in the other, a localised man-in-the-middle attack was carried out for the purpose of surveillance. Technical vulnerabilities were responsible for four incidents: StartSSL (2008), Comodo (2011), DigiNotar (2011), and again StartSSL (2011). Of these, two had a very serious impact: Comodo (2011) and DigiNotar (2011). In the case of DigiNotar, the entire PKI was disrupted to the point that browser vendors had to ship emergency up- 45
62 3. Analysis of the weaknesses of the X.509 PKI dates as X.509 mechanisms, including revocation, failed completely. Notably, only the attack on StartSSL in 2008 was carried out by a white-hat attacker. The other three were carried out with malicious intent. At least in the case of DigiNotar, a large-scale man-in-the-middle attack was detected, which hinted that a country at least profited of the attack, although there is no proof it initiated it. Finally, we find that PKI structure was a cause in four incidents: in the cases of Comodo (2008), Comodo (2011), DigiCert (2012), and Trustwave (2012), either RAs or subordinate CAs made mistakes or failed to comply with their obligations. At least in the case of Comodo (2011), a man-in-the-middle attack seems to have been the result. The revelations made by Trustwave point at a grave problem concerning masssurveillance, however. It remains unclear how many such subordinate CAs already exist or, worse, are continued to be sold. Concerning incident detection, we find that CAs themselves disclosed incidents and vulnerabilities surprisingly often, namely on five occasions (although they often did not provide many details). However, in the two incidents that had the worst impact, Comodo (2011) and DigiNotar (2011), the disclosure came either late and after independent researchers had already found evidence (Comodo) or the attack was not disclosed at all (DigiNotar). In two cases, ongoing attacks were detected by Google, thanks to their internal mechanism of comparing the certificate in a TLS handshake with internally stored references. In the third event, DigiCert (2012), the attack was not discovered by the CA, either Reinforcements to the X.509 PKI We address Research Objective O1.3 in this section: based on our historical analysis from Research Objectives O1.1 and O1.2, we draw conclusions what effective reinforcements for the X.509 PKI should look like. In keeping with Research Objective O1.2, we are going to structure our discussion around the following two aspects: Resistance against the attack vectors determined in the historical analysis Detecting and reporting an incident The impossibility of direct defence The primary attack vectors we determined were operational practices and technical vulnerabilities. This was made worse by the existence of subordinate CAs and RAs in the X.509 PKI. The first conclusion we would like to offer here may sound surprising at first: it is impossible to defend against these vectors directly. We elaborate on this in the following. Operational practices The current CA system is built on root programs run by vendors of browsers and operating systems. These programs generally require audits and compliance with policies in order for CAs to be included in a root store. Yet we found that CAs repeatedly violated policies they had agreed to. As subordinate CAs and RAs are, in contrast to CAs, not documented in the public documents of a root program, they are an obstacle in the effective detection of incidents. A report by Netcraft that was published very recently supports our argument: Netcraft found that one year after the Baseline Requirements of the CA/Browser-Forum had come into effect, a number of CAs were still issuing certificates that were in violation of the agreed practices [180]. Netcraft reported keys that were too short, certificates that missed revocation information, or showed wrong use of the CN field. In total, Netcraft reported 2500 cases. 46
63 3.4. Reinforcements to the X.509 PKI Some of the largest CAs were among the offenders. Against this background, and our previous findings, the position we take is that operational practices will continue to be a problem, at least in the medium term. PKI structure The above argument is intrinsically linked to the issue of the X.509 PKI structure. The compromise of one authority means the compromise of the entire structure. RAs and subordinate CAs can be useful for better identity verification, but they remain the weakest links in the PKI structure. Even if they were entirely removed, however, we remain in doubt whether this improvement would have a larger impact: a large number of CAs with equal signing rights continues to exist our analysis of the Mozilla root store has shown that. Any improvement in the short or medium term must take the existence of a large number of equal authorities into account. Technical vulnerabilities Concerning technical vulnerabilities, we take the view that flaws in software will always exist, and thus also exploitable vulnerabilities. CAs, by their very nature, must operate public-facing systems that accept input from untrusted sources. This attack vector is next to impossible to close Improving defences The second conclusion we offer is the following: the above does not mean at all that we are defenceless, nor does it mean we need to abandon X.509 immediately. There are at least three ways to address the shortcomings of today s X.509 PKI. Out-of-band mechanisms can help First, if we cannot address the problems of the X.509 PKI directly, we must design mechanisms that raise the security for users considerably, even against very strong attackers. These mechanisms must be designed to work outof-band, i. e., without relying on X.509 mechanisms themselves. The reason is that users in the above described cases had no way to assess the authenticity of a certificate other than evaluating the certificate itself. The compromise of a root CA made it impossible to use revocation mechanisms. Some out-of-band mechanisms to improve X.509 have been proposed. They fall into several categories. We analyse the most important contributions in Chapter 8. Incident detection to aid containment Second, we suggest to return to the old wisdom of computer security that good defences are not only concerned with thwarting an attack. Rather, one should expect that defences are breached and have established powerful reactive mechanisms to contain the damage. This should not be left to single CAs as the compromise of one is damaging for all. We thus suggest that mechanisms to detect incidents in the PKI are the most important step in containing damages. We saw in the last section that some of the more dangerous incidents were not disclosed by the CAs themselves (or only belatedly) but by third parties, which had a legitimate interest in thwarting the attack. Designing mechanisms for detection from the outside is a key factor in improving the X.509 PKI. As part of this thesis, we designed a detection system, which we present in Chapter 9. Outside pressure Finally, we believe it is possible to exercise pressure on CAs to cause them to improve their operational practices after all, a bad reputation is a poor basis for economic success. One way to mount this pressure, and at the same time increase the security of the X.509 PKI as a whole, is to monitor the deployed PKI. One case where this would have helped are the certificates with short key lengths issued in the 47
64 3. Analysis of the weaknesses of the X.509 PKI case of DigiCert Sdn. Bdh. Monitoring the deployed PKI has a further benefit: it makes it possible to detect configuration problems on servers and notify administrators. In the next chapter, we show that monitoring can indeed unveil poor (security) practices, both on the side of servers as well as on the side of CAs Related work Our analysis of X.509 criticism is mostly based on the work by Perlman [61] as well as that of Ellison and Schneier [23]. Both publications provide significantly more detail than we discussed here. Perlman discusses a wider range of PKI setups and trust models; Ellison and Schneier also discuss issues related to usability (for users) as well as end-host security (for client computers and client authentication). We chose these two publications as they can be said to be highly accurate where they identify issues in X.509. They also cover all aspects that are important in our discussion. Naturally, there are many other publications available. Gutmann, for example, discusses improved PKI setups in [32], focusing on the revocation issue. In [33], the same author makes suggestions to improve X.509 based on interviews with programmers, administrators and managers. Chadwick also identified several issues in a talk at EuroPKI 2004 [156]. In [22], Ellison addresses the usability aspect again and references principles established within SPKI [100], a PKI that never saw wide deployment but took an entirely different approach by replacing the concept of global identifiers with that of local names that can be chained. There is very little related related academic work available that gives a historical assessment of incidents in the X.509 PKI and analyses the root causes. Asghari et al. reported on several CA incidents in [7]. They also identified the weakest link in the PKI structure as a serious flaw. Their work focuses on an analysis of the interplay between economical incentives and market forces and thus does not discuss systemic vulnerabilities beyond PKI structure. Notably, however, the authors show empirically that certificate pricing is not a driving market force. Roosa and Schultze [65], in a legal publication, also identified the same weaknesses in the CA trust model as Perlman and Ellison and Schneier and cite some incidents as examples. Ian Grigg compiled a list of incidents from 2001 to 2013, which he announced in the mozilla.dev.security.policy newsgroup [196] and published in a wiki at [151]. The text gives only a brief description of each incident, but contains most of the incidents discussed by us. A similar list was published in another wiki by The Hacker s Choice at [265]. The list is significantly shorter than both the one at [151] as well as ours. It was compiled in the wake of disclosures about mass surveillance carried out by government agencies. We know of two books that are work-in-progress and contain sections on historic CA incidents. The first is [86, p ] by Gutmann. The cited section provides an entertaining summary of CA-caused incidents. It does not analyse the root causes systematically. The other book is [89, p ] by Ristić. Ristić gives an (often shorter) overview of many of the same CA incidents we discussed, but does not analyse root causes, either Key contributions of this chapter This chapter addressed Research Objective O1. We conclude this chapter with a list of the key findings. 48
65 3.6. Key contributions of this chapter Research Objective O1.1 We analysed historical criticism of the X.509 PKI. Three major criticisms were: CA proliferation The number of CAs is high, and growing. This increases the number of weak links. Lack of liability CAs have very little liability towards relying parties (customers, users), if any at all. Strength of identity verification CAs rely on insecure communication to carry out identity verification or may lack the proper means to do so. We investigated whether these issues were addressed. We found that no solutions had been introduced for the first two, CA proliferation and liability. On the contrary, the number of root certificates continues to grow, as does the number of organisations that control them. The liability of CAs is only given for EV certificates, and even then the sum for which a CA is liable is relatively low. On the bright side, the introduction of the Baseline Requirements and EV guidelines by the CA/Browser Forum has introduced common standards and defined several classes of certificates. Certificates for domain names may still be issued by relying on insecure mechanisms like or DNS. However, certificates with name verification of the subject and EV certificates require CAs to carry out a much more thorough validation. Our conclusion here is that weaknesses in the X.509 PKI mostly on an organisational, but also on a technical level were known from early on, but never satisfactorily resolved. The proliferation of CAs, in particular, constitutes a persisting danger. Research Objective O1.2 We documented incidents related to the X.509 PKI in a survey. To the best of our knowledge, this is the first academic survey to cover this topic. Our goal was to identify the root causes for the incidents. Table 3.1 provides a summary. We found that the most common causes of incidents were: Poor operational practices Some CAs were tricked into issuing certificates for the wrong entity. Other made mistakes when issuing certificates and signed keys that were too short or accidentally issued intermediate certificates instead of server certificates. Operational setups The weakest link argument we mentioned above holds. The high number of CAs, subordinate CAs and RAs was involved in several incidents where the mistake was not made by the primary CA, but by an organisation acting in its name. Control over the latter was not pronounced enough in some cases (e.g., Digicert Sdn. Bhd. or Comodo in 2011). Vulnerabilities in the technology used The gravest incidents were all caused by compromises of CAs, subordinate CAs or RAs. In several cases, the intruders managed to issue rogue certificates. In at least one case, this resulted in a real manin-the-middle attack. As a country may have been involved in the latter, it seems necessary to include an attacker of this strength in the threat model for X.509. Furthermore, we found that incidents were often detected by third parties, not by the CAs themselves. Those parties had a legitimate interest in thwarting attacks. 49
66 3. Analysis of the weaknesses of the X.509 PKI Research Objective O1.3 Based on our findings from Research Objectives O1.1 and O1.2, we derived conclusions with respect to possible improvements to the X.509 PKI. Our primary conclusion is that the attack vectors that were exploited are hard or impossible to defend against directly. Consequently, the focus for improving X.509 should be on Out-of-band mechanisms Several of the attacks were successful because no mechanism existed to verify the correctness of certificates other than the certificates themselves. Establishing further channels over which users can verify the authenticity of a certificate seems crucial to improve the security of X.509. Strong mechanisms to detect incidents early Several of the attacks were detected very late, when the damage was already done. Furthermore, the attacks were often not disclosed by the CAs themselves. Early detection of ongoing attacks would allow to take measures to contain the damage. Monitoring It is possible to detect problems in X.509 deployment by monitoring issued certificates (e.g., via active scans). This also allows to mount pressure on CAs to only issue certificates that comply with recognised security standards (e. g., the Baseline Requirements) and to improve their security practices in general. 50
67 4Chapter 4. Analysis of the X.509 PKI using active and passive measurements This chapter is an extended version of our previous publication [37]. Please see the note at the end of the chapter for further information. As shown in Chapter 2, the X.509 infrastructure consists of a rather large number of organisations and entities. These may be linked by contractual obligations, but their operations often show a high degree of independence. CAs, subordinate CAs and RAs are required to carry out their work in conformance with certain certification practices that they agree to follow. We showed in Chapter 3 that several incidents were caused by failure to follow such operational practices. In this chapter, we take one step back and shift our focus away from incidents to the state of the X.509 PKI as a whole. Although the concrete implementation of work processes within a CA is not directly observable, it is possible to determine the outcomes of these processes: they are evident in the deployed X.509 PKI. Our overall research question is: can we assess the quality of this PKI, with the ultimate goal of determining where weaknesses occur due to poor operational practices? To find an answer to this question, we carried out a thorough large-scale analysis of the currently deployed and practically used X.509 infrastructure for TLS and examined its security-related properties. We used two empirical methods. Data obtained from active scans allowed us to draw conclusions with respect to the X.509 PKI as it is deployed on servers. Data obtained from passive monitoring allowed us to draw conclusions with respect to the X.509 PKI as normal users encounter it during their Internet activities Investigated questions The following are the research questions we investigated. Fundamentals: secured connections We set ourselves the goal to determine how many servers offer TLS for HTTP, i.e., HTTPS. This can be achieved with active scans. Security of deployment Certificates need to be deployed in a correct way in order for authentication and key agreement in TLS to succeed. Most importantly, certificate chains need to be correct and without errors, and the certificate s subject must indicate the host on which the certificate is used. Cryptographic material should not be deployed on many different physical machines as this increases its exposure and thus the attack surface. We investigated these deployment factors. Certification structure The number of intermediate certificates and the number of certificates they sign are indicators of the PKI s certification structure. On the one 51
68 4. Analysis of the X.509 PKI using active and passive measurements hand, too many intermediate certificates increase the exposure of cryptographic material. On the other, use of at least one intermediate certificate is important as it allows to keep the private key for the root certificate safely offline. We investigated these factors in the deployed X.509 PKI. Cryptography The cryptographic material used to establish TLS connections should be strong enough to provide the desired level of security. We decided to investigate the properties of public keys and hash algorithms in certificates as well as the symmetric ciphers used to secure the actual connections. Issued certificates versus encountered certificates Active scans can only detect certificates as they have been issued and then deployed on servers. However, they cannot provide us with statistical information about certificates that users encounter during their Internet activities. We thus decided to investigate the latter case by using passive monitoring to extract certificates from TLS connections of users. Development over time One should expect the security of the X.509 PKI to improve over time. We decided to investigate this by observing the state of the PKI over 1.5 years. Influence of geographic factors It is well known that many services on the Internet are provided in a geographically distributed fashion Content Distribution Networks (CDNs) are one example. We were interested whether the different locations would be configured in different ways, despite offering the same service. We thus decided to carry out additional scans from several geographic vantage points, distributed across the globe Measurements and data sets We present our measurement methodology and the data sets we obtained in this section. We first describe the methodology for active scans, then for passive monitoring, before we give a description of the data sets themselves. For the purpose of comparison, we also included a third-party data set from the Electronic Frontier Foundation (EFF) in our analysis. Table 4.1 gives an overview of all data sets. The data sets that we acquired by active scans have been released to the scientific community at [249] Methodology for active scans We collected X.509 certificates with active scans between November 2009 and April We used primarily vantage points from Germany, first from University of Tübingen and later from Technische Universität München 1. In April 2011, we also added several measurement points in other countries using PlanetLab [248] hosts. These countries were China, Russia, USA, Brazil, Australia, and Turkey. We chose the hosts on the Alexa Top 1 Million Hosts list [133] as the hosts to scan. For each scan, we chose the most up-to-date list. The Alexa list contains the most popular hosts on the WWW as determined by the ranking algorithm of Alexa Internet, Inc. We chose this list as it contains sites that many users are likely to visit. Although its level of accuracy is disputed [84], it nevertheless is appropriate for our need to identify popular hosts. The list s format is somewhat inconsistent: usually, domains are listed without the www. prefix, but this is not always the case. We thus decided to emulate browser-like behaviour by expanding each entry into two hostnames: one with the prefix and one without. 1 This change became necessary due to our group s move to Munich. 52
69 4.2. Measurements and data sets Short Name Location Period Type Certificates (distinct) Tue Tübingen, DE Nov 2009 Scan 834k (207k) Tue Tübingen, DE Dec 2009 Scan 819k (206k) Tue Tübingen, DE Jan 2010 Scan 817k (204k) TUM Tübingen, DE Apr 2010 Scan 817k (208k) TUM Munich, DE Sep 2010 Scan 829k (211k) TUM Munich, DE Nov 2010 Scan 827k (213k) TUM Munich, DE Apr 2011 Scan 830k (214k) TUM Munich, DE Apr 2011 Scan, SNI 826k (212k) Shanghai Shanghai, CN Apr 2011 Scan 799k (211k) Beijing Beijing, CN Apr 2011 Scan 797k (211k) Melbourne Melbourne, AU Apr 2011 Scan 834k (213k) İzmir İzmir, TR Apr 2011 Scan 826k (212k) São Paulo São Paulo, BR Apr 2011 Scan 833k (213k) Moscow Moscow, RU Apr 2011 Scan 831k (213k) S. Barbara S. Barbara, USA Apr 2011 Scan 834k (213k) Boston Boston, USA Apr 2011 Scan 834k (213k) MON1... grid certificates: Munich, DE Sep 2010 Monitoring 183k (163k), 47% (52%) MON2... grid certificates: Munich, DE Apr 2011 Monitoring 989k (102k) 5.7%(24.4%) EFF EFF servers Mar IPv4 scan 11.3M (5.5M) Jun 2010 Table 4.1. Data sets used in our investigation of X.509. Every TLS scan was preceded by nmap scans of TCP port 443 (three probes) to filter out hosts where this port was closed. We did not scan aggressively; the actual certificate scans thus started two weeks after obtaining the Alexa list. Our TLS scanning tool itself is a wrapper around OpenSSL [267]. It takes a list of hostnames as input and attempts to conduct a full TLS handshake on port 443 with each host. We let it run with 128 processes in parallel; thus a single scan took less than a week. Where a TLS connection could be established, we stored the full certificate chain as sent by the server, along with all data concerning TLS connection properties. PlanetLab hosts received a slightly different treatment. We omitted the nmap scans entirely. The primary reason was that we wanted to scan TLS with the same host list as in our main location so we would be able to compare differences between locations. Furthermore, we wanted to scan from the remote location at roughly the same time as from our primary location. Thus, we imported the list of hosts with open port 443 from our main location in Germany and used it as a basis for the TLS scans Passive monitoring As mentioned, we used data obtained from passive traffic measurement to complement our view on the deployed X.509 PKI with a view that corresponds to how users experience the X.509 PKI during their Internet activities. Our passive traffic measurements were carried out in the Munich Scientific Network (MWN) in Munich, Germany. We were able to monitor all traffic entering and leaving that network. The network is relatively large as it encompasses three major universities and several affiliated research 53
70 4. Analysis of the X.509 PKI using active and passive measurements institutions. The MWN provides Internet access to users of these institutions via a 10 Gbit/s link. At the time we carried out our measurements, the network served about 120,000 users and about 80,000 devices. The peak load that we measured on the link was about 2 Gbit/s inbound and 1 Gbit/s outbound traffic, observed in April We carried out two monitoring runs, both during semester breaks. The setups we used were different, although the hardware in both setups remained the same (Intel Core i7, with hyper-threading; Intel 10 GE network interface with 82598EB chipset). The sampling algorithm was also the same in both runs: we sampled the first n bytes of each bi-flow. This method was described by Braun et al. in [12]. The difference between both runs lay in the processing. In the first run (September 2010), we used an approach that is similar to the one used by the Time Machine [43]. We dumped all sampled packets to disk into files of size 10 GB. As soon as one file was complete, we started an offline extraction process to obtain the certificates. We had to cope with hard drive limitations (both I/O and space). Thus, we sampled only the first 15 kb of each bi-flow. For our second monitoring run (April 2011), we switched to an online analysis of TLS traffic. The method used was based on TNAPI [26], with an improvement presented by Braun et al. in [11]. With six instances of our monitoring application running in parallel, we could analyse up to 400 kb of traffic data for each bi-flow, with packet loss of less than 0.003%. We used Bro [60] in both monitoring runs to process TLS. Thanks to its dynamic protocol detection, described in [19], we could identify TLS traffic without being limited to certain ports Data properties Table 4.1 summarises the locations, dates and number of certificates in the data sets. Table 4.2 provides additional details for the monitoring runs. Our data sets can be divided into four groups. The first group consists of the scans from hosts located in Germany at the University of Tübingen (Tue) and at TU München (TUM). These scans were carried out between November 2009 and April 2011, thus spanning a time interval of about 1.5 years. In April 2011, we performed an extra scan with Server Name Indication (SNI) enabled. SNI is a TLS extension to address virtual HTTP hosts. In such setups, a single Web server is responsible for a number of WWW domains. The name of the domain an HTTP client wishes to access is part of the HTTP headers it sends. Without SNI, a Web server is unable to determine which certificate it is supposed to send: the TLS handshake takes place before the client can inform the server via the HTTP header. SNI solves this by letting the client indicate the name of the domain as part of the TLS handshake. We carried out our scan with SNI enabled to determine if there were any significant differences in the certificates a server would send. The second group of data sets was obtained in April We employed Planet- Lab [248] nodes from different countries, in order to obtain a geographically distributed picture of the TLS deployment. Our goal was to determine whether a client s location would result in different certificates received from a server. A typical example where we expected this to happen were CDNs. These often use DNS to route clients to different computing centres, depending on the geographic location of the client. Different computing centres might use different certificates, which would give us relevant data on the state and practice of certificate deployment in CDNs. Comparison between locations also has a desirable side effect: it can show whether certain locations actively interfere with TLS traffic by swapping end-host certificates during connection establishment (a man-in-the-middle attack). 54
71 4.2. Measurements and data sets The third group of data sets was obtained by passively monitoring live TLS traffic. There is an important difference between what can be learned from active scans versus passive monitoring. Active scans show which certificates are deployed for which host, and statistics like percentages of valid certificates thus refer to the state of the PKI as it is deployed. This might differ from what a user experiences: a user might access well-protected sites more frequently than poorly protected ones with invalid certificates. Evaluating the certificate chains we encounter in passive monitoring thus yields a picture of the state of the PKI as it is encountered by users. We extracted all observed certificates in TLS traffic over each two-week period of a run. In September 2010, we observed more than 108 million TLS connection attempts, resulting in over 180,000 certificates, of which about 160,000 were distinct. Our second run observed more than 140 million TLS connection attempts, which were responsible for about 990,000 certificates, of which about 100,000 were distinct. We found that most TLS connections are due to HTTPS, IMAPS and POPS (see Table 4.2 for details). One of the difficulties we encountered was that the MWN is a research network that hosts several high-performance computing clusters. We consequently observed much grid-related traffic secured by TLS and found many grid certificates. They had short life-times and were replaced fast (their median validity period was just 11 hours). Gridrelated certificates cannot be reasonably compared to certificates for WWW hosts. We thus filtered them out in our analysis of certificate properties. We explain this in the next section. Finally, we included a data set from the EFF in our analysis. This data set was obtained using a different scanning strategy. The EFF data set is based on scanning the entire assigned IPv4 address space, which took a few months. According to the source code 2, it seems an attempt was made to accelerate the scanning by assuming a /8 subnetwork would not contain any Web servers if the first 655,360 probes did not hit one 3. The method used by the EFF results in a higher number of observed certificates, but does not provide a mapping onto DNS names. Hence, the data set cannot be verified in terms of a matching subject for a hostname, since information about which domain was supposed to be served with a given certificate is not contained. In contrast, our own data sets provide this information. Since a sizeable part of IP addresses are assigned dynamically [78, 34], the long scanning period also impacts the accuracy of the mapping from IP addresses to certificates. The results from this data set must thus be taken with a grain of salt. However, due to its sheer size, the data set remains valuable for comparisons. An important distinction that we sometimes make is whether we analysed certificates of the full set or just the distinct certificates in the data set. The difference is that the former refers to the deployment of certificates and thus duplicate certificates can occur, i.e., certificates that are used on more than one host. The latter is a pure view at certificates as they have been issued Data preprocessing The International Grid Trust Federation [266] operates an X.509 PKI that is separate from the one for HTTPS and other TLS-related protocols. Their root certificates are not included in the Firefox root store, but are distributed in grid setups. Our setup 2 file ControlScript.py, lines 41 45, revision ffc10e4e1876a855f0ce24f29ae0ac80d38a99dc. There is a second scanner in later revisions that uses roughly 850,000 probes; file scan/cs3.py, lines 77 85, from revision 73403a74d23e604fa6b9ae918245f0ccaad62a2f, added in A later IPv4-wide scan was carried out by Heninger et al. [35]. They found about twice as many certificates as the EFF. 55
72 4. Analysis of the X.509 PKI using active and passive measurements Property MON1 MON2 Connection attempts 108,890, ,615,428 TLS server IPs 196, ,562 TLS client IPs 950,142 1,397,930 Different server ports 28,662 30,866 Server ports % 95.43% HTTPS (port 443) 84.92% 89.80% IMAPS and POPS (ports 993 and 995) 6.17% 5.50% Table 4.2. TLS connections in recorded traces. stored certificates without a reference to the (potentially many) TLS connections during which it was observed. Although we cannot filter out grid traffic in our analysis of TLS connections to hosts, we were still able to identify some properties by correlating the encountered IP addresses with those of known scientific centres. For our analysis of certificate properties (Section 4.4), we used a rather coarse filter mechanism: we simply checked whether or not a certificate contained the word grid in the issuer field. We tested our certificate filter by checking the certificate chains in the data set containing the thus determined grid certificates. Indeed, 99.95% of them could not be found to chain to a CA in the Firefox root store, and not one of them had a valid certificate chain (as is to be expected due to the use of a different PKI setup). At the same time, the values for the validity of certificate chains of non-grid certificates was either in the same range as in our active scans (MON1) or even higher (MON2). We thus conclude that our filter removed most of the grid certificates and the remaining bias is tolerable. We describe results from our analyses now, going item-wise through each question that we address Host analyses Our first analyses are host-based: we investigate properties of the TLS hosts that we either contacted through active scanning, or whose connections we monitored passively Host replies with TLS A central question was how many hosts actually support TLS and allow TLS connections on ports that are assigned to these protocols. To begin, Figure 4.1 shows the results of our nmap probes for the scans in November 2009 and April It groups host from the expanded Alexa list by rank: the top 1000, the top 10,000, the top 100,000, and all hosts (top 1 million). We plot the cases of open ports vs. closed or otherwise non-reachable ports. We did not distinguish between unreachable ports due to network configurations at the destination systems and unreachable ports due to network failures in intermediate systems. We did count failures due to DNS resolution (no IP address for domain name) and nmap timeouts these never occurred in more than 2-3% of cases. The most interesting case is, naturally, where a host showed an open TCP port 443, i.e., where at least one nmap run determined an open port. These were the candidate hosts we tried to connect to with OpenSSL later. Figure 4.1 reveals the fraction of hosts with an open port 443 is higher over the entire range of the Alexa list than just for the top There is very little change 56
73 4.3. Host analyses 100% 90% 80% 70% % of all hosts 60% 50% 40% 30% 20% port not open port open Tue Top 1k TUM Top 1k Tue Top 10k TUM Top 10k Tue Top 100k TUM Top 100k Tue Top 1m TUM Top 1m 10% 0% Figure 4.1. Hosts with open port 443 vs. hosts without open port 443 for scans in November 2009 (Tue) and April 2011 (TUM), in relation to Alexa rank. over time we find a trend towards enabling TLS only among the higher-ranking hosts, but even there it is not pronounced too strongly. This seems surprising as one might assume that the more important sites have more reason to protect sensitive data than those on the lower ranks. Without more data (and possibly more intrusive scanning), it is hard to find compelling reasons here. However, one might speculate that two factors might have an influence. First, it is possible that hosts on the lower ranks use out-of-the-box default configurations more often, or at least do not optimise their Web server configuration much as operators expect less traffic anyway. In these cases, TLS would be enabled by default. Hosts on the higher ranks, on the other hand, are more likely to use optimised configurations as they have to cope with different amounts of traffic and they might disable TLS for performance reasons. If this is the case, however, the result is a rather poor deployment: only about half of the hosts among the top 1000 offer TLS (or at least have the corresponding port open). For the remainder of this analysis, we focused only on the hosts that had reported an open port 443. We evaluated replies to our OpenSSL scanner. Figure 4.2 shows the results for these hosts. As can be seen, the numbers do not change significantly over time, neither for the overall picture nor for the top Two thirds of all queried hosts offer TLS on port 443, and more than 90% of the top 1000 do so, too. We found a surprising number of cases where OpenSSL reported an unknown protocol on the HTTPS port. We therefore rescanned all hosts that had shown this result and analysed samples of the rescan traffic manually. In all samples, the servers in question offered plain HTTP on the TLS port. As can be seen, this unconventional configuration is less popular with highly ranked servers. The number of cases where a connection attempt failed (due to refused connections, handshake failures, etc.) also showed a correlation to rank, but was generally low. 57
74 4. Analysis of the X.509 PKI using active and passive measurements 100% 90% 80% 70% % of all connections 60% 50% 40% 30% 20% 10% 0% Other failure Connection refused Lookup failure Timeout Handshake failure Unknown protocol Success Tue Top 1k TUM Top 1k Tue Top 10k TUM Top 10k Tue Top 100k TUM Top 100k Tue Top 1m TUM Top 1m Figure 4.2. TLS connection errors for scans in November 2009 (Tue) and April 2011 (TUM), in relation to Alexa rank. On the whole, only about 800,000 hosts from the expanded Alexa list allowed successful TLS handshakes on the HTTPS port. Since 2010, several industry leaders like Google, Facebook, and Twitter have switched to TLS by default, thus bringing the importance of secure connections to the attention of a larger public. It seems, however, their example was not widely followed, at least during our observation period. The corresponding data from our monitoring also showed a large number of TLSenabled servers. Recall, however, that we captured Grid traffic, too, but could not filter it during our monitoring runs (live analysis of the certificates was not possible). Table 4.2 shows a summary of the monitored traffic s properties. We particularly point out the distribution of TLS connections to the well-known ports for HTTPS, IMAPS and POPS. These three protocols make up for most TLS traffic however, there is a relatively large number of ports that are used in total. Also note the increase in observed TLS servers: this increase is also the main factor responsible for the increase in the observed certificate numbers in Table Negotiated ciphers and key lengths The strength of cryptographic algorithms and the length of the involved symmetric keys determine the cryptographic protection of a TLS connection. We used our monitoring data to obtain statistics on ciphers and key lengths. We did not use data from active scans: it would have only limited validity as the negotiated ciphers depend on what a client supports. Hence, all results from active scans would be biased. Figure 4.3 presents the most frequently negotiated cipher suites, key lengths, and hash algorithms encountered in the monitoring runs. The first keyword in the cipher suite, e.g., RSA or DHE-RSA, refers to the method of key exchange. DHE indicates the Diffie-Hellman Ephemeral Key Exchange, the only mode that provides Perfect Forward Secrecy (PFS). PFS is an important security 58
75 4.3. Host analyses RSA_WITH_RC4_128_MD5 RSA_WITH_AES_128_CBC_SHA DHE_RSA_WITH_AES_256_CBC_SHA RSA_WITH_AES_256_CBC_SHA RSA_WITH_RC4_128_SHA RSA_WITH_3DES_EDE_CBC_SHA RSA_WITH_NULL_SHA DHE_RSA_WITH_CAMELLIA_256_CBC_SHA RSA_WITH_NULL_MD5 DHE_RSA_WITH_AES_128_CBC_SHA Others MON1 MON % of connection ciphers Figure 4.3. Top 10 chosen ciphers in passive monitoring data. property. An attacker who is able to record non-pfs-protected communication and later obtains the private keys used in the handshake (e.g., by compromise of a host) can decrypt the session key used in the TLS session and thus decrypt the entire conversation. PFS avoids this attacker by requiring that an (active) attacker must be able to break or compromise the private keys at the time of the handshake in order to be successful. As we can see, only one cipher suite with PFS enjoyed significant popularity in our monitoring runs, namely DHE with RSA, together with AES, at a key length of 256 bits. The need for PFS may not have been as pronounced in 2011 as it is now in the light of powerful attackers who can store entire encrypted sessions and who may have the power to obtain the necessary private keys, DHE is a wise choice. We can also see that ciphers that were considered (very) strong at the time were most commonly selected: RC4 and AES in Cipherblock Chaining mode (CBC). These were sometimes also used with a very good safety margin (256-bit modes). 3DES was still used, but not in the majority of cases. MD5 occurred relatively frequently in Message Authentication Codes (MACs). In MAC schemes like HMAC, this is not considered problematic at this time, but it is not encouraged either [97]. In April 2011, we found an increased share of SHA-based digest algorithms, a positive development. Lee et al. had analysed ciphers in TLS in 2007 [45]. Comparing our results to theirs, we found that while the two most popular algorithms remained AES and RC4, their order had shifted. In 2007, AES-256, RC4-128 and 3DES were the default algorithms chosen by servers, in that order. In our data, the order was RC4-128, AES-128 and AES-256. It is difficult to determine a compelling reason here. It could be that more clients enabled support for TLS, and with different ciphers supported; but it could also be that more servers supported TLS at the time of our monitoring and that their default choice was the very fast RC4 at lower key length. Furthermore, we can see that some of the connections, albeit a minority, chose no encryption for their user traffic during the handshake. Such NULL ciphers were observed for 3.5% of all connections in MON1, and in about 1% of all connections in MON2. We were able to trace the corresponding IP addresses to computing centres. Our hypothesis is that TLS was only used for authentication and integrity of grid traffic, whereas encryption was omitted for performance reasons. In summary, our results showed very good security as far as ciphers, key lengths and hash algorithms were concerned at least at the time of our observations. In 59
76 4. Analysis of the X.509 PKI using active and passive measurements retrospect, we need to point out that CBC mode and RC4 in TLS have come under some pressure since our analysis. In summer-autumn 2011, a new attack on TLS was published: BEAST allows an attacker to derive HTTP cookies without actually breaking the encryption [244]. It works only in CBC modes and in TLS version 1.0 and the even older SSL 3. For a while, it seemed that using a stream cipher like RC4 was a good way to mitigate the attack. However, it was long known that this setup requires great care to be taken to avoid certain attack vectors [40]. In 2013, AlFardan et al. presented two attacks on RC4 in TLS that showed the security of the algorithm is far less than suggested by the keylength [4]. The attacks are not yet practical on a larger scale; however it is old wisdom in cryptography that attacks only become better over time. The authors suggested to move away from RC4 entirely. New scans and monitoring runs will need to take this into account and monitor the situation closely Certificate analyses We now present results concerning properties of certificates and certification chains in X.509. For this analysis, we filtered out Grid-related certificates in the data from passive monitoring Certificate occurrences Ideally, every WWW domain should have its own certificate for TLS connections. However, in practice it is common to use so-called virtual host setups to serve a number of domains from the same server. This method is based on an HTTP header, and it has a disadvantage: plain TLS does not indicate the domain that is to be accessed. This means that a Web server cannot determine the domain that a client wishes to access until after an encrypted connection has already been set up. At this time, the server must already have sent its certificate. There are two ways to deal with this problem. Either one uses the same certificate for all domains on a server, and adds all domain names to the certificate. This is not very elegant, but works with all setups. The second way is to use the SNI extension: this allows to send the required domain name as part of TLS. Since the SNI extension was only introduced several years after TLS [92], it is not universally deployed. It is thus quite common that a certificate is issued for several domain names. Note, however, that there are further reasons for a domain owner to buy just a single certificate with several hostnames included. One may be cost: this solution might be cheaper than separate certificates. It may also be less time-consuming for the operator as the configuration of the Web server is simpler. However, as the private key for every certificate must also be stored with the public key, this method can increase the attack surface if a private key needs to be stored on more than one physical machine. We checked how often the same certificate was reused on several hosts. Figure 4.4 shows the complementary cumulative distribution function (CCDF) of how often the same certificate was returned for multiple different hostnames during the active scan of September 2010, in the middle of our observation period. We can see that the same certificate can be used by a large number of hosts (10,000 or more), although the probability for this is significantly less than 1:10,000. However, the probability that a certificate is reused rises quickly for a smaller number of reuses. We found it not uncommon (about 1% of the cases) that 10 hosts share the same certificate. We investigated which hosts are particularly prone to reuse a certificate. To this end, we evaluated the domain names in the certificates subject field. Despite being a violation of the specification in the Baseline Requirements [148] (also see Chapter 3, p. 34), 60
77 4.4. Certificate analyses 1.0 all certificates valid certificates 0.1 Pr[ #hosts > X ] e 4 1e Number of hosts per certificate =: X Figure 4.4. Certificate occurrences: CCDF for number of hosts per distinct certificate. this is the field that is practically certain to hold the intended hostname. Figure 4.5 shows our results for the certificates that we found most often. Most of these are identifiable as belonging to Web hosters but only the certificates for *.wordpress.com were at least sometimes found to be valid (in 42.5% of cases). This is a rather poor finding, considering how popular some of these hosters are. is a placeholder certificate for the Apache Web server, possibly appearing here because of Apache servers that run a default configuration (but probably are not intended to be accessed via HTTPS). We continued to investigate hostnames for those certificates that occurred at least 1000 times, and found that these seemed to be primarily Web hosting companies. We explore the issues of domain names in the subject fields and correctness of certificates in the next sections Correctness of certificate chains To avoid confusion, we use the following terminology for the remainder of this work. A certificate is verifiable if it chains to a recognised root certificate in a root store, and the signatures in the chain are all correct. Furthermore, we require that no certificate in the chain must be expired or have a validity date ( not before field) in the future, and intermediate and root certificates must have the CA flag set to true. When we speak of a valid certificate, we assume that an additional semantic check takes place: the certificate must have been issued for the correct hostname. Note that we do not yet address the issue of hostnames we defer this to the next section. There are a number of reasons why a certificate may not be verifiable due to errors in the chain. Hence, we verified chains with respect to the Firefox root store from the official repositories at the time of the scan or monitoring run 4. Note that we determine 4 These are currently called Mozilla Central. The current URL is 61
78 4. Analysis of the X.509 PKI using active and passive measurements *.blogger.com *.bluehost.com *.hostgator.com *.blogger.com *.hostmonster.com *.wordpress.com Figure 4.5. Domain names appearing in subjects of certificates most frequently used on many hosts. The double entry for *.blogger.com is due to two different certificates with this subject. verifiability with respect to a particular root store the same certificate that is not verifiable due to a missing certificate in one root store may theoretically be verifiable with another root store. We chose the Firefox root store, however, as it is a publicly accessibly resource of a popular WWW client. We used OpenSSL s verify command to check certificate chains. Our check verified the full certificate chain according to OpenSSL s rules. We examined which errors occurred how often in the verification of a certificate chain. Note that a single chain may contain multiple errors. Figure 4.6 presents our results for a selection of our data sets. The error codes are derived from OpenSSL error codes. Commonly, a browser would display a warning to the user (usually with the option to override the alert). Depending on the vendor, additional user clicks are necessary to determine the exact cause. In the following, we use error codes as employed by OpenSSL to indicate problems with the certificate chain. Error code 10 indicates that the end-host certificate was expired at the time we obtained it. Expired certificates can be considered in two ways: either as completely untrustworthy or just as less trustworthy than certificates within their validity period. The latter would account for human error, i.e., failure to obtain a new certificate. We determined expiration in a post-processing step, which we show in Listing 1. This was necessary as we did not store timestamps during our monitoring runs, due to disk space limitations. Furthermore, some (rare) certificates had missing timestamp fields, and we wanted to process these in a lenient way that allowed for such errors in the certificates. Error code 18 identifies an end-host certificate as self-signed. This means no certificate chain at all is used: a user has to trust the presented certificate and can only verify and validate it out-of-band (e. g., by checking hash values manually). Error codes 19 and 20 indicate a broken certificate chain. Error code 19 means a correct full chain (with root certificate) was received, but the root certificate was not in the root store and thus untrusted. This error can occur, for example, if a Web site chooses to use a root certificate that is not included in a major browser. Certain organisations (like some universities) sometimes use root CAs of their own and expect their users to add these root certificates manually to their browsers. If this is not done securely and out-of-band, its value is very debatable we have anecdotal experience of university Web sites asking their users to ignore the following security warning, which would then lead them to the secured page. Error code 20 is similar to 19: there was 62
79 4.4. Certificate analyses 100% 90% 80% 70% 0: verifiable 10: expired 18: self signed 19: root cert not in root store 20: no root cert found at all 32: incorrect use for signing % of all certificates 60% 50% 40% 30% 20% 10% 0% Tue Nov 2009 TUM Apr 2011 Shanghai EFF MON1 MON2 Figure 4.6. Error codes in chain verification for various data sets. Multiple errors can cause the sums to add up to more than 100%. a certificate in the sent chain for which no issuing certificate could be found, neither in the sent chain nor in the root store. Error code 32 means that one or more certificates in the chain are marked as not to be used for issuing other certificates. Interestingly, cases where signatures were wrong were rare: just one certificate in November 2009, nine in the second monitoring run and 57 in the EFF data set. Figure 4.6 reveals that trust chains were correct in about 60% of cases when considering the active scans and over all certificates. Expired certificates (about 18%) and self-signed certificates (about 27%) are by far the most frequent errors found. The number of verifiable certificates does not change significantly when considering only distinct certificates. Between November 2009 and April 2011, these numbers also remained practically constant. Note that the entries on the Alexa list had greatly differed by then; more than 550,000 hosts in April 2011 had not been on our expanded list in November We can thus say that even while the popularity of Web sites may change (and new sites likely enter the stage), the picture of the PKI with respect to verifiable certificates remains the same. This is a rather poor finding as no improvement seems to occur. Error codes 19 and 32 occurred very rarely. For our scans from Germany, we can thus conclude that expired certificates and self-signed certificates are the major cause for chain verification failures. We compared our findings to the vantage points in Santa Barbara and Shanghai (Figure 4.6; only Shanghai data shown) and found the perspective from these vantage points was almost the same. Figure 4.6 also shows the findings for MON1 and MON2. Here, the situation is somewhat different. Although the number of correct chains was similar in MON1 (57.55%), it was much higher in MON2 (82.86%). We can also see that the number 63
80 4. Analysis of the X.509 PKI using active and passive measurements Listing 1 Algorithm to compute expiration of a certificate. 1: Algorithm Compute expiration 2: Requires: Certificate fields not before, not after, time of TLS handshake 3: Output: true when expired, else false 4: Procedure expirycheck(not before, not after, cert grab time): 5: if not after = : Field empty 6: return true Count as expired 7: else if cert grab time > not after: Expired cert 8: return true 9: else if not before = : Field not set 10: return false Count as not expired: not after is OK 11: return (not before > not after) of errors resulting from expired certificates has decreased, and so have the occurrences of Error 20. This does not mirror the findings from our scans. We cannot offer an absolutely compelling explanation for this phenomenon, but one plausible explanation is that the increased use of TLS by major Web sites (especially Google and social networks) contributed as these are extremely popular among users. We also compared our results with the full data set of the EFF, which represents the global view for the IPv4 space. We found differences. First of all, the ratio of self-signed certificates is much higher in the EFF data set. This is not surprising, given that certification costs effort and often money operators on not so high-ranking sites may opt for self-issued certificates or just use the default certificates of common Web servers like Apache. Samples showed us that these are not uncommon among self-signed certificates. It should be noted that our observation period ended before incidents like the DigiNotar case (see Chapter 3) became known. Further scans might show whether there has been improvement in the quality of certificate chains since then. On the whole, however, we found the fact that about 40% of certificates in the top 1 million sites showed broken chains to be rather discouraging Correct hostnames in certificates The second major factor in determining whether a certificate should be accepted is the correct identification of the certified entity. Only the application that uses a given TLS connection can know which subject to expect. The common practice on the WWW (but also for IMAPS and POPS) is that the application (i.e., the Web browser) verifies that the subject certified in the certificate matches the DNS name of the server. In X.509 terminology and syntax, the subject field must be a Distinguished Name (DN). A Common Name (CN) is part of the DN. Very commonly, a DNS name is stored in the CN, although the Subject Alternative Name (SAN) field would be the correct place to put it. In our scans, however, the SAN was the less common practice. Technically, a user should also check manually that the other fields in the subject indicate the intended entity or organisation (e.g., the user s bank), but this is rarely done. Extended Validation (EV) certificates, which we discuss later, facilitate such assurances. In our investigation, we checked if the CN attribute in the certificate subject matched the server s hostname. We also checked if the SAN matched. Where the CN or SAN fields were wild-carded, we interpreted them according to RFC 2818 [117], i.e., *.domain.com matches a.domain.com but not a.b.domain.com. One exception was to count a single * as not matching, in accordance with Firefox s behaviour. Note that 64
81 4.4. Certificate analyses this investigation can be carried out only for data sets from active scans of domains as neither data from monitoring nor the EFF data contain an indication of the requested hostname. In the scan of April 2011 (no SNI), we found that the CNs in only 119,648 of the 829,707 certificates matched the hostname. When we allowed SANs, too, this number rose to 174,620. However, when we restricted our search to certificates that also had correct chains, the numbers are 101,070 (correct hostname in CN) and 149,656 (correct hostname in CN or in SAN). This corresponds to just 18.04% of all certificates. We checked whether the picture changed for the data set of April 2011 where we had SNI enabled. This was not the case. The number of certificates with both valid chains and correct hostnames remained at 149,205 (18.06%). We deduce from this that client-side lack of SNI support is not the problem. We also determined the numbers for the scans in November 2009, April 2010, and September 2010: they are 14.83%, 15.83%, and 16.84%, respectively. This indicates a weak but positive trend. Our findings mean that only up to 18% of certificates can be counted as absolutely valid according to the rules implemented in popular browsers in a scan of the top 1 million Web sites. More than 80% of the issued certificates would have led to a browser warning. In this light, we are not surprised it is often said that users choose to ignore security warnings. These are major shortcomings that need to be addressed. However, we also have to add a word of caution here: while a poor finding, it is not implausible that many of these hosts are actually not intended to be accessed via HTTPS and thus neglect this critical configuration. Normal users may therefore never encounter the misconfigured site, even in the case of very popular sites. Still, omitting support for TLS does not increase security, either Unusual hostnames in the Common Name We encountered a few unusual hostnames. In the data set of April 2011, with SNI enabled, we found 60,201 cases of the string plesk as a CN. Our hypothesis was that this is a standard certificate used by the Parallels/Plesk virtualisation and Web hosting environment. We tested this by rescanning the hosts, hashing the HTTP reply (HTML) and creating a histogram that counted how often which answer occurred. Just eight kinds of answers were alone responsible for 15,000 variants of a Plesk Panel site, stating site/domain/host not configured or the like. A further favourite of ours were certificates issued for localhost, which we found 38,784 times. Fortunately, neither certificates with plesk nor localhost were ever found to have valid chains Hostnames in self-signed certificates Server operators may opt to issue a certificate to themselves. Hence, no external responsible Certification Authority exists. This saves the costs for certification, but requires users to accept the self-signed certificate and trust it. The value of self-signed certificates is debatable: some view them as useful in a Trust-On-First-Use security model as used with the SSH protocol; others view them as contrary to the goals of X.509. Our own view is that self-signed certificates can be useful for personally operated servers, or where it is safe to assume that a Man-in-the-middle attack in the first connection attempt is unlikely and a form of pinning can be used later (see Section 8.2). In the data set with enabled SNI (April 2011), we checked if the self-signed certificates had a subject that matched the hostname. The result was sobering: 99.4% of CNs did not match. Subject Alternatives Names matched in 0.13% of cases. 65
82 4. Analysis of the X.509 PKI using active and passive measurements Location EV status Tue Nov % TUM Sep % TUM Apr % Shanghai 2.56% Santa Barbara 2.49% Moscow 2.51% İzmir 2.50% Table 4.3. Deployment of EV certificates over time and from Germany; and the same for April 2011 from Shanghai, Santa Barbara, Moscow and İzmir. Interestingly, very few typical names account for more than 50% of the different CNs. The string plesk occurred in 27.3% of certificates as the CN (without any domain). Together, we found either localhost or alternatively localhost.localdomain in 24.7% of CNs (without any further domain part). The remaining CNs in the top 10 all had a share of less than 3%. Yet the bulk of CNs is made up of entries that do not occur more than 1 4 times i.e., names are assigned (possibly automatically), but they do not match the hostname. Our conclusion is that self-signed certificates are not maintained with respect to hostname. This may make them puzzling to the average user Extended Validation Technically, a user should not only be able to verify that the domain in the CN or SAN matches, but also that other information in the certificate correctly identifies the entity on an organisational level, e.g., that it is really the bank he or she intended to connect to and not a similar-looking phishing domain. This is the purpose of the so-called EV certificates, which were introduced several years ago. EV certificates are meant to be issued under the relatively extensive regulations described by the CA/Browser- Forum [147]. An identifier in the certificate identifies it as an EV certificate. A browser is meant to signal EV status to the user (e.g., via a green highlight in the address bar). We analysed how often EV certificates occurred. Table 4.3 shows the results. One can see that there is a slight trend towards more EV certificates. We inspected the top 10,000 hosts in the scan of April 2011 (no SNI) more closely and found that the ratio of EV certificates was 8.93%. For the top 1000 hosts it was 8.11%, and for the top %. Surprisingly, for the top 50 it was 5.17%. We found two explanations for this. First, Google sites dominated the top 50 of our Alexa lists (almost half of all hosts), and Google does not use EV 5. Second, a number of well-known Web sites (e.g., Amazon and ebay) use different hosts to let users log in. These are not in the top 50, but use EV. To summarise, we found that EV certificates are not very wide-spread, even though they can be very useful for sensitive domains. Since they are commonly more expensive than standard certificates, this is somewhat to be expected Signature Algorithms Cryptographic hash algorithms have come under increasing pressure in the past years, especially MD5 [69]. Even the stronger SHA1 algorithm is scheduled for phase-out [243]. 5 This is even true at the time of writing. 66
83 4.4. Certificate analyses Prevalence in signatures 100% 90% 80% 70% 60% 50% 40% 30% 20% 10% 0% RSA/SHA1 RSA/MD5 Tue Nov 2009/TUM Apr 2011 MON1/MON2 Shanghai 1/1/2010 Date 1/1/2011 Figure 4.7. Popular signature algorithms in certificates. When researchers announced in 2008 they could build a rogue CA using MD5 collisions [260], a move away from MD5 was expected to begin. We thus extracted the signature algorithms in certificates. Figure 4.7 shows the results for November 2009 and April 2011, the monitoring runs, and the vantage point from Shanghai. We omitted the rare cases (less than 20 occurrences altogether) where we found the algorithms GOST, MD2 and SHA512. The algorithms SHA256 and SHA1 with DSA were also only found rarely, in 0.1% of cases or less. In our active scans, 17.3% of certificates were signed with a combination of MD5 and RSA in In 2011, this had decreased by 10% and SHA1 had risen by about the same percentage. The view from the monitoring data was slightly different. Most importantly, MD5 usage numbers were lower, both for all certificates and only for distinct ones. Between September 2010 and April 2011, the number had fallen even further. Our conclusion here is that MD5 does not play an import role in this PKI any longer Public key properties It is quite evident that the ciphers used in certificates should be strong, and keys should be of a suitable length to achieve the desired security. Otherwise the certificate might be crackable by an attacker: RSA with 768 bits was factored in 2009 [41]. With the security margin of RSA-1024 shrinking, a move towards longer ciphers has been recommended in 2011 [142]. We thus investigated the public keys in certificates. Concerning the ciphers, the result was very indicative. In the active scans of November 2009 and April 2011, which span 1.5 years, the percentage of RSA keys on all queried hosts was always around 99.98%. DSA keys made up the rest. Counting only distinct certificates, the percentages remained the same. The values for the monitoring runs were practically identical. In these two scans, we also found a movement towards longer RSA key lengths: the percentage of keys with more than 1024 bits increased by more than 20% while the percentage of 1024-bit keys fell by about the same. The general trend towards longer key lengths can be seen in Figure 4.8: the newer the data set, the further the CDF graph is shifted along the x axis. This shows that the share of longer key lengths increased while shorter key lengths became less popular, with the notable exception of 384-bit keys that were found in the crawls from
84 4. Analysis of the X.509 PKI using active and passive measurements Pr[X < length] e 04 1e 05 Tue Nov 2009 TUM Sep 2010 TUM Apr % quantile / median / 25% quantile Key length (bits) Figure 4.8. Cumulative distribution of RSA key lengths. Note the unusual atanh scaling (double-ended pseudo-log) of the y axis. and 2011, but not in the 2009 data. These were RSA keys, not keys for elliptic-curve algorithms, where such lengths might be expected. The small triangles/circles/lozenges along the curves indicate the jumps of the CDF curves; hence they reveal furthermore that there is a significant number of various non-canonical key lengths, i.e., key lengths that are neither a power of 2 (e.g., 2048) nor the sum of two powers of 2 (e.g., 768). However, their share is extremely small as the CDF lines do not exhibit any significant changes at these locations. It is not a particularly security-relevant finding 6, either. An exponent and modulus make up the public key together; and there is only one private key for every public key. Concerning RSA exponents, the most frequent RSA exponent we found in November 2009 was 65,537, which accounts for 99.13% of all exponents used. The next one was 17, which accounts for 0.77% of exponents. The value 65,537 is the minimum value recommended by NIST [141], which is also fast to use in computations. It seems to be a preferred choice by software to create certificates. There are two caveats to watch out for in public keys. The first refers to a now well-known bug of 2008: the Debian distribution of OpenSSL had removed a source of entropy and caused very weak randomness in key generation. It was therefore possible to precompute the affected public/private key combinations. Such keys must not be used as the private keys are publicly known. We determined the number of certificates with weak keys of this kind by comparing with the official blacklists that come with every Debian-based Linux distribution. Figure 4.9 shows the results for our scans. We can see the number of affected certificates become less over time. Interestingly, the percentage of Debian-weak keys was higher when we investigated it for just the distinct certificates. This means Debian-weak keys are more likely to occur on a single host, as opposed to being reused on several hosts. Our numbers fit well with another investigation of 2009 [79] they essentially continue where that investigation left off. Finally, the percentage of affected certificates was four times less in our monitoring data (about 0.1%) this is a very good finding as it shows that the servers that most 6 Keys are the products of two primes, e.g., 1024-bit keys are expected to be the product of two large primes whose length is on the order of 512 bits (there are a number of rules how to choose primes to make RSA secure). The product can, in rare cases, require a few bits less to encode. 68
85 4.4. Certificate analyses 0.9% 0.8% 0.7% Share of weak keys 0.6% 0.5% 0.4% 0.3% 0.2% 0.1% 0 distinct certificates all certificates 1/1/2010 Date 1/1/2011 Figure 4.9. Debian weak keys over the course of 1.5 years in the scans of the Alexa Top 1 Million. users deal with are generally unlikely to be affected. However, we also found some weak yet absolutely valid certificates (correctly issued by CAs, correct hostnames, etc.) that were still in use, but the number was very small: such certificates were found on about 20 hosts in the last scan. The second caveat is that no combination of exponent and modulus should ever occur in different certificates. However, we found 1504 distinct certificates in the scan of April 2011 that shared the public/private key pair of another, different certificate. In the scan of November 2009, we found 1544 such certificates. The OpenSSL bug could have been a cause for this, but we found that only 40 (November 2009) and 10 (April 2011) of the certificates fell into this category. We found one possible explanation when we looked up the DNS nameservers of the hosts in question. In about 70% of cases, these pointed to nameservers belonging to the same second-level domain. In about 28% of cases, these domains were prostores.com and dnsmadeeasy.com. A plausible hypothesis here would be that some Web space providers issue certificates and reuse the public/private keys either intentionally or due to some flaw in a device or software. In either case, it means that some private key owners are theoretically able to read encrypted traffic of others. They can even use a scanner to find out which domain to target. However, our hypothesis does not explain the large number of remaining certificates with duplicate keys. We could not give a reason ourselves at the time we carried out the scans. Later, Heninger et al. found evidence that flaws in key generation could have been involved. We return to this in Section 4.5. Our own conclusion here is that shorter key lengths were still too frequent, but the overall trend was very positive. RSA keys should not be issued any more at less than 2048 bits. The Debian OpenSSL vulnerability has become rare in certificates Validity periods Certificates contain information for how long they are valid. This validity period is also a security factor. If a certificate is issued for a very long period, advances in cryptography (especially hash functions) can make it a target for attack. Alternatively, 69
86 4. Analysis of the X.509 PKI using active and passive measurements Pr[X < validity] Tue Nov 2009 TUM Apr 2011 MON2 Apr Validity (years) Figure Comparison of certificate validity periods, all certificates. an attacker may attempt to reuse a stolen certificate (with stolen private key) and rely on the fact that certification revocation is not very effective in any case (see Section 2.7). When we analysed the validity period for the certificates we encountered in our scans, we found that the majority of the certificates was issued with a life span of months, i. e., one year plus a variable grace period. Other popular lifespans were two years, three years, five years, and ten years. This can be seen from the cumulative distribution function of the certificate life spans depicted in Figure Comparing the data of November 2009 with the data of April 2011, we can see that the share of certificates with a validity period of more than two years increased, in particular the share of certificates issued for ten years. The curve for the second monitoring run reveals that the life spans typically encountered by users are either one, two, or three years, plus some grace period. In particular, certificates with life spans of more than five years seem to be only rarely used. What the figure does not show are the extremal values for the certificate life span: we encountered life spans on a range from two hours up to an optimistic 8000 years. This was particularly evident in the monitoring data from April Figure 4.11 shows the same kind of plot, but this time for the distinct datasets. The number of certificates in the second monitoring run with extremely short validity periods (2 hours or less) is striking. We thus inspected these certificates manually: they all had random-looking issuers; and all issuer strings were unique with the exception of just six certificates. We found a plausible solution when we showed these certificates to a representative of the Tor project [269], who acknowledged the issuer strings as typical for certificates used in Tor circuits. While there is a trend towards slightly longer periods rather than shorter ones (which is slightly worrisome), the otherwise reasonable validity periods seem to give little reason for concern Length of certificate chains As explained in Chapter 2, intermediate certificates kept within the same CA allow to store the root certificate offline and carry out all online operations from the inter- 70
87 4.4. Certificate analyses Pr[X < validity] Tue Nov 2009 (distinct) TUM Apr 2011 (distinct) MON2 Apr 2011 (distinct) 1h Validity (years) Figure Comparison of certificate validity periods, distinct certificates. mediate certificates. At least one intermediate certificate per chain is thus a sensible setup. One should not use too many, however: it is not implausible that the probability for negligence increases with the number of intermediate certificates. This is even more problematic in setups where intermediate certificates are not kept within the same CA, but used for subordinate CAs outside the direct control of the root CA. Although not our focus, it is worthwhile to note that the verification of long chains has an impact on performance (especially if the verifying device is a hand-held computer). We thus proceeded to investigate the length of certificate chains. We did this for the data sets from November 2009, April 2011 (no SNI), the EFF data set and the first monitoring run. We derive the length of a chain as the number of all intermediate certificates in the chain that are not self-signed. The rationale is that OpenSSL constructs chains by attempting to find a combination of certificates that yields a chain leading to a certificate in the root store. Consequently, self-signed intermediate certificates in the chain are either root certificates themselves, and we can safely discount them as not being intermediate certificates 7. Or they are certificates outside a chain, i.e., they cannot contribute to the verifiability of a certificate as they are not contained in a root store. In this case, they only impact performance, and we can discount them for our security-oriented investigation here. There is a minor caveat here: it is possible in X.509 to construct more than one valid chain. One way to do this is to use the fields Authority Key Identifier (AKID) and Subject Key Identifier (SKID) from RFC 5280 [94], which provide (supposedly) unique identifiers for issuer and subject. The alternative is to use the fields for subject and issuer directly (these may sometimes not be unique). As a result, the corresponding intermediate certificates use the same public key, but chain to a different root certificate. We tested how often two chains may have been used in the mentioned datasets. We found the method via AKID and SKID was used in 0.06% of certificates in November 2009, and only about 0.01% further cases where the second method may have been used (we only checked matches on issuers and subjects, not public keys). The total number 7 TLS allows to send root certificates as part of the chain, although there is no real advantage for clients, except where clients display authentication decisions for unknown root certificates to the user. Most users would probably not know how to make this decision. 71
88 4. Analysis of the X.509 PKI using active and passive measurements 70% 60% Tue Nov 2009 TUM TUM Apr 2011 EFF MON1 50% Share in certificates 40% 30% 20% 10% 0% and greater Chain length Figure Certificate chain lengths for two scans, one monitoring run, and the EFF data. If no intermediate certificates are sent, the chain length is 0. across all scans was between 0.02% and 0.06%. The numbers for the monitoring run were similar. As they were so low, we decided to disregard the special case of multiple chains in our analysis. Figure 4.12 shows the results. We see that the vast majority of certificates is verified via a chain of length three or less. At the other end, more than half of the certificates have a chain length of zero. The natural explanation here is the high number of selfsigned certificates that we observed. When comparing the scan from November 2009 to the one in April 2011 (no SNI), we see that the share of chains of length zero greatly decreased while the share of chains with length one or more significantly increased by about 20%. The graph, as well as the increased average chain length (0.52 in November 2009 vs in April 2011), point to a weak tendency in the past 1.5 years to employ more intermediate certificates, not less. We double-checked this by plotting the chain lengths again, with self-signed end-host certificates excluded. The result can be seen in Figure The overall numbers are smaller, as is to be expected. The shift towards using intermediate certificates is very pronounced when considering the changes from November 2009 to April Interestingly, our results for the second monitoring run were entirely different. Chain lengths of 0 3 occurred at almost equal percentages, around 25 30%. We checked why this might be the case by analysing the subjects in the certificates. We found that they indicated high-profile sites in all cases, which we often knew to have enabled TLS since the first monitoring run, which were very popular among users, and which had appeared at different frequencies in our first run. The most common certificates were from Akamai and Dropbox (both chain length 0); Google services (chain length 1), Apple and Microsoft (chain length 2); and Rapidshare, Cloudfront, and Foursquare (chain length 3). 72
89 4.4. Certificate analyses 60% 50% Tue Nov 2009 TUM TUM Apr 2011 EFF MON1 40% Share in certificates 30% 20% 10% 0% and greater Chain length Figure Certificate chain lengths for the same data sets, with self-signed end-host certificates excluded. Overall, we can say that certificate chains are generally remarkably short, and the move towards using intermediate certificates has not introduced chains that would be too long. Considering the trade-off of too many intermediate certificates versus the benefits of using them, this is a positive development. The maximum length of chains found in the scans and EFF data set is 17. In the monitoring data, it is only 12. The scans thus detected hosts with very unusual chain lengths (outliers), whereas most certificate chains are actually relatively short. We briefly checked whether the high values of 17 down to 12 were cases of multiple chains; this was not the case Certification structure While the use of intermediate certificates can be beneficial for security, it is also true that if too many intermediate certificates are used in a chain, the undesired result can be that the attack surface increases slightly as there are more targets. The number of distinct intermediate certificates versus the number of distinct certificate chains built with them is thus an indication whether a small number of intermediate certificates is used to sign a large number of certificates (good for security) or whether this is done with a larger number of intermediate certificates (bad for security). We investigated the number of distinct intermediate certificates and the distinct certificate chains that are built with them. Figure 4.14 shows the development of the intermediate certificates. For the active scans from Germany, we see about 2300 distinct intermediate certificates in the data set, with a trend to increase. Compared to the size of the root store in Firefox, this means that, on average, every CA would use more than ten intermediate certificates. However, we already know that average chain lengths are short, so this points to a very skewed distribution. The number of distinct intermediate certificates in the EFF data set is even higher, almost grotesque: 124,387. The ratio 73
90 4. Analysis of the X.509 PKI using active and passive measurements Count Intermediate certificates Certification chains 1/1/2010 Date 1/1/2011 Figure Temporal development of the number of distinct intermediate certificates (squares) and the number of distinct certificate chains (triangles) across the scanning data sets. of certificates/intermediate certificates for the top 1 million hosts is about 335 (scan of April 2011); in contrast, it is about 91 for the whole IPv4 space. This means that the top 1 million hosts use less intermediate certificates than hosts in the whole IPv4 space do. To analyse chains, we computed a unique ID for every distinct certification chain we found. For this, we discounted the end-host certificate and any self-signed intermediate certificate in a chain as a potential root CA, as we did before. The remaining certificates were sorted, concatenated and hashed. Recall that the number of intermediate certificates is very small compared to the number of end-host certificates. Correspondingly, we found only a small number of certificate chains: about 1300 in November 2009 (compared to over 2000 intermediate certificates). This means that the X.509 certification tree (end-hosts are leaves) shrinks rapidly from a wide base to very few paths leading to the root CAs. In the EFF s data set, we find an unexpected number of different chains: 17,392, which is much higher than the number in our scans. The ratio of distinct intermediate certificates to distinct certification chains in our own scans was between 0.6 (November 2009) and 0.76 (April 2011, no SNI). The numbers are plotted in Figure For the EFF data set, it was This indicates that the convergence to very few certification paths is much more expressed for the global IPv4 space than for the popular Alexa hosts. Overall, our finding here is that too many intermediate certificates are encountered (leading to an unnecessary attack surface). The dimension of the problem is not huge, however. In the top 1 million hosts, the situation is better than in the IPv4 space as a whole. 74
91 4.4. Certificate analyses Scan Suspicious certificates Differences to TUM, April 2011 Santa Barbara São Paulo Melbourne İzmir Boston TUM, April Shanghai 10, Bejing 10, Moscow 10,986 11,800 Table 4.4. Occurrences of suspicious certificates per location, and number of certificates different to those seen from TUM Different certificates between locations We investigated how many downloaded certificates were different between locations. Our motivation was twofold. A Web site operator may offer duplicated or different content depending on geographic region; CDNs are a large-scale example of this. In this case, it is possible that certificates are bought from different CAs. It is also possible that an operator switches CAs but fails to propagate the move to all sites in a timely fashion. Another possible reason can be of a malicious nature: a router can intercept traffic and swap certificates transparently on the fly (man-in-the-middle attack). We labelled hosts as suspicious when their certificate was identical from most locations and only differed in one to three locations. Table 4.4 shows the results from each vantage point. Although the suspicious cases seem to occur particularly often when scanning from China and Russia, this might be simply the result of localised CDN traffic. We thus examined differences between the 2011 scans from Shanghai and Germany. The number of different certificates between these two locations was 9670, which is about 1% of all certificates in the data set for Germany. Only 213 of the corresponding sites were in the top 10,000; the highest rank was 116. We can surmise that if operators of high-ranking sites use CDNs for their hosting in these regions, then they deploy the same certificates correctly. From manual sampling, we could not find a man-in-the-middle interception. We checked how many of the differing certificates from Shanghai were actually valid (correct chain, CN, etc.). This yielded just 521 cases and only in 59 cases, the certificate was absolutely valid in the data set for Germany but not in the one for Shanghai. We checked the corresponding domains manually; not one of them could be identified as highly sensitive (e. g., politically relevant, popular Web mailers, anonymisation services, etc.). About a quarter of certificates were self-signed but different in the two locations. The reason for this is unknown to us. While we are reluctant to offer compelling conclusions here, we do wish to state the following. First, there are not many differences between locations. High-ranked domains using CDNs seem to properly distribute their certificates. Maybe this is the most interesting finding, given the overall administrative laxness that is revealed by the many badly maintained certificates. Second, the number of different certificates was significantly higher from the vantage points in China and Russia. However, we found no indication of an attack. Third, we emphasise that we did not manually investigate all domains the hope that other researchers would carry out their own investigations was one of our reasons to publish our data sets. 75
92 4. Analysis of the X.509 PKI using active and passive measurements GoDaddy.com VeriSign Equifax Parallels SomeOrganization (localhost.localdomain) The USERTRUST Network Thawte Thawte Consulting cc none (localhost) Comodo CA Limited Figure Top 10 of issuers in data set of April 2011 (no SNI), distinct certificates Certificate issuers We were interested to see which issuers occur most commonly. This is interesting for two purposes: first, it gives some insight into market share. Second, the respective CAs may be at higher risk of attacks as they may be perceived as more valuable (e.g., an attacker might hope his attack remains unnoticed for a longer time because the issuing CA for his rogue certificates has not changed, or he might want to steal the larger customer database). We therefore determined the most common issuers for certificates in the data set from April We first investigated the case of the distinct certificates this allows us to gain an insight into how many certificates were issued by different entities. We found 30,487 issuer strings in total. However, many different issuer strings may actually represent issuing entities that belong to the same organisation. As the subordinate CAs or even intermediate certificates used by CAs are generally not known (root stores do not keep track of them), we used the following method to obtain an approximation of the top 10 most common issuers. We extracted the Organisation part of the issuer field in most cases, this will already identify the organisation that runs the issuing entity. We then grouped by this field and counted all occurrences in end-host certificates. Figure 4.15 shows the result. We find GoDaddy as the top issuer, followed by VeriSign and Equifax. At the time of writing, the latter two are actually both owned by Symantec. We find a high number of issuers identifying themselves as Parallels this is a virtualisation software by Plesk. Two issuers, SomeOrganization and none, are found in self-signed certificates and are likely a form of default certificates as their CNs (in the issuer) always indicated localhost and localhost.localdomain, respectively. The USERTRUST Network is a CA that is part of Comodo. We then proceeded to investigate the issuers over all certificates, i. e., allowing for certificates reused on hosts. The picture was somewhat different. Figure 4.16 presents this top 10. The USERTRUST Network was suddenly at the top, with GoDaddy second, and Comodo ranking much higher. This means certificates from these CAs are reused on several hosts much more often. We also find GeoTrust, another CA owned by Symantec, and Google, who run a subordinate CA certified by Equifax. The high number of Google certificates is likely due to the use of Google certificates on Google s many services. 76
93 4.4. Certificate analyses The USERTRUST Network GoDaddy.com Equifax Comodo CA Limited Parallels GeoTrust SomeOrganization (localhost.localdomain) VeriSign Google none (localhost) Figure Top 10 issuers in data set of April 2011 (no SNI), all certificates Further parameters We inspected the serial numbers in valid certificates and looked for duplicates by the same issuing CA. We did not find any in the last three scans. This is a good finding as a certificate s serial number is intended to be a unique identifier (recall that blacklisting of certificates in revocation lists is done via the serial numbers). We also investigated a certificate property that is of less relevance for security, but interesting nonetheless: X.509 version 1 has been outdated for years. The current version is X.509 version 3. We investigated the data sets of November 2009 and April 2011 in this regard. In November 2009, 86.01% of certificates were version 3, 13.99% were version 1. In April 2011, 85.72% were version 3 and 14.27% version 1. Although our first guess was that this was an artefact of measurement, we found that 33,000 certificates with version 1 had not been seen in any previous scan. None of them had valid certificate chains, however, and 31,000 of them were self-signed. Of the others, the biggest issuer was a Russia-based company. We investigated all issuers that had issued more than two certificates and found that all of them seemed to employ a PKI of their own, but without root certificates in Firefox. The reasons for this use of version 1 are unknown to us, but plausible causes are software default settings or an arbitrary choice to use the simpler format of version 1. Version 1 lacks some extensions that are useful to limit the ways in which a certificate can be used, however, so this is not a wise choice Certificate quality We conclude our analysis with a summarising view of certificate quality. Figure 4.17 shows a classification of certificates in three categories, which we termed good, acceptable and poor. Good certificates have correct chains, correct hostnames, exactly one intermediate certificate 8, do not use MD5 as a signature algorithm, use non-debianweak keys of at least 1024 bits, and have a validity of at most 396 days (a year plus a grace period). For acceptable keys, we require the same but allow two intermediate certificates, and validity is allowed to be up to 25 months (761 days). Poor keys represent the remainder of keys (with correct chains and hostnames, but otherwise failing to meet our criteria). Figure 4.17 shows certificate quality for the scan in November 2009 and for the scan in April 2011 (no SNI). First of all, the figure reveals that the share of valid certificates (total height of the bars) is negatively correlated with the Alexa rank. This does not come as a surprise, since operators of high-profile sites with a higher Alexa rank can be expected to invest 8 As before, we do not filter out sites that send more than one chain. 77
94 4. Analysis of the X.509 PKI using active and passive measurements 60% 50% Poor Acceptable Good Share in rank range 40% 30% 20% 10% 0% Tue Top 10 TUM Top 10 Tue Top 50 TUM Top 50 Tue Top 100 TUM Top 100 Tue Top 500 TUM Top 500 Tue Top 1k TUM Top 1k Tue Top 5k TUM Top 5k Tue Top 10k TUM Top 10k Tue Top 50k TUM Top 50k Tue Top 100k TUM Top 100k Tue Top 500k TUM Top 500k Tue Top 1M TUM Top 1M Figure Certificate quality in relation to Alexa rank for the data sets of November 2009 (Tue) and April 2011 (TUM). Note that the figure shows only valid certificates, and thus the numbers do not add up to 100%. more resources into a working HTTPS infrastructure. What is surprising, however, is that even in the top 500 or 1000 i.e., truly high-ranking sites only just above 40% of certificates are absolutely valid. Only the top 10 sites seem to be an exception here. Interestingly, although the more high-profile sites are more likely to deliver valid certificates, the share of poor certificates among their valid certificates is higher when compared to the entire range of the top 1 million sites. Concerning development over time, we find interesting trends. Overall, the fraction of sites with valid certificates increased over our observation period. While the difference in the top 10 is marginal, we see a consistent development over the entire range. The relative fractions (good versus acceptable versus poor) do not seem to change much; only the fraction of good-quality certificates shrank slightly. A possible explanation may lie in our criterion for the number of intermediate certificates in chains: we know that this number increased over time. We do not view this as a critical finding: compared to other flaws in certification, the impact of using one versus two intermediate certificates is marginal Related work and aftermath Since our analysis of the X.509 PKI covers the years , we group our discussion of related work into two groups: publications before our own, and publications after ours that, in part, built upon it. 78
95 4.5. Related work and aftermath Previous work We are aware of two previous contributions on certificate analysis for TLS. Both were given as talks at hacking symposia, but were not published as articles. Between April and July 2010, members of the EFF and isec Partners conducted what they claimed to be a full scan of the IPv4 space on port 443 and downloaded the X.509 certificates. Initial results were presented at DEF CON 2010 [184] and 27C3 [245]. The authors focused on determining the certification structure, i.e., number and role of CAs, and several noteworthy certificate properties like strange subjects (e. g., localhost) or issuers. Ristić conducted a similar scan like the EFF in July 2010 and presented some results in talks at BlackHat 2010 [251] and again (now including the EFF data) at InfoSec 2011 [202]. The initial scan was conducted on 119 million domain names, and additionally on the hosts on the Alexa Top 1 Million list [133]. Ristić arrived at about 870,000 servers to assess, although the exact methodology cannot be derived from [251, 202]. However, the information about certificates and ciphers collected is the same as in our scans, and together with the EFF data set our data sets provide a more complete coverage. Vratonjic et al. presented a shorter study of a one-time scan of the Alexa Top 1 Million list [75], which was published while our own contribution was under submission. Their results confirm ours. Lee et al. also conducted a scan of TLS servers [45]. In contrast to our work, they did not investigate certificates but focused on properties of TLS connections (symmetric ciphers, MACs, etc.) and the cryptographic mechanisms supported by servers. The number of investigated servers was much lower (20,000). Yilek et al. investigated the consequences of the Debian OpenSSL bug of 2008 [79]. The authors traced the effect of the error over a time of about 200 days and scanned about 50,000 hosts. The problem with the above scans, particularly of the IPv4 space, is that more hosts are included that are likely not intended to be accessed with TLS and thus provide invalid (and often default) certificates. The percentages given in [184, 245, 251, 202] thus need to be treated with caution. This is particularly true for the scan by the EFF as this scan covered IP ranges used for dynamic IP address allocation. Combined with the long duration of the scan, this leads to an inaccuracy. Our actively obtained data sets concentrate on high-ranked domains from the Alexa Top 1 Million list, and observe these domains over a long time period. Note that high-ranked domains can be assumed to be aimed more at use with TLS. This should at least be true for the top 1000 or top 10,000. Our monitoring does not suffer significantly from the problems mentioned above, either. Thanks to it, we were not only able to estimate the deployment of the TLS infrastructure, but were also able to analyse which parts of the PKI are actively used and therefore seen by users. Furthermore, our view on the TLS deployment is not a single snapshot at an arbitrary time, but includes changes that operators have conducted in 1.5 years. By analysing TLS data that has been obtained from all over the world, we could also estimate how users see the TLS-secured infrastructure in other parts of the world Later work A number of publications carried out investigations that were similar to ours and, in some cases, built upon it. 79
96 4. Analysis of the X.509 PKI using active and passive measurements Lenstra et al. published an analysis of the strength of DSA and RSA keys in 2012 [46]. They built a data set of public keys from three sources: their own collection of public keys, the EFF data set and our data sets. They investigated the properties of the keys. One of their primary findings was that more RSA than DSA keys showed weaknesses. Their conclusion was that generating RSA keys carries significantly higher risk than generating DSA keys. A similar analysis was carried out by Heninger et al. and published very shortly afterwards [35]. In contrast to the work by Lenstra et al., Heninger et al. created their database of keys from their own IPv4-wide scans. They confirmed the finding of a higher proportion of weak RSA keys, but came to an entirely different conclusion. Thanks to their active probing, they could show that a number of weak keys are the result of devices with poor entropy during key generation they even noted that we had found such keys in our own analysis in the form of duplicate keys in different certificates. The authors could also show that devices with poor entropy are at extreme risk of revealing their private key when using DSA: here, the entropy must be high enough every time the algorithm is used for signing, not just on key generation. The conclusion by Heninger et al. was thus that device properties were responsible for the weak keys, and that DSA is in fact the more dangerous algorithm to use. The team also found duplicate keys that were caused by other issues we return to this in our own discussion of SSH public keys in Chapter 6. Durumeric et al. presented their tool to scan the entire IPv4 space at line speed in [21]. Among other things, they also presented early results on HTTPS adoption over one year and found an increase of almost 20%. Durumeric et al. followed this up with a larger study in [20]. The focus of the latter study was on the certification structure as created by CAs and subordinate CAs, and to a lesser degree on the properties of endhost certificates as we investigated them. Among other things, the authors investigated the number of trusted CAs and found a large number of intermediate certificates, on the same order as we had found in the EFF data set. Disturbingly, they find that a very large number of certificate chains contain the same intermediate certificate. This would mean a compromise of this certificate would cause a major key rollover on the Internet. The authors draw a picture of the distribution of subordinate CAs and find many non-commercial entities. They also found unexpected security-relevant issues, like locally scoped names in CNs (e. g., localhost), which were signed by CAs (recall we did not find any of these for the Alexa Top 1 Million list of domains). Asghari et al. presented a study of HTTPS from a security-economical point of view in [7]. Based on lessons learned from CA compromises, they also conclude that the weakest CA is the weakest link in the HTTPS authentication model. Their primary contribution is an in-depth analysis of CA market share, with a surprising finding: the more expensive CAs hold a significantly larger market share than the cheaper CAs. They conclude that the market is not primarily driven by price. Using a qualitative approach (interviews with buyers), they conclude that buyers are aware of the weakest link argument, but continue to buy from more expensive vendors. One of the reasons is that large CAs are considered too large to be removed from browser root stores i.e., buyers do not have to fear that their sites are suddenly without HTTPS access in case of compromise. Another reason is that larger CAs often offer accompanying services like extended support. Akhawe et al. provided a study [1] in which they used passive monitoring to obtain a large number of certificate chains, based on measurements in networks with a total of over 300,000 users and over nine months. One of their contributions was a better understanding of how browser libraries make authentication decisions, which was so far very poorly documented among other things, they found that the NSS library as used 80
97 4.6. Summarising view by Firefox is more lenient in certificate verification than OpenSSL. Where OpenSSL accepted 88% of chains, NSS would accept 96%. This means that Firefox users are slightly less likely to see warnings than previous studies, including ours, suggested. The authors also measured the frequency of TLS errors in their study and gave recommendations on how to design the authentication decision in browsers better and with less false-positive warnings for users. Amann et al., finally, presented an analysis of the trust graph in the HTTPS ecosystem [6], together with an analysis of known man-in-the-middle attacks, where the certificate chain of the rogue certificate was different. Their goal here was to determine whether malicious certificates are well detectable, e. g., by noting the sudden changes in the certificate chain, for example due to the change of the root CA or an intermediate certificate. They found that this is not the case as too many such changes exist and are of a routine nature rather than an attack. The authors discussed the implications for one of the concepts to improve X.509 security, namely Certificate Transparency (CT). We return to this aspect in Chapter Summarising view By combining and evaluating several actively and passively obtained data sets, which were in part also obtained over 1.5 years, we were able to derive a very comprehensive picture of the X.509 infrastructure as used with TLS. Our analysis supports with hard facts what has long been believed: that the X.509 certification infrastructure is, in great part, in a sorry state. The most sobering result for us was the percentage of certificates that a client using the Mozilla root store would accept without a warning: just 18%. This can be traced to both incorrect certificate chains (40% of all certificates exhibit this problem), but even more so to incorrect or missing hostnames in the subject or SAN. With selfsigned certificates, where conscientious operators would have an incentive to use the correct hostname, the situation was much worse. The only positive point is that the percentages of absolutely valid certificates increased since 2009, but then again only very slightly. Recall that these numbers refer to the top 1 million hosts the percentage of certificates where the chains are correct was lower for the full IPv4 space than for the top sites as we found by examining the EFF data set. Moreover, many certificate chains showed more than one error. Expired certificates were common, and so were certificates for which no root certificate could be found. A further problematic finding is that all our data sets revealed a high number of certificates that were shared between a large number of hosts. This was even the case for highprofile Web hosters and often, the hostnames did not match the certificates there, either. Although offered by several CAs, EV certificates do no seem to be in wide use. This truly seems a sorry state. It does not come as a surprise that users are said to just click away warnings, thus adding to the general insecurity of the WWW. As few CAs are responsible for more than half of the distinct certificates, one should think the situation should be better or at least easier to clean up. There are some positive tendencies that should be mentioned, however. Our evaluation shows that the more popular a given site is, the more likely it supports TLS, and the more likely it shows an absolutely valid certificate. On the whole, key lengths seem not to constitute a major problem. The same is true for signature algorithms. Keys with short bit lengths are becoming fewer, and the weak MD5 algorithm is clearly being phased out. Over the 1.5 years, we also found an increase in the use of intermediate certificates while chain lengths remained remarkably short. This is a good development 81
98 4. Analysis of the X.509 PKI using active and passive measurements as end-host certificates should not be issued by a root certificate that is used in online operations. Concerning our passive monitoring, the data we obtained allowed us to evaluate negotiated properties of TLS connections, which cannot be obtained with active scans. We were able to determine the negotiated ciphers and digest mechanisms. At the time, most connections used ciphers considered secure, at acceptable key lengths, with a good security margin. However, recent developments have put pressure on some of the used algorithms, and it will be interesting to carry out a similar monitoring run to determine whether TLS implementations choose different ciphers now. With the above mentioned problems in certificates, however, we have to conclude that the positive movements do not address the most pressing problems, which are the certification structure and deployment practices Key contributions of this chapter In this chapter, we addressed Research Objective O2.1. We analysed the properties of the X.509 PKI using active and passive measurements. Our general finding was that the X.509 PKI is not well deployed. Our key contributions were as follows. Long-term distributed scans We scanned the servers on the Alexa Top 1 Million list over the course of 1.5 years, between November 2009 and April In addition, we scanned the servers from eight further vantage points across the globe in April This allowed us insights into the X.509 PKI as it is deployed on HTTPS servers. At that time, ours were the largest and longest scans of this kind. Passive monitoring We extended our data sets with certificates won from monitoring TLS connections in the Munich Scientific Network (MWN). This yielded insights into the X.509 PKI as it is encountered by users accessing sites according to their browsing habits. It also allowed us to determine the symmetric ciphers used in TLS connections. Third-party data set As a reference, we also analysed data from a third party, namely the EFF, who had carried out a three-month long scan of the IPv4 space and collected roughly 11 million certificates. This data set allowed us to compare the X.509 PKI as used for the most popular Web sites with the PKI as a whole. However, due to the nature of the EFF s scan, the results for their data set must be treated with some care (no domain information, loss of accuracy due to IP address reassignments). Secured connections We found a clear correlation between a site s rank on the Alexa list and the probability it would offer TLS-secured access. Interestingly, the percentage of sites that have an open HTTPS port is higher for the top 1 million than for the top 1000 or even top 10,000 sites. The explanation we can offer are default configurations for hosts on the lower ranks of the list and conscious decisions to disable TLS for the higher-ranking sites, possibly for performance reasons. However, when connecting to the sites with an open HTTPS port, we found that only about 60% offered HTTPS, although this percentage was much higher for the 1000 most popular sites (over 90%) and even the top 10,000 most popular sites (roughly 80%). While a good finding for the top sites, it is a rather poor result as a whole. Security of deployment The majority of certificates chained to a root certificate in the Mozilla Firefox s root store and was not expired nor showed other errors in the 82
99 4.7. Key contributions of this chapter chain. However, almost 20% of certificates were expired, showing insufficient deployment practice. We found that only 18% of certificates were verifiable and issued for the correct hostname. Worse, the trend showed only slight improvements over time. This result is very disappointing and shows little care is applied in deploying certificates. Almost 30% of certificates in our data sets were selfsigned (and more than 40% in the EFF s data set). We could show that the majority of them were issued without regard to hostnames: less than 1% were issued for the right hostname. Although we found some extreme cases, validity periods for certificates were mostly sufficiently short and no reason for concern. We also found that many certificates are reused on many domains. Where domains are hosted on different machines, this is a security weakness as it increases the attack surface. This is one area where improvements are needed. Certification structure We could show that most certificates are issued via a rather short chain of intermediate certificates. This is a relatively good finding: short chains reduce the attack surface, but allow to keep the root certificate offline. However, the number of intermediate certificates is high, pointing to a rather skewed distribution of the length of certificate chains. Cryptography Our findings concerning the length of public keys were mostly positive. Short key lengths were still too common, but the trend showed a clear movement towards longer keys. Vulnerabilities like the Debian bug were already very rare. We could also show that MD5 is in the process of being phased out. This is a good finding as this algorithm cannot be relied on any more. Our monitoring showed that cryptography is generally not a weakness as both strong ciphers and long keys are used. At the time of our monitoring, the most common symmetric algorithms were AES in CBC mode and RC4. In the light of new attacks on both CBC and RC4, however, these are not optimal choices. It would be insightful to carry out monitoring again and determine whether clients and servers have moved to other block modes and moved away from RC4. Issued certificates vs. encountered certificates Where sensible, we compared our findings for the data sets from active scans versus the ones from passive monitoring. The differences were rarely drastic. However, the data from our second, later monitoring run showed a clear increase of correct certificate chains. Furthermore, we found a number of very short-lived certificates in our data, which we attributed to the Tor network. Development over time For several of the issues we investigated, we traced the development of the X.509 PKI over time. We found little development in fundamental TLS connectivity or properties of certificate chains. However, we found a trend to use more intermediate certificates (and short chains) and a movement towards longer key lengths. Unfortunately, the really critical issues (like correct chains, correct hostnames) did not show significant improvements. We note that the more dangerous attacks on the X.509 PKI happened after our investigation period (see Chapter 3). It would be interesting to determine whether the attacks caused a move towards more security in HTTPS configurations. Influence of geographic factors We could show that results from our other vantage points did not differ crucially. The operators of CDNs seem to carry out certificate deployment with due care. Correlation to rank We could determine that the quality of certificates (correct chains, hostnames, sensible values for validity and key length) correlated with the Alexa 83
100 4. Analysis of the X.509 PKI using active and passive measurements rank, but in a surprising way. We determined three categories of valid certificates: good, acceptable and poor. While the ratio of valid certificates was higher for the top-ranking sites, the fraction of poor certificates among them was also higher. Our overall conclusion is that the X.509 PKI is in a poorly maintained state, with a high fraction of certificates not being absolutely valid for the host where they are used. There is also very little improvement over time. The primary efforts in improving the X.509 PKI thus need to focus on sensible deployment and certification practices Statement on author s contributions This chapter is an improved and extended version of the following paper: R. Holz, L. Braun, N. Kammenhuber, G. Carle. The SSL landscape a thorough analysis of the X.509 PKI using active and passive measurements. Proc. 11th ACM SIGCOMM Internet Measurement Conference (IMC), Berlin, Germany, November 2011 (reference [37]). The author of this thesis carried out all scans and carried out the post-processing of the thus obtained data. He also carried out the post-processing of certificates in the data sets from monitoring. The author made major contributions to all results that concern evaluation of host properties (Section 4.3) and evaluation of certificates (Section 4.4). The author made major contributions to the paper. For this chapter, the author reanalysed the data sets. Deviations to the numbers in the paper are due to this improved methodology. In the original publication, we used a simpler script to extract root stores that would include certificates in its output that were not meant to issue server certificates (e.g., root certificates for S/MIME) or were blacklisted (the demonstration MD5 certificate from [260] and Mozilla test certificates). Server certificates are not expected to be issued from such certificates. For this chapter, the author extracted all root stores again with the more precise script by Langley [211], which the author extended into a tool suite to work on older root stores, too [200]. The author s re-evaluation using this new method produced only marginal differences. In the original paper, our results showed minor deviations due to two oversights. First, we accepted expired intermediate certificates as valid. In the new methodology, the author corrected this. The differences were again marginal (the re-evaluation of our data sets with respect to expired certificates showed differences of only 0.1% 0.7%). Second, an undocumented behaviour in OpenSSL had caused our instance to fall back on root certificates installed by the Linux distribution in addition to the correct root store. This means we slightly overestimated some numbers, e. g., the number of verifiable certificates. The re-evaluation showed the differences to be marginal. Furthermore, this OpenSSL behaviour actually emphasised our message as we overestimated the number of correctly issued certificates. Static properties of certificates and hosts (i. e., such properties that do not depend on verification steps) were not analysed again. Using the new methodology, the author made a number of additions to the original results, and also added some corrections: Section The author added an analysis how many hosts (correlated to rank) had an open port 443. The author put this in relation to how many hosts actually offered TLS on this port. Section The author reanalysed the results in the lights of cryptographic developments since 2011, in particular with respect to Diffie-Hellman key exchanges, AES in CBC mode, and RC4. Section A mistake in the number of Wordpress certificates has been fixed. 84
101 4.8. Statement on author s contributions Section The author corrected a mistake in the plot. Section Marginal deviations in the percentages were fixed (less than 0.1%). Section Minor errors in the numbers were fixed by the author (deviation of about 2% in the case of matching CNs). Section The author added a comparison between distinct and non-distinct certificates and found that Debian-weak keys are less likely to be reused on multiple hosts. Section The author added a comparison with distinct certificates, where a number of extremely short-lived certificates could be associated with probable use of Tor. Section The author added results for multiple chains. He also analysed chain lengths a second time, with self-signed end-host certificates excluded, and compared the results. This analysis provides even stronger evidence for the move towards using more intermediate certificates. The author also added an analysis of the differing chain lengths for the second monitoring run and determined the reason to be the very different distribution of popular sites. Section The author fixed a mistake in the text describing the plot and clarified the statement on the convergence of certification paths from end-host certificates towards root certificates. Section The author reanalysed the data with a new method for counting and added a comparison to issuers in distinct certificates. The new results show that certificates from certain CAs are more likely to be reused on multiple hosts. Section The author reanalysed the data with improved criteria for the categories and added a comparison between earlier and later scan. The author changed the above sections to reflect the additions and results from the new methodology. The following sections are also adapted from the paper. For Section 4.2, the author added details about the scans and added a discussion of the inaccuracy in the third-party data set. He also rewrote the section on the monitoring setup. For Section 4.4.2, the author added the algorithm to determine expired certificates. In Section 4.4.8, the author added a statement concerning the later work by Heninger et al., who found an explanation for the duplicate keys we had found. Section 4.5 is an extended version from the paper, too. The author split the section into earlier and later work, and added related work for the latter category. The following sections are from the paper, with only stylistic changes: 4.4.6, 4.4.7, , , and 4.6. Section is a shortened version from the paper. All plots in this chapter are by the author. 85
102
103 5Chapter 5. Analysis of the OpenPGP Web of Trust This chapter is an extended version of our previous publication [73]. Please see the note at the end of the chapter for further information. Webs of Trust are an approach to PKI that is quite orthogonal to the hierarchically structured X.509 PKI that we analysed in Chapter 4. In a Web of Trust, every entity can certify any other entity. One particularly important Web of Trust is the one established by implementations of the OpenPGP standard (RFC 4880, [93]), e. g., Pretty Good Privacy (PGP) and the GNU Privacy Guard (GnuPG). In this chapter, we describe the results of a thorough investigation of the Web of Trust as established by users of OpenPGP Introduction and investigated questions OpenPGP was conceived primarily as an encryption tool for private users, to be used in applications like . constitutes one of the primary uses of OpenPGP to this day 1. This use case is entirely different from the WWW: OpenPGP is not intended to be used to certify myriads of Web sites. Instead, OpenPGP means to establish cryptographic links between real persons and to exploit relationships between them to make it possible to assess the authenticity of their public keys. Due to its entirely different use case, the research questions to ask are different from those for the X.509 PKI they have less to do with problems that are due to deployment and more with the relationships between keys. The latter are reflected in signatures. OpenPGP does not need central entities that act as dedicated issuers of certificates. A certificate in OpenPGP is simply a signature on a name (with address), public key, expiry date, and optionally an indication of how thoroughly an entity s identity was verified by the signing party. Thus, one often speaks of signatures and keys instead of certificates when discussing OpenPGP. The key to understanding OpenPGP lies in analysing the structure of the graph that the OpenPGP Web of Trust constitutes. It is possible to state certain properties that a good Web of Trust must exhibit, and these are accessible to graph analysis. Using this form of analysis, we investigated the following research questions. Fundamental statistics The first question to ask is what the size of the Web of Trust is, and how many keys with certification paths (i.e., signature chains) exist between them. This gives an insight for how many users the Web of Trust is potentially useful in the sense that they can use it to authenticate other keys or have their keys authenticated by others. 1 OpenPGP is also often used in Linux distributions to sign software packages. 87
104 5. Analysis of the OpenPGP Web of Trust Usefulness of the Web of Trust A good Web of Trust must allow to find certification paths from one key to many others, otherwise it is not useful. This degree of usefulness is the next question we investigate. The length of the paths is also important: short paths reduce the number of entities on the path that a user has to trust and thus increase a user s chances of accurately assessing a key s authenticity. Giving and receiving many signatures is important, too: it increases the chances of several redundant paths between keys, which is beneficial for GnuPG s trust metrics. Robustness Keys in the Web of Trust are stored on key servers, from where they can be retrieved. They are subject to the usual life-cycles in a PKI, i.e., they may expire, be withdrawn, and possibly be compromised. The effect would be that certification paths would break. We thus decided to investigate how the Web of Trust reacts to the random and targeted removal of keys, i.e., to which degree keys remain connected via (redundant) certification paths. Social relations A good Web of Trust should model social relations and social clustering well: where communities of users exist, the chances of being able to accurately assess trustworthiness of users within the same community increase. We decided to investigate community structures in the Web of Trust and attempt to map them to social relations. Furthermore, we decided to investigate whether the Web of Trust shows the so-called Small World effect, which is common in networks of social origin. Cryptography Just as with X.509, the cryptographic algorithms and keys in use in OpenPGP should be sufficiently strong. We decided to investigate whether this is the case. Historical development The Web of Trust graph is unique in the sense that all certification information in the Web of Trust is preserved on key servers. Hence, it is possible to derive the historical development of the Web of Trust since its conception in the 1990s. As previous studies of the Web of Trust dated back almost ten years, we were interested to see to which extent the Web of Trust had changed Methodology We used primarily methods from graph analysis to determine properties of the Web of Trust. In this section, we describe how we extracted the graph topology and summarise the metrics we used Graph extraction As mentioned in Section 2.5, a system of publicly accessible key servers allows users to upload their keys together with the signatures so other users can retrieve them. The keys servers synchronise via the Synchronizing Keyservers (SKS) protocol. Keys are never removed from a key server consequently, a snapshot of a key server s database contains the history of the entire Web of Trust. We modified the SKS software to download a snapshot of the key database as of December Table 5.1 shows properties of our data set after the extraction. The data set contains about 2.7 million keys and 1.1 million signatures. Of these, about 400,000 keys were expired, another 100,000 revoked. About a further 52,000 keys were found to be in a defective binary format. The actual Web of Trust, which consists only of valid keys that have actually been used for signing or have been signed, is made up of 325,410 88
105 5.2. Methodology Total number of keys 2,725,504 Total number of signatures 1,145,337 Number of expired keys 417,163 Number of revoked keys 100,071 Number of valid keys with incoming or outgoing signatures 325,410 Number of valid signatures for the latter set of keys 816,785 Table 5.1. Our data set for the analysis of the OpenPGP Web of Trust. keys with 816,785 valid signatures between them. Consequently, the majority of keys in the data set is not verifiable (no signature chains lead to them) and does not belong to the Web of Trust. Note that our method implies an important caveat. Users are not required to upload their keys. Yet there is no centralised or structured way to search for and download keys other than key server networks. Consequently, our data set has the inherent bias that it contains only keys from users who took the extra step to upload their keys. As the data set is relatively large, statistical analysis will still yield meaningful results, but it is important to keep this limitation in mind. The number of unpublished keys is unknown, unfortunately. When representing the Web of Trust as a graph, we represented keys as nodes and signatures as directed edges. This was a deliberate choice. An alternative would have been to map keys to individual persons. However, such a mapping is not easy to define: different users may have the same names, or the same users may spell their names differently every time they create and upload a new key, or they may simply use pseudonyms. Although the user ID in an uploaded key contains an address, this is not particularly reliable, either, as these can change, too. Ultimately, it is keys that sign other keys, and we thus chose to analyse a key-based graph Terms and graph metrics Based on the common notions of graph theory, we define some terms, following [83] herein. In the following, let V be the set of nodes of the graph G, with V = n. u and v indicate nodes. Strongly Connected Components (SCCs) An SCC is a maximal connected subgraph of a directed graph where there is at least one directed path between every node pair u, v. Note that the paths from u to v and v to u may incorporate different nodes. Distances between nodes path between them. The distance d between two nodes is the length of the shortest Distances in the graph The characteristic distance of a graph, d, is the average over all distances in the graph, i.e., the average path length: d = 1 n 2 n d(u, v) (5.1) u v V Eccentricity The eccentricity of a node u, ɛ(u), is defined as the maximum distance to another node, i.e. 89
106 5. Analysis of the OpenPGP Web of Trust ɛ(u) = max{d(u, v) v V } (5.2) Graph radius and diameter all eccentricities: The diameter of a graph is defined as the maximum over dia(g) = max{e(u) u G} (5.3) The radius is defined as the minimum over all eccentricities: rad(g) = min{e(u) u G} (5.4) Node neighbourhoods We define the h-neighbourhood of a node v as the set of all nodes from which the distance to v is at most h: N h (v) = {u V d(v, u) h} (5.5) Clustering coefficient The clustering coeffcient indicates the probability that two neighbours of a node have an edge between them, i.e., are neighbours themselves. Let G = (V, E) be the undirected graph. A triangle = {V, E } is a complete subgraph of G of size 3, i.e., = 3. The number of triangles of a node v is given by λ(v) = { v V }. A triplet of a node v is a subgraph of G that consists of v, two edges, plus two more nodes such that both edges contain v. The number of triplets of a node v can be given as τ(v) = ( d(v) ). 2 The local clustering coefficient of v is defined as c(v) = λ(v) τ(v) (5.6) c(v) indicates how many triplets of v are triangles. The global clustering coefficient of G can then be defined as: C(G) = 1 V c(v) (5.7) v V with V = {v V d(v) 2} to disallow non-defined values for τ(v). Correlation of node degrees as defined by Pastor-Satorras et al. Following Pastor-Satorras et al. [59], we define a measure for the correlation of node degrees: knn = k k P c (k k) (5.8) gives the average node degree of neighbours of nodes with degree k. P c (k k) indicates the probability that an edge that starts at a node with degree k ends at a node with degree k. Assortativity coefficient The assortativity coefficient [55] is a measure whose purpose is similar to the function defined in Definition 5.8. It measures the degree of assortative mixing in a graph: nodes with high degree that are connected mainly to other nodes with high degree. The assortativity coefficient takes values between -1 and 1. Positive values indicate assortative mixing, negative ones do not. According to Newman [55], assortative mixing is a property that distinguishes social networks from other realworld networks (e.g. technical or biological ones). It can thus be used to differentiate 90
107 5.3. Results between similar graphs that exhibit the so-called Small World effect. We return to this in Section Results In this section, we present the results of our analysis. We begin with an analysis of the Web of Trust s macro structure Macro structure: SCCs An SCC defines a subset of the graph where there is at least one signature chain between every key pair. SCCs are important for participants of the Web of Trust: mutual verification of key authenticity is only possible for participants within the same SCC. An optimally meshed Web of Trust should be one giant SCC. We computed the SCCs of the graph, and found 240,283 SCCs in the Web of Trust. However, more than 100,000 of these consisted of a single node and about 10,000 SCCs consisted of node pairs. The Largest Strongly Connected Component (LSCC) consisted of about 45,000 nodes. The remaining SCCs mostly had a size between 10 and 100 nodes. Figure 5.1(a) shows the distribution. Many SCCs have unidirectional edges to the LSCC, but extremely few have edges between each other. The SCCs can be arranged in a star formation around the LSCC in the middle (Figure 5.1(b)). Out of all smaller SCCs, about 18,000 nodes showed a unidirectional edge into the LSCC, making it (in principle) possible for such a key to verify keys from the LSCC. In the other direction, 92,000 keys outside the LSCC are reachable from a key within the LSCC. We found three interesting hubs in the LSCC and one regional particularity. The German publisher Heise, the non-profit CA CAcert and, until recently, the German association DFN-Verein 2 operate or have operated CAs to sign keys. Together, they signed about 4200 keys in the LSCC in our data set. The Heise CA alone signed, in total, 23,813 keys yet only 2578 of these were in the LSCC. This SCC structure gravely impacts the usability of the Web of Trust. First of all, the large number of smaller SCCs means that even among those users who have made the effort to upload their keys to a key server, most do not participate actively in the Web of Trust. Otherwise, their SCCs would already have merged with the LSCC (one mutual signature is enough). This is also emphasised by the following comparison. The ratio of edges to nodes in the LSCC is 9.85; the same ratio for the total Web of Trust is Signature activity in the LSCC must thus be much higher than in the rest of the Web of Trust such strong user activity is very desirable to achieve a better meshing in the Web of Trust. Second, a high percentage of participants in one of the smaller SCCs is unable to verify most keys in the Web of Trust. The LSCC is really a structure of paramount importance: the keys in the LSCC constitute only 14% of the keys in the Web of Trust, but only the owners of these keys can really profit from the Web of Trust to verify the authenticity of unknown keys. They can build signature chains to all keys in the LSCC plus to twice as many keys outside the LSCC. Thus, a recommendation for new participants would be to obtain a signature from a member of the LSCC as early as possible to make their key verifiable. A good choice is also to get a (mutual) signature of one of the CAs in the LSCC. With such a signature, paths can be built to all keys in the LSCC, plus to a large number of keys outside the LSCC that are only reachable via the CA. This emphasises that a Web of Trust can benefit from CAs. 2 This entity also acts as a subordinate CA in the X.509 PKI, where it operates a large network of RAs. 91
108 Analysis of the OpenPGP Web of Trust quantity 1e+00 1e+01 1e+02 1e+03 1e+04 1e component size (a) (b) Figure 5.1. (a) Size distribution of SCCs. (b) Plot of SCCs down to a size of 8. The remainder of our analysis focuses on the LSCC as the most relevant component for participants Usefulness in the LSCC Usefulness is a term that is difficult to express formally. It can be defined in several dimensions. We presented the most relevant ones in Section 5.1. When discussing the implications of distances between nodes, we will generally refer to the default settings of GnuPG as this is a popular implementation of OpenPGP. There is a further important issue to take into account here. In OpenPGP, a signature does not store the so-called introducer trust (see Section 2.5), i. e., information how much a given user trusts another user to verify a participant s identity accurately before issuing a signature. Such information is always stored locally and never released. This has an important consequence for us: when we discuss the usefulness of the Web of Trust, we really assume that the links between keys, which are expressed as signatures, would be considered trustworthy by a verifying entity and thus would be usable to this entity. In other words, we can only assess the best case for the Web of Trust rather than the average or worst case, because we do not have the information how introducer trust is distributed in the Web of Trust. Distances We first analysed distances between keys in the graph. The average distances between nodes in the LSCC (see Figure 5.2(a)) range between 4 7, which is at best just below GnuPG s limit, which by default allows a maximum path length of 5 in assessing a key s authenticity. At worst, these values exceed it. The characteristic distance of the LSCC is Its eccentricity is much higher: it is almost exclusively between To determine the implications for usefulness, we identified how many keys are reachable from a given key within a certain distance. We computed the set of verifiable keys as the nodes in a h-neighbourhood for h = 1,..., 5. Figure 5.3 shows the cumulative distribution function of h-neighbourhoods. For the 2-neighbourhood, we see a steep incline, from which we can conclude that this 92
109 5.3. Results quantity indegree (a) (b) Figure 5.2. Distribution of (a) average distances, (b) indegree in LSCC. Fn(x) h=2 h=3 h=4 h= number of nodes in h-neighbourhood Figure 5.3. CDF of reachable nodes due to h-neighbourhoods. neighbourhood must be relatively small for all nodes. The size of the neighbourhoods grows considerably for increasing h. For h = 3, the third quartile is about For h = 4 and h = 5, it becomes 16,300 and 30,500, respectively. Our findings indicate that signature chains within GnuPG s restrictions are sufficient to make a very large fraction of the keys in the LSCC verifiable. This is a good result for usefulness and shows that the LSCC is meshed quite well. However, for h = 5, the maximum number of reachable keys we found was 40,100. This means that, on average for all keys, there will be almost 5000 keys (a tenth of the LSCC) to which no path at all can be found within GnuPG s restrictions. Small World effect and social links The size of 5-neighbourhoods shows that paths are frequently very short. A possible explanation for this is a Small World effect, which following [56] can be informally understood to be the phenomenon that the average path length between any two nodes is significantly shorter than could be expected by judging from graph radius and diameter. A high clustering coefficient is often viewed as indicative. We investigated this in the LSCC. As there does not seem to be a universally accepted definition of the 93
110 5. Analysis of the OpenPGP Web of Trust clustering coefficient for directed graphs, we reduced the directed graph to an undirected one (omitting the direction of edges and merging duplicates). The clustering coefficient we computed is C = This indicates that, on average, roughly half of all neighbours of a node have edges between them. The value is on the same order as described in [56] for social networks with strong clustering. The characteristic distance in the LSCC is 6.07, while the diameter of the graph is 36 and the radius 16. Our finding is that the LSCC does indeed show a Small World effect. This indicates social clustering. Together with the short paths, this would make trust assessments easier for users. We further explore the social nature of the Web of Trust in Section Node degrees GnuPG s trust metrics view redundant and distinct signature chains as beneficial in assessing a key s authenticity. A high node indegree thus means that the corresponding key is more likely to be verifiable by other keys. A high outdegree increases the likeliness to find redundant signature chains to other keys. We computed the average indegree (and outdegree) in the LSCC as However, as can be seen in Figure 5.2(b), the distribution of indegrees in the LSCC is skewed. The vast majority of nodes have a low indegree (1 or 2). The result for the outdegrees is very similar: as can be seen in Figure 5.4(a), there is a positive correlation between indegree and outdegree of a node. The plot for outdegrees is indeed so similar to the one for indegrees that we omitted it here. About a third of the nodes in the LSCC have an outdegree of less than 3. Together, these results mean that the Web of Trust s usefulness has an important restriction: many nodes need to rely on single certification paths with full introducer trust and cannot make use of redundant paths. Mutual signatures (reciprocity of edges) If many Web of Trust participants cross-sign each other, this would be a great improvement in the overall verifiability of keys. We computed the reciprocity of edges, i.e., the fraction of unidirectional edges for which there is also a unidirectional edge in the other direction. The LSCC has a reciprocity value of This shows that there is room for improvement: the LSCC would profit much if more mutual signatures were given Robustness of the LSCC The robustness of the LSCC is also an interesting topic: how is the LSCC connected internally, and hence how sensitive is it to removal of keys? In the context of OpenPGP, the random removal of a node can be the result of an event like key expiration or revocation, which invalidates paths leading over the key in question. These events can and do occur in practice. Targeted removal of a key, however, is very hard to accomplish as SKS never deletes keys and stays synchronised. An attacker would need an unlikely high amount of control over the SKS network to make a key disappear. Scale-free property Scale-freeness in a graph means that the node degrees follow a power law, i.e., the distribution of degrees can be expressed as a function f(x) = ax k. Connectivity-wise, scale-free graphs are said to be robust against random removal of nodes, and vulnerable against the targeted removal of hubs (which leads to partitioning). This is usually explained by hubs being the nodes that are primarily responsible for maintaining overall connectivity [2]. We thus investigated first to which extent the Web of Trust shows this property. 94
111 5.3. Results Fn(x) knn e-03 1e-01 1e+01 ratio indegree/outdegree (a) outdegree (b) Figure 5.4. (a) CDF of ratio indegree to outdegree in LSCC. (b) Correlation of node degrees according to Definition 5.8: average outdegree (knn) of neighbours of nodes with degree k. The double-log scale in Figure 5.2(b) could lead one to the conclusion that the distribution of node degrees follows a power law. However, Clauset et al. argued in [15] that this is not indicative and methods like linear regression can easily be inaccurate in determining a power law distribution. We followed the authors suggestion instead and used the Maximum Likelihood method to derive power law coefficients and verified the quality of our fitting with a Kolmogorov-Smirnov test. The authors of [15] give a threshold of 0.1 to safely conclude a power law distribution. Our values for indegrees and outdegrees were and 0.011, respectively. As this is off by a factor of ten, our conclusion is that a power law distribution is not plausible. Consequently, the graph cannot be scale-free in the strict sense of the definition. This finding is contradictory to earlier works by Boguñá et al. [9] and Čapkun et al. [74]. The question is yet whether the graph is still similar to a scale-free one. Apart from high variability of node degrees, a set of high-degree nodes that act as interconnected hubs are characteristic for scale-free graphs [2, 49]. The positive correlation between the degree of nodes and the average degree of their neighbours (Figure 5.4(b)) suggests that nodes with high outdegrees do indeed connect to other such nodes with high probability. To bolster our finding, we computed the assortativity coefficient and obtained a value of This is similar to what has been computed for other social networks with a hub structure [56]. Our conclusion is that the graph is similar to a scale-free one and exhibits a hub structure, but is not scale-free in the strict sense. Random removal of nodes Based on this finding, we investigated how the LSCC reacts to random removal of nodes. We removed nodes and recomputed the size of the remaining LSCC as an indication of loss in overall connectivity. For random removal, we picked the nodes from a uniform distribution. Figure 5.5 shows our results. The graph is very robust against the random removal of nodes: we have to remove 14,000 nodes to cut the LSCC s size by half. To reduce it to a quarter, we have to remove more than half the nodes (25,000). The conclusion here is that events like key expiry or revocation do not greatly influence the robustness, and consequently the usability, of the Web of Trust. 95
112 5. Analysis of the OpenPGP Web of Trust size LSCC random targeted number of removed nodes Figure 5.5. Removing nodes at random and in a targeted fashion and recomputing the size of the LSCC. Targeted removal of nodes and CAs For targeted removal, we chose nodes with highest degrees first. The graph was more robust than expected. When we removed all nodes with a degree of more than 160 (240 nodes), the size of the LSCC was still 40,000. Only when we proceeded to remove all nodes with a degree of more than 18 (about 5000 nodes), the LSCC was half its size. Removing 2500 more nodes, we finally cut the LSCC down to about one ninth of its original size. This means that nodes with lower degrees (less than 18) play a significant role in overall connectivity (although the decay of the LSCC is quite pronounced once they are also removed). The rather slow decay stands in contrast to the rapid decay upon removal of the best-connected nodes that is commonly observed in scale-free networks. Targeted removal of keys does not greatly affect the Web of Trust, and is not an efficient attack. The hub structure is not the single reason for highly meshed connectivity in the Web of Trust. We decided to strengthen the attack by removing the keys of the three CAs. Our finding was similar: the LSCC split into one LSCC of size 42,455 and 1058 very small SCCs. This means that the CAs, although beneficial in making keys verifiable, are not responsible for holding the LSCC together Community structure of the Web of Trust Social clustering is an important property in a Web of Trust: it is more likely that members of a cluster know each other at least to some extent and can thus assess the trustworthiness of particular keys better. The Small World property was a first hint at social clustering. Newman and Park noted that a high degree of clustering is typical for social networks [58]. Fortunato [25] calls such subsets of nodes communities if the nodes have high intra-connectivity in their subset, but the subset as such shows a much lower connectivity to nodes outside. Community detection We analysed the Web of Trust with state-of-the-art algorithms for community detection to determine whether a pronounced community structure exists and can be mapped to 96
113 5.3. Results Method Modularity Communities found (size > 3) BL (l = 2) BL (l = 5) COPRA (v = 1) COPRA (v = 3) Table 5.2. Dissection of the LSCC into communities: algorithms BL and COPRA. Note that the definition of modularity for overlapping communities is different. The values for BL and COPRA are thus not directly comparable. real-world relationships. We also attempted to determine whether signing events like Key Signing Parties can be identified in the graph. These are organised events where a large number of participants come together in person and cross-sign each other s keys. Unfortunately, algorithms for community detection are often defined for undirected graphs. Signatures also store little information that could help identify social links and events in time. We decided to use DNS domains in user IDs and timestamps of signature creation as a basis. As an algorithm for a directed graph, we chose the one by Rosval et al. [66]. For undirected graphs, we chose the algorithms by Blondel et al. [8] (BL) and COPRA [31], based on suggestions in [44]. COPRA allows overlapping communities, but is non-deterministic. We ran it ten times and computed the differences. As a measure for the quality of a dissection, we used modularity [57], which relates the amount of intra-cluster edges of a graph with communities to the expected value for a graph without communities. Note that the definition for overlapping communities is different, so the values for COPRA and BL cannot be compared directly. Only the algorithms by Blondel et al. and COPRA yielded useful results. The algorithm by Rosval et al. computed a dissection into 2869 communities, almost all of them without any intra-cluster edges. The lack of intra-cluster edges means that the algorithm did not detect any true communities at all. We thus had to consider its results unreliable. We ignored them in our subsequent evaluation. BL and COPRA Table 5.2 shows the results of dissections with BL and COPRA for communities of size less than 3. Both BL and COPRA are configurable: BL can be repeated in iterative phases and COPRA requires a (user-chosen) parameter v to reflect the degree of overlapping. For BL, phase 2 (l = 2) yielded the best results (plausible number of communities, high modularity). For COPRA, values of v up to 3 were found best. We know from [14] that modularity values larger than 0.3 indicate a significant community structure. Depending on the algorithm and chosen parameters, between 94% (COPRA) and 99% (BL) of nodes in the LSCC belonged to such a community. BL and COPRA agree on the same orders of magnitude with respect to the number of communities and nodes therein. The high modularity values and the general shape of community distributions by size (see Figures 5.6(a) and 5.6(b)) are also similar. Most communities are very small, but a significant number of large or very large communities exist. Similarities, however, end here. COPRA indicates one extremely large community of 19,000 21,000 members. BL finds more communities of medium size ( ) and mid-large size ( ). To further investigate this, we analysed how communities are connected. COPRA found that most small communities are clustered around the largest community and mostly link only to this community. BL found several large communities to which the smaller communities connect. 97
114 5. Analysis of the OpenPGP Web of Trust quantity COPRA v=3 quantity BL l= community size community size (a) (b) Figure 5.6. Distribution of communities by size. Method dominated assignable dominated assignable signatures by TLD to TLD by SLD to SLD within 30d BL (l = 2) 53% 45% 4% 27% 12% BL (l = 5) 47% 47% 8% 21% 14% COPRA-1 58% 40% 13% 30% 40% COPRA-3 58% 38% 14% 31% 41% Table 5.3. Community structure with respect to membership in top-level domains (TLD) and second-level domains (SLD). Mapping to domain names and keysigning parties We analysed how the community dissections mapped to top-level and second-level domains (TLDs and SLDs) in the user IDs. If the same TLD or SLD occur very frequently in a cluster, this would be an indication that the cluster represents a true community of users. We say a community is dominated by a domain if at least 80% of its nodes belong to that domain. We say a community can be assigned to a domain if at least 40% of its nodes belong to it. Table 5.3 shows the results. For both BL and COPRA, we found that a large percentage of communities are dominated by a top-level domain: between 47% and 58%. If a community was not dominated, we checked if it could at least be assigned. A further 38% 47% could be said to be assignable to a TLD. This result did not change much when we disregarded generic TLDs (.com, etc.): with COPRA, 38% of communities were dominated by a country s TLD and a further 23% were still assignable. Results for BL were similar. Together, assigned and dominated communities make up by far the largest part of communities found (98% for BL-2 and COPRA, v = 1). However, the picture changes for second-level domains. With COPRA, only about 13% of communities are dominated by an SLD and only a further 30% of communities can be assigned to an SLD. 98
115 5.3. Results Keysigning Parties are events where one can expect signatures to be uploaded to key servers within a short time frame. Table 5.3 shows the percentage of nodes in the communities where signatures were created within a month. We find poor results for BL, but much better ones for COPRA. In about 40% of communities, the signatures were created within 30 days of each other. Conclusion with respect to community detection Concerning community detection, it is difficult to reach compelling conclusions. We provide ours as a basis of discussion. Both algorithms agreed that a large number of smaller communities exist. Given the huge number of TLDs and SLDs and given that the Web of Trust graph spans more than a decade, the results seem statistically significant enough to conclude that the community structure does indeed capture some social properties of the Web of Trust. However, grouping by TLD is a blunt measure, and the mappings to SLDs were by far not as compelling. Our tentative conclusion is that the signing process in the Web of Trust is indeed supported, to a traceable extent, by real-world social links. The social nature of the Web of Trust is not a myth. At least where certification paths are short, the community structure should make it easier for users to assess the trustworthiness of a key. Beyond this result, however, community detection is yet too imprecise to offer more succinct conclusions Cryptographic algorithms We present results which cryptographic algorithms were used in our data set. Tables 5.4(a) and 5.4(b) present results for hash and public key algorithms, respectively. Keys with a length of less than 1024 bits were rare. The key lengths would have been secure for Today, it is fair to say that a move towards longer key lengths should be made rather sooner than later. Concerning hash algorithms, the stronger SHA1 algorithm is by far the most frequent. The weak MD5 algorithm is still present at about 10%. SHA2 variants are a small minority. Concerning public key algorithms, ElGamal/DSA constitutes the vast majority (four times more than RSA). The OpenPGP standard allows to set certain values when signing a key to indicate how thoroughly a key owner s identity has been checked before signing. Precise semantics are not defined, however. The standard value is generic, which is also the most common value found (67.1% of signatures in the LSCC), but 26.8% of signatures are issued with the highest value positive and 6.4% with casual. As setting a value other than generic requires user-interaction, it shows that at least a part of the users in the Web of Trust takes the signing process seriously. The values that these users set can be helpful for others when they have to assess the authenticity of a key History of the Web of Trust We also examined the Web of Trust s history. Recall that SKS servers never delete keys; thus our snapshot of the Web of Trust contains its entire history. Our investigation starts in 1991, when PGP was released. Figures 5.7(a) and 5.7(b) show the development of the Web of Trust and the LSCC, respectively. A significant growth occurred only after This correlates with the founding of PGP Inc., the release of version 5 of the PGP software, and the beginning of the German Heise CA s work. The growth of the total Web of Trust slowed down after 2001, and the growth of the LSCC after We do not surmise any specific reason for this. Possible explanations are saturation or the advent of S/MIME, a rivalling standard. Figures 5.8(a) and 5.8(b) show the rate at which new PGP keys were added to the Web of Trust and the LSCC, respectively. 99
116 5. Analysis of the OpenPGP Web of Trust Algorithm Occurrences SHA1 398,849 MD5 41,700 SHA SHA SHA RIPE-MD/ Signatures total 446,325 (a) Algorithm Occurrences ElGamal/DSA ,555 RSA RSA RSA RSA RSA RSA Keys total 44,952 (b) Table 5.4. Occurrences of (a) hash algorithms, (b) public key algorithms. (a) (b) Figure 5.7. Development of key population of Web of Trust (a) and LSCC (b) over time. ElGamal/DSA keys make up the largest part, probably due to RSA s once-strict licence requirements. In 2009, RSA became the default this is reflected in the plot of the total Web of Trust. Interestingly, the switch is almost untraceable in the LSCC. The LSCC seems to show more resilience to changes. Our findings do not have direct implications for security. It is known that ElGamal/DSA signatures need strong pseudo-randomness during execution in order to be secure, and this has been found to be problematic in the case of embedded devices used in conjunction with protocols like SSH [35]. However, we find it plausible that the majority of OpenPGP keys are used on desktop machines or even stronger hosts, where entropy is not a problem. Concerning earlier results for the scale-free property, we find that the Web of Trust was much smaller at the time of these previous analyses thus, previous work analysed a very different network Related work The OpenPGP Web of Trust has been the subject of investigation before, albeit at other stages of its development and with a focus that was less on security-relevant properties. 100
Managing security-relevant data from measurements on Internet scale
Managing security-relevant data from measurements on Internet scale (Tales from the road) Ralph Holz 9 June 2015 About the speaker PhD from Technische Universität München, 2014 Dissertation on measurement
for High Performance Computing
Technische Universität München Institut für Informatik Lehrstuhl für Rechnertechnik und Rechnerorganisation Automatic Performance Engineering Workflows for High Performance Computing Ventsislav Petkov
Public Key Infrastructures
Public Key Infrastructures Chapter 5 Public Key Infrastructures Content by Ralph Holz Network Architectures and Services Version: November 2014, updated January 7, 2016 IN2101, Network Security 1 Public
7 Key Management and PKIs
CA4005: CRYPTOGRAPHY AND SECURITY PROTOCOLS 1 7 Key Management and PKIs 7.1 Key Management Key Management For any use of cryptography, keys must be handled correctly. Symmetric keys must be kept secret.+ Guide to Network Security Fundamentals, Third Edition. Chapter 12 Applying Cryptography
Security+ Guide to Network Security Fundamentals, Third Edition Chapter 12 Applying Cryptography Objectives Define digital certificates List the various types of digital certificates and how they are used
Overview of CSS SSL. SSL Cryptography Overview CHAPTER
CHAPTER 1 Secure Sockets Layer (SSL) is an application-level protocol that provides encryption technology for the Internet, ensuring secure transactions such as the transmission of credit card numbers
CS 356 Lecture 28 Internet Authentication. Spring 2013
CS 356 Lecture 28 Internet Authentication Spring 2013 Review Chapter 1: Basic Concepts and Terminology Chapter 2: Basic Cryptographic Tools Chapter 3 User Authentication Chapter 4 Access Control Lists
Certificates. Noah Zani, Tim Strasser, Andrés Baumeler
Certificates Noah Zani, Tim Strasser, Andrés Baumeler Overview Motivation Introduction Public Key Infrastructure (PKI) Economic Aspects Motivation Need for secure, trusted communication Growing certificate
Attacks against certification service providers and their ramifications
Federal IT Steering Unit FITSU Federal Intelligence Service FIS Reporting and Analysis Centre for Information Assurance MELANI Technological consideration Attacks against certification
Securing End-to-End Internet communications using DANE protocol
Securing End-to-End Internet communications using DANE protocol Today, the Internet is used by nearly.5 billion people to communicate, provide/get information. When the communication involves sensitive
Chapter 7 Transport-Level Security
Cryptography and Network Security Chapter 7 Transport-Level Security Lectured by Nguyễn Đức Thái Outline Web Security Issues Security Socket Layer (SSL) Transport Layer Security (TLS) HTTPS Secure Shell
SSL Server Rating Guide
SSL Server Rating Guide version 2009j (20 May 2015) Copyright 2009-2015 Qualys SSL Labs () Abstract The Secure Sockets Layer (SSL) protocol is a standard for encrypted network communication.
Public Key Infrastructure
UT DALLAS Erik Jonsson School of Engineering & Computer Science Public Key Infrastructure Murat Kantarcioglu What is PKI How to ensure the authenticity of public keys How can Alice be sure that Bob s purported
Introduction to Network Security Key Management and Distribution
Introduction to Network Security Key Management and Distribution Egemen K. Çetinkaya Department of Electrical & Computer Engineering Missouri University of Science and Technology [email protected]
CS 6262 - Network Security: Public Key Infrastructure
CS 6262 - Network Security: Public Key Infrastructure Professor Patrick Traynor 1/30/13 Meeting Someone New 2 What is a certificate? A certificate makes an association between a user identity/job/ attribute,
PUBLIC KEY INFRASTRUCTURE
PUBLIC KEY INFRASTRUCTURE Copyright tutorialspoint.com The most distinct feature of Public Key Infrastructure PKC is that it uses
Introduction to Cryptography
Introduction to Cryptography Part 3: real world applications Jean-Sébastien Coron January 2007 Public-key encryption BOB ALICE Insecure M E C C D channel M Alice s public-key Alice s private-key Authentication%
Network Security Fundamentals
APNIC elearning: Network Security Fundamentals 27 November 2013 04:30 pm Brisbane Time (GMT+10) Introduction Presenter Sheryl Hermoso Training Officer [email protected] Specialties: Network Security IPv6
Analyzing DANE's Response to Known DNSsec Vulnerabilities
Analyzing DANE's Response to Known DNSsec Vulnerabilities Matthew Henry Joseph Kirik Emily Scheerer UMBC UMBC UMBC [email protected] [email protected] [email protected] May 9, 2014 Abstract: SSL/TLS is currently &
The DoD Public Key Infrastructure And Public Key-Enabling Frequently Asked Questions
The DoD Public Key Infrastructure And Public Key-Enabling Frequently Asked Questions May 3, 2004 TABLE OF CONTENTS GENERAL PKI QUESTIONS... 1 1. What is PKI?...1 2. What functionality is provided by a
Authentication Applications
Authentication Applications will consider authentication functions developed to support application-level authentication & digital signatures will consider Kerberos a private-key authentication service
Digital certificates and SSL
Digital certificates and SSL 20 out of 33 rated this helpful Applies to: Exchange Server 2013 Topic Last Modified: 2013-08-26 Secure Sockets Layer (SSL) is a method for securing communications between
Analysis of the HTTPS Certificate Ecosystem
Analysis of the HTTPS Certificate Ecosystem, James Kasten, Michael Bailey, J. Alex Halderman University of Michigan HTTPS and TLS How does HTTPS and the CA ecosystem fit into our daily lives? Nearly all
CS 6262 - Network Security: Public Key Infrastructure
CS 6262 - Network Security: Public Key Infrastructure Professor Patrick Traynor Fall 2011 Meeting Someone New 2 What is a certificate? A certificate makes an association between a user identity/job/ attribute
SAC075: SSAC Comments to ITU-D on Establishing New Certification Authorities
03 December 2015 Subject: SAC075: SSAC Comments to ITU-D on Establishing New Certification Authorities The Internet Corporation for Assigned Names and Numbers (ICANN) Security and Stability Advisory Committee
Understanding Digital Certificates and Secure Sockets Layer (SSL)
Understanding Digital Certificates and Secure Sockets Layer (SSL) Author: Peter Robinson January 2001 Version 1.1 Copyright 2001-2003 Entrust. All rights reserved. Digital Certificates What are they?
Security + Certification (ITSY 1076) Syllabus
Security + Certification (ITSY 1076) Syllabus Course: ITSY 1076 Security+ 40 hours Course Description: This course is targeted toward an Information Technology (IT) professional who has networking and
Security Digital Certificate Manager
System i Security Digital Certificate Manager Version 5 Release 4 System i Security Digital Certificate Manager Version 5 Release 4 Note Before using this information and the product it supports, be sure
Internal Server Names and IP Address Requirements for SSL:
Internal Server Names and IP Address Requirements for SSL: Guidance on the Deprecation of Internal Server Names and Reserved IP Addresses provided by the CA/Browser Forum June 2012, Version 1.0 Introduction
The SSL Landscape A Thorough Analysis of the X.509 PKI Using Active and Passive Measurements
The SSL Landscape A Thorough Analysis of the X.509 PKI Using Active and Passive Measurements Ralph Holz, Lothar Braun, Nils Kammenhuber, Georg Carle Technische Universität München Faculty of Informatics
Neutralus Certification Practices Statement
Neutralus Certification Practices Statement Version 2.8 April, 2013 INDEX INDEX...1 1.0 INTRODUCTION...3 1.1 Overview...3 1.2 Policy Identification...3 1.3 Community & Applicability...3 1.4 Contact Details...3
Chapter 10. Network Security
Chapter 10 Network Security 10.1. Chapter 10: Outline 10.1 INTRODUCTION 10.2 CONFIDENTIALITY 10.3 OTHER ASPECTS OF SECURITY 10.4 INTERNET SECURITY 10.5 FIREWALLS 10.2 Chapter 10: Objective We introduce
Public Key Infrastructure (PKI)
Public Key Infrastructure (PKI) Reading Chapter 15 1 Distributing Public Keys Public key cryptosystems allow parties to share secrets over unprotected channels Extremely useful in an open network: Parties
Internet Programming. Security
Internet Programming Security Introduction Security Issues in Internet Applications A distributed application can run inside a LAN Only a few users have access to the application Network infrastructures
Security Goals Services
1 2 Lecture #8 2008 Freedom from danger, risk, etc.; safety. Something that secures or makes safe; protection; defense. Precautions taken to guard against crime, attack, sabotage, espionage, etc. An assurance;
Application Security: Threats and Architecture
Application Security: Threats and Architecture Steven M. Bellovin [email protected] smb Steven M. Bellovin August 4, 2005 1 We re from the Security Area, and We re Here to
HKUST CA. Certification Practice Statement
HKUST CA Certification Practice Statement IN SUPPORT OF HKUST CA CERTIFICATION SERVICES Version : 2.1 Date : 12 November 2003 Prepared by : Information Technology Services Center Hong Kong University of
Authenticity of Public Keys
SSL/TLS EJ Jung 10/18/10 Authenticity of Public Keys Bob s key? private key Bob public key Problem: How does know that the public key she received is really Bob s public key? Distribution of Public Keys!
Public Key Infrastructure (PKI)
Public Key Infrastructure (PKI) In this video you will learn the quite a bit about Public Key Infrastructure and how it is used to authenticate clients and servers. The purpose of Public Key Infrastructure
Key Management Interoperability Protocol (KMIP)
(KMIP) Addressing the Need for Standardization in Enterprise Key Management Version 1.0, May 20, 2009 Copyright 2009 by the Organization for the Advancement of Structured Information Standards (OASIS).
Key Management and Distribution
Key Management and Distribution Overview Raj Jain Washington University in Saint Louis Saint Louis, MO 63130 [email protected] udio/video recordings of this lecture are available at:
Multipurpsoe Business Partner Certificates Guideline for the Business Partner
Multipurpsoe Business Partner Certificates Guideline for the Business Partner 15.05.2013 Guideline for the Business Partner, V1.3 Document Status Document details Siemens Topic Project name Document type
Authentication Applications
Authentication Applications CSCI 454/554 Authentication Applications will consider authentication functions developed to support application-level authentication & digital signatures Kerberos a symmetric-key
ALTERNATIVES TO CERTIFICATION AUTHORITIES FOR A SECURE WEB
ALTERNATIVES TO CERTIFICATION AUTHORITIES FOR A SECURE WEB Scott Rea DigiCert, Inc. Session ID: SEC-T02 Session Classification: Intermediate BACKGROUND: WHAT IS A CERTIFICATION AUTHORITY? What is a certification
Lecture VII : Public Key Infrastructure (PKI)
Lecture VII : Public Key Infrastructure (PKI) Internet Security: Principles & Practices John K. Zao, PhD (Harvard) SMIEEE Computer Science Department, National Chiao Tung University 2 Problems with Public
Security Digital Certificate Manager
IBM i Security Digital Certificate Manager 7.1 IBM i Security Digital Certificate Manager 7.1 Note Before using this information and the product it supports, be sure to read the information in Notices,
StartCom Certification Authority
StartCom Certification Authority Intermediate Certification Authority Policy Appendix Version: 1.5 Status: Final Updated: 05/04/11 Copyright: Start Commercial (StartCom) Ltd. Author: Eddy Nigg Introduction
Security & Privacy on the WWW. Topic Outline. Information Security. Briefing for CS4173
Security & Privacy on the WWW Briefing for CS4173 Topic Outline 1. Information Security Relationship to safety Definition of important terms Where breaches can occur Web techniques Components of security
Securing your Online Data Transfer with SSL
Securing your Online Data Transfer with SSL A GUIDE TO UNDERSTANDING SSL CERTIFICATES, how they operate and their application 1. Overview 2. What is SSL? 3. How to tell if a Website is Secure 4. What does
Understanding Digital Signature And Public Key Infrastructure
Understanding Digital Signature And Public Key Infrastructure Overview The use of networked personnel computers (PC s) in enterprise environments and on the Internet is rapidly approaching the point where
Description: Objective: Attending students will learn:
Course: Introduction to Cyber Security Duration: 5 Day Hands-On Lab & Lecture Course Price: $ 3,495.00 Description: In 2014 the world has continued to watch as breach after breach results in millions
Key Management and Distribution
Key Management and Distribution Raj Jain Washington University in Saint Louis Saint Louis, MO 63130 [email protected] Audio/Video recordings of this lecture are available at:
How SSL-Encrypted Web Connections are Intercepted
Web Connections are Web Connections Are When an encrypted web connection is intercepted, it could be by an enterprise for a lawful reason. But what should be done when the interception is illegal and caused
Public Key Infrastructure
Motivation: Public Key Infrastructure 1. Numerous people buy/sell over the internet hard to manage security of all possible pairs of connections with secret keys 2. US government subject to the Government
Cryptography and Network Security Chapter 14
Cryptography and Network Security Chapter 14 Fifth Edition by William Stallings Lecture slides by Lawrie Brown Chapter 14 Key Management and Distribution No Singhalese, whether man or woman, would venture
Certificate Management in Ad Hoc Networks
Certificate Management in Ad Hoc Networks Matei Ciobanu Morogan, Sead Muftic Department of Computer Science, Royal Institute of Technology [matei, sead] @ dsv.su.se Abstract Various types of certificates
The Changing Global Egg Industry
Vol. 46 (2), Oct. 2011, Page 3 The Changing Global Egg Industry - The new role of less developed and threshold countries in global egg production and trade 1 - Hans-Wilhelm Windhorst, Vechta, Germany Introduction | http://docplayer.net/490275-Empirical-analysis-of-public-key-infrastructures-and-investigation-of-improvements.html | CC-MAIN-2018-51 | refinedweb | 53,018 | 54.02 |
Wt & JWt 3.2.0
A new version of the library packed, with a fair share of new features.
detailed release notes here
download: wt-3.2.0.tar.gz (C++) / jwt-3.2.0.zip (Java)
We bumped the mid-version number, not only because this release brings a lot of new functionality to the plate, but, we also did some changes that may require existing users to be modified — read the release notes carefully.
A new namespace Wt::Auth contains services, model and view classes to implement a state-of-the art authentication system in your web application. It contains password-based authentication, implementing best practices, remember-me cookies, email confirmation, and authentication using third party identification services such as Google, based on the upcoming OpenID Connect and OAuth 2.0 protocols. We appreciate any feed-back on the API or features.
See also the overview in this blog post or the updated hangman example.
We are planning to include the authentication module in JWt for the next release (3.2.1).
The HTTP client handles HTTP and HTTPS protocols, and can be used for POST or GET requests. In its current state, it was developed mainly to be useful for implementing the OAuth 2.0 protocol, but we plan to expand its features to cover most use-cases for an HTTP client within the scope of a web application.
While this will not replace all use-cases of more expansive libraries such as curl, the implementation has one clear advantage: the client is implemented using asynchronous I/O, and uses the same thread-pool as used for processing requests. This avoids tying up threads while waiting for downstream servers.
The Mail client implements (a subset of) the SMTP protocol to send mails. As for the HTTP client, in its current state, it was developed mainly to be useful for implementing email confirmation for the authentication module, but we plan to expand its features to cover most use-cases for a mail client within the scope of a web application. It does support proper Unicode handling in recipient names, message title and plain or HTML body texts, which already is a benefit over many alternative libraries.
We also added a Json namespace that deals with JSON deserialization (and later, also serialization).
Denial-of-Service mitigation. We have added two measures which can be configured to prevent DoS attacks that try to exhaust the server by spawning sessions. This is in particular a risk when deploying using the progressive bootstrap method, since then a plain HTML session can be spawned with a single request.
Plain sessions may be limited to be only a fraction of the total number of sessions (most legitimate sessions are Ajax-enabled)
Ajax sessions need to confirm their "intelligence" by solving a puzzle which requires them to properly parse the (ever-changing) JavaScript and HTML. This renders attacks using bot-nets unpractical.
Compromised session ID risk reduction: would a session ID be compromised (even though it is well protected, especially when using HTTPS), it can in many cases no longer be used to hijack that session.
A full page refresh (using the session ID to rerender the current application state) is no longer allowed unless both client IP address and user-agent are unchanged. To still enable page refresh in this situation, you may configure the use of a cookie which can be used to confirm the original browser (although that cookie will not be used for session tracking). You may even chose to disable this feature entirely by specializing refresh().
The session ID cannot be used to POST events to an Ajax session, since these require proof of other ever-changing context specific information, notably a pageId and ackId.
A detailed description of the security features of Wt and JWt will be the topic of a blog post by itself.
The release contains many other improvements. Besides the usual improvements to widgets, we have also some changes specific to the C++ or Java versions:
Wt (C++): This version comes with many reorganizations, including a more flexible (and useful) logging system, deferred response rendering, new template features and other additions including a Firebird backend for Wt::Dbo. We have also bumped our WebSockets implementation in the built-in httpd server to include support for the newest draft specifications of the protocol.
JWt (Java): We have now implemented logging within the library using SLF4J, which allows you to plug the JWt logging into your own logging framework of choice. In this version, we have also cleaned up the servlet-2.5 versus servlet-3.0 support: the same JWt application can now be deployed in a Servlet 2.5 or Servlet 3.0 container. When deployed in a Servlet 3.0 container, async support may be enabled and this will be used to implement server push in a more scalable way. JWt is now also available in the central Maven repository.
Great framework!
Thank you! | http://www.webtoolkit.eu/wt/blog/2011/11/29/wt___jwt_3_2_0/ | CC-MAIN-2013-20 | refinedweb | 829 | 51.48 |
Building Chatbots using Python — Part 0
In this blog, we will learn how to build our first chatbot. After gaining a bit of historical context, we will set up a basic structure for receiving text and responding to users, and then learn how to add the basic elements of personality. And finally, we will learn to build a rule-based system for parsing text.
When you build a chatbot, it is necessary to understand what chatbots do and what it looks like. We have heard of Google Allo, Siri, IBM Watson, etc. The fundamental problem that these bots try to solve is to become an intermediary and help users become more productive. They do this by allowing the user to worry less about how the information will be retrieved, and the input format needed to attain specific data. Bots tend to become more intelligent as they handle user data input and gain more insights. Chatbots are successful because they give you precisely what you want.
A brief history of Chatbot
Conversational software, commonly known as ‘Chatbot,’ is not a new concept! Chatbot development is way more comfortable than it was a few years ago, but chatbots did exist decades ago. However, the popularity of chatbots has increased exponentially in the last few years.
Command-line applications (Console applications) were introduced in the 1960s with the keyboard+video screen terminal. We need to type instructions using a rigorous syntax for using a command-line app, but it is much closer to human language than the underlying machine instructions.
In 1966, ELIZA, the first Chatbot, was created. This now-famous program was able to hold a conversation by using a pattern-matching and substitution technique. Despite the relatively simple code behind ELIZA, it was a pretty compelling conversationalist. In this blog post, we will build our minimal version of the ELIZA chatbot, which will lay the foundation for making some more complex chatbots.
EchoBot
Let us begin with a simple task by building a bot called EchoBot. It merely echoes back to you whatever you say to it. Initially, all the bots that we will make in this blog series will receive messages in python code and print their responses. Later, we will learn to connect our bots to various messaging apps.
To build an EchoBot, we define a ‘respond’ function, which takes a message as an argument and returns an appropriate response.
bot_template = "BOT : {0}"
user_template = "USER : {0}"# Define a function that responds to a user's message: responddef respond(message):# concatenate the user's message to the end of a standard botrespone bot_message = "I can hear you! You said: " + message# Return the result return bot_message# Test functionprint(respond("hello!"))
Here we define a function using the keyword ‘def,’ then the name of the function, then its arguments in parentheses, and then a colon. The body of the function is indented by one level. We specify the output generated by the function using the ‘return’ keyword. If a function doesn’t have a ‘return’ statement, it returns a ‘None’ type.
# Create templates
bot_template = "BOT : {0}"
user_template = "USER : {0}"# Define a function that sends a message to the bot: send_messagedef send_message(message):# Print user_template including the user_message print(user_template.format(message))# Get the bot's response to the message response = respond(message)# Print the bot template including the bot's response. print(bot_template.format(response))
# Send a message to the bot
send_message("hello")
We can insert variables into a string in Python by using the string’s ‘format’ method. Inside the respond function is a string containing curly brackets. These act as placeholders, and will get replaced by the value of the argument we pass when we call ‘format.’ To keep track of everything that’s being said, we’ll define another function called ‘send_message’ that prints what the user just said, gets the response by calling the respond function, and then prints the bot’s response.
Creating a personality
Creating an engaging personality is a critical part of chatbot development. It’s one of the key differences as compared to any other kind of software.
Why creating a personality for the Chatbot is so essential? — Let us suppose, with our Chatbot, all we could do was type precise instructions to our bot. We would just have a command-line application and not a chatbot.
Most chatbots are rooted in a messaging app that people are comfortable using to talk to their friends. And we can expect that the users of our will want to make a bit of smalltalk before trying out any functionality that they came for. It’s not much effort to code up some responses to common questions and is worth it for the improved user experience.
Smalltalk and Including variables
# Define variables
name = "Shrusti"
weather = "sunny"# Define a dictionary with the predefined responsesresponses = {"what's your name?": "my name is {0}".format(name),"what's today's weather?": "the weather is {0}".format(weather),"default": "default message"}# Return the matching response if there is one, default otherwisedef respond(message):# Check if the message is in the responses if message in responses:# Return the matching message bot_message = responses[message] else:# Return the "default" message bot_message = responses["default"] return bot_message
The simplest thing we can do is use a python dictionary, with user messages as the keys and responses as the values. For example, say we define a dictionary called ‘responses,’ with the messages “what’s your name?” and “what’s today’s weather” as keys, and suitable responses as values. Next, we define a function called ‘respond,’ which accepts a message as a single argument. This function tests if a message has a defined response by using the ‘in’ keyword, that is, “if message in responses.” This statement only returns ‘True’ if the message corresponds to one of the dictionary’s keys. Notice that this will only work if the user’s message exactly matches a key in the dictionary. In later parts of this blog, we will build much more robust solutions. Notice that if there isn’t a matching message, the ‘return’ keyword will never be reached so that the function will return None.
Since the world outside is always changing, our bot’s answers have to be able to as well. The first thing that we can do is add some placeholders to the responses. For example, instead of “The weather is sunny,” you can have a template string, like “it’s {} today.” Then later, you can insert a variable ‘weather_today’ by calling format weather today.
Choosing responses
# Import the random module
import randomname = "Shrusti"
weather = "sunny"# Define a dictionary containing a list of responses for each messageresponses = {"what's your name?": ["my name is {0}".format(name),"they call me {0}".format(name),"I go by {0}".format(name)],"what's today's weather?": ["the weather is {0}".format(weather),"it's {0} today".format(weather)],"default": ["default message"]}
# Use random.choice() to choose a matching responsedef respond(message): if message in responses: bot_message = random.choice(responses[message]) else: bot_message = random.choice(responses["default"]) return bot_message
It gets dull hearing the same responses over and over again, so it’s an excellent idea to add a little variety! To return completely different responses, we can replace the values in the responses dictionary with lists. Then when we are choosing a response, we can randomly select an answer from the appropriate list. To do this, import random, and use the ‘random.choice’ function, passing the list of options as an argument. For now, we are still relying on the user message matching our predefined messages exactly, but we’ll soon move to a more robust approach.
Asking questions
import randomresponses = {"question": ["I don't know :(","you tell me!"],"statement": ["can you back that up?","tell me more!","oh wow!",":)","how long have you felt this way?","I find that extremely interesting","why do you think that?"]}
def respond(message):# Check for a question mark if message.endswith("?"):# Return a random question return random.choice(responses["question"])# Return a random statement return random.choice(responses["statement"])# Send messages ending in a question marksend_message("what's today's weather?")send_message("what's today's weather?")
# Send messages which don't end with a question marksend_message("I love building chatbots")send_message("I love building chatbots")
A great way to keep users engaged is to ask them questions or invite them to go into more detail. This was actually one of the things which made the ELIZA bot, so fun to talk to. Instead of using a bland default message like “I’m sorry, I didn’t understand you,” you can use some phrases that invite further conversation. Questions are a great way to achieve this. “Why do you think that?”, “How long have you felt this way?”, and “Tell me more!” are appropriate responses to many different kinds of message, and even when they don’t quite match are more entertaining than a boring fallback
Text processing with regular expressions
Regular expressions are a very useful tool for processing text. We will use them to match messages against known patterns, extract key phrases, and transform sentences grammatically. These are the core pieces we need to create our ELIZA style bot.
The regex behind ELIZA
Much of the ELIZA system’s magic relied on giving the impression that the bot had understood you, even though the underlying logic was extremely simple.
For example, asking ELIZA, “do you remember when you ate strawberries in the garden?” ELIZA would respond: “How could I forget when I ate strawberries in the garden?”. Part of what makes this example so compelling is the subject. We are asking about memories, which we associate with our conscious minds and our sense of self. The memory itself, of eating strawberries in the garden, invokes powerful emotions. But if we pick apart how the response is generated, we see that it’s quite simple.
Pattern matching and Extracting keyphrases
To build an ELIZA-like system, we need a few key components. The first is a simple pattern matcher. This consists of rules for matching user messages, like “do you remember x” To match patterns we use regular expressions. To use these in Python, we ‘import re’ Regular expressions are a way to define patterns of characters and then seeing if those patterns occur in a string. In regular expressions, the dot character is special and matches any character. The asterisk means “match 0 or more occurrences of this pattern”, so “dot star” matches any string of characters.
Adding parentheses in the pattern string defines a ‘group’. A group is just a substring that we can retrieve after matching the string against the pattern. We use the match object’s ‘group’ method to retrieve the parts of the string that matched. The default group, with index 0, is the whole string. The group with index one is the group we defined by including the parentheses in the pattern.
import re
import random
rules = {'do you think (.*)': ['if {0}? Absolutely.','No chance'],'do you remember (.*)': ['Did you think I would forget {0}',"Why haven't you been able to forget {0}",'What about {0}', 'Yes .. and?'],'I want (.*)': ['What would it mean if you got {0}','Why do you want {0}',"What's stopping you from getting {0}"],'if (.*)': ["Do you really think it's likely that {0}",'Do you wish that {0}','What do you think about {0}','Really--if {0}']}# Define match_rule()def match_rule(rules, message): response, phrase = "default", None# Iterate over the rules dictionary for pattern, responses in rules.items():# Create a match object match = re.search(pattern, message) if match is not None:# Choose a random response response = random.choice(responses) if '{0}' in response: phrase = match.group(1)# Return the response and phrase return response.format(phrase)# Test match_ruleprint(match_rule(rules, "do you remember your last birthday"))
Grammatical transformation
To make responses grammatically coherent, we will want to transform the extracted phrases from first to second person and vice versa. In English, conjugating verbs is easy, and simply swapping “I” and “you,” “my,” and “your” works in most cases. We can use another function from the ‘re’ module for this: ‘re.sub’. This substitutes patterns in a string. For example, take the sentence “I walk my dog”. re.sub “You walk your dog.”
# Define replace_pronouns()def replace_pronouns(message): message = message.lower() if 'me' in message:# Replace 'me' with 'you' return re.sub('me', 'you', message) if 'my' in message:# Replace 'my' with 'your' return re.sub('my', 'your', message) if 'your' in message:# Replace 'your' with 'my' return re.sub('your', 'my', message) if 'you' in message:# Replace 'you' with 'me' return re.sub('you', 'me', message) return message
print(replace_pronouns("my last birthday"))print(replace_pronouns("when you went to Florida"))print(replace_pronouns("I had my own castle"))
Putting it all together
The final step is to combine these logical pieces together. We start with a pattern and a message. We extract the key phrase by creating a match object using pattern dot search and then use the group method to extract the string represented by the parentheses. We then choose a response appropriate to this pattern and swap the pronouns so that the phrase makes sense when the bot says it.
We then insert the extracted phrase into the response to partially echo back what the user talked about, giving the illusion that the bot has understood the question and remembers this experience.
# Define respond()def respond(message):# Call match_rule response = match_rule(rules, message) if '{0}' in response:# Replace the pronouns in the phrase phrase = replace_pronouns(phrase)# Include the phrase in the response response = response.format(phrase) return response# Send the messagessend_message("do you remember your last birthday")send_message("do you think humans should be worried about AI")send_message("I want a robot friend")send_message("what if you could be anything you wanted")
We learned how to code a simple chatbot like EchoBot and ELIZA. In this series further, we will learn to make more complex chatbots. | https://shrustighela.medium.com/building-chatbots-using-python-part-i-84bf34b29cad?source=post_internal_links---------6---------------------------- | CC-MAIN-2021-21 | refinedweb | 2,344 | 64.41 |
** Some details below of the definition of α are wrong.**
Let E be a non-CM elliptic curve over Q.
Let d>2 be an odd positive integer.
Let χ vary over Dirichlet characters of order d whose conductor m is coprime to the conductor N of E.
We have L(E,χ,1)=τ(χ)1⋅a∈(Z/mZ)∗∑χ(a)⋅⟨ma⟩E± where ± is the sign of χ, τ(χ) is the Gauss sum, and ⟨ma⟩E±=πi(∫i∞rfdz±∫i∞−rfdz) is the ± period mapping.
To make things very concrete we assume that m is prime. This is not necessary.
Let G denote the quotient of (Z/mZ)∗ of order d, so we have an exact sequence 1→H→(Z/mZ)∗→G→1 where H is the unique subgroup of (Z/mZ)∗ of order n=φ(m)/d.
Choose a generator h∈(Z/mZ)∗, i.e., any element of φ(m) of order φ(m)/d, so H=⟨h⟩.
Choose b∈(Z/mZ)∗ of order φ(m), and write (Z/mZ)∗=Hb0∪Hb1⋯∪Hbd−1(disjoint union)
Since χ(H)={1}, we have L(E,χ,1)=τ(χ)1⋅i=0∑d−1(χ(bi)j=0∑n−1⟨mbihj⟩E±)
Fix ωE± so that ⟨ma⟩E± is an algebraic multiple of ωE± (so, e.g., ωE± might just be the least real or imaginary period of E). The rational period mapping is [ma]E±=ωE±⟨ma⟩E±∈Q.
L(E,χ,1)=τ(χ)ωE±⋅i=0∑d−1(χ(bi)j=0∑n−1[mbihj]E±)
For i=0,1,…,2d−1, let αm±(i)=φ(m)log(m)1⋅j=0∑n−1[mN(d−1)/2bihj]E±∈R.
The distribution ΛE,d is the distribution of real numbers αm(i), where we vary over all m and i>0. More concretely, for each integer m coprime to NE such that d∣φ(m), compute the d real numbers αm(i) and add them to our set of values. The distribution ΛE,d is then the result of doing this as m goes to ∞.
NOTE: The term αm(0) is the sensitive theta coefficient.
Regarding complexity the work in doing this computation is the work of computing the rational numbers [a/m]E± for all a. It's the same bottlekneck that goes into approximating p-adic L-series using the classical Riemann sums algorithm. The code in Sage for this is fairly slow, but I have some fast code in psage, which I used for some papers on p-adic L-series.
In terms of Sage, the
rational_period_mapping
method on a modular symbols space computes
a choice of [a/m]E±:
M = ModularSymbols(11,sign=1).cuspidal_submodule() N = M.level() f = M.rational_period_mapping() f([oo, 1/11]) # a/m = 1/11
d = 3 ms = [m for m in prime_range(2000) if gcd(m, 11) == 1 and euler_phi(m) % d == 0 and m%2==1] print(ms)
def alphas(m, d, normalize=True): assert d%2 == 1 R = Integers(m) Npow = R(N)^((d-1)//2) gen = R(primitive_root(m)) n = euler_phi(m)//d b = gen h = gen^d if normalize: denom = float(sqrt(euler_phi(m)*log(m))) else: denom = 1 alphas = [] for i in range(1, (d-1)//2 + 1): s = 0 for j in range(n): symb = [oo, (Npow * b^i * h^j).lift() / ZZ(m)] period = f(symb)[0] s += period alphas.append(s / denom) return alphas
print ms[0] alphas(ms[0], d, normalize=False)
alphas(37, d, normalize=False)
for i in range(10): print ms[i], alphas(ms[i], d, false)
data = [] for m in ms: data += alphas(m, d)
len(data)
stats.TimeSeries(data).plot_histogram(bins=30)
# More data... ms2 = [m for m in prime_range(2000,3000) if gcd(m, 11) == 1 and euler_phi(m) % d == 0 and m%2==1] for m in ms2: data += alphas(m, d)
t = stats.TimeSeries(data) t.plot_histogram(bins=30)
t.plot_histogram(bins=100)
print t.mean(), t.standard_deviation()
stats.TimeSeries(data).plot()
d = 29 ms = [m for m in prime_range(3,5000) if gcd(m, 11) == 1 and euler_phi(m) % d == 0] print(ms)
print alphas(ms[0], d)
data = [] for m in ms: data += alphas(m, d)
print len(data) t = stats.TimeSeries(data) print t.mean() t.plot_histogram(bins=100)
t.plot()
stats.TimeSeries(t[:i].mean() for i in range(5,len(t))).plot(gridlines='minor') | https://share.cocalc.com/share/97bd8410dbf257b01b754f2de67afd3ac81e8410/code/11a.ipynb?viewer=share | CC-MAIN-2020-16 | refinedweb | 741 | 64.51 |
Redux-saga like process manager for Dart.
This library supports communication pattern between isolates through 'cannel'.
Note: This package is still under development, and many of functionality might not be available yet. Feedback and Pull Requests are most welcome!
import "dart:async"; import 'package:dart_saga/dart_saga.dart'; rootSaga([msg, greeting]) async* { print("rootSaga(${msg}) started greeting: ${greeting}"); Completer<int> saga2handle = new Completer(); yield fork(saga2, params: ["start saga2"], completer: saga2handle); for (int i = 0; i < 10; i++) { yield wait(1); if (i == 5) { yield cancel(await saga2handle.future); } } } saga2([msg]) async* { print(" saga2(${msg}) started"); Completer<int> saga3handle; yield fork(saga3, params: ["start saga3"], completer: saga3handle); for (int i = 0; true; i++) { print(" saga2"); yield wait(1); yield put(Action("HOGE", "From saga2")); if (i == 3) { yield cancel(await saga3handle.future); } } } saga3([msg]) async* { print(" saga3(${msg}) started"); while (true) { print(" saga3"); Completer takenAction = new Completer(); yield take("HOGE", completer: takenAction); print(" taken ${await takenAction.future}"); } } main() { var effectManager = new EffectManager(); effectManager.run(rootSaga, ["start rootSaga", "hello"]); }
% pub run example/simple_demo.dart start _isolate context Task.start 0 rootSaga(start rootSaga) started greeting: hello Task.start 1 saga2(start saga2) started saga2 Task.start 2 saga3(start saga3) started saga3 saga2 taken Action(HOGE, From saga2) saga3 saga2 taken Action(HOGE, From saga2) saga3 saga2 taken Action(HOGE, From saga2) saga3 Task(taskId=2) terminated: null. Task(taskId=1) terminated: null. Task(taskId=0) terminated: null.
Add this to your package's pubspec.yaml file:
dependencies: dart_saga: ^0_saga/dart_saga.dart';
We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, other
Primary library:
package:dart_saga/dart_saga.dartwith components:
isolate.
Document public APIs (-10 points)
50 out of 50 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.
Fix
lib/dart_saga.dart. (-3.45 points)
Analysis of
lib/dart_saga.dart reported 7 hints, including:
line 18 col 7: Name types using UpperCamelCase.
line 22 col 7: Name types using UpperCamelCase.
line 26 col 7: Name types using UpperCamelCase.
line 30 col 7: Name types using UpperCamelCase.
line 35 col 7: Name types using UpperCamelCase.
Maintain
CHANGELOG.md. (-20 points)
Changelog entries help clients to follow the progress in your code.
dart_saga.dart. Packages with multiple examples should use
example/readme.md. | https://pub.dartlang.org/packages/dart_saga | CC-MAIN-2018-51 | refinedweb | 398 | 51.95 |
This is the mail archive of the [email protected] mailing list for the Java project.
Rui Wang writes: > Hi, > > I did a simple test to analyse the speed impact of using GCJ between > java bytecode and native machine code. > But the result looks not very promising, the data below shows that there > is rather large decrease of speed instead of increase. > I couldn't figure out why, any suggestions are appreciated. We can't figure out why either, becasue your test uses the files task.test, servers.d, and result.d, none of which you provided. > For Impl.java > public class Impl implements IFace { > public Impl(){ > } It's quite possible that an optimizing compiler will be able to figure out that this is not really a loop: > public int ping(int i, int j) { > int count= 0; > for(int n = 0 ; n < i*j; n++) > count++; > return count; > } > } Andrew. | http://gcc.gnu.org/ml/java/2006-02/msg00094.html | CC-MAIN-2017-30 | refinedweb | 151 | 72.87 |
The QtPieMenu class provides a pie menu popup widget. More...
#include <qtpiemenu.h>
List of all member functions.
The QtPieMenu class provides a pie menu popup widget.
A pie menu is a popup menu that is usually invoked as a context menu, and that supports several forms of navigation.
Using conventional navigation, menu items can be highlighted simply by moving the mouse over them, or by single-clicking them, or by using the keyboard's arrow keys. Menu items can be chosen (invoking a submenu or the menu item's action), by clicking a highlighted menu item, or by pressing \key{Enter}.
Pie menus can also be navigated using gestures. Gesture navigation is where a menu item is chosen as the result of moving the mouse in a particular sequence of movements, for example, up-left-down, without the user having to actually read the menu item text.
The user can cancel a pie menu in the conventional way by clicking outside of the pie menu, or by clicking the center of the pie (the "cancel zone"), or by pressing \key{Esc}.
Pie menus are faster to navigate with the mouse than conventional menus because all the menu items are available at an equal distance from the origin of the mouse pointer.
The circular layout and the length of the longest menu text imposes a natural limit on how many items can be displayed at a time. For this reason, submenus are very commonly used.
Use popup() to pop up the pie menu. Note that QtPieMenu is different from QPopupMenu in that it pops up with the mouse cursor in the center of the menu (i.e. over the cancel zone), instead of having the cursor at the top left corner.
Pie menus can only be used as popup menus; they cannot be used as normal widgets.
A pie menu contains of a list of items, where each item is displayed as a slice of a pie. Items are added with insertItem(), and are displayed with a richtext text label, an icon or with both. The items are laid out automatically, starting from the top at index 0 and going counter clockwise. Each item can either pop up a submenu, or perform an action when activated. To get an item at a particular position, use itemAt().
When inserting action items, you specify a receiver and a slot. The slot is invoked in the receiver when the action is activated. In the following example, a pie menu is created with three items: "Open" and "Close" are actions, and "New" pops up a submenu. The submenu has two items, "New project" and "New dialog", which are both actions.
Editor::Editor(QWidget *parent, const char *name) : QTextEdit(parent, name) { // Create a root menu and insert two action items. QtPieMenu *rootMenu = new QtPieMenu(tr("Root menu"), this); rootMenu->insertItem(tr("Open"), storage, SLOT(open())); rootMenu->insertItem(tr("<i>Close</i>"), storage, SLOT(close()); // Now create a submenu and insert two action items. QtPieMenu *subMenu = new QtPieMenu(tr("New"), rootMenu); subMenu->insertItem(tr("New project"), formEditor, SLOT(newProject())); subMenu->insertItem(tr("New dialog"), formEditor, SLOT(newDialog())); // Finally add the submenu to the root menu. rootMenu->insertItem(subMenu); }
By default, each slice of the pie takes up an equal amount of space. Sometimes it can be useful to have certain slices take up more space than others. QtPieItem::setItemWeight() changes an item's space weighting, which by default is 1. QtPieMenu uses the weightings when laying out the pie slices. Each slice gets a share of the size proportional to its weight.
At the center of a pie menu is a cancel zone, which cancels the menu if the user clicks in it. The radius of the whole pie menu and of the cancel zone are set in the constructor, or with setOuterRadius() and setInnerRadius().
Any shape or layout of items is possible by subclassing QtPieMenu and reimplementing paintEvent(), indexAt(), generateMask() and reposition().
See also
This enum describes the reason for the activation of an item in a pie menu.
See also activateItem().
If this pie menu is a submenu, the richtext text argument is displayed by its parent menu.
The parent and name arguments are passed on to QWidget's constructor.
If this pie menu is a submenu, the icon argument is displayed by its parent menu.
The parent and name arguments are passed on to QWidget's constructor.
If this pie menu is a submenu, the icon and richtext text arguments are displayed by its parent menu.
The parent and name arguments are passed on to QWidget's constructor.
This signal is emitted just before the pie menu is hidden after it has been displayed.
Warning: Do not open a widget in a slot connected to this signal.
See also aboutToShow(), insertItem(), and removeItemAt().
This signal is emitted just before the pie menu is displayed. You can connect it to any slot that sets up the menu contents (e.g. to ensure that the correct items are enabled).
See also aboutToHide(), insertItem(), and removeItemAt().
See also QtPieMenu::ActivateReason.
This signal is emitted when a pie menu action item is activated, causing the popup menu to hide. It is used internally by QtPieMenu. Most users will find activated(int) more useful.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
This signal is emitted when the action item at index position i in the pie menu's list of menu items is activated.
See also highlighted().
This signal is emitted when the pie menu is canceled. Only the menu that emits this signal is canceled; any parent menus are still shown.
See also canceledAll().
This signal is emitted when the pie menu is canceled in such a way that the entire menu (including submenus) hides. For example, this would happen if the user clicked somewhere outside all the pie menus.
See also canceled().
When subclassing QtPieMenu, this function should be reimplemented if the shape of the new menu is different from QtPieMenu's shape.
Example: ../hexagon/hexagonpie.cpp.
This signal is emitted when the item at index position i in the pie menu's list of menu items is highlighted.
See also activated().
This function is reimplemented if a subclass of QtPieMenu provides a new item layout.
Returns the inner radius of the pie menu. See the "innerRadius" property for details.
QIconSet icon(QPixmap("save.png")); rootMenu->insertItem(icon, this, SLOT(save()));
The items are ordered by their ordinal position, starting from the top of the pie and going counter clockwise.
Examples: ../editor/editor.cpp and ../hexagon/main.cpp.
Adds an action item to this pie menu at position index. The text is used as the item's text, or the text that is displayed on this item's slice in the pie. The receiver gets notified through the signal or slot in member when the item is activated.
rootMenu->insertItem("Save", this, SLOT(save()));
The items are ordered by their ordinal position, starting from the top of the pie and going counter clockwise.
Adds an action item to this pie menu at position index. The icons and text are used as the item's text and icon, or the text and icon that is displayed on this item's slice in the pie. The receiver gets notified through the signal or slot in member when the item is activated.
QIconSet icon(QPixmap("save.png")); rootMenu->insertItem(icon, "Save", this, SLOT(save()));
The items are ordered by their ordinal position, starting from the top of the pie and going counter clockwise.
Adds the submenu item to this pie menu at position index. The items are ordered by their ordinal position, starting from the top of the pie and counting counter clockwise.
QtPieMenu *subMenu = new QtPieMenu("<i>Undo</i>", this, SLOT(undo())); rootMenu->insertItem(subMenu);
See also setItemEnabled().
See also setItemIcon() and itemText().
See also setItemText().
See also setItemWeight().
Returns the outer radius of the pie menu. See the "outerRadius" property for details.
To translate a widget's contents coordinates into global coordinates, use QWidget::mapToGlobal().
Examples: ../editor/editor.cpp and ../hexagon/main.cpp.
The default implementation does nothing.
Example: ../hexagon/hexagonpie.cpp.
Sets the inner radius of the pie menu to r. See the "innerRadius" property for details.
See also isItemEnabled().
Example: ../editor/editor.cpp.
See also itemIcon() and setItemText().
pieMenu->setItemText("<i>Undo</i>", 0);
See also itemText() and itemIcon().
The pie menu in this image has three pie menu items with icons and no text. The item at position 0 has a weight of 2, and the rest have the default weight of 1.
See also itemWeight().
Example: ../editor/editor.cpp.
Sets the outer radius of the pie menu to r. See the "outerRadius" property for details.
Examples: ../hexagon/hexagonpie.cpp and ../hexagon/main.cpp.
This property holds the inner radius of the pie menu.
The radius in pixels of the cancel zone (in the center) of the pie menu. Setting the radius to 0 disables the cancel zone.
See also outerRadius.
Set this property's value with setInnerRadius() and get this property's value with innerRadius().
This property holds the outer radius of the pie menu.
The outer radius of the pie menu in pixels.
See also innerRadius.
Set this property's value with setOuterRadius() and get this property's value with outerRadius().
This file is part of the Qt Solutions. | http://doc.trolltech.com/solutions/3/qtpiemenu/qtpiemenu.html | crawl-003 | refinedweb | 1,566 | 66.44 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.