Monday, May 4, 2009

OpenAL EFX

So, I've been working on sound support for my game. I couldn't find OpenAL EFX extension initializer, so I generated one myself using grep and awk. Here it is.
Use InitEFX() to initialize EFX extensions. You can also use HasEFX() in the code to check if EFX is supported (and has been initialized). After successful call to InitEFX() , you can use EFX functions which are listed in efx_proc_list.include.h (it declares function pointers in header by defining P macro, and defines and initializes them in C file) .

game development.

For past several months I've been working on computer game. As it is nearing release, I'm going to start blogging about it.
Game looks like this:





It is, basically, a 3D space shooter with all the scenery and models generated using mathematical equations (see mathart section on my website).

There is rather old youtube video of that game.

I'll be blogging more about this - stay tuned.

Wednesday, April 15, 2009

Newcomb's paradox

Wikipedia article
Some website's article.
There are two boxes, labelled A and B . You face a choice between taking just box B or both boxes.
Box A contains 1000$ . If Predictor had predicted that you'll take just the box B, box B contains 1000000$. Else if Predictor has predicted that you'll take both boxes, box B contains nothing.
A million people played this game, and Predictor was never wrong.
Will you take just the box B or will you take both boxes?
(I'm "one-boxer")

I think this paradox is not weird enough and needs to be made weirder. Imagine that boxes are made of glass. In such case, would you still choose one box? Why does it make difference when even with opaque boxes you know that taking both boxes always gives you 1000$ more?
(There is why it makes difference, actually: you could pre-decide to pick box B if it empty, and pick both if B is not empty, making predictor certainly wrong)
Also, what happens if its 50$ vs 100$ ? 99$ vs 100$ ? 0.01$ vs 100$ ?

Thursday, April 2, 2009

Sherlock Holmes and The mystery of Cold Fusion

I think that the first questions that Sherlock Holmes would have asked if he was investigating cold fusion would be...
Who did experiment and where did they bury the body?!

It is very easy to show that if cold fusion with reported excess heat was real, there would have been quite a few fatalities, given the lack of precautions in such experiments.

Human lethal dose is 5..10 Sieverts, equivalent to or 5..10 Grays of gamma radiation, i.e. 5..10 joules per kilogram.
1 Gray = 1 Joule of absorbed ionizing radiation per kilogram = 100 Roentgen.

Neutron radiation does 5..10x more damage than gamma radiation, so lets assume it takes 1 Gray of neutron radiation to kill, or at very least, seriously hurt human. Suppose that experimenter weights 100kg, that'll be 100 joules of absorbed neutron radiation.
Most of the deuterium-tritium fusion energy is released in form of neutron radiation, which is somewhat poorly absorbed by electrolysis cell.

You see where its going. Excess heat output of 1 watt means 3600 joules per hour, which means that there is real risk for experimenter to absorb lethal dose and die, or less dramatically, to get sick. The doses, even for short experiments, would easily exceed yearly allowance for nuclear industry workers. Worse yet, neutron activation would make equipment and walls of building themselves radioactive.

Interestingly, even one milliwatt of fusion power would make regular four-digit geiger counter that you can buy on ebay (and which counts 10 clicks a minute on background) quickly overflow and beep its "run for your life" alarm.

The conclusion is... either there is massive cover up of many deaths, or cold fusion is a hoax.

Twitter

After hearing about twitter for 10th or 20th time, I thought its about time to register account on it, dmytry, rationalizing it as reserving my name.
Geez. It even got a button to auto-follow a bunch of random people, and a bunch of them will auto-follow you.
Feel free to follow me, I'll auto-follow you, and yes, it is extremely unlikely I'll read what you write, and just as unlikely you'll read what I write.

So bloody useless, even more useless than this blog.

Wednesday, April 1, 2009

Couple compound shell commands

make passwords:
base64 < /dev/urandom
(I know of pwgen, but above line is better for paranoid. You may fear that pwgen has some sort of bug that greatly decreases amount of entropy in passwords, but, surely, you gotta trust /dev/random and /dev/urandom , and base64. if those fails you're screwed anyhow)

print all gcc defines
gcc -dM -E - < /dev/null

access to some sites behind mis-configured switches can be improved with (as root)
ifconfig eth0 mtu 1000
or lower number

reversing order of numbered files
for((i=0;i<720;++i)); do mv file_$(printf "%05d" $i).png file_$(printf "%05d" $((720-i))).png ; done
(replace 720 with number of files)

remove executable privileges recursively without making folders non-browsable:
find ./ -type f -exec chmod -x {} \;

Friday, March 27, 2009

Ha.... a linux worm.

http://www.linux-magazine.com/online/news/psyb0t_attacks_linux_routers_update

Notably, the worm doesn't seem to be using vulnerabilities in the software itself - just good old stupid passwords. If your router's root password is "password" you're going to get owned.

Wednesday, March 25, 2009

My agent iz in ur brain.... controlling u.

Something that has always fascinated me. Brain parasites which control their hosts, turning them into real world zombies. There is worm which can control cricket into jumping in water; there is rabies virus which makes mammals rabid (rabid fox loses fear of humans or other predators and instead gets attracted to them; rabid dog on other hand bites humans; quite curious change in behaviours), there's a fungus that control ants, and Leucochloridium paradoxum which controls snails and even paints "eat me" target.

You may by now be wondering what lolcats have to do with parasites.
Toxoplasma gondii makes mouse get attracted to cats, so that mouse gets eaten and parasite can sexually reproduce in the cat; the infection is harmless to cats. You can even say that parasite is effectively a symbiont to cats, feeding cats with mice!
Toxoplasma gondii can also infect humans, where it similarly infects brain and muscle tissue, and has effect on neutransmitters in brain, in particular dopamine. Its massive. Half of adult humans worldwide have that thing in brain!
For all we know, it may trying to expand into new medium by forcing humans to post lolcats on internet :-)

Okay, okay, I'm just joking, but still, that is quite fascinating.

Friday, March 13, 2009

String theory of antigravity.

In light of news that string theory made a prediction, I just came to realization that string theory is correct.
It usually provides correct explanation of antigravity - levitating objects are often suspended on strings.

Monday, March 9, 2009

Linux better than pirated Windows

I think that must be repeated more.

Pirated Windows is a second most popular desktop operating system according to Ballmer (and in many regions, the most popular desktop operating system at home and even office).

And it really is a horrible OS. Illegal, immoral, unpatched, full of trojans and malware (often coming with viruses as part of the install), or of third party antivirus and firewall software which slow the system down to total crawl. No support whatsoever. Frequent reinstalls are required. Microsoft's "genuine advantage" gets in the way, and so on and so forth.

But people still pirate windows. Supposedly because they see pirated $250 windows for $0 to have higher value than free Linux for $0

You can argue all day long if genuine Windows is worth $250 or not. Maybe it is, maybe it is not, i guess that depends to what you're doing.
But pirated windows is certainly not worth even $0 .

(that's just my opinion, anyway)

Friday, March 6, 2009

Ad nonsense

I was curious how often people really click on ads. The experiment ran on my website for several days. 1050 views with 0 clicks. I did already suspect that the legitimate ad click rate is very low, and that majority of users don't even register ads consciously (nor subconsciously).
I'll keep experiment running on this blog.

Wednesday, March 4, 2009

Some random thought on multiverse hypothesis, isotropy of space, and anthropic principle

If there is a lot of universes with varying physics laws, would we be likely to find ourselves in an universe where physics laws are slightly non-isotropic? (like, for example, if ratio of proton and electron mass is larger on one side of universe than another).
If our physics laws are is more isotropic than we could expect, then this may show multiple universes hypothesis and/or anthropic principle to be wrong or unusable for reasoning about properties of universe.

(some basics of what I'm talking about)
The multiple-universe hypothesis (along with anthropic principle) is a proposed explanation why physics laws appear to be well tweaked for some form of intelligent life to exist, and why we got some very specific physics laws at all. Hypothesis goes as following, what if a lot of universes with different physics laws exists, some inhabited some not. Certainly, we could only find ourselves in universe with physics laws that allow intelligent life. But would such universe also have "sensible" physics laws, same everywhere and so on?

Monday, March 2, 2009

Linux works out of the box.

One of good things said about OS X is that OS X works out of the box. But it doesn't work out of the box on any hardware - it works out of the box, on mac hardware.

I believe same can be just as well said about Linux: It works out of the box... on mac-level hardware :-)

Or, to be exact, Linux generally works out of the box on quality hardware.
If you stay away from obscure cheap crap (or expensive crap), and get distro that is not too fundamentalist about open source and includes closed source drivers (such as mandriva), everything works "out of the box" (as in you put livecd, boot, and voila).
For example, my relatively cheap pc with gigabyte motherboard (Intel p45 chipset), Intel q9300 cpu, NVidia 9800 gt, and Seagate 750gb hard drive worked absolutely perfectly "out of the box". I honestly never had to press reset button (or otherwise force reboot) in 5 months since buying it. (edit: actually I had to press reset once. When hot-disconnecting dvd drive, I pulled at cable and video card crashed. that was scary.)

You wont get that experience with windows. You'll have to google for and install every driver by hand, which feels almost like making your own bloody Linux-from-scratch.
On other hand, of course, if you have obscure motherboard chipset, and a lot of other obscure, crappy hardware, Linux could even fail to boot.

But you may say, what's about all the post-install headache such as entering commands on terminal, editing /etc/wt.f/awful.conf by hand, and so on? If you don't want to do that, just don't! You can live without it, like you would on windows or os x, where you generally do not have well documented, human editable config files. All the important configuration can be done with GUI.

Thursday, February 26, 2009

On importance of advertisements.

http://blogs.eweek.com/applewatch/content/macbook/microsoft_ceo_scoffs_at_mac_share_gains.html

I kind of agree with Ballmer on several points here.
In particular, on importance of advertisements. I think it is fair to say that ads are much less effective for microsoft, for several reasons.

Firstly, target audience size:
Suppose, Microsoft has marketshare 90%
Suppose Microsoft makes extremely powerful but expensive advertisement campaign which converts 5% of remaining non-windows users (whom are 10%) to windows. That'll raise Microsoft's marketshare from 90% to 90.5%

Suppose Apple has marketshare 5% and they make such campaign which converts 5% of those 95% non-mac users to mac. That'll raise apple's marketshare from 5% to 9.75% . Both relative and absolute increases are much higher for Apple than for Microsoft.

Secondly, visibility. It is fair to say that those 10% of non-windows users are aware of windows; ads don't have effect of increasing the awareness.

Thirdly, Microsoft, unlike Apple, is not relying on selling highly overpriced hardware or software. Many mac users own Microsoft Windows.
You say you had to buy windows to run software that is not available for mac? Blame apple for not providing cross platform development tools, and for licensing SDK in such a way that adaptations to other build environments cannot be redistributed.

Tuesday, February 24, 2009

Porting to OS X.

Been very busy, hence no blog updates.

Today I did a lot of messing with Mac OS X. Firstly, I did set up compiler on Linux to build for Mac (by this tutorial), only to discover that OSX 10.5 obsoleted old binary format somehow (i386_THREAD_STATE marker number changed, *what the hell*), so I had to fix and debug linker (took several hours), manually merging in some headers from apple's SDK into odcctools (automatic merge failed).

Secondly, whenever I use mac I'm annoyed by OS X infamous mouse acceleration curve.

I found apple mouse driver's settings, you can read those online here All the important settings are base-64. IOHIPointing.cpp and IOHIPointing.h seem to be the implementation. I'll refrain from commenting on the apple's truly horrific coding practices, apart from noting that apple's linker sources seem even worse.

Friday, January 2, 2009

More drawings.

Drew some male faces for a change.

McGuyver (or what's the actor's name):



(I kinda cheated - paused movie. Need to learn to draw without pausing.)

some "random" face drawn without reference: