Generating a UUID, hashing it with a good cryptographic hash algorithm, and then taking a substring of the hash value would be the closest you’d get to globally unique there.
SHA-1, for example, is 160 bits over a 128-bit UUID, so theoretically the pigeonhole principle would be okay there given the various cascading effects of the hash. The substring, obviously, would be a smaller space but all of the bits should be more-or-less equally random so the chance of collision would be proportional to the number of bits only, unlike substrings of a raw UUID.
Now, at that point there’s essentially no difference from generating an 8-byte random number with a sufficiently good RNG, but it’s a fun thought exercise.
There is a difference - compute time. The random number generator can run out of randomness and stall until more randomness is supplied, so it is best to keep it simple and use a system-supplied random number with code that has a predicable number of calls to it, or (probably better), avoid using the random number generator at all and simply use a key that is incremented from a known starting point and encoded to a consistent length (e.g., to hexadecimal).
I just bought a 108 year old house, and I’m trying to figure out where all of the phone wiring is run, so I can use it to pull ethernet cable from the basement to the second floor.
One quick observation is how cautious the phone companies were (100 years) in avoiding drilling holes, vs. the cable companies (20 years) that excised parts of the original wood flooring and drilled multiple half inch holes straight through the siding, plaster and trim.
I spent my entire weekend putting together a presentation for our biggest client. My morning was spent on last minute adjustments. The presentation felt like a disaster. I was interrupted several times with criticism while I was building up to our call to action, and the final slides felt like a question mark rather than an exclamation point.
The following discussion period felt adversarial, to say the least. I received heavy criticism from one of the science directors. However, another department head, one who had previously been heavily critical of my work, stepped up to bat for us. The reactions were extremely mixed (in a way that is confusing to me), and as the meeting abruptly closed due to time constraints, I felt like I unintentionally provoked a turf war at a federal institution. Biggest client, not good.
I’ve been kicking myself all day for missing the mark, not only on the presentation, but on the months of development work leading up to it.
I’m used to nailing it on stuff like this. But somehow this one slipped through my fingers, and I didn’t even realize it until I was wrapping up the presentation. Shit. This could be an exprensive mistake, even end the company.
What am I doing this week? I’m trying to find a way to turn this situation around.
This brought back some memories. I nearly had SGI Linux working on an SGI O2 back in 2003, but it would hang near the end of the boot process. I think I was using some form of Debian.
Debugging my apartment lease. I’m fighting with my landlord of 12 years over amending the lease termination clause to accomodate my pending home purchase. They cited the Fair Housing laws against me, which have nothing to do with amendments, and are meant to protect the lessee, not the lessor. Its funny, the lease would have been a jumble of legalese to me 10 years ago, but after writing office actions for patents, it seems simple by comparison. I think I see a path forward.
I’m working this weekend to achieve someone else’s deadline on a project. I’ve gotten pretty good at time estimates for software development, and when I’m working on multiple projects I multiply the estimate by two to get a reasonable deadline so I can keep up with my other work.
Unfortunately, I’m working with someone who knows that, takes my estimates, divides by two and commits that deadline to our client. I’m getting burned out and I need to fix this problem.
I just put an offer on a house. The idea terrifies me, and my anxiety has been through the roof this week.
Hang in there. There’s definitely an initial hump of work right after buying but after that owning is no harder than renting, just a different assortment of things to deal with. Definitely cheaper, too.
Yup. And even if you end up paying as much as with renting, at least you don’t have landlords hovering - those are like an extra set of in-laws :)
Looking at houses. I was planning on buying next spring, but there are a few in the historic district that just came onto the market, so I may move those plans up a few months.
The cats and I are heading to my folks’ for the weekend. I’m going to spend some time doing pre-winter maintenance on my Jeep - oil change, check brakes and fluid levels, grease front end. Also, I plan to watch some college football, although DirectTV and Fox are currently in a contract dispute, so they’ve lost all local programming and half of the sports channels. Hopefully, Hulu Live can get the game there.
On Sunday I plan to spend some time on I/O performance tuning for the C++ part of my genome comparison application. The CUDA implementation was such a success that writing the result file is now the major bottleneck. I’ve been keeping an outline of all of the problems I’ve encountered. If I can resolve just a few more issues, I’ll start writing up some of these and hopefully contributing some original content to this site.
I’m happy to someone trying to dispel the “Hollywood tells me real programmers do X!” Sleep deprivation is pretty close to the mental equivalent of being drunk.
When I don’t get enough sleep, I find a 15-20 minute nap 10x more useful than drinking caffeine. Getting actual sleep is better, but naps > caffeine.
EDIT: Maybe I didn’t sleep enough because I typo’d “nap”
Sleep deprivation is pretty close to the mental equivalent of being drunk
Sleep deprivation is pretty close to the mental equivalent of being drunk
More people need to know this. And then they need to think (for like, 30 seconds) about the medical industry’s obsession with making junior doctors work 18-36 hour shifts because “that’s what last bunch did to me when I was her age”
I totally agree with this sentiment. Since I started working from home (February), I’ve cut back on my coffee consumption (still need one in the morning), and I’ve been taking a 20 minute power nap (feet elevated) around 1pm. It really helps. I’m mentally refreshed in the afternoon. I do worry that I might have a difficult time transitioning back to a normal office environment some day.
I think I could benefit from essentially the inverse premise
You’re in luck because someone did exactly that:
It’s a multi-part tutorial but it’s pretty good. Keep in mind that C++ is a huge language and this only touches up on a small subset of C++.
I went through that about a year ago (I had experience with C89 and pre-standard C++ but have been all Java since the late 90’s). My biggest difficulty was all the different standards that are available. Stroustrop 4th edition for C++11 (C++0x) along with a C++ Primer 5th edition got me started on the right path, and now CUDA is forcing me to learn C99.
This is helpful. I’ve had to learn C99 for my CUDA kernels, and the only C reference book I have was published way before that standard (Harbison & Steele 3e, 1991, must be C89). I figured it would be close enough, but I’ve been surprised at some of the things that work and some things that don’t work (my kernels are invoked from C++ code).
Saturday morning I’m going to be doing some performance testing on my CUDA application and tweaking the PTX assembly code to see if I can improve it over the compiler optimizations.
Saturday afternoon a few friends and I will be biking/bar-hopping the Lansing River Trail and catching a bit of the MSU-Indiana football game here and there.
My last race of the season is Sunday morning. I’m finally recovered from my brutal half marathon experience last weekend, and fortunately this one is just an 8k. I’m looking forward to switching over to some lower-impact training. There’s a new yoga studio downtown so I might sign up for a mid-week evening class.
Oh - and I’ve recently come into possession of 6 pounds of rhubarb and 10 pounds of fresh apples (from a tree I planted from seed in 2006). So at some point this weekend I’m going to be cutting/freezing some apples and making some rhubarb cobbler and jelly.
Been reading Designing Data Intensive Applications for a bit. Slowed down in the chapter on replication, but overall I’m enjoying it quite a bit.
This is on my bookshelf but I haven’t opened it yet. I’m moving it up in the queue.
Yeah, I’ve got a lot of those. Looking through the table of contents got me pretty jazzed though. I’d recommend having a look, it might give you the motivational boost to crack it open.
The Design of OS/2
I don’t want to give away any spoilers but it’s about the design of OS/2.
You left out the most important part: why do you read it? :-)
I like operating systems.
Does it get into the Warp era at all? I miss warping, it was my favorite era of personal computing. So many options…
No it stops at about 1.2 I think, and regardless focuses mostly on low-level kernel stuff.
I’ve got a couple if loose ends to tie up on some data curation projects, and then its back to PostgreSQL development. There are a few papers I want to read on dynamic programming for GPUs (finally got my first GPU application completed over the weekend).
Also, I’m recovering from the half marathon I ran yesterday. I started having some foot issues (plantar fascia tendon) at the 8 mile point and ended up with my slowest personal time ever, but it seems that I didn’t injure myself, so I’ll count that as a success.
I found climbing helps a lot with my running as far as building foot strength - my plantar fasciitis wasn’t a problem while I was climbing regularly.
I was thinking about the foot pain for the two hours I was running yesterday, and I realized that a likely contributing factor is that I started working from home 100% in February, and I switched over to a standing desk at the same time. I’m on my feet all day, barefoot. I may need to start wearing shoes at home.
Tomorrow I plan to finish my first real CUDA GPU application. I’m 95% there, just need to clean up some indexing and benchmark it. I’d be done by now if not for a 6 hour power outage yesterday. I’ll be watching some college football starting around noon tomorrow, so that will be a good time to launch some test processes.
On Sunday morning, I have my last half marathon of the year. Only one more race in my series after that, and its a 10 miler.
Also, I’m continuing to cat-sit and house-sit for my girlfriend while she’s travelling for work.
Studying Encryption for my CISSP test in November.
Is a corporate sponsor still required for this certification? I studied for this exam 18 years ago but my employer refused to sign a form stating their support, so I couldn’t register for the exam.