Categories
Uncategorized

The upcoming 2010 housing crash

People around me think that housing prices are low. They are only low compared to the extreme heights of 1996 when irresponsible banks gave irresponsible loans to irresponsible buyers. They are still high when compared to what the average person can reasonably afford.

This is why housing prices are going to crash, most likely this year:

1. Government interest rates have to eventually rise: The Prime Rate is currently 3.25. Except for the great depression, they are the lowest they have ever been. Historically they have ranged up to 20% with about 6% on average. Most people buy the house they can get a loan for, not the house they can responsibly afford. So lower interest rates increase competition for higher priced homes, and raise home values. Here’s a fuller article on the subject.

2. In the 1970’s, with one income earner, if the primary income earner lost his job his spouse could enter the workforce and help things get by. However, today most households already have two income earners, thereby doubling your risk of lost income due to job loss or sickness. As we are in a recession, the chance of job loss is relatively quite high.

3. Prices are still too high for the average family to afford. Typically, you can only buy a house 3X your annual income. Here in Orange County, the average house is 550K, but the average household income here is $96,436. As I live here, I know first-hand that $300K can only get you a small condo (basically an apartment) plus heavy association fees.

Categories
Uncategorized

Reasons why I like Impuse more than Steam

I buy a lot of games, and I like Impulse better than Steam for digital downloads.

  1. As far as I can tell, with Impulse you get the ‘real’ version of the game, meaning you can apply external patches from the developer. With Steam, you get a modded version that cannot be patched until Steam itself releases the patch. In the past, such as with X3: Terran Conflict, I’ve seen this take weeks after the official patch. Some of the games that I have have never been patched to the current version.
  2. The Steam download servers are slow, especially recently with their holiday sales. I’ve left downloads running overnight, such as when I downloaded the 5 GB game Silent Hunter: Wolves of the Pacific, only to find that the download stopped at 43%, and took another 12 hours to complete. With Impulse, I just bought Arma 2 about 30 minutes ago, which is over 8.42 GB, and it’s already at 75% complete.
  3. I’ve never had a bad experience trying to play the games I bought with Impulse. With Steam, when I bought Hearts of Iron 3 it crashes because of some problem with the Steam version of the game and the tutorial not working. The developer didn’t help me, and from the forum you can see this is a known problem that is basically being ignored. Silent Hunter also had installation problems when you buy the expansion pack and install it at the same time.
  4. With Steam when I had billing problems, there was no-one to contact, or else they hid the contact information well enough that I couldn’t find it when I wanted to. With Stardock, I get an email when I make purchases and every time I’ve responded about a problem, such as not being able to find registration codes, I’ve gotten a relatively quick response.
Categories
Uncategorized

How to do manual torpedo targetting in Silent Hunter 4: Wolves of the Pacific

Torpedo targeting in Silent Hunter 4: Wolves of the Pacific is very hard. The manual doesn’t correctly explain it and the online videos I saw are incorrect and incomplete.

1. Bring up your periscope and look at the target
2. Press L to lock the target. This way the periscope keeps looking at the target.
3. Press N to bring up the target recognition manual.
4. (In hard you can do this, but not realistic) Press Less than and Greater than to look at your target with the free camera. This makes identifying it easier.
5. Find the target in the target recognition manual, and press the checkmark in the upper right.
6. In the mid-left and upper right will be slider tabs. Press both of them to expand new windows.
7. In the upper right slider tab, press the button for target distance estimation. This is as described in the manual.
8. Drag down the mirrored target until the waterline of the mirrored version reaches the top of the mast of the real version.
9. Wait 5 seconds or more. The longer the better. The manual incorrectly tells you to press the clock button twice. During this time, I adjust the torpedo settings in the left slider window. Always set the torpedo to fast (I’m not sure why this is not the default). If you set the depth according to the target recognition manual you will shoot under the target. I’m not sure why. I’d just go by the manual, 20 feet for battleships, 12 for cruisers and large merchants, 10 for light cruisers and small merchants, and 6 for destroyers.
10. Do step 8 again.
11. Switch to the speed estimation tab (as per the manual)
12. Press the clock button. You will get a speed and bearing estimate. The manual is wrong about this, instead telling you to press the clock button twice. The online videos do not do this. Instead, they just guess at the speed. Anyway, the speed will be set automatically when you press the clock button using this method.
13. Press the red button to enter the speed into the TDC
14. I haven’t found a better way to do this, but you need the angle between the front of their ship and your submarine. As the online videos do, go to the navigation map and use the triangle. Click in front of their ship, online the bearing. Click on their ship. Then click on your submarine.
15. Quickly enter this angle back at the periscope screen. Then press the red position finder button. If it was already on, turn it off then on again. This locks the angle at your periscope, and updates the position according to the speed and angle entered previously. If you turn it on too early, as they do in the youtube videos, the the angle from you to the target will be when you first pressed it, using the default target speed of 0. So it will fire at an angle behind the target. When the position keeper is on, the point to shoot at will move as your sub moves, and will also move using the speed and angle values you entered in step 13 and 14.
16. If you are in hard rather than realistic difficulty, you should go to the attack map and check your work. The white X should be on top of your target. THe line from the X should match the bearing of your target. The most probable error is that the range is wrong.
17. Mathematically, the distance to the target doesn’t matter if they are directly in-line with your sub (0 degrees ahead for forward tubes, 180 for rear). So if you fire closer to these angles, then distance estimation errors hurt you less. But generally, you will need to correct the range to be quite accurate if you want any chance of hitting.
18. Adjust the spread, and fire a torpedo. You can also adjust the spread to compensate for errors – if the range estimate is too long, then your shot will go behind the target. You need to adjust the spread for each torpedo. For whatever reason, the speed and depth is saved per-torpedo but the spread is not.

