Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 internet speed test! ×

Comment Re:std::insert is double awful (Score 1) 266

Actually, the explanation in the article is that there is a memory allocation for a node done *before* checking whether the object is present. So if the object is present, there is a pointless memory allocation and deallocation done. Nothing to do with inlining, and an easy fix for the library: just swap the order of the check for presence and the memory allocation.

Comment Re:Lots of links to articles, phfft (Score 1) 234

This works especially well in languages where you can have a function whose definition is within the scope of a function. Then all the functions are guaranteed to be together in the source, and with their containment relationships obvious to the human reader. If one changes an inner function's functioning, one only needs to check in one place--the outer function--for how this affects things.

Comment Re: Year of the Chicks (Score 1) 406

He wanted to use "Gemaco Borgata" cards at the Borgata Casino. That sounds like a line of cards the casino itself must have ordered. Wikipedia says that the casino is suing Gemaco for the cards being defective.
It does, however, sound to me like it's cheating for a player to deliberately choose such defective cards.

Comment Re: Hell no (Score 1) 381

I don't question this, but I wonder how you manage to keep the skill. I used to program Z80 assembly in the late 90s (Sharp organizers) and 8086 in the early 90s, but I can't say that I know Z80 and 8086 assembler anymore.
Or have you managed to keep up the memory by continuing to program antique devices (not a terrible idea)?

Comment Re: How about (Score 1) 230

I've been making screen dimming apps for Android (RootDim and ScreenDim) for a long time, and have often wondered why the minimum system brightness on just about all devices is so high. Here is my hypothesis. If one sets the display to a level where it's visible but not bright in pitch black conditions, the display may be invisible in normal conditions. This could result in customers complaining their device is broken as they can't see the screen. (But there are alternatives to just setting the minimum high. They could have warnings, or they could turn brightness up even in manual adjustment mode if the light sensor gets enough light.)
One piece of advice I have is to go for OLED rather than LCD screen. On LCD, black is gray in low light conditions a the backlight leaks.

Comment BASIC on TS-1000 (Score 1) 515

I got a Timex Sinclair 1000 when I was 10, as well as a simple book about BASIC programming. Eventually, that got upgraded to a TS-2068. There wasn't much family budget for games for me, so I wrote a number of my own. Did a bit of Z80 assembly for better speed. Then when the family got a PC, I learned C, FORTRAN, some Pascal, and 8086 assembly.

Comment Poetic APIs (Score 1) 405

IANAL, but I could imagine a case where someone names a method with a copyrighted haiku: void old_pond_CR_a_frog_leaps_in_CR_waters_sound(). (From Wikipedia's example of a haiku translation; I don't know if their example is copyrighted, but you get the point.) In that case, I think it's not an unreasonable case that the API is copyrightable at least in part. In such a case, even code calling the API--not just an implementation of the API--would require a fair-use defense. I would hope such a fair-use defense would be possible.

So, yes, my example shows that it should be possible for an API to be copyrighted, at least in theory (whether java.lang is sufficiently poetic is a different question!). But the example also shows that unless a fair-use defense is possible, programming is really stifled.

Comment Different math from K-12 (Score 2) 616

It's hard to do almost any programming without understanding boolean operations (both logical and bitwise), and one will be really limited if one doesn't understand binary arithmetic and how hexadecimal works. I don't think this stuff is ordinarily taught in grades K to 4. One isn't going to understand how what integer types in many languages do unless one understands modulo-2^n arithmetic. Again, that's not ordinarily taught in grades K to 4. It may not even be taught in grades 5 to 12 (no doubt depends on school). None of this is *hard* mathematics, but it's mathematics nonetheless.

Generally speaking, all algorithms should probably be thought of as mathematical entities. So whenever one is trying to figure out an algorithm for a task, one is doing mathematics. It's not the sort of mathematics one typically does in K-12, but it's mathematics nonetheless. And it's not uncommon to have to do a little bit of traditional mathematics on the side to figure out if you're going to run out of memory or take too long.

And even if you're not trying to understand an algorithm yourself, at least you need to be able to understand statements like "Worst case performance of a merge sort is O(n log n) while the average case performance of a bubble sort is O(n^2)" in order to choose between off-the-shelf ones.

Slashdot Top Deals

Computers don't actually think. You just think they think. (We think.)

Working...