HNHacker News
TopNewBestAskShowJobs

udp

3,469 karma · joined November 15, 2010

submissionscomments
udp··on What Is the “Length” of a String?
Sure, but the majority of the text computers have to parse has a syntax consisting of low codepoint ASCII characters (think XML tags vs. data). The fragments of text using a high codepoint language are usually only interesting at render time.
udp··on What Is the “Length” of a String?
It really doesn't matter. A string is a binary blob until you need to parse it, or display it. If you need to parse a string and it's UTF-8, you can pretend it's an ASCII string because the control characters you need for parsing are probably ASCII characters such as {, [, or ". UTF-8 continuation characters set a high bit to ensure that UTF-8 is a superset of ASCII, so you can use all of the standard C library functions. If you need to display a string, you're already using a font library which, in addition to providing the logic to iterate through the string character by character, can work out kerning etc.

I never understood the rationale for using encodings such as UTF-16. They seem to be the worst of both worlds: strings for which ASCII would be adequate take 2x the space, and the encoding is still multi-byte. I once worked with a Windows developer who swore blind that UTF-16 was not a multi-byte encoding. When I provided evidence to the contrary, they responded something along the lines of "ok, but who would ever need more than 16 bits worth of characters?". ¯\_(ツ)_/¯

udp··on Why All of Our Games Look Like Crap
The fact that you identify "that typical windows 95 style game" as being a thing implies that it is a style, whether or not you like the style. Building games that look like that today is just a specific kind of retro.

The screenshots of John's games make me feel nostalgic in the same way that I'm sure NES and Arcade style games make 80s kids feel nostalgic. The Windows 95 style is retro now, even if it still feels current to us!

udp··on Why All of Our Games Look Like Crap
Baba Is You and Downwell are a totally different kind of retro. They're trying to look like NES games. John's games are retro as well, but they channel the very different style of 90s Windows games, which had so many colors (256) they didn't know what to do with them all.
udp··on Introduction to Nintendo 64 Programming (1999)
That was a bit of a disappointing read. I was expecting some technical details but it was mostly just about how they managed the project.
udp··on Exercises in Emulation: Xbox 360’s FMA Instruction
> I left the Xbox team long before the Xbox One shipped and I haven’t paid any attention to it since then, so I don’t know what they decided to do.

From experience trying to play 360 games on an Xbox One, the console reads nothing from the DVD and instead downloads the game from the Internet. It also only works for specific games. I therefore assume they gave up with emulation and simply recompiled certain 360 games for x64.

udp··on Hexyl: A command-line hex viewer
What difference would that make?
udp··on I need to copy 2000+ DVDs in 3 days. What are my options?
Pretty standard in the UK outside of major towns/cities.
udp··on Windows Server 2019 Includes OpenSSH
epoll
udp··on Designing Headers for HTTP Compression
The 4 MB JPEG would be downloaded, though, while the headers would be uploaded. Consumer internet has terrible upload speeds in general.
udp··on UTF-7: a ghost from the time before UTF-8
Very true, but once you're at the level of complexity where you're rendering a GUI are you really concerned about cache invalidation due to incorrect branch prediction iterating strings?

GUI rendering is very expensive for lots of reasons, but I don't believe that's one of them - even in the UTF-8 case. You're ultimately either drawing thousands of pixels or communicating over a (relatively compared to the CPU cache) slow bus with the GPU.

udp··on UTF-7: a ghost from the time before UTF-8
> As pointed out elsewhere, you are wrong because UTF-16 'characters' can still be comprised of compounded elements. (Base character plus additional composition elements to create a final character.) In simple terms, you can't just treat it as an array to index to any given character.

I am aware of that having implemented UTF-8 myself, and I thought I was fairly clear in my comment about characters vs. bytes.

> The assumption about finding specific characters (for example, command flags) in a string or array of strings is also... complicated. As an example: https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms

