# JavaHelp for Clojure

To get everything working in clojure a few modifications need to be performed. First in project.clj you must add javahelp as a dependency, and indicate the resource path where you will store the helpset. By default leinengen will create a MyProject/resources directory and I placed my helpset in a subdirectory there:

In core I only show some of the required namespace additions and the menu entries.

I have 2 dummy variables in there so I can use the let expression, but I could rearrange using doto:

I prefer the let method. Though it has those messy dummy variables, I can more clearly decipher what is going on.
Code available on github

Share

# A JavaHelp Class

With my helpset prepared as described in the last post I am ready to launch the javahelp viewer.

Given the opacity of the api pdf files, I decided that I needed to first implement a Java class that would open a help dialog. Once I have defined the required methods, it will be easier to recode in Clojure. It has been >10 years since I last thought about Java code so getting back in the swing (hah!) won’t be easy. When I last worked with the language generics and enums were yet to be defined.

I call my class OpenHelpDialog and don’t bother putting it in a package.

I navigate to its directory which is “/home/mbc/plate-manager/jws/pm/pmhelpclasses” and:

Note that I include the helpset directory in the classpath, as well as the helpclasses. Then run:

Looks good. By default a MainWindow is displayed.

From the api pdf it looks like the main function of the HelpBroker is to enable objects (menu items, buttons, etc.) with the ability to launch the help viewer when a HelpActionListener is activated. Looking through the methods on HelpBroker I see hb.setDisplayed(true), which allows me to launch the viewer directly. A prior version of OpenHelpDialog had a button that was activated with the HelpBroker.enableHelpOnButton() method. If I were writing in Java, that may be the preferred method, but I was uncertain how to utilize the HelpBroker that way in Clojure, given that I have another layer of abstraction between clojure and java - the seesaw gui classes.

Share

# jhelpdev

## Preparing the Helpset

A helpset is a set of html and xml files that work together to provide a help system. Getting the layout correct is tedious but jhelpdev automates a lot of the process. The best place to start is generate a project so that you can see what the html template looks like, and start populating the system with explanatory html help files.

I want to get the help system up and running early in the development process because I find the help files are a good place to take notes and narrate to myself the processes that my application should be handling. Once I have a skeleton helpset, it is easy to add information as the coding project progresses. At any point I can delete the xml files (not the htmls!!) and regenerate the helpsystem with jhelpdev.

Tp get jhelpdev running, navigate to its directory and:

Here is what the interface looks like when a few html files have been added to the helpset directory:

Map.jhm provides a mapping between target and html file.
HelpTOC.xml proves text for TOC and mapping to target (a name).

Note the disclaimer in the jhelpdev help:

“You acknowledge that this software is not designed, licensed or
intended for use in the design, construction, operation or
maintenance of any nuclear facility.”

Code with caution.

Once your helpset is in shape you can use hsviewer.jar to view in the standard javahelp MainWindow. This is a good test to make sure all is working.

Share

# Introduction

I would like to author a help file for my Plate Manager clojure application. I queried the Clojure google group but did not get any response as to which options might be viable. About 15 years ago I used JavaHelp for a java application I wrote. Given that clojure runs on top of java, I considered JavaHelp as an option.

The most recent update to javahelp, v2.0.05, appears to have been last updated in 2010. Maybe a cause for concern, but how much innovation would one expect in the help space anyway? As long as it works I’ll give it a try. Reading through the APIs pdf, I see mentioned multiple other help systems/companies, all which appear to be defunct when I try to click through. Javahelp may be the only option.

JavaHelp help files are written in html. There are additional XML files that organize headings, table of content, search, context sensitive help, etc. It is not as slick as I remmber the old Windows 3.1 help files to be, but is cross platform and quite flexible. Here is a view of the MainWindow interface. It also has a popup window without multiple frames and buttons, as well as tooltip help.

After a bit of hacking, I conclude that JavaHelp will work and is best implemented in three steps, for which I will generate three posts:

