Wednesday, December 25, 2013

Saturday, November 30, 2013

Kmeans++ Color Quantization seeding.

So I was checking through a few color quantization algorithms and read the procedures needed for the Kmeans++ algorithm which is just Kmeans but it is initially seeded by finding maximally distinct colors from all previous color entries. And I was like hey, I totally already solved that problem!

In fact, I made a color dictionary of maximally distinct colors from all previous colors so to do the whole color quantization routine with an optimized initial seed, I can just feed it N digits of my lookup table that basically fits the gamut perfectly.

private static final String[] indexcolors = new String[]{
        "#000000", "#FFFF00", "#1CE6FF", "#FF34FF", "#FF4A46", "#008941", "#006FA6", "#A30059",
        "#FFDBE5", "#7A4900", "#0000A6", "#63FFAC", "#B79762", "#004D43", "#8FB0FF", "#997D87",
        "#5A0007", "#809693", "#FEFFE6", "#1B4400", "#4FC601", "#3B5DFF", "#4A3B53", "#FF2F80",
        "#61615A", "#BA0900", "#6B7900", "#00C2A0", "#FFAA92", "#FF90C9", "#B903AA", "#D16100",
        "#DDEFFF", "#000035", "#7B4F4B", "#A1C299", "#300018", "#0AA6D8", "#013349", "#00846F",
        "#372101", "#FFB500", "#C2FFED", "#A079BF", "#CC0744", "#C0B9B2", "#C2FF99", "#001E09",
        "#00489C", "#6F0062", "#0CBD66", "#EEC3FF", "#456D75", "#B77B68", "#7A87A1", "#788D66",
        "#885578", "#FAD09F", "#FF8A9A", "#D157A0", "#BEC459", "#456648", "#0086ED", "#886F4C",
        "#34362D", "#B4A8BD", "#00A6AA", "#452C2C", "#636375", "#A3C8C9", "#FF913F", "#938A81",
        "#575329", "#00FECF", "#B05B6F", "#8CD0FF", "#3B9700", "#04F757", "#C8A1A1", "#1E6E00",
        "#7900D7", "#A77500", "#6367A9", "#A05837", "#6B002C", "#772600", "#D790FF", "#9B9700",
        "#549E79", "#FFF69F", "#201625", "#72418F", "#BC23FF", "#99ADC0", "#3A2465", "#922329",
        "#5B4534", "#FDE8DC", "#404E55", "#0089A3", "#CB7E98", "#A4E804", "#324E72", "#6A3A4C",
        "#83AB58", "#001C1E", "#D1F7CE", "#004B28", "#C8D0F6", "#A3A489", "#806C66", "#222800",
        "#BF5650", "#E83000", "#66796D", "#DA007C", "#FF1A59", "#8ADBB4", "#1E0200", "#5B4E51",
        "#C895C5", "#320033", "#FF6832", "#66E1D3", "#CFCDAC", "#D0AC94", "#7ED379", "#012C58",
        "#7A7BFF", "#D68E01", "#353339", "#78AFA1", "#FEB2C6", "#75797C", "#837393", "#943A4D",
        "#B5F4FF", "#D2DCD5", "#9556BD", "#6A714A", "#001325", "#02525F", "#0AA3F7", "#E98176",
        "#DBD5DD", "#5EBCD1", "#3D4F44", "#7E6405", "#02684E", "#962B75", "#8D8546", "#9695C5",
        "#E773CE", "#D86A78", "#3E89BE", "#CA834E", "#518A87", "#5B113C", "#55813B", "#E704C4",
        "#00005F", "#A97399", "#4B8160", "#59738A", "#FF5DA7", "#F7C9BF", "#643127", "#513A01",
        "#6B94AA", "#51A058", "#A45B02", "#1D1702", "#E20027", "#E7AB63", "#4C6001", "#9C6966",
        "#64547B", "#97979E", "#006A66", "#391406", "#F4D749", "#0045D2", "#006C31", "#DDB6D0",
        "#7C6571", "#9FB2A4", "#00D891", "#15A08A", "#BC65E9", "#FFFFFE", "#C6DC99", "#203B3C",

        "#671190", "#6B3A64", "#F5E1FF", "#FFA0F2", "#CCAA35", "#374527", "#8BB400", "#797868",
        "#C6005A", "#3B000A", "#C86240", "#29607C", "#402334", "#7D5A44", "#CCB87C", "#B88183",
        "#AA5199", "#B5D6C3", "#A38469", "#9F94F0", "#A74571", "#B894A6", "#71BB8C", "#00B433",
        "#789EC9", "#6D80BA", "#953F00", "#5EFF03", "#E4FFFC", "#1BE177", "#BCB1E5", "#76912F",
        "#003109", "#0060CD", "#D20096", "#895563", "#29201D", "#5B3213", "#A76F42", "#89412E",
        "#1A3A2A", "#494B5A", "#A88C85", "#F4ABAA", "#A3F3AB", "#00C6C8", "#EA8B66", "#958A9F",
        "#BDC9D2", "#9FA064", "#BE4700", "#658188", "#83A485", "#453C23", "#47675D", "#3A3F00",
        "#061203", "#DFFB71", "#868E7E", "#98D058", "#6C8F7D", "#D7BFC2", "#3C3E6E", "#D83D66",
        "#2F5D9B", "#6C5E46", "#D25B88", "#5B656C", "#00B57F", "#545C46", "#866097", "#365D25",
        "#252F99", "#00CCFF", "#674E60", "#FC009C", "#92896B"

Wednesday, November 20, 2013

The Joys of the Hookah

(I don't smoke but digitizing this)


Though some may smoke segar, cheroot,
Or others' taste a pipe may suit,
They can't with thee the palm dispute,
                                             My Hookah.
When oft in boats I've been confin'd,
And ev'ry festive scene resigned,
Thou hast consol'd my drooping mind,
                                             My Hookah.
Whilst slow the pinnace seem'd to glide,
Along the Gunga's barren side,
What pleasing comfort thou supplied,
                                             My Hookah.
And when for weeks no change I've seen,
No fertile banks or meadows green,
With thee I've ne'er dejected been,
                                             My Hookah.
In gloomy jungles, where, alas!
No friend was near to quaff the glass,
Still did the hours contented pass,
                                             My Hookah.
And if the season bred disease,
From stagnant jeels or wither'd trees,
They smoke dispell'd the noxious breeze,
                                             My Hookah.
Expos'd to Sol's meridian power,
Or delug'd by the pelting shower,
Thou cheer'dst me in the gloomy hour,
                                             My Hookah.
In camps where oft untimely fell,
The valiant youth by fever's spell,
They fumes for ever kept me well,
                                             My Hookah.
From lengthen'd march the foe to meet,
Assail'd by thirst, expos'd to heat,
The conflict gain'd! I'd joyful greet
                                             My Hookah.
By arduous duty now deprest,
My strength exhausted, still no rest,
To me though then wert doubly blest,
                                             My Hookah.
Then as I sat beneath a tree,
If shade there haply chanc'd to be,
I seiz'd thy snake with extasy,
                                             My Hookah.
And now with evils still more trying,
To grieve for friends, departed, dying,
Alas! I often smok'd thee sighing,
                                             My Hookah.
The heart which can refuse a tear
For those who fall in war's career,
Can ne'er deserve thy envy'd cheer,
                                             My Hookah.
And if by chance in party dining,
Where conversation see'd declining,
I never thought of once repining,
                                             My Hookah.
But if that silence should be broke,
I did as others did, I spoke,
And then resumed thy snake to smoke,
                                             My Hookah.
Should lovely women deign partake,
A whiff or two for smoking's sake,
What odour would it give thy snake,
                                             My Hookah.
Not nectar would I wish to sip,
Allow'd that blest Munall to grip,
Which has been press'd by woman's lip,
                                             My Hookah.
If Hookahs can such pleasure give,
And smokers can such joys recieve,
Oh! let me smoke thee while I live,
                                             My Hookah.

1st, "Cheroot," an Eastern name for segar.
3d, "Gunga." the native appellation for the Ganges,
5th, "Jungle", thick forests.
6th, "Jeel," large pools formed by the rains; and from their stagnant state, rendering the neighbourhood peculiarly unhealthy.
11th, "Snake," the name given to the long flexible tube which conveys the smoke.
17th "Munall," the part applied to the mouth; made of gold, silver, or agate,

Sunday, November 10, 2013

Field Terrain Fractals

It occurs to me that treating fractals as fields that iterate from the previous and are solvable recursively for some subset so long as it doesn't diverge from the entire infinite field actually provides for not just a much better diamond squared fractal but rather for an infinite array of different types of fractals. There are basically only noise algorithms to do landscape like things, but if you take my algorithm and simply use it to recursively iterate the iterations within a limited scope you can produce a hell of a lot of different fractals.

Not to say they aren't useful, but most fractal iterations simply iterate and store the entire fractal in memory. To some extent that's not really needed. You could create a series of linear fractions say by starting by in infinite random field and then each iteration inserting the midpoint offset displacement just along the width. You'd get the 1d midpoint replacement fractal in infinite rows.  Or perhaps more useful you could apply say a box blur to a landscape, insert additional area with average random offset and repeat each iteration.

If (iteration == 5) {
     request sliver of the Iteration5 from iteration4 requested + 1 on each side,
     Apply a block blur (or frankly any convolution), and return the center bit that is accurately blurred.

You could likely produce pretty good landscape noise by inserting progressively less random additional points between all your current points and then applying a blur to all points. Even larger Gaussian blurs wouldn't be too difficult. In fact, there are some artifacts in diamond squared that cannot be fixed. Some points simply have different probability curves based on their location. If you always got the maximum possible random number every time, for a diamond squared field, you'll notice a *VERY* apparent pattern.

This typically blends into the noise and only matters for the standard deviation of the pattern. So long as they average at 0, it isn't very obvious (if you have run so that on average you deviate in some direction, it becomes apparent). It doesn't really have to be this way.

Saturday, November 9, 2013

Field Diamond Squared Fractal Terrain Algorithm

The traditional Diamond Squared algorithm for generating fractal terrain has a number of constraints that make it really hard to use.
Gives a pretty good rundown of the cons:

* The map must be stored in memory, because pixels reference other pixels.
* Because it must be stored in memory, memory becomes a constraint. [...]
* The map must have a width and height of 2x + 1 pixels.
* Has 'creasing' artifacts if wrapping isn't used.
* Wrapping isn't always wanted.

I have solved all of these. And simplified the algorithm.

The traditional algorithm is that you set 4 corners to random values and wrap around the edges.

0 0
0 0

You double the height and width. Then each place you have four corners available to you, you insert the average of those corners and a slight random offset.

0   0
  1   1
0   0
  1   1

Due to the wrapping. You have four diamonds.

Then after all the diamond steps are done, you add in the square sections.

0 2 0 2
2 1 2 1
0 2 0 2
2 1 2 1

Keeping in mind it wraps around.


My solution is to simply view the base step as an infinite field of purely random values. This seems harder to conceptualize. But, it fixes the problems. You can't create an infinite field with twice the width as an infinite field. But, if you note, the next iteration doesn't require anything more than 1 away from the current iteration.

Even without any wrapping you can take:
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

And diverge.

0   0   0   0
  1 2 1 2 1
0 2 0 2 0 2 0
  1 2 1 2 1
0 2 0 2 0 2 0
  1 2 1 2 1
0   0   0   0

We went from a 4x4 to a 5x5. Next it goes to a 7x7 then a 11x11 then a (2n-3)x(2n-3)...

So we can simply reverse this with our well formed request.

If we want 1000x1000 block of data say at the range [0-1000], [0-1000] at 24 iterations (which under the traditional method would require 2^48 bits of memory to store), we can request:

[0,1000] [0,1000] @ 24 which means we divide the range in half rounding towards the larger area and increasing the bounds by 1.
We need the range:
-1 to 501 @ 23
-1 to 252 @ 22
-1 to 127 @ 21
-1 to 65 @ 20
-1 to 34 @ 19
-1 to 17 @ 18
-1 to 10 @ 17
-1 to 6 @ 16
-1 to 4 @ 15
-1 to 3 @ 14
-1 to 3 @ 13
-1 to 3 @ 1
-1 to 3 @ 0 which simply returns a field of 4x4 random numbers.

Rather than all that nonsense with wrapping and seeding and making what is actually a special case of the base case, we can simply reduce the algorithm to:

getTerrain(x0,y0,x1,y1,iterations) {
    if (iterations == 0) return maxtrixOf(random numbers);
    map = getTerrain(floor(x0/2) - 1, floor(y0/2) - 1, ceiling(x1/2), ceiling(y1/2), iterations-1);
    make a newmap twice as large.
    copy values from map into x*2,y*2 locations in newmap.
    apply diamond where possible. +- smaller random offset
    apply square where possible. +- smaller random offset
    return requested area from within newmap. (This is typically newmap from [1,(n-1)] [1,(n-1]


That's the entire algorithm. No more constraints and it's easier. On top of this the number of iterations doesn't control the size of the field but rather smoothness, of the underlying fractal. And since the base case is seen as an infinite field of purely random numbers, it goes on forever even at just a couple iterations as the iterations has no bearing on the size (it's always infinite).

On top of this rather than using a random number, you can use the the x, y, and iterations to make a pseudorandom but deterministic number like through a SHA1 hash. Then you can page from within the same area, forever without needing to have calculated all of it to start. You can create an infinite landscape without needing infinite memory to start, and returning to the same coordinates will give you the same results, and it doesn't matter which way you took to get there. 'There' will be deterministic.


I hacked together a working bit of the code in javascript:

Stealing liberally from


Also check my newer algorithm Olsen Noise (though still lacking a javascript implementation) which corrects the artifacting and allows it to be changed into N dimensions. It also, simplifies. The algorithm even more.

Saturday, October 19, 2013

Sunday, September 29, 2013

Firefly Symphony Clips

Rich people and unethical behavior.

It turns out that rich people don't need to be polite, they have money.

Saturday, September 14, 2013

Chapman Cohen -- Fragile Things quote.

These gods of the ancient world sent rain and gave their followers good health; they answered prayers; they sent their faithful worshippers to a prepared heaven and their enemies to a prepared hell. But as man’s worship declined so the objects of the worship declined also. Gods are fragile things, they may be killed by a whiff of science or a dose of common sense. They thrive on servility and shrink before independence. They feed upon worship as kings do upon flattery. That is why the cry of gods at all times is “Worship us or we perish.” A dethroned monarch may retain some of his human dignity while driving a taxi for a living. But a god without his thunderbolt is a poor object. -- Chapman Cohen, The Devil

Thursday, September 5, 2013

West Virginia BOE v. Barnette

In a concurring opinion via wikipedia:
"Words uttered under coercion are proof of loyalty to nothing but self-interest," wrote Black and Douglas in a concurring opinion. "Love of country must spring from willing hearts and free minds, inspired by a fair administration of wise laws enacted by the people's elected representatives within the bounds of express constitutional prohibitions."

Update: Full paragraph rather than wiki synopsis.

Words uttered under coercion are proof of loyalty to nothing but self-interest. Love of country must spring from willing hearts and free minds, inspired by a fair administration of wise laws enacted by the people's elected representatives within the bounds of express constitutional prohibitions. These laws must, to be consistent with the First Amendment, permit the widest toleration of conflicting viewpoints consistent with a society of free men.

Monday, August 19, 2013

One of the saddest things in history, Ignaz Semmelweis

Semmelweis was outraged by the indifference of the medical profession and began writing open and increasingly angry letters to prominent European obstetricians, at times denouncing them as irresponsible murderers. His contemporaries, including his wife, believed he was losing his mind, and in 1865 he was committed to an asylum. In an ironic twist of fate, he died there of septicaemia only 14 days later, possibly as the result of being severely beaten by guards.
He effectively figured out germ theory and how to combat it. And was so angry at the medical community for not accepting his conclusions that he wrote enough irate letters attacking them that they locked him up, beat him, and he died of an infection. He basically was the guy who put medicine in the black. It was the case prior to him, that alternative medicine practitioners did better than traditional medicine because alternative medicine kept you away from traditional medicine which killed you. That you could bleed on a battlefield of a wound and stand a better chance of surviving than if you were taken to a clinic. Women would have children in the street rather than go to the clinic staffed with doctors and would beg to go to the midwife clinic. Prior to the 19th century, medicine was worse than voodoo because for as weird and nonsensical as voodoo is, they didn't kill you unlike medicine. Today we are very cognisant of this. The reason for the reliance on outpatient surgery is not high turn over and getting patients out as quick as possible for the sake of money, but because hospitals are not safe places to stay for long periods and the sooner they can boot you out the better your rates of avoiding post-op infections.

Thursday, August 8, 2013

College Education as a Poll Tax.

I was reading Wikipedia and came to this paragraph in the article on Economic mobility:

It is a widespread belief that there is a strong correlation between obtaining an education and increasing one’s economic mobility. The education system in the United States has always been considered the most effective and equal process for all individuals to improve one’s economic standing. Despite the increasing availability to education for all, family background continues to play a huge role in determining economic success. To individuals who do not have or cannot obtain an education, the greater overall levels of education can act as a barrier, increasing their chance of being left behind at the bottom of the economic or income ladder.

Since you basically need a Bachelor's to get an entry level job, only those families well off enough to send their kids to college can do so and then those who can't get left behind. It's a bit like charging everybody for the right to vote and the rich don't mind much because it's not much money to them. But, it prevents the poor from moving forward or looking after their interests.

Thursday, August 1, 2013

Saturday, July 27, 2013

The origins of Christianity by culture or divine edict.

The Bible depicts that hemisphere earth, with a strong metal-like dome covering the world. Because that's what everybody in the middle east thought. It was a circle, but also pretty much flat save for some mountains. You really could build a tower to reach the sky. You really could be drowned by the cosmic ocean if the windows in the vault of heaven were opened, and God spent the entire 2nd day of creation building the damn thing, and a goodly part of the 4th adding little stars into the dome. And upon the end of the world, those stars will rain down to the Earth like snowflakes. Look, at the core, they believed pretty much exactly what their neighbors believed. It was largely a flat Earth with everything revolving around it. They sacrificed goats to appease others and then to appease the gods. And got into the habit of blood sacrifice to God. The Pagans came around with their children of gods stories, all over the place gods were having children with mortals and doing extraordinary things. And in this exact region we first find a little religion called Christianity where God has a child with a woman who is sacrificed to forgive the sins of the people. I mean, if a goat is good how much better must be the son of God (It even makes this exact argument in Hebrews 9). Later to reconcile the polytheistic aspects the trinity was invented (early Christian work was largely Arian with Jesus as a separate but high creation of God, the Messiah, God's warrior). So in the end we have a religion wherein God takes human form through virgin birth (a highly prized quality in Paganism judging from how many stories involve it, even though the Jewish myth of messiah only asked for a young girl) and then God sacrifices God to God to give God permission to God to be less angry at God's creation because their ancestors ate magical fruit from a magical tree on the advice of a talking reptile. This religion, doesn't make sense as an actual way to run the universe. It simply doesn't. It's absurd and why does God need his own God blood to do something? And yadda yadda yadda. But, it does make absolutely perfect sense as what culture would invent. This is *EXACTLY* what that culture would have invented as a religion. And we're pretty sure that's exactly where most religions come from, as sure as the Vikings made a religion wherein good vikings dying in the act of being good vikings would go to an afterlife of a bar in the sky wherein they'd drink booze with the gods, or that cultures on volcanic islands invent fire gods who are mercurial in nature and quick to anger.

Tuesday, July 16, 2013

I'd like to Thank Bayes Theorem.

Back in 2011 I wrote:

If a woman is murdered, it's really odd to think that being married to her is pretty good evidence that you killed her without any other considerations. Because most of the time the husband is the guilty party. Likewise though there appears to be no evidence to suggest that Lance Armstrong cheated in order to win the Tour d' France seven times, there's actually really good evidence. Competitive bicycling due to distance traveled gives huge advantages to anybody who cheats. And the fact that Lance Armstrong won seven times, is good evidence that he cheated without any other considerations. In fact, if anybody wins the Tour d' France that is strong evidence that they cheated, so good in fact, that one could be justified in believing they cheated on that point alone.

This was before the whole Lance Armstrong fallout was even a whisper on the wind. I came to the conclusion he cheated simply by understanding Bayes even when there was no traditional evidence against him.

Friday, July 12, 2013

Science, Religion, and the answers to questions.

The question of the compatibility of religion and science depends on what you generally mean by compatible, and religion. But, we'll tend to gloss over compatibilism, but depending on what is meant by those terms it's either true or false, and depends.

You assert that both science and God are essential to our understanding. That already assumes God is real. But further declares God is essential to our understanding. In principle and practice, you actually have to prove that step. And if you did, it would already be a reasonable proof.

The worst problem I see is pretty central to the argument. You seem to be misconstruing being wrong with non-overlapping magisterium. You very much can use science to prove religious claims. But, let me focus down on why you say you can't.

Often times when God is given as an explanation for a natural process it is a gods of the gaps argument. It sees an opening in our understanding (we haven't explained morality, or design in nature, or the origin of the universe) and shoves God in there. Then science comes along and actually gives the correct answer and explains the phenomenon. Using this background you then veer completely the wrong direction. Saying, more or less, that if such points are that way falsified, is it not therefore true that science cannot falsify such notions.

In reality, the way this works is the answer that fails the most, is demonstratively not a good answer. If you had two horses that ran a million races and every time they ran a race the first horse won, and they were preparing to run another race, which horse should we bet on? This is the way it has been with the gods of the gaps, and the track record of the success of supernatural and divine claims. Lighting is caused by Zeus. Wait, it's just a natural phenomenon. Thunder is caused by Thor's Hammer. Wait it's an exploding sonic boom of air around lightning. Disease is caused by demons, and Jesus can shoo those demons away. Wait, they are cause by microscopic life forms. Genetics must be caused by God. Nope. Life must be God by God. Nope. The universe must be caused by God. Nope. -- Each time, supernaturalism is offered as an answer, and each time the answer turns out to be unknown natural phenomenon.

In every case, thus far the answer to every mystery has always turned out to be unknown natural phenomenon. You state in your conclusion that, "to rely solely on science is irrational" -- I must ask you to substantiate that premise. Because, thus far, with regard to how the universe works, the only thing that has ever answered a question, that we use to not know the answer to and we now do know the answer to, made that transition was science. -- At best religion was only interjected into those questions as a placeholder for our ignorance. We don't know why the seasons happen or why there are stars, the gods must have given us the seasons and the stars must be lights embedded in the dome that covers the Earth. -- Now we do. Religion was the wrong answer. And to the best I can tell has never actually answered any question. Science on the other hand has answered everything we've actually answered.

As for the why and how dichotomy, this generally isn't your argument so I'll be a little less kid gloves. It's entirely fictitious. Why are we here? There's plenty of answers. Generally our parents had sex is a pretty good answer to that. How does that work? Well, we have a pretty complete understanding of reproduction. Why does life exist here on this planet ultimately? Because it can. We can't accept all answers. Or rather, we can but we need to check how reasonable they are and decide which one is the most likely to be correct (or which is the least wrong).

The question here isn't really the "most convincing" but actually which one is the most likely to be true. Humans are an odd lot. We are easily distracted by shiny things and hollow promises. So, anybody might be find themselves liking the answer that they are the very special creation of the creator of the universe, who due to accepting these particular beliefs, will be given an eternity of bliss much more than they like the answer, that they evolved on this planet, their parents had sex, and they will die and be dead. While there's nothing to support the former, there's every reason to think the latter is true. But, again, humans love shiny things and hollow promises.

Looking more specifically towards the Christian answers they seem even less convincing. Not because the promises of eternal life and avoiding eternal punishment makes it a sucker's bet to refuse. But, because that stuff is exactly what humans would come up. God needed blood to fix the universe, and only his own blood had enough magic to do it, so he gave himself a body and killed it. He did this to create a loophole in the system he had already invented that nobody could succeed because some mythological ancestors ate magical fruit from a magical tree, and God's anger at them carried down to their innocent children. And finally the only way that God could stop being angry at his creations and needing to send them eternally to the place of infinite torture was to don a baby suit, live a perfect life, and die horribly. Because blood appeases God, and the better the blood, the more it appeases God. So God's blood appeases God the most, and so that was the only way God could be so very appeased to allow all you sinners into heaven anyway, even though you are all vile evil crap. God loved you enough to have a very bad weekend for your sins.

I know I'm making light of the religion there, but if you look at it sociologically you can see all the very human hooks. Humans want to avoid pain and achieve pleasure. So they are promised eternal bliss and to avoid eternal torture. Humans are easily shamed into doing things and guilted into them, so look what you made me do, Jesus had to die for your sins! Or historically it it makes perfect sense that in first century Israel. You have a society that actually believed that blood sacrifice appeased God, and they were very recently taken over by Pagan Rome. And the Pagans absolutely loved their stories about the sons and daughters of gods. Demigods were a hugely popular genre in their culture. And where these two intersect we find the first instances of the religion that says that the Son of God was sacrificed to God for the sins of the people and believing and accepting this gives you eternal life. It later gets complicated through trinitarianism (if the Son of God is God, he sacrificed Himself to Himself), but it's all a pretty direct path to how humans actually invented such things and how the religion was much more strongly influenced by culture than by reality.

If that were true, it would be rather heterodox in and of itself. That seems like a really strange way to run a universe with 70 sextillion stars and hundred of sextillions of planets. But, that humans made up such gods, seems really really likely. Because humans all over this planet make up all kinds of gods. Gods with several heads, that look like humans, that create the universe, that fight and kill giants, that create themselves. We humans love to make up gods. We are easily convinced by such stories, but not because the stories are true. But because the stories are so very deeply human. They are exactly the sorts of things that should convince us, they are specifically designed (self-designed infact) to get followers and be effective, and get more followers and be even more effective.

This is the principle distinction between "convincing" and "correct". We humans can easily be bamboozled, and nobody does it better than we do it to ourselves. Science is so very effective because it pulls out all the stops in order to prevent this from happening. In science, we try very very hard to keep from fooling ourselves.

Science answers the how questions, but it also answers the why questions. Religion answers neither type of question. In the history of answering questions, it's boasting a whopping zero percent. There are not always answers to the why questions. "Why the seas are boiling hot?" "Why were the last powerball numbers 28 36 40 48 55 and 1, and not something else?" However, there's also some how questions that equally don't have answers. "How is the decay of a radioactive isotope caused?" -- Questions do not have to have answers. But, for the questions that don't have answers there's a lot of them that are why questions because it asks for motivations and a lot of things aren't motivated. "Why does the sun rise in the morning?" Sure, inertia and rotating masses, but "Why is it like that?" You can eventually get down to what is basically just statistical noise. Where there is no good reason why it is that and not something else.

And religion comes along, and does what it always does. It shoves god into any question that isn't answered.

However, the core of your argument is that both science and God are essential to our understanding reality. But, is that actually true? What if I insisted that fairies are required to answer these why questions. Any question about why something is that way and not another is attributed to the will of the fairies who made it that way and certainly wouldn't have made it a different way. -- If this even makes logical sense, it cannot be that God is actually essential. God is again, as always, just being inserted as a placeholder for not having an answer, a role indistinguishably similar to my hypothetical fairies. And what if we went the other way, and tried replacing science. That both fishing and God are essential to understanding the universe. We instantly notice that fishing sticks out like a sore thumb. It doesn't ever answer questions, it's a procedure by which we use fishing poles to catch fish.

It seems that we could very well simply reduce that statement to just science. Science is essential to our understanding of reality. And if you want to add to that, you'd need to show that whatever you're adding is capable of solving actual problems and has a track record for having solved actual problems without science. To the best of my knowledge, only mathematics possibly fits that criteria. Why is it that "to rely solely on science is irrational" -- it seems to be the only thing that gives us correct answers, builds computers, takes us to the moon, cures diseases, doubles our lifespan, and actually replace ignorance with understanding.

Thursday, July 11, 2013

Tu Quoque atheist, tu quoque....

No. This tu quoque stuff needs to stop.

You believe that God needed blood to fix the universe and only his own blood had enough magic to do it so he donned a baby suit, lived 30 years, and sacrificed Himself to Himself to give Himself permission to be less angry at His creations whose ancestors ate magical fruit from a magical tree on the advice of a talking reptile... and I don't believe you.

That doesn't require evidence, it requires the thing being absurd or you having no evidence. I have both!

Thursday, June 27, 2013

DOMA, Scalia, and fair defeat.

In the Winsor case, Scalia's peroration in his dissent reads:

"Some will rejoice in today’s decision, and some will despair at it; that is the nature of a controversy that matters so much to so many. But the Court has cheated both sides, robbing the winners of an honest victory, and the losers of the peace that comes from a fair defeat."

What an bit of claptrap. The majority of the Supreme Court handed victory to the to the pro-gay marriage side (the end part of Scalia's dissent is largely about how the decision is designed to make sure that states also cannot discriminate). And this in turn means that people will not be allowed to vote on the rights of gay people and thereby deprive them of an honest victory. -- You aren't suppose to vote on the rights of other people, that's what makes them rights. Having victory tied up into a neat little package with a bow already affixed is an honest victory. The idea that we should discriminate until the tyranny of the majority can be prevented by changing minds all the way to Mississippi is idiotic. You don't get to let bigotry delegate people to second class citizenship, and you certainly shouldn't allow people to vote on whether other people have rights or not. And having the courts say that that isn't fair, is an honest victory, you don't need to change the minds of bigots to win the game honestly. Fuck bigots. You don't get to vote on people's rights.

Friday, June 21, 2013

Tat's Trivia Bot 3.69

Tat's Trivia Bot 3.7

I think I found the dialog issue. When you'd open it it would beep due to crashing. I also added in KAOS questions. I didn't know what they were before, but apparently they are like Total: except you don't lose for not getting all the answers. More or less. I also added a hint for the KAOS questions, which similarly works for total as a piggy backed the question type. I also expanded the dialog a nice chunk. Like replaced all the stuff and took up more room. It looked horrible on my system and my system's fairly modern so maybe it sucks other places too.

Latest Version: Tat's Trivia 3.69

Also if you need an eggdrop tcl trivia script for IRC I do recommend:
Seemed like a pretty reasonable script, and seemed to have pretty clean execution. Runs on an entirely different platform than my mIRC bot (so don't bother if you don't know what it is).

Sunday, June 16, 2013

How to build a pyramid!

There's a lot of speculation as to how the ancients built the pyramids, most use ramps. Some speculate that ramps couldn't hold the really big stones or would collapse. Really the better way to do it would be to mud the entire base. Create a hill of mud up to the top of the pyramid used thus far. So rather than any sort of special ramp, you'd pretty much end up with a mountain of mud, then when you're done, just dig it out. It might require moving a lot of dirt, but it's well within the abilities of peoples and it would never collapse under any amount of weight. Put some rocks in place, build a hill, put some rocks in place, make the hill bigger. You'd largely end up doing that anyway. Especially as you need to lift the stones up higher.

Tuesday, June 11, 2013

Richard Carrier on Pagans, Progress, and Religion

"The pagans gave us democracy, citizenship, human rights, in fact the entire concepts of rights including freedom of speech, science, medicine, philosophy, formal logic, and mathematics. They also gave us a philosophical defence of moral virtues including philanthropy, generosity, mercy and honesty. Does that make paganism reasonable? No. The reason pagans came up with these things is not because they were pagans it is because they just happened to be pagans at the time that these humans came up with these brilliant, and beautiful, and good ideas and disseminated them. The fact that Christians may have done, and come up with good things, and good ideas, and done good things, is not because they're Christians but because they just happened to be Christians at the time. If they were Muslims or if they were pagans at the time, they might have come up with the same ideas and done the same things. Just as pagans did lots of great things, that we also benefit from tremendously" - Richard Carrier

Friday, May 24, 2013

Sometimes code can be pretty... and worthless.

public static boolean permutation(List values, int index) {
        return permutation(values, values.size(), index);
    private static boolean permutation(List values, int n, int index) {
        if ((index == 0) || (n == 0))  return (index == 0);
        Collections.swap(values, n, n-(index % n));
        return permutation(values,n-1,index/n);

It finds an indexed permutation for the list. So each permutation index will give a new permutation... at least until you run out of integers which is at about 12 items.

Monday, May 20, 2013

Been a while since I posted.

I blame facebook. Keep posting minorly interesting things there and not here for nobody to see.

Tuesday, April 23, 2013

Successful marriages.

To say that those marriages which end in divorce are failures is to say that those marriages which end in death are successful.

Friday, April 12, 2013

Carrier Debate, fun

Oddly a slaughterfest. I loved the parts where Richard Carrier finished. Like he answered all the points and just sat back down with time on the clock.

Sunday, April 7, 2013

What you should want to dust a computer.

Computer people sometimes want canless air systems to blow out computers. But they cost like 60-100 bucks.

Computer people should want AC air mattress pumps. They cost 17 bucks and you might already have one.

Friday, April 5, 2013

Idea of the day: Space exploration through sexism.

No woman has stepped foot on the moon. And no woman ever will! NASA knows that women have cooties.

You'd want to blame a coincidence but it really is sexism that tended women away. And you'd want to say that it's not true, but we can't go to the moon. China seems inclined to send folks to the moon again, maybe some Chinese woman will be the first woman on the moon. Heck Valintina Tereshcova was the first woman in space.

Tuesday, April 2, 2013

Need a scale to size function for the actual monitor to the real life object?

Some programs have a zoom to scale function that requires training the program to know how large their pixels are, so they sometimes do things like ask what size a specific line is, so you take out a ruler and measure it.

A better way of doing that is by using the ISO 7810 standard to your advantage. Credit cards and most ID cards are all the same size. If you can indicate what size that is, you can scale images to the correct size without much effort and it works internationally etc.

Took half an hour to figure out a good standard candle but it turns out that international banking demanding a standard is actually quite useful.

Tuesday, March 12, 2013

Yay. FeministFrequency Video Game Tropes.

I've been a fan of FeministFrequency for a long time now. Since long before the dust-up. Apparently she got picked up by some anti-feminist folks who made all the usually death/rape threats. Which got her kickstarter project over funded and expanded the typical tropes she was going to do into a much larger project and ended up going away for a very long time.

But finally, new videos!

Well the first episode has finally trickled in.

Saturday, March 2, 2013

Is atheism a comfort?

Atheism offers me no bribes for my beliefs. It promises me no magical kingdoms, no bliss, no eternity with my family, no salvation from the fires of hell. The only thing it seems to give me is an understanding that reality is what it is. I believe atheism not because it offers me a prize, but because I genuinely believe that it's true.

Saturday, February 16, 2013

Thanks Russian Cameras.

I love that you exist. Thank you Russian cameras.

Saturday, February 9, 2013

Why can't heaven speak?

Why can't dead people in heaven talk to people on Earth. Nothing would put a person on the straight and narrow for Christ faster than a talk with their dead grandmother in heaven. It's no more compulsory than a talk with a living grandmother. But, oh so much better. Why then is there no communications?

Given Christianity this would serve God's purposes, ad hoc reasons must be given as they are pulled from one's ass.

Given atheism the answer is obvious (dead people are dead).

So atheism provides what amounts to a free explained phenomenon simply as a side effect. But, Christianity needs to make up something new to explain that problem.

This is evidence for atheism and evidence against Christianity.

Tuesday, February 5, 2013


I've done a reasonable amount of java script coding lately implementing turtle graphics and lsystem as well as other projects and I must admit since the early 2000s the language has become dare I say, elegant. I don't know if that kind of evolution is possible for many languages but really it's no where near as horrible and trick ridden as I recall. Where you'd code it for IE because everything else would take code IE could take but if you coded for another browser it would go wonky and object. It was a pain. Now, it's actually a really pretty language, tossing functions around like variables and calling them and having variables properly react like what you'd want them to be.

Quote: Gandhi

Truth never damages a cause that is just. – Mohandas K. Gandhi

Wednesday, January 16, 2013

Yes, but can't we still just accept it as plausible?

That's not how plausible works. I could say that I don't think that life on this process began with chemicals and random time like all the scientists doing real work on the subject actually think. But I think humans from the distant future traveled back in time and created this planet and invented the life on it.

Would you argue that is plausible and credible and open? Do you think there being no evidence against it or for it, is a mark in it's favor?

The answer really should be no. I can with enough special pleading make the claim that the moon is made out of green cheese something for which there is no evidence against. We know the density of the moon, well the cheese just happens to be very dense. We've been to the surface and found rocks, because it has rocks on the surface. If I explain away every objection with another bit of story I can get it to the point where we should find no evidence against the proposition of our moon being made out of green cheese in some kind of special way that makes it outwardly appear to be made out of rock.

Should we then say there's no evidence against the theory and at the very least we should consider it plausible and credible?

The actual answer is no. Evidence is largely defined by Bayes Theorem, and there are a few variables there for how ad hoc the hypothesis is and how much additional stuff you need to accept it and how good the alternative hypotheses actually are.

This is the case with Hameroff's theory. We should not consider it plausible or credible because it is stupid. It is trying to explain away a robust observation that our consciousness actually becomes aware of decisions our brains have made half a second later. It invokes utter crap that physicists and neuroscientists scoff in an attempt to explain these observations away. But, really we should just accept that those observations are true. The moon just happens to look exactly like it's made out of rock because it's made out of rocks. And our gap junctions have chemicals and only get triggered by chemicals and our brains consist of neurons firing in patterns because that's what we are, neurons firing in patterns. The truth isn't something that needs to be explained away with exotic explanations, it can actually just be true.

So, no. The fact that it's really absurd is actually considerable evidence against it. And the fact that the alternative is that what we see is what we get, and that explanation explains all the data that needs explaining suffices to say that a theory that needs to make thoughts exist in quantum fields and magically travel backwards in time, can go ahead and be discarded as wrong.

You may not solve the mystery of missing socks by involving elves. Elves are a greater mystery than missing socks. Socks go missing. You don't need to explain how because of QM they fell out of the universe and traveled forward in time and we'll end up getting them back. They really can just get lost. Brains really can just be a skullfull of neurons and chemicals. And the moon really can just be rock.

Hameroff and Penrose, nonsense²

Largely, this is cut and pasted from my reply to somebody on youtube about Hameroff and Penrose's idiotic theories about consciousness. It's really hard to explain how stupid they are but I fell I did a pretty good plain English explanation. And my blog is largely for myself, with the exception of the Trivia Bot parts that actually do a public service. But, I wouldn't want to lose such a nice reply so I put it here, where I could search and cite and rehash it in the future if it ever comes up.


There's no evidence that particles that pop out of this universe likely by colliding with anti-particles or generally just doing so went into another universe. We just know that at the very very tiny spacetime is broiling with fun pops in and out of spacetime. There's very little to suggest there are any other universes involved or that this carries any information.

There are a series of experiments which have rather firmly established that what we are consciously aware of lags behind by about half a second. We can hit a baseball with a baseball bat but the actual decision isn't made consciously, but rather the conscious mind is informed of it later, and fills it in.

We've also done a lot of experiments with split brain patients and confabulation. Where a person is sat down, they are told via a message on their left side textually to stand up. They stand up. And are asked vocally why they stood up. The standing up was decided by the right brain, but the left brain is being asked to answer the question and they will wax poetic about how they were cold and left a jacket in the car or about how the chair isn't comfortable.

There's also an experiment where a person is shown two small pictures of people and asked who is more attractive. After they make the decision, the pictures are switched with a little slight of hand magic trick and they are further asked why they chose that picture (the one they didn't actually pick). They will explain the decision at length.

We know this stuff happens in the brain. But, then Hammeroff and Penrose don't think it does. It's not a quirky weird thing about the brain that consciousness is informed later and confabulates the answers as to why it made that decision. No. What happens according to them. Is that your conscious decision from the future magically travels back in time half a second through the quantum field and something about gap junctions to have actually made that decision that it could not have made.

This isn't some amazing truth they've stumbled on that means that atheists are really bad at their jobs, they are actually trying to argue that the Emperor has cloths on even though he's walking around naked. When you get passed the fancy buzz words and the physics you realize the physics has the richness of the particles and the quantum mechanics and all they have is a lot of made up stuff about how Quantum Mechanics therefore Consciousness is real rather than made up. Even though there is absolutely no indicator whatsoever that it's either needed or real.

I wouldn't really go out of your way to blame ego, or insist that he's proved souls existed because he proposed a theory you don't possess the acumen to poke holes in or the desire to do so. It's really nonsense. The universe is not a massive conspiracy to get your thoughts into your brain half a second early.

Tuesday, January 15, 2013

Coining a New Word: Hypothetica

Hypothetica: like estoricia or Americana, are those things of the esoteric or American. For example, "maybe there were swarms of bees and that's why he hid in that hole." or "maybe if there were a meteor heading towards Earth" those hypothetical things are hypothetica.

Sunday, January 6, 2013

Colorblindness and Maximally Distinct Color Palettes.

While I did bother to do a lot of legwork and effort to determine which colors are maximally distant the issue of color blindness was always on my mind. While you can push the list of distinct colors to a couple dozens (read left to right, top to bottom).

It seems that given color blindness, you'd really be better off mixing in a few things other than just colors. While you could just use a static lookup list, which is likely the best for color distinction, you might want to consider if there's a better way to do that same thing with aspects that are more distinct to more people, like dashed lines, thicker lines, candicaned lines, marquee text made to fit a line, etc.

You get about four or five really distinct colors for those with lower gamuts of colors. And while my list is still really awesome. You might want to rethink your entire idea to use colors.