James has a new post called http://prog21.dadgum.com/206.html in which he wonders if lots of the idioms like const, and static or sealed classes are them to allow developers to protect themselves from themselves. I would have commented on his blog, but he doesn’t like comments, which is a completely sane stance to have, heck the only comments I get here are spam.
So I had always thought those idioms where there to allow complier optimizations because there was extra information that was not tracked on older compilers, or to make the code cleaner.
const variables are to a avoid macro’s “true evil” and to keep the type information. static allowed to keep the symbol table size down sealed allowed real optimization, as functions will never to replaced.
And these were needed, so the new language could perform “better” at some key benchmark used to once again prove that poor “real world” problems in assembly, C are faster than in new language X. Thus all problems should use C/asm.
The other day on Google+ I read a post from Ana Andres talking about coding Tiny Planets, and how it was running really slow in Matlab somewhere in the pixel drawing code.
That got me thinking about how I would code it in C#, and Ana had a good blog post showing one way of thinking about how the transformation was happening , one of her goals was to make an animated GIF so people could see the wrap bend happening.
Now the this was plenty fast enough, I was getting 2-3 fps on my laptop using only one core, so from a speed perspective moved on.
My first plan was to interpolate between the points (all though that would really slow, and look bad at the outside), but when I showed my co-worker my method, he said I was silly and should just traverse the output space, and find the input pixel that maps, so I did that and got:
I then had to put the bend code back in, as that was a special aspect needed for the animation and got:
I then started playing with sub-sampling to make the output less jaggie (F), and then I decided blend in YUV (or YCrCb) colour space, and finally settled on five point YUV average where you have a center of the pixel and the four 1/4 towards the pixel diagonal corners. Giving:
For now the GIF’s at coverted to videos, but if they are to slow I will have to go back to like links
Now improvement on the process would be to allow scaling and translation of the origin on the polar focus, this might be useful in an interactive UI to allow exploring the space.
Here’s my source code for Step H, it was fun to learn to make GIFs in C#.
We are porting our MSVC/Win32 applications to Clang/GCC/Linux and have just spent the morning tracing why our unit tests fail.
double a = NAN;
Under MSVC and Clang all good, GCC asserts. We added printf’s and looked at the assembly and the code was hard coded to 0.
Some googling found 2006 posts stating GCC -ffast-math did odd things with isnan, and it’s still a presently reported issue
This came about because we are using Premake, and had the FloatFast flag set, because that’s how our MSVC projects were set, and we don’t want to change those builds, so for now we have tweaked the Premake code for this flag under GCC, as it doesn’t make sense that you would ever want isnan to be hard coded to zero, that’s really not fast maths at all.
We also put a #ifdef for ffast-math to break if this flag is present in the future.
And by we I mean Dave, and I just sat and talking it though with him.
After a couple of weeks of hard code tracing Coderat nailed the where/how of the bit rates for Nikon DSLR movies recording are set. The sad thing is the source of the bit rates is just a simple function that had been documented for a couple of years, the completeness of it’s effect was just not understood. Sigh.
But now we have patched in higher bit rates. To that end 34mbps and 54mbps have been tested on a D5100, and I’ve tested 34mbps, 49mbps and 64mbps on my D7000.
The online patch tool now lets to install these rates, on D5100 and D7000, and only at 1080p, but I’m sure more models/modes will follow as requested.
I had no record problems with 64mbps (really 60mbps as I had no sound being recorded), using both my slow Transcend Class 10 card, or my fast SanDisk Extreme Pro, which I purchased for these very tests back in 2012.
I’ve become very frustrated at my teenage children who spend way too much time watching video’s and using our monthly bandwidth all up. I’ve also got sick of turning the ADSL router off at the wall to signal annoyance.
What I really keen to workout is how to do total data usage, so I can cap each user. But the above gives me enough to be able to turn Internet on/off person, and I can tweak it to have permanent outage. And they know this, so we’ll see how behavior changes.
[2021-07-17 Another never posted post, did some quick digging on the web.arcine.org to find the relevant content]
I recently purchased the Rebecca & Fiona - Luminary Ones (Nause Remix) off iTunes Store as I really like the song, and that mix in particular. The song is a 7m 47s DJ friendly mix, thus has 2 minutes of intro and 2 minutes of outro, that are honestly boring.
So I have been day dreaming of making a new cut of the track with those minutes trimmed, so I jumped into iTunes to see the file type to work out what needs to be done to trim the song, and just for the laughs I look at the Options tab of the track, and low and behold, a ‘Start Time’ and ‘Stop Time’.
And the settings worked on my PC, so I synced my iPhone, and they work there also. Sorted!
Now I would like a fade out option, as the ending is abrupt, but there is not a nice breakdown to end on, and maybe I will trim the song externally, but 95% of my problem is solved, so most likely I won’t.
Wow, I just read the Galaga No-Fire Cheat write-up, and that is one of the coolest things I read in ages. I love the fact it’s possible via Mame to dig though the code. I love that people care enough to do it, and I love the cracking open of an old school game cheat, to solve the how/why it occurred.