• Generate html help files using jhelpdev
• Use java to test and learn which javahelp methods are needed
• Translate to clojure

It does not seem like Oracle is forthcoming with information on javahelp. I had to poke around and ultimately downloaded api files from other sites. I have collected them on my git site for you to retrieve.

Share

# Own vs. Share

Today is the 3 year anniversary of the purchase of our 2013 Ford Explorer XLT. Purchased at two years old, 30,000 miles for \$28,050, it originally sold for \$38,000. The original owner suffered about \$5000/year depreciation. Currently with 47,000 miles it is valued at \$16,380 by KBB, bringing my depreciation costs to about $4000/year over 3 years. In addition to depreciation I have spent \$1080 on repairs and service which included replacing brakes and rotors and an expensive (500+) routine service (Service level C?). Works out to a yearly average of about \$350. Total expenses: Item$/year
Depreciation 4000
registration 30
inspection 35
insurance 1180
repairs and routine service 350
Total 5600

By far the biggest expense is depreciation. What if you own a higher quality vehicle? We also have a 2005 Lexus LS430, possibly the most reliable car on the road. Original purchase price ~\$66,000, now worth ~\$12,000 (49,000 miles) for an average depreciation cost of ~\$4100 over 13 years. Not any better. And the Lexus is expensive to insure and repair, How does this compare to car sharing? I looked up the cost of a family friendly SUV on Turo. Ford Explorers were in the mix and the typical cost was \$80-100 per day. Let’s say \$100 per day, that would allow 56 one day rentals before breaking even with owning. Sounds compelling given that we only use the Ford for long distance travel when vacationing. Convenience is the other consideration. Sharing/renting is a hassle, having to pick up and return the vehicle, deal with paperwork etc. It is a great convenience to just walk out the door and have a vehicle at your disposal. But clearly that convenience comes at a price. There are inconveniences to owning too - repairs, service, inspection, cleaning etc. Maybe it’s a wash. Another option is to own and share to reduce cost. Share # Bitcoin Buycott I see this at Steve Sailer’s site. The original at Medium is already taken down. The Bitcoin Buycott You voted Trump. Now buy Bitcoin. By Austin Lee January 20, 2018 If you’re a Trump voter, you recognize that the political process typically does not work for the average American. President Trump may be the exception to this rule, but prudence and the track record of politicians in general dictates that we need to have a backup plan. Even Trump may not be able to reverse the cumulative impact of millions of illegal aliens and trillions in debt. As Ann Coulter put it: “We Made Donald %#&@ Trump PRESIDENT — What Else Can We Do?”. The short answer is: Buy Bitcoin. We don’t advocate this as a short-term investment. Indeed, the bulk of this article was written long before the current soaring price. The price of Bitcoin is high today, but could well drop precipitously tomorrow (though the long-term trend is extremely strong). Investing in Bitcoin is not recommended as a get-rich-quick scheme. No, we advocate buying Bitcoin as a political statement, as a long-term investment, and as a way for the right to control our own destiny and build a censorship-resistant internet where the left can’t blot out the truth or no-platform our president. On its face, though, this might seem to be a bizarre suggestion. Isn’t Bitcoin an imaginary currency in the middle of a huge bubble? And isn’t it a million miles away from border control, immigration policy, and the political problems we face? Quite the contrary. As we will show, Bitcoin is actually the proton torpedo targeting the heart of the Death Star. Because if Bitcoin wins, it takes away the state’s ability to tax. And if the state loses the ability to tax, the left no longer has any financial incentive to capture the state — or to import millions of foreigners to swing elections. The closest historical analogy is the fall of the USSR. Just as the perestroika-induced dissolution of the Soviet government freed the Russian people and eventually restored the Russian Orthodox church, so too will a Bitcoin-induced bankruptcy of the US government free the American people and ultimately restore traditional American culture. This is a bold thesis. We justify it in three steps. First, we explain why politics suffuses everything today. Next, we explain why it is far more effective for millions of conservatives to buy Bitcoin than to vote for yet another useless Congressional Republican. Finally, we discuss why this radical strategy is in fact ethical — and why it will result in a better result for you, your family, and the world than any available alternative. ### Why does politics suffuse everything today? The fundamental premise of modern society is this: if you capture the state, you capture the money. The group that controls the state has control over the police, the military, and the budget of the United States. It can choose to tax its enemies and reward its friends. This gives a multi-trillion dollar incentive for capturing the state. The leadership of the left understands this. This is why Obama ordered the IRS to go after the Tea Party, and why FDR ordered the IRS to attack Andrew Mellon. This is why the left hands out Obamaphones, frees felons before a vote, and steals elections with walking-around money. The left is playing to win control of a huge amount of money and power. A large bank of easily bought voters and the media to manipulate them are their key tools for gaining power. And once in power they can engage in legalized looting on a world-historical scale. Though they do have leaders and centers of power (the State Department, Harvard, the New York Times, Hollywood), the left is not centrally controlled. What we face is “institutional leftism.” The people of the left do what they do because they are responding to incentives. These incentives are obvious: it is easier to steal than to build, easier to capture the state and use it to seize others’ wealth than to create their own. With that looted money and power, they gain status, and more money and power. What opposes the left? Borders of every kind. Ethical conventions that tell us not to covet our neighbor’s wealth. Patriotic conventions that prevent them from busing millions over the border to bust our elections. And legal conventions that limit the ability of the state to seize our property. And this is why the left has been busily eroding these borders. From the Cloward-Piven strategy to sanctuary cities to lawless seizures, for the better part of a century there has been a Gramscian long march through the institutions to destroy the ethical, patriotic, and legal conventions that prevent the left from taking your money and land. Anything that can protect borders and resist the power of the state is bad for the left. They want you to be an atomized individual cowering before them, with the state visualized as the Eye of Sauron above. Thus the church is the enemy, the family is the enemy, and indeed any organic community organization is the enemy of the state. If an organization has any money or influence, it will be called into the dock and attacked as racist, sexist, or homophobic until its borders are busted and it has become yet another zombie vassal. If it resists, more force is applied, until eventually the once proud organization crumbles under a boycott organized by the national press, or a federal lawsuit enforced by federal courts and funded by federal money. So this is why politics suffuses everything. Because the left uses the state as a way to bust your borders and take your money and land, and because you dare to resist. Indeed, if you talk to a biologist about what distinguishes a dead cell from a living one, the key factor is whether that cell can still regulate its borders. If a cell’s membrane is dissolved, if its guts are indistinguishable from its surroundings, if it has fully “celebrated its diversity”: that cell is dead. What is true for the lowly cell is true for the body politic. If you cannot protect your borders, your possessions will be taken and you will eventually die. The left understands this too. They patrol their borders vigilantly while pathologizing your attempts to defend your country and property. That is why they make it so difficult to be an open Republican at the New York Times, at Harvard, or in Hollywood. That is why they jealously guard the flow of money from advertisers to outlets like Breitbart. And that is why they make it a firing offense to question leftist orthodoxy in their captured institutions. They defend their borders, but you may not defend yours. For the left, what is yours is theirs. And what is theirs is theirs. If you exclude people from your nation, your company, or your wallet, you are racist, sexist, and homophobic. Conveniently, their justification for excluding you from their institutions is the same: because you are racist, sexist, and homophobic. With the same words, they erode your borders while shoring up their own. We now understand the state of affairs. We need to protect our borders, our money, and our land. But we’re not going to win a war of words with the left. They control every major media outlet. And while we can win elections, we can’t truly win political battles. The right has nominal Republican control of 33 governorships, 69 state legislative chambers, the House, the Senate, and the Presidency — but one year later, there is still no wall. So we need something more powerful than words and politics to protect our borders. That something is cryptography. ### Cryptography is the border that can’t be busted You don’t need to be a computer scientist to understand the most important point about cryptography: no amount of violence can solve a math problem. Put another way, there are equations we can write where it’s easy to check the answer but very difficult to find the solution. The major breakthrough of Bitcoin was turning this scientific fact into the basis for a new system of property rights. You possess Bitcoin if and only if you possess the answer to a particular kind of mathematical equation. That answer looks like a special kind of password, also called a “private key.” If you want to send Bitcoin to someone, you enter your private key into your Bitcoin client, much like you send email to someone by entering your private password into your Gmail account. Bitcoin has one huge difference from Gmail, though: there is no “password reset”. If you lose your Bitcoin private key, you lose your Bitcoin. It’s gone, just like losing a bundle of cash. Possession of the private key is ten tenths of the law in Bitcoin. The advantage of this strictness is that someone who does not have your Bitcoin private key does not have access to your Bitcoin. Unless they know who you are — something the Bitcoin network does not make transparent by default — they can’t hit you with a wrench to gain access to your Bitcoin private key, and thus your Bitcoin. Instead, if they want direct access to a particular Bitcoin wallet without the consent of the owner, they would have to either solve an unsolved math problem (namely: “invert a series of iterated hashes to derive the private ECDSA key”) or spend trillions of years of computer time to brute force a solution. This, finally, is a border that the left can’t bust. Cryptography means they can’t take your money without your consent. Now, to be clear, this particular attack is not the only possible attack on the Bitcoin network. There are other attacks, like states shutting down exchanges (places where you buy Bitcoin) or capturing the so-called “Bitcoin miners” (the network of servers that validate Bitcoin transactions). The next few years and decades are likely to result in a cycle of predator/prey-style interactions where nation states try to attack Bitcoin and the Bitcoin network reacts to blunt the attack. So we are by no means home free with Bitcoin. But it is by far the most promising development for the right in the last decade. With Bitcoin, the right is not just holding our ground, we are taking territory. Because Bitcoin has scaled from a libertarian dream in 2009 to billions in value today, and inspired an entire blockchain industry worth yet more billions. The blockchain industry now has the backing of billions in venture capital, millions of users, many of the world’s best programmers, and thousands of computers and companies running all over the world. Most importantly, Bitcoin — and related technologies like Ethereum — have created thousands of libertarian-leaning millionaires, people who saw its potential and bought in early, voting against the state with their wallets…rather than their ballots. It is time for you to join them. ### The personal investment is political The reason you should buy Bitcoin — and hold it for the long term — is that you can build your wealth while undercutting the state. First, let’s talk about the wealth building part. If you had protested Obama’s re-election in 2012 by holding up a sign, you would have nothing to show for it today. But if you had protested Obama’s re-election by buying$1000 of Bitcoin on Nov 7, 2012 at a price of $10 per Bitcoin, you would now have more than$1M in realized gains — because one Bitcoin is worth more than $10,000 today. Will the price of Bitcoin go down? In the short term, quite probably. Can it keep going up in the long term? And is it worth buying in now? Nothing is ever certain. But many of the most successful investors in technology expect that the price of Bitcoin will eventually rise to$100k to $1M or even more. One reason for this bullish projection is that many technologists believe Bitcoin will replace gold, which has a market cap of$2T. As an unseizable digital gold, Bitcoin should ultimately attain the level of gold if not exceed it. Another reason that tech people believe the price will rise is that there are 7 billion humans on the planet and only 21 million Bitcoin, so demand is likely to exceed supply — though it should be noted that it is possible to buy and trade fractions of a Bitcoin if you can’t spare the money to buy 1 whole BTC.