Categories
Uncategorized

Disappointed in neatworks

I bought a Neatworks scanner to make my office paperless. After using it for 9 months, I’m pretty disappointed in it, mostly due to poor software.

1. You can scan multiple pages in order, but they are processed out of order, meaning you have to manually reorder them. After complaining about this to the good customer service, they released a patch that only fixed it if you use quick scan center, and then the pages are still in reverse order. Using the regular scan center it’s still out of order.
2. The stored document quality is very bad, almost unreadable, with white backgrounds turning grey, and the overall quality degraded.
3. The OCR accuracy is bad. I don’t know the exact percentage of the time it fails, but it’s definitely the majority of the time.
4. The UI is bad overall, making the software very tedious to use. For example, if I scan 100 receipts all in the same tax category, I have to manually select the tax category for each one through a huge drop down list. You can’t even type to narrow down the category unless you type exactly the category as it is spelled, with punctuation and multiple spaces.
5. Scans are often off-center because there are no guideposts to ensure your documents scan in straight. This is true of both receipts and regular 8.5 x 11 documents.
6. You can export to pdf only, and then only immediately after scanning a document. Once you archive it you can no longer do so, nor can you modify the document, such as fixing the page order.

Categories
Uncategorized

GPL just means your code probably won’t be used

I ran into a guy recently who was well qualified for a contract I was offering and even already had code to do it. The only thing preventing me from hiring him was that his code was under the GPL. When asked if he would do a dual license, he flatly refused at any price.

I appreciate what the GPL stands for, which is that source code should be available. But as a practical matter the best code generally comes from people who are paid, and businesses able to pay for code tend to want to maximize profits on what they have done. And one possible tool to maximize profit is to not have the software open-source.

RakNet is open-source because it helps me make money. More users, fewer support costs, contributions from users, and market appeal count among the benefits of being open-source. I’m not worried about theft because the businesses capable of paying license fees have so much to lose were they to violate copyright that it doesn’t make financial sense for them to not pay.

On the other hand, if I were to make a commercial game, open source means I’d be unable to discourage piracy. People would release for free games based on my source which would compete with my own sales. While it’s relatively easy to enforce copyright against major companies, that’s not true against the entire internet.

In the game industry you’re basically forbidden from using any GPL code. From time to time this means I haven’t used code I otherwise would. It’s never been the case, nor do I expect it to be, that because I used a GPL component I was forced to release my source where I wouldn’t have otherwise. It just means I won’t use the GPL code to begin with.

Categories
Uncategorized

How to build QWT-5.2 with Visual Studio 2005

I posted instructions here

In case it’s deleted or lost:

