Tuesday, December 06, 2011

A Quick Introduction to Vi (GVIM) for Programmers

Vi is an awesome editor. A bit of a learning curve, but this little tutorial will get you going.

An Editor of Two Minds (or Modes as it were)

Vi has two modes: typing mode and command mode. Command mode turns the entire keyboard into a bunch of function keys.

Vi starts in command mode. To switch into typing mode press (for example) the i key (i for input). To exit typing mode (and go back to command mode) press Esc.

When in typing mode, type, as normal. This is the behaviour most people are used to, it is command mode that is somewhat unique to Vi.

Command Mode

Command mode turns the entire keyboard into function keys: not keys with which to enter text.

Some frequently used commands:

Command Key Result
i switch to typing mode; start at the current cursor position
Esc exit typing mode
a switch to typing mode, start after the current cursor position
d delete the character at the current cursor position
D delete from the cursor to the end of the line
dd delete the current line
dG delete from the current line to the end of the file
. repeat the last editing command; for example if the last command was “d” repeat the d (delete character) command
o open up a newline (after the current cursor position) and enter typing mode
j move the cursor down a line
k move the cursor up a line
h move the cursor left
l move the cursor right
u undo last edit (this is repeatable command)
G go to the bottom of the file
Y yank; copy the current line into the buffer
3Y yank 3 lines into the buffer (note many command can be prefixed with a count)
p put the contents of the buffer (as line(s) after the current line
M move the cursor to the middle of the current screen
:2,9 s/in/out/ from lines 2 to 9 substitute the first occurrence of in on each line with out
(press Enter to execute)

The best vi editors:

General: vim.org

For Visual Studio: viemu.com

For Eclipse: viplugin.com

For NetBeans: jvi.sourceforge.net/

F#ck You FedEx

Anyone living in Canada who has every ordered a package from the United States hates FedEx almost as much as they hate UPS. Here is an example:

Order a 50 pound package from epluselectricbike.com and E+ will tell you FedEx charges $350 to ship to Canada. $350! Unbelievable! We aren’t talking about shipping an car or something, just a box.

But if you go to yesweshiptocanada.com, a company that specializes in forward shipping and use their shipping calculator you get a surprise. They can ship to Canada via FedEx, for $158. So basically FedEx is ripping off E+’s Canadian customers. F#ck you FedEx. What is it about Canadians that all corporations feel we need to be ripped off all the time?

P.S. To ship to Victoria BC use Clipper Direct, the best deal by far.

Tuesday, November 08, 2011

Monroe Replacement Struts Suck Ass

I wanted to get a warning out so other’s don’t get screwed by Monroe like I did.

A few years ago I needed new struts and Napa recommended Monroe. These guys had been good so I went with their recommendation. One of the replacement struts was defective and had to be replaced almost right away. Then they lasted less than 20,000 miles. I don’t put many miles on my car so the warranty expired long ago.

Monroe Struts: don’t buy them.

Monday, October 10, 2011

What does Occupy Wall Street have to do with you?

"Occupy Wall Street" is a movement to bring democracy to America. No, not that fake democracy where politicians pay lip service to voters then meet behind closed doors with corporate leaders to decide how to run things. The movement's goals are to bring real democracy to the US, where government acts in the best interests of the people.

Keith Olbermann reads a statement from the Occupy Wall Street movement (click here). It is worth watching twice, and needs to be seen by as many people as possible.

The movement is spreading (including Canada!). Photo's from the movement here.

Lots of related video's on youtube, including this guy (who is well informed).

So, what does Occupy Wall Street have to do with you?
Debt, environmental degradation, pollution, injustice, inflation, war, poverty: all unnecessary, all the direct result of greed and corruption. Is that really the world you want to live in? The movement is fighting for everyone's quality of life, including yours.

Help spread their message and get involved!

Tuesday, August 02, 2011

Wind Power Rules

I’ve heard the argument that wind power is not a great solution to our energy needs because it isn’t always windy. Makes sense huh? Except there are two realities that argument ignores.

The first is the energy grid. Most of us get our power from many miles away, often from hundreds of miles away. It might not be windy right here right now, but it is windy somewhere right now, somewhere not that far away. The energy grid moves the power from where it is generated to where it is needed. Wind power needs to be installed in multiple well-researched locations and connected to the energy grid. I live on Vancouver Island and the northwest coast of the island is very windy, yet there is no wind power installations (yet). It is because “BC Hydro” is stuck with a hydro mindset, not appreciating the benefits of wind.

The second thing is return on investment. The amount of energy invested into implementing wind power compared to the amount of energy produced. (The cost of the investment is closely tied to the energy cost.) Today it takes about 1 barrel of oil (energy) input to produce 3 barrels of oil output which explains why the costs of gas keeps going up (and will continue to go up). According to Crash Course wind power is actually one of the most efficient energy investments there is. Wind power has a great return on investment.

Friday, June 24, 2011

The United States of America: An Empire In Decline

Empire? 800 military bases in 120 countries. Empire.

The United States used to export oil. Now it imports.

The United States used to be the world’s biggest creditor. Now it is the world’s biggest debtor.

What are the trends? Let’s look at some graphs.

The jobs situation sucks:

Average Duration_0

Not In Labor Force

More and more require assistance:

Food Stamps_0

The US government’s spending is out of control:

Chart-Federal-Net-Outlays

Households are scarcely any better:

Chart-Household-Debt

The Federal Reserve is printing money like there is no tomorrow:

Chart-Monetary-Base

Out of control debt:

US_National_Debt_Chart_2010

Debt compared to income:

national-debt-income

It’s a lie that the Federal Reserve wants to keep inflation down:

Inflation

The rich take it all for themselves:

income gap

The Baby Boomers want to fund their retirement by selling assets, but to who? The baby boomers (also know as "the selfish generation") out-number the next generation. The boomers have also been using their collective clout to get more for themselves, leaving their debt (both in dollar terms and environmental damage) and obligations to the next generation, insuring the next gen will be poorer.

Tens of thousands of manufacturing plants have closed. Millions of manufacturing jobs and other good jobs have been lost, jobs with good pay and benefits, replaced by low-paying service jobs with limited (if any) benefits.

The environment is in decline. Decades of abuse has stripped the soil of it's nutrients. The water table has dropped substantially. The ocean's all around the States have huge and expanding dead zones (actually this true all around the world).

Oil, the driver of the economy, has peaked and is in decline with no replacement in sight. The amount of energy in a gallon of gas is amazing, there is nothing like it (that isn’t radioactive). In a few years Mexico will stop exporting oil to the US. Expect gas prices to continue increasing 10-50% each year.

The last time the US defaulted was in 1971 when Nixon took the US off the gold standard. The US will inflate it’s way out of this mess, which really is just another form of default.

Ever since Nixon took the US off the gold standard the US has been in decline, but the decline has been hidden by the use of debt. I could do the same thing, cash all the equity out of my house to buy cars, go on vacations, etc. My neighbours would think we were doing well, but the truth would be the opposite.

Not a pretty picture. There is no hope for the US to recover, not in a “good” way, not as long as the incompetent criminal class are in charge.

What should the US do?

  1. Close all military bases outside the US and bring the troops home. Shutdown the military industrial complex.
  2. End the War on Drugs. Nationalize all private prisons.
  3. Nationalize energy companies.
  4. Nationalize water companies.
  5. Default on all US treasury’s owned by China. Everyone may manipulate their currencies, but China is the master. The result: manufacturing jobs lost from American to China. It is time to fight back.
  6. Use an act of Congress to force the privately owned Federal Reserve to forgive all US Government debt owned by the Federal Reserve.
  7. End corporate personhood. A corporation is not a person and should not have the rights of a person.
  8. Limit contributions to political parties to a very small amount (e.g. $100).
  9. Return to the gold standard.
  10. Return to a real democracy.

Problem solved.

I highly recommend: Crash Course

Related: How The U.S. Will Become A 3rd World Country

Wednesday, June 22, 2011

Germans: Break Up the EU!

Spiegel is reporting: If the Euro Fails, Germany Will Be Responsible

Right on, go for it! The break-up of the Euro would be a defeat for the elites and a victory for people everywhere. You think some fuck in Brussels gives a shit about anything but his masters? Better to have local representation.

The more global these governing bodies become (like the EU, the WTO, the World Bank, etc.) the more control the elites have over them. And the less they answer to the people.

I’d also like to see the US break-up into a collection of independent states and Canada into a collection of independent provinces.

Friday, May 20, 2011

The Four Day Work Week

This article is about much more than working fewer hours. It is about quality of life, for you, your family, your friends. For all people and all living things. It is about what is fair and about right and wrong. It is about all of us taking back control over our own lives.
 
Almost everyone agrees they would rather work less than 5 days a week. So why don't we? Some wrongly think it isn't possible, that we can't afford it. We can. As noted in this article, some have actually achieved it. For most of us it is very possible, but governments, businesses and corporations ("them") want us working longer hours. Not for our benefit - for theirs!
 
If you walk around a modern shopping mall today, what do you see? I see a whole lot of stuff that has no use, and a lot of services I have no need for. One way we can work less is to stop wasting our time and money on useless products and services. They are only there in a desperate attempt to take our money. Much of what is at the mall has no value.
 
As more jobs become automated, be it self-checkout at Home Depot or robots building cars, people are supposed to be working less. But all that is happening is fewer people are working and others are left in the cold.
 
It is pretty hard to get by in our (or almost any) society without a job. Sometimes the choice comes down to starve or steal! I realize not everyone is a great worker, but on the other hand many good people are having difficulty finding work. We need to fix this. The solution is to divide up the available work more fairly.
 
Who Benefits From Our Hard Work
Most of us work and even before we get paid, the government gets a share first. The government does an okay job of making us feel as if we get value from taxes we pay but it isn't true. The value we get from the taxes we pay is much less than it should be. Work less and you will be taxed less.
 
"The tax system is a very efficient means for the ruling class to finance their standard of living at the expense of the rest of us while claiming to provide some service in return" - James West, The Midas Letter
 
Many of us work for companies who profit from our work. Typically an employee's labour creates something of value which is sold. Both the employee and the company benefits. But most companies are not concerned with quality of life issues - they just want you to work more hours so they can make more money. Quality of life should come first.
 
How Do We Work Against Each Other?
Governments and corporations encourage us to work against each other. We compete for higher pay, more prestige, a bigger house (mortgage), etc. They encourage us to look down on people who are less successful. They tell us if we don't work long hours then we must be lazy. It benefits the powers that be but hurts people. Governments and corporations want you to depend on them, that way they can control you.
 
Governments also use patriotism to encourage prejudice against the people of other countries, but that is a topic for another day.
 
What About Retirement?
How can a person work only four days a week and still expect to retire? Governments and corporations push the idea of retirement for various reasons, but mostly to get you to work harder and longer now with the promise of taking it easy later. It is better to take those planned retirement days and spread them out throughout your life. Most of the world’s public and private pension plans are in trouble financially. You never know what tomorrow will bring. I take a few weeks of unpaid time off work each year.
 
Another big problem with trying to save for retirement: central-banks artificially create inflation making it necessary to invest retirement funds in an attempt to keep up with inflation. What a bunch of BS. Tell the banks and the investment houses like Goldman Sacks to go jump off a bridge.
 
What Can Be Done - Part 1: Inform
The first step is to continually become more informed and educated. The powers that be want to keep you ignorant and dependant. Are you going to just let them?
 
What Can Be Done - Part 2: Take Action
The second step is to take action. These are just some examples.
 
Join a union if you can because achieving our goal will require unity. What does the word "union" mean to you, is it a dirty word? The corporate-controlled media has worked very hard to make you believe unions are a bad thing. And they are - for the corporations. The rich coordinate their efforts: why shouldn’t we?
 
Join a co-op or start your own non-profit business. Join an environmental group. Grow some of your own food. Get to know your neighbours. Consume less. If you are in the market for a home, don't fall for the McMansion trap; buy something you can afford that was built using fewer resources.
 
Avoid any support for large companies, this especially includes any support for the corporate-controlled media (Fox News, New York Times, etc.). If you must keep your job at a large company do as little work as possible and encourage others to do the same. Cut back on your hours.
 
If you have cable or satellite television cancel it, because television is controlled by huge companies (like GE, a weapons maker) and it is the largest source of corporate propaganda. Try to avoid bank-credit as much as you possibly can: think of the interest you pay as a tax.
 
What Can Be Done - Part 3: Take Control Back
Governments and companies don't tell us what to do we tell them. Representatives, and I use the term loosely, need to know they will not be re-elected if they do not support people's rights. Companies that resist will be boycotted. It is that simple.
 
Today we have the problem of too many individual groups working separately, but we need to work together. Groups like WWF, Sierra Club, Greenpeace, etc. need to join forces and coordinate their efforts.
 
The goal of the Zeitgeist Movement is to put an end to war, poverty, environmental degradation, corruption and injustice. Watch Zeitgeist Addendum to understand how this can all be achieved: but not without your involvement.
 
Join the Zeitgeist Movement. Take Control. Success of this movement will result in a high quality of life for all, not just the rich.

Thursday, July 15, 2010

Where to invest?

If you happen to have some money to invest, lucky you! But where? The US stock market is as corrupt as it gets, thanks to government intervention, HFT (high frequency trading), a SEC that spends more time browsing Internet porn than enforcing rules, etc. Not to mention the market might be going no where but down for a while. Gold looks pretty good long term, but short term might be in for a summer pull-back. Real estate doesn't look so good, at least not until there is a clear bottom (we are not there yet). Interest rates in bonds and bank accounts suck ass. What is left?

The US government might have had good intentions with the "Cash for Clunkers" program, but that was an example of what not to invest in. Don't invest in something that losses value dramatically, like automobiles.

Invest in something that returns value. People need food, shelter, energy, transportation, etc. If a person could invest in order to have these things then that person would be investing in something of value.

An obvious example is of course energy. An investment in solar and/or wind power could really pay off. It depends on your own situation. Do you live somewhere with great sunshine and maybe even state and/or federal rebates on solar panels? Do you live somewhere with lots of wind and you have enough land to support a large wind mill?

I live in British Colombia, Canada, where electricity is (currently) cheap and solar panels cost twice what they go for in the States (why?). I am keeping an eye on what is going on in the industry, such as Lowes selling easy to install solar panels (in the States of course).

If solar panels last 25 years but pay for themselves in 5-7 years they could be a great investment. Something to consider when other investments are not looking so good.