The victory of Bitcoin is by no means assured. But it’s vastly more likely than it was even a few years ago. And if it wins, and you bought Bitcoin in 2018— you win.

### How the Bitcoin economy goes dark

Now let’s talk about the second part of the equation: how Bitcoin is the ultimate form of right-wing protest. Forget the NFL or the latest ephemeral Twitter dustup. As Thoreau said, there are a thousand hacking at the branches of evil for every one striking the root.

Bitcoin strikes the root.

If Bitcoin becomes as popular as Twitter or Facebook in the United States — and it is well on its way — it will hobble and eventually eliminate the ability of the state to tax. As Nobel Laureate Milton Friedman predicted in 1999, without the ability to tax, the incentive for capturing the state enters a steep decline.

Here’s how that works. Remember in early 2016 when James Comey scolded Apple for implementing end-to-end encryption? Around that time, the FBI released a memo complaining that Americans were “Going Dark,” that encrypted communications were no longer visible to the surveillance state.

Well, with Bitcoin and related technologies those encrypted communications become encrypted transactions. To hold money, to send it, or to receive it will increasingly be done in a fully encrypted fashion.

To get a sense of how this will play out, imagine that it’s 2020 and that 10% of the US population (or about 30M people) has a significant amount of their wealth in Bitcoin, and in allied privacy-preserving technologies like ZCash and Monero. Imagine also that the overall effective annual US tax rate is 40%, combining income tax, sales tax, property tax, and other taxes.

