Stagflation is Back
Inflation over the last 12 months at 9.8%
I've discussed the falling value of the dollar on this blog before. Well, the numbers are in and your dollar will buy 9.8% less than it did one year ago. Some of this is due to the rising cost of energy, but even with energy factored out of the equation your dollar is worth much less than it was a year ago.
Why is it worth less than it was a year ago? There are really three reason for this outside of the rising cost of energy, the current account deficit, the federal budget deficit, and intervention by the Federal Reserve. The current account deficit is still at roughly $700 billion. This means that more and more dollars are being pumped overseas reducing the value of our currency and our ability to afford products produced overseas. The budget deficit means that those dollars being pumped overseas are not being invested in domestic firms increasing our GDP, but instead are being used to cover our spending on defense and social programs. The federal reserve has reacted to our slumping economy by devaluing our currency through increasing the money supply. These three come together to reduce your standard of living.
I would like to say that these problems are short term and will be resolved over the next few years, but that just isn't the case. Both of the major parties presidential candidates are intent upon increasing government spending faster than increasing revenues. So the national debt will continue to grow and require foreign financing. The falling currency will help our trade imbalance, but the increased price of oil will quite probably negate that effect. The Federal Reserve and fiat money are here to stay, so we can expect to see the money supply continue to grow to help finance our debt.
The end result of all this is that our children will have a lower standard of living than we do.
If we continue on our path of asking government to solve our economic problems, this will lead to government taking on more and more responsibilities. Health care is already government run, in large part, through Medicaid. The proportion of our health care spending handled by government will quite probably grow during the next presidential term.
As the government takes on a larger an larger role in our economy we can only expect these problems to get worse. Our national debt will continue to grow. Our growth in GDP will reduce to levels closer to that of our European neighbors.
These problems are all the result of choices by the American electorate. One of the problems with modern democracy is that we demand that government do too much. We ask it to solve every problem we have in our lives. Unfortunately we are forcing our children to pay for our irresponsibility.
NewsNet
Source code
Well, I'm just getting started on this project and it will probably be quite some time before it is really usable, but it never hurts to make source code available. The code can be found at:
git://squeakydolphin.com/NewsNet
I haven't put the licensing on it yet, but you can assume that it is GPL'd. I'll mark the source to indicate that within the next few days.
At this point it isn't really usable, but if you are interested, and have feedback, suggestions, or patches, please don't hesitate to contact me.
Simple Parser in JavaCC
I've pretty much decided to write an improved NNTP server for USENET that includes a number of features that USENET really requires. Basically the idea is to improve USENET. I don't know that I'll be successful in this attempt, but I'm going to write the code anyway.
I'm just getting started in this endeavor and the first step is to write an NNTP server that doesn't contain any extensions and follows the specification well. I've started on this task and it became time to refactor the NNTP command parser to something a little more generic.
I asked on USENET for suggestions on which parser generator to use and JavaCC is the one that seemed to be the most popular. To get started I wrote a grammar that only accepted four commands; HELP, POST, GROUP, and ARTICLE. Only the message ID version of ARTICLE was accepted. This grammar doesn't really do anything useful yet, but I thought it might be useful to people working to implement simple grammars in JavaCC.
The biggest problem was recovering from an error. There are really two parts to this. The first is to make sure that your grammar matches any input that comes in. That is done in my grammar using the CATCH_ALL token. This will prevent any TokenMgrError from being thrown. The second step is to catch the ParseExcpetion when it is thrown and to do something useful. In my grammar, we just throw out everything up to the new line and then continue parsing. I think this is probably how many people would like their parsers to work.
You might notice the JAVACODE non-terminal and wonder why I didn't just use a regular empty non-terminal. As it turns out, JavaCC doesn't like it when you do this. By using the JAVACODE statement certain sanity checks in JavaCC are turned off and then everything starts working correctly. Thanks go to Jonathan Revusky for this.
I hope this code is useful to you. If you have any questions I recommend the mailing list that can also be accessed on the Gmane USENET news server at news.gmane.org.
options {
STATIC = false;
IGNORE_CASE = true;
}
PARSER_BEGIN(NNTPParser)
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class NNTPParser {
public static void main(String[] args) throws
ParseException,IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader (System.in));
NNTPParser parser = new NNTPParser(reader);
parser.start();
}
}
PARSER_END(NNTPParser)
SKIP : { " " | "\t" }
TOKEN : {
<HELP_CMD: "HELP" >
| <GROUP_CMD: "GROUP" >
| <ARTICLE_CMD: "ARTICLE" >
| <POST_CMD: "POST" >
| <MSG_ID: "<"((["a"-"z","_", "@"])*".")*(["a"-"z"])*">" >
| <GROUP: ((["a"-"z"])*".")*(["a"-"z"])+ >
| <LINE_END: "\n" | "\r\n" >
| <CATCH_ALL: ~[] >
}
void start() throws IOException :
{
Token t;
}
{
(
try {
<HELP_CMD> <LINE_END>
{ System.out.println("HELP"); }
| <POST_CMD> <LINE_END>
{ System.out.println("POST");
| <GROUP_CMD> t = <GROUP> <LINE_END>
{ System.out.println("GROUP " + t.image); }
| <ARTICLE_CMD> t = <MSG_ID> <LINE_END>
{ System.out.println("ARTICLE " + t.image.substring(1, t.image.length() - 1)); }
| oops()
}
catch (ParseException ex) {
boolean errorSent = false;
do {
t = getNextToken();
if (! errorSent && t.kind != EOF) {
System.out.println("Syntax Error");
errorSent = true;
}
} while (t.kind != LINE_END && t.kind != EOF);
if (t.kind == EOF) {
return;
}
}
)*
}
JAVACODE
void oops() {
throw new ParseException("Oops");
}