Also aware of that. But it only matters if you're actually searching for those characters. Parsing something like XML or JSON, therefore, is as easy with UTF-8 as it would be with ASCII, because you're only looking for characters like < or { which are the same byte values in UTF-8. You don't need to worry about accidentally finding a continuation byte because UTF-8 sets high bits on continuation bytes for exactly this reason.

udp··on UTF-7: a ghost from the time before UTF-8
Correct me if I'm wrong:

UTF-16 can be faster if you're iterating through characters, but for parsing iterating through bytes is usually sufficient. It's fine to use something like plain old strchr to search for a { or a < in a UTF-8 string. Characters only get really important when you want to print the string.

udp··on Apple iPhone Supplier Foxconn Planning Deep Cost Cuts
Also in the UK, and I can't remember the last time I actually bought a phone outright. I resigned myself years ago to paying ~£40/mo for a contract and insurance. Every 2 years I get an upgrade to the latest iPhone.
udp··on Apple iPhone Supplier Foxconn Planning Deep Cost Cuts
Most users don't care about any of those things.

- You can use the included adapter instead of a headphone jack. I do this every day to plug my phone into the car and it's no big deal. If I had a newer car stereo it'd be bluetooth anyway, and wireless headphones are pretty cheap now.

- What would a normal user use NFC for other than Apple Pay?

- Most people couldn't care less if the port is Lightning, USB-C, or micro USB so long as it charges their phone.

- iMessage works flawlessly, and the standard (at least here in the UK) is WhatsApp rather than MMS now to communicate across the iOS/Android void.

udp··on F.D.A. Plans to Seek a Ban on Menthol Cigarettes
Nothing strategic there. It would be bizarre and unprecedented to ban any e-cigarette flavour. There are thousands, and there’s nothing special about menthol.
udp··on F.D.A. Plans to Seek a Ban on Menthol Cigarettes
As a regular user of nicotine lozenges, I’m struggling to work out how my lung alveoli are going to be affected.
udp··on F.D.A. Plans to Seek a Ban on Menthol Cigarettes
It’s actually really annoying. I hardly ever drink sugary drinks, but sometimes on a long drive I’d get one specifically for the sugar content (sans caffeine and taurine). Now diet versions of everything seem to be default.
udp··on Timercpp: JavaScript-like setTimeout and setInterval for C++
Exactly. And the eventloop that is available to a C++ application will differ completely depending on framework/platform. The only thing common to all platforms is that a thread is most likely to be the wrong way to do this.
udp··on The Scots Language
Also present in North East English, which can be just as far removed from the Queen's English as the Scottish dialect. "Bairn" and "hus" definitely, and also "gan" (to go), "yam" (home, norwegian "hjem").

If Scots is now considered a language, then Geordie surely must be. Here's a nice example: https://en.wikipedia.org/wiki/Blaydon_Races#Lyrics

udp··on Intelligent, devoted, alien – parrots are unlike any other pet
I've seen this myself in Belgrade zoo, Serbia. Wolves running around in cages not much bigger than my budgie cage. It's not OK. However this shouldn't be used as a straw man to argue against what I said regarding budgies considering the huge phylogenetic distance between birds and mammals.
udp··on Intelligent, devoted, alien – parrots are unlike any other pet
I wrote an initial answer to this which was basically "get a pair!" and then decided to start again.

As a child, I had a lone female budgie. She was completely tame - almost "post-tame" to the point that she knew you weren't a threat so was quite OK with biting you to make a point if you tried to get her to do something like the perpetual ladder game. I'd get back from school and she'd sit on my shoulder all evening chuntering into my ear.

When I started my degree she - age 10 - had to move on, so I gave her to a friend to look after. The friend had, until recently, had a pair of budgies, but sadly was left with just the male. Upon introduction the two lone budgies bonded immediately in a completely heartwarming display. She lived for 2 more years happily with her new mate, and I always felt guilt for keeping her on her own all that time.

Fast forward to now and I have two budgies together, and they're really happy. They're all over each other all day. They have arguments, and they work through them, and they end up smooching and grooming and feeding each other again. They're so loving they're gross.

But do I think my first budgie was unhappy? No, I don't. She was fine, she just identified with people for most of her life.

Then, do I think these budgies as a couple are happier than she was? Yes, I think they probably are.

Ultimately it's up to you and how you want to care for the bird. If you want a super tame bird and you think you can provide enough time for them that they won't be lonely, you can make the decision to get a single budgie. If you want them to be able to have fun on their own when you're not there, get a pair - because then they don't need you.

Both of my current budgies are finger tame, but for them interacting with humans is mostly an annoyance. They will get curious and start chatting with you if you come to the cage, and they will get on your hand - but if they hear the other budgie that takes priority. One thing I haven't tried is getting two young birds and taming them independently before introducing them to each other...

Cage size I think within reason the bigger the better. Tall thin cages work well if your space is restricted, since vertical space is usually more readily available.

udp··on Intelligent, devoted, alien – parrots are unlike any other pet
Prison analogies. You obviously have a strong opinion about this, which I respect - but I don’t have the time or energy to enter into a debate.
udp··on Intelligent, devoted, alien – parrots are unlike any other pet
Interesting regarding the mirror test! There’s so much about these dinosaurs we don’t know yet.

I’ve never clipped but I totally understand. I just cover them up and remove swings but driving with a spooked budgie isn’t fun.

Fresh fruit and veg are always there, shouldn’t have omitted that. Millet OD is only if I’m leaving them unsupervised for a weekend which is very rare, but they are very sensible with how much they eat.

udp··on Intelligent, devoted, alien – parrots are unlike any other pet
> In general I think we should not keep such animals as pets ever. Unless you have the time and commitment their lifes will just be miserable.

Starting with an ultimatum and then immediately undermining it with an “unless” seems counterproductive. I wish people would realise that not every comment has to begin or end with a sensational assertion.

udp··on Intelligent, devoted, alien – parrots are unlike any other pet
No, they’d freak out. They would completely panic, get lost, and then get eaten by a cat or die of cold.

I also feed wild birds. Everyone should. After having to bury a whole clutch of sparrow fledglings a few months ago after a cat got the nest I’m pretty sure my budgies - spending the entire day happily grooming each other, playing with toys, and enjoying unlimited free food - have a better time than them, though.

udp··on Intelligent, devoted, alien – parrots are unlike any other pet
I’m really not. When I first got the most recent budgies I was working from home and the cage was open all day so they were free to roam. They quickly made it their home and seldom left because a) that was where the food was and b) as a pair, they need somewhere to potentially build a nest.

