Some interesting reading

As I wait in joyful hope for the coming of my saviour and patch for the game Torchlight II, I read arbitrarily on the internet. I started with this shared on Facebook:

11140366_10153282832816605_7043588325758940608_n

So I Googled E Frenkel. It strikes me as a story that somebody made up, but that doesn’t matter. First I found a Darwin awards page. Boring. One can only read the same joke so many times.

Then I found this… It’s one of a series of essays, this one about belief. Although it doesn’t start too well, referring to a deluded Russian psychic who probably didn’t exist, and near the beginning it refers to some other people with strongly held beliefs, strong enough to put faith before their lives. Too bad one of those people also probably didn’t exist. (Jesus of Nazareth.) But otherwise, it’s an interesting and thought-provoking essay. It’s worth reading if you have time to kill – especially if you’re downloading a time-throttled and large patch from a site full of pirated software…

Update: Actually I’m really glad I found those essays. They are worth reading, though not at work because they are lengthy and need to be read slowly as well as carefully to comprehend and retain. This one is about beliefs, including causality, and causal versus equivalence relationships. Having not yet read enough of the essays to understand where their “modeling”, which they define as “the process of usefully describing those structures of experience that give rise to human abilities”, is leading, but I am intrigued.

Posted in Skepticism | Tagged , | Leave a comment

Very annoying. Torchlight II characters max out at level 100. Now what to do with my free time?

I was going to write a very different post, one that describes my feelings of sadness (and the reason for those feelings) , and how it affects me. The thing is, I wouldn’t have been able to deal with those feelings a couple (or three) years ago. That version of me would be back in active addiction now, and it is good not to be that person anymore. It’s bittersweet though because I still have the feelings of sadness. But maybe I’ll write that another day…

I’ve been escaping my feelings and triggers by playing this game for weeks. Here’s what my character looks like now: [Click for full-size image in new tab.]

IrisColt

Excuse her rude name… It’s an anagram for a certain bit of female anatomy that I always use as my female character’s name. Nobody has ever noticed though. (It’s not that complicated you know. Iris Colt — Colt Iris — Clot Iris — Clitoris. Why do people not see anagrams?) Anyway, she’s a dual wand-wielding “embermage” dealing massive amounts of elemental damage and has been great fun to play.

Although the game developers did a great job of keeping the game world balanced, in that no matter the character’s level, the monsters are always roughly the same difficulty, the main incentive to continue playing was always to get the character to level up. At level-up time, you assign character and skill points to build your character. Now this one can’t. About 10 levels ago, her “fame” progress stopped progressing. It still increments, but in such miniscule amounts it will never reach the end of that progress bar. Then earlier today, most of the way though my third time through the game (on difficulty level NG++, which means normal replayed twice), the experience points maxxed out. So I can still play to find better equipment (as finding better weapons, armour and items is the other part of building a great character), but otherwise the fun is over. I finished the game for the third time anyway, and it will allow me to “retrace my footsteps” but I’m not sure if I should bother.

Also there was an odd glitch this time around when playing. I can’t complete one of the side quests, called “robot parts” because on one level, four “gongs” must be hit to open the way to secret room. Somehow the map generated with one of the four gongs in a corner and unreachable, so I could not get that “robot part”. You can see that unfinished quest still listed in the screen shot.

A few years ago, I played a similar game, Diablo II, for months without ever reaching level 100. This one got there too quickly. I can play my son’s character, currently a level 28 “engineer”, which he wants me to do because he wants his character to be “strong” like mine. Or I can start a new character of my own, since mine does have a few skill points in redundant skills, but it would make little difference since the skills I actually use are also maxxed out.

Otherwise, I need to find something else to occupy my free time, since this game has taken my mind off my cravings and I don’t want my thoughts to go back there. This sucks.

If anyone knows of any similar PC games, which allow single player games, please let me know. My colleague told me about a good one called Path Of Exile, but I really prefer single player games. Or maybe I should buy an Xbox and play Diablo III? (I hear the Xbox version supports single-player games, but the PC one does not.)

Posted in Addiction, Family, Recovery | Leave a comment

If atheism is a religion…

Just saw this on Facebook and I had to post it here.

11221839_881626985245121_8522202246283544922_n

The image makes the point effectively and concisely. I have been accused of being “religious” in my atheism too many times. I think it’s easier for a theist to assume that not believing is somehow the same as believing, but it isn’t. It’s never about believing that there isn’t a God. One should start with the null hypothesis, and assume nothing. Religion’s starting point is the implicit assumption that a god exists, then misunderstanding anyone who does not accept your bullshit.

No time to write anything significant today… I must go pick up my son in a few minutes… but I had to share the above image.

Posted in Skepticism | Tagged , | Leave a comment

On figuring out the appropriate bitrate for video conversions

Sometimes I look at source code I wrote a couple of years ago, when I was high on meth, and I think to myself, “You are a fucking imbecile”. Other times it seems I was much brighter then than I am now.

Anyway, I’m watching The Flash. I downloaded episodes 1 to 14 in MP4 format (DVD Rip), and then downloaded episodes 15 to 22 in the only format I could find, which turned out to be MKV (HD Rip). Incidentally, you can find the latest episode, when it gets released, by searching Google for the string “The Flash S1E23 – 350mb – kakashihatake2”, then find the torrent.

They all play on my TV, but unfortunately the MKV sorts before the MP4, which means I have episodes 15 to 22 displaying before episodes 1 to 14. (I can change the default sort order, but the TV doesn’t persist that setting, so it would be worthwhile to force the sort order to be correct by manipulating the files.) So I figured I may as well try converting the MKV to MP4. But what bitrate to choose?

Actually I came up with something a couple of years ago, when I was high, and wrote my own little GUI that wraps ffmpeg. The formula I came to then, which is of course not my own, was buried in this code:

        /// <summary>Calculates an appropriate bitrate. (Actually this probably only applies to mp4.)</summary>
        /// <remarks>Options.EncoderOptions is dynamic. Depending on the format, it may not have a VideoBitRate
        /// or TwoPassEncoding property. We thus try to set them, then handle and ignore any exceptions.</remarks>
        private void CalculateBitrate(Size value = default(Size))
        {
            var factor = 1;

            try
            {
                /* A compromise: ffmpeg is failing on pass 2 with the error: The requested bitrate is too low.
                 * This is after applying the calculation below and a factor of 1. So for two-pass encoding, 
                 * increase the factor to 2. So far this works OK. */
                if (Options.EncoderOptions.TwoPassEncoding)
                    factor = 2;
            }
            catch { }

            try
            {
                /* Using the "Kush Gauge" to calculate the bitrate: 
                 * Pixel count (wxh) * fps * motion factor (1, 2, or 4) * 0.07 = bitrate/1000 
                 * 
                 * If this method is passed a valid Size parameter, use it. Otherwise, if the options specify 
                 * the video is being cropped and scaled, use Options.Scale; otherwise use Options.Size. */
                var newSize = value != default(Size) ? value :
                    Options.Crop.Size == Options.Size && Options.Scale.Size != Options.Size ?
                    Options.Scale.Size : Options.Size;

                Options.EncoderOptions.VideoBitRate = ((double)newSize.Width * newSize.Height * Options.FrameRate * 0.07D * factor / 1000D).ToString("F2") + "k";
                encoderGrid.Refresh();
            }
            catch { }
        }

My implementation uses something called the “Kush Guage”, whatever that is. I remember neither reading about it nor implementing it. As you can see, my meth-high-implementation doesn’t really follow the formula exactly. But anyway, it works quite well, so I’m running my ffmpeg wrapper to do the conversion. (After doing a test on a small part of the video to confirm that the result is good quality.)

I’m using the 64-bit static build version of ffmpeg, which I found here. My generated command-line to use, for H264 MP4 that converts fairly quickly is this:

ffmpeg.exe  -i “G:\Videos\Series\The Flash S1E15.mkv” -c:v libx264 -vprofile Main -preset Faster -b:v 1546.74k -maxrate 1546.74k -bufsize 1200k -threads 0 -acodec libvo_aacenc -b:a 128k -r 23.976 -ar 44100 -ac 2 -y “G:\Videos\Series\The Flash S1E15.mp4″

That command-line should work for all MKV to MP4 conversions, where the bitrate was calculated as:

Width*Height*Frame-rate*0.07*motion-factor/1000, where motion-factor is supposed to be 1, 2, or 4, but my implementation always uses a factor of 1 (for single-pass encoding and a factor of 2 for two-pass encoding). This command-line is doing the encoding in one pass. That works out to:
1280*720*23.976*0.07/1000 = 1546.74k

Actually there were some bugs in my code, which is why I shouldn’t be sharing my ffmpeg wrapper. (Actually all my code and the compiled application is shared, but I’m not linking to it here because I have not uploaded the version with bug fixes.) For one thing, it was using a lower “max bitrate” than the specified bitrate (which totally fucked up the video quality), so I worked around that now by hacking my code to always specify the same rate for both. The code I wrote back then to generate the command line is so complicated, I can no longer understand it. Modifying it now was like changing somebody else’s code. Some guy who is both a genius and an idiot simultaneously. Yet another reason not to use crystal meth.

[Other things worth noting… The audio bitrate is based on the source rate, so that is something that should be set dynamically, depending on the source. Disabling multi-threaded encoding with “-threads 0” is probably unnecessary, but back when I wrote that code, I mostly encoded to a DivX-compatible format, and my DVD player at the time couldn’t play files properly if they were encoded with more than one thread.]

I may share my video converting application once I get to understand the code enough again to clean it up a little.

Update: According to this site, this bitrate calculation is about right for H264 mp4. But it looks like the max rate should be 150% of it, not the same value. But it gets confusing. For VBR (variable bit rate), the bitrate should be about 75% of this value. I will have to adjust my code and play around to find the optimum bitrate.

Posted in Methamphetamine, Programming, Recovery | Leave a comment

To all the drug users desperate and willing to do anything for that next hit: It doesn’t have to be this way

Today when my colleague returned from a smoke break outside, he told me how he’d been approached by a man, who was fifty-something and looked strung out and desperate, yet well dressed and well spoken, who had then told him a story about being short of cash for a bus ticket and being in a dilemma, and asking for money. My colleague knows – hopefully not only because I have emphasized it to him many times – that the man is a drug addict. Also, the man forgot that he already tried that story about two weeks ago.

Normally when approached by such people, I say only the words, “I’m sorry. I can’t help you.” Then they go away. (Sometimes they persist, in which case I am rude to them.) But I was thinking about this as I drove home from work, thinking about what I would love to say instead, if only they would listen…

It doesn’t have to be this way. It really doesn’t. You don’t have to be enslaved by your drug. You don’t have to be desperate to get it, so desperate that you are willing to do anything, including humiliating yourself by approaching strangers at shopping malls and trying to con each out of a few cents here and there that eventually add up to make a hit. Considering that when you reach this point, you have already lost the trust of your family and alienated everyone who used to care about you, isolated yourself, it should be a huge red flag to you that you have placed yourself in this situation. If you were thinking straight you would realize that you should never have put yourself in this position, and that you need to get yourself out of it, no matter how difficult that may be. You should realize that it is unacceptable to live your life like this.

It doesn’t end there – I know. I knew people in rehab, straight men and even more women, who sold themselves to other men to get their fix. I met people in NA meetings who robbed to get their fix. You don’t have to live that meaningless life where a chemical is more important to you than anything else, where your life is empty and has no purpose. You don’t have to hate yourself; to come down and be ashamed; to look at others and imagine that they are judging you. You don’t have to live this life where nobody cares about you, least of all yourself.

You can be happy and normal, fulfilled and lead a good life, one that you can be proud of. You can be a good parent, and a good worker who is admired by your peers. But right now, it’s your fault that you are a junkie. You might think that begging or conning others out of money is harmless, but in reality you are a burden to others, and if they judge you harshly, that is to be expected. Don’t be angry when people refuse to give you money. I’ve met many who are, many who seem to think that others who are more fortunate than them should just give them money – that they deserve it somehow. You made your own poor choices, and I made my own good fortune. (Eventually.) While I empathise and I understand addiction because I put myself through it, I feel no pity and I owe you nothing. It’s your responsibility to get help; to find a way to get into rehab. That should be your only goal now. Rehab. Don’t think any further than that.

Posted in Addiction, Methamphetamine, Recovery | Tagged | 2 Comments

To whomever texted me… Please resend

Just in case you happen to read this blog, which is unlikely…

My phone, Nokia Lumia 520, is very fucked at the moment. It freezes frequently, and the touchscreen stops responding. Sometimes that means I can’t accept a call – which is really annoying to everyone at work because my ringtone is really loud and plays the whole of The Bitter End… Sometimes it means I can’t read a SMS, and the only way I can fix it is to take the battery out and then restart it. This time it threw that SMS away, and I could see from the notification that it said “Jerome please…” but that’s about all. Please resend.

Also, rather use WhatsApp – it doesn’t lose those messages, as far as I know.

Posted in Uncategorized | Tagged | Leave a comment

Vitamins and cancer risk

The supplement industry has always amused me. I must admit my knowledge of vitamins is scarce. It’s based on my school biology education, and that was a while ago… I finished school in 1989.

But one thing that always amazed me about vitamins and how they are marketed is that most people seem to assume that they are not only a good thing, but are necessary somehow, even though my meagre understanding of biology tells me that they are micronutrients – micro, as in we need them in tiny amounts that can easily be obtained by a balanced diet. (Have you met somebody who suffered from scurvy? I haven’t.) I tried using vitamins when I was much younger, in my early twenties. And I noticed then that all they ever gave me was colourful urine. I used to joke that one only needs to take vitamins if one wants colourful piss. The more you take, the more colours of the rainbow you will piss into the toilet. And that’s all they really achieve.

Then last year I read some interesting sceptical articles that went further then just agreeing with me – it seems that supplements are the most common cause of liver disease these days. (Not vitamins, but other supplements used for building muscle and so on.) But now it looks worse than that. There is evidence that taking excessive vitamins puts one at greater risk of contracting cancer. Don’t take my word for it. Read the article and follow the links to the studies here.

It is amusing though, that the marketing of something without any supporting evidence has made a huge and profitable industry – one that’s been going for many years, and most people simply accept what the adverts tell them at face value. We truly do live in a credulous world. I know that, for example my own mother swears by vitamins, and thinks that taking vitamin C somehow magically prevents her from catching colds. She has years of anecdotes to back it up, and I will never be able to convince her otherwise.

Posted in Skepticism | Tagged | Leave a comment