Now assume that 10% of the economy goes dark, forgoing credit cards to transact with each other over the blockchain in a tax-free way — just like people gave up physical mail to communicate over email in a stamp-free way.

The IRS and the banking system can’t see the transactions of 10% of the economy anymore — and can’t tax them. So the remaining 90% of the economy will have its taxes raised to compensate, resulting in a new effective tax rate of roughly 44%. But this tax hike will drive more people into the dark economy. As this feedback loop continues, eventually 50% of the economy goes dark. The remaining non-dark 50% would now have their tax rates doubled from 40% to an exorbitant 80% just to maintain the same level of payments to the IRS, driving even more people into the dark economy.

As the process accelerates, the entire economy goes dark, and we have actually starved the beast. The only receipts governments will receive after that event horizon are voluntary, crowdfunded contributions. This proposal is far more radical than anything a Republican Congress could even pretend to support, let alone vote for. That is why it will work. As Larry Page would put it, “10X is easier than 10%.”

In practice, the process of going dark may be much faster, because the smartest and richest would be among the first to defect, and because they are by far the most heavily taxed. So we would need far less than 50% of the population to enter the blockchain economy to bring the US government to its knees.

The transitional state will last for years, or decades, and be messy beyond belief. Endless media denunciations of the unpatriotic tax evaders will result in billions of free advertising for the dark economy. Some vocal Bitcoin-rich folks will likely go to jail. Many more will see the writing on the wall, and leave the US with their newfound wealth, or even give up US citizenship (eventually perhaps to return when things calm down). Many politicians will be found denouncing digital currency one day, and then revealed to be major holders of digital currency the next day.

It will take a generation and there will be many setbacks and reversals. And it will require more than just Bitcoin, as smart contract systems like Ethereum, the aforementioned private cash systems like ZCash and Monero, decentralized exchanges like Bancor and Ox, and decentralized domain name systems like Blockstack and ENS will all be part of the puzzle.

But once the economy has fully gone dark and the state is no longer a vehicle for systematic looting, everything will change. Change the incentives and you change the behavior. Remove the incentive for capturing the state and you remove the political behavior. No taxation, no welfare state. No welfare state, no attraction for illegal aliens. Bitcoin is the proton torpedo into the heart of the Death Star.

All you need to do to begin voting against the state with your wallet is to visit a Bitcoin exchange from the privacy of your home, click the buttons, and buy a few thousand dollars of Bitcoin. Then just hold it for ten years — and do not sell it under any circumstances, even if the price is down for a year and things look grim. The fake news media has reported Bitcoin “dead” more than 100 times, but those who held through everything are the ones sitting pretty today.

No signs are necessary. No placards, no public protests. Buy Bitcoin and hold it. Tell your close friends about it if you want. Then just wait.

Share

Share