1. Make sure that Qt\2009.03\bin is in your PATH environment settings. %QTDIR%\bin\ was already in my path, but didn’t work, so I also added C:\Qt\2009.03\qt\bin
2. Edit qwt-5.2/qwtconfig.pri to build both release and debug, and you probably also want it not to build a dll
3. Open Start / All Programs / Microsoft Visual Studio 2005 / Visual Studio Tools / Visual Studio 2005 Command Prompt
4. Go to qwt-5.2/qwtconfig.pri
5. Type qmake qwt.pro
6. Type nmake
7. The static libraries will be in qwt-5.2\lib . Link these into your Visual Studio project
8. Header files are in qwt-5.2\src . Add this path to your Visual Studio project
9. Copy qwt-5.2\designer\plugins\designer\qwt_designer_plugin5 .dll to Qt\2009.03\qt\plugins\designer
10. Copy qwt-5.2\designer\plugins\designer\qwt_designer_plugin5 .exp to Qt\2009.03\qt\plugins\designer
11. Copy qwt-5.2\designer\plugins\designer\qwt_designer_plugin5 .lib to Qt\2009.03\qt\plugins\designer
12. Run Qt Designer
13. Click Help / About Plugins
14. Make sure qwt_designer_plugin5.dll is listed there

Categories
Uncategorized

Just saved $5,000

I had a project I was sending out to potential contractors, to display a 320×200 video feed based off images from SQL. My performance requirement was 30 FPS for 4 videos, 15 FPS for 8. One company wrote:

“For $5000, we can
implement the proof of concept suggested by my senior engineers (see below)…

For example, I had two of my senior engineers review the RFP. They both zeroed in on a possible bottleneck between animating the user interface at 30fps vs. retrieval from the database. It is their recommendation that a *proof of concept* be implemented that indentified the bottleneck (if any) so that the appropriate infrastructure could be implemented to achieve your performance goals.”

Up until that point, I had only used QT for a few days, had never written OpenGL before. I’m not a graphics programmer.

I did it myself, in a day, by reading the SQL in a thread, buffering multiple rows at a time, bypassing the QT calls to skip code that doesn’t apply for single frame videos, and using glTexImage2D to generate the texture and glTexSubImage2D to update the texture.

I didn’t have to modify the QT source, or come up with new data structures, or call an expert. Just pick the low hanging fruit. For all I know it could be twice as fast again if I really knew what I was doing.

Take it as a word of warning when dealing with fat contracting firms, more used to dealing with Cisco than small businesses. These guys think nothing of asking for 2K a day, spending a week on what would take a motivated hungry programmer a few hours. Meeting after meeting, week after week, charging you for that time, just to come up with a price you’d reject out of hand.

Categories
Uncategorized

How to get a callback on button press from QT designer

Right click on the body of the form.
Click Change Signals / Slots
Under slots, press the + key. Add the name of the callback that you want.
Link it with the signal/slot editor
Now your generated file of the same name will have a callback of the name of the slot you added
Derive from your generated file
Use public slots: to implement, as per the manual

—EDIT—

Found an easier way
Derive from the autogenerated class
Write something like
public slots:
void on_actionSQL_Query_activated();

Replace actionSQL with the name of your object. Replace activated with the name of the signal that is sent.

Categories
Uncategorized

How to add a new window with QT and Visual Studio integration

Took me a long time to figure this out, but got the answer on Stack Overflow

“In Visual Studio, the workflow I use when I want to design a new window is to add a Qt GUI class with Project->Add Class…->Qt4 Classes->Qt4GuiClass.

Then, fill out the form as necessary and the VS add-in will add the appropriate ui and moc files. Double clicking on the ui file will bring up Qt Designer, which you can use to lay your window out.”

Categories
Uncategorized

QT Visual Studio integration doesn’t work / how to fix

I downloaded the SDK for Windows
https://qt.nokia.com/downloads/sdk-windows-cpp

Then the Visual Studio Add-In
https://qt.nokia.com/downloads/visual-studio-add-in

Installed both. Now the 4th or so option in Visual Studio is “QT”

You can click create project / QT / QT Application.

However, it doesn’t work

I read a forum post to click in the file menu QT / QT Options. However, if you click add, the OK button to select a file is always disabled.

Forum Post where others give the answer. You have to set two environment variables, and build with mingw

Building QT in MinGW is pretty hard to figure out. So I found a YouTube video on how to do it
QT + Visual Studio 2005 Part 1/5

And it doesn’t build without errors
Unresolved externals

It’s great that they give this out for free under the LGPL, but from a sales standpoint this is an Epic Fail. It doesn’t work out of the box, there is no documentation or support on why, and the price is very high. $4000 for a license and $2000 for 10 support incidents.