You said you kept “a” budgie. They are highly social creatures and do not like being kept alone.

udp··on Intelligent, devoted, alien – parrots are unlike any other pet
I always use massively oversized cages and keep them by the window, which probably helps.
udp··on Intelligent, devoted, alien – parrots are unlike any other pet
Again, all budgie advice, but:

Perches/twigs taken from live trees. I have hazel and apple in the garden so that’s what they usually get (and destroy) but check the wood is OK for budgies before giving it to them. All parrots love destroying things, and providing perches to strip is a good way to satisfy this urge without letting them eat an entire sheet of sandpaper. Basically just throw suitable foliage in there and they’ll find something to do with it.

Swings of any variety. You can make them from thick metal wire (thick enough that they can’t twist it themselves), optionally with a wooden perch part or make the whole thing from wire.

Ladders!

Small mirrors with caution, and not if you’re trying to tame them. They may “redistribute” food onto the mirror for their inverted friend. Interestingly in my current pair the female seems to pass the mirror test and the male doesn’t!

Bells, but make sure they can’t pull the clapper out and potentially swallow it. One of my previous budgies used to hit the bell, then was annoyed by the sound and so would attack it. The sound then obviously got louder and she would attack more violently, and so she kept herself occupied for quite a while.

It’s also nice to give them something to bathe in, which they may or may not take to. It needs to be a very shallow plate of water, and don’t just leave it in the cage or they will defacate it in and drink it afterwards.

They need cuttlefish bones and iodine blocks for bird health. Unlike dogs they won’t overeat, so even if you put lots of millet (budgie junk food) in there they will stop when they’re full. Useful if you’re leaving them for a couple of days because you can just provide extra food.

udp··on Intelligent, devoted, alien – parrots are unlike any other pet
I’ve kept budgies (parakeets) all my life, and occasionally I’ll post a picture on social media and get the inevitable “keeping birds in cages is cruel” backlash. It invariably comes from people who do not keep birds.

Budgies love their cages. They clean them, they rearrange them, they make them into a perfect environment in any way they can. Introduce something they don’t like and it’ll end up on the floor. Introduce something they do like and they’ll probably move it because they weren’t happy with the placement.

With the pair I have currently, the whole front of their cage opens up and I open it every day. Usually the male has a five minute fly around the room, lands on the cage, then climbs back in. The female usually doesn’t even bother because she’s far too occupied with housekeeping and making angry noises because he’s not with her.

I can’t speak for the larger parrots having never looked after any, but budgies love their cages.

← PreviousPage 3 of 18Next →