Better HN
topnewbestaskshowjobs
Log inSign up

ktRolster

4,173 karma · joined Sep 27, 2015 (11y ago) · 1,726 submissions

Kate Thompson: best selling Amazon author

http://www.amazon.com/Zero-Bugs-Program-Faster-Thompson/dp/0996193308

Some Essays I've Written http://zerobugsandprogramfaster.net/essays/1.html

Submissions

comment 8y ago · link · parent

I can smell your program. All that new hardware around me. The smell of dot matrix ink.

2.

“Accelerated Responsible Disclosure” – Daniel J. Bernstein(mobile.twitter.com ↗)

1 points · by ktRolster · 8y ago · discuss

comment 9y ago · link · parent

You can also add the --back option as an alias, so you don't need to type it in every time on systems where that is important. You could also use an environment variable to modify the behavior.

The GNU team did this when they added or changed behavior to the original tools. A lot of them have flags like -posix and such which give them a strict set of behaviors.

comment 9y ago · link · parent

It's not a problem. It's a way things can be better.

comment 9y ago · link · parent

Alan Kay is the one who said "The best way to predict the future is to invent it." He did so by inventing quite a bit of the technology that is in every PC and smartphone today.

comment 9y ago · link · parent

more-discoverable undo

I think he wanted more discoverable everything, the undo was just used as a particularly bad example on the iPhone.

He wants the world to be more discoverable, to modify our very culture so that learning is easy (an example he gave was with math, so it's not just a small, 'smart' percentage of the population who actually gets it, but everyone absorbs it from a young age).

comment 9y ago · link · parent

His ideal vision is always described in very abstract terms. If he took the care to write it down precisely, what it should look like, I'm sure there would be hundreds eager to build it for him.

Look at Squeak. http://squeak.org/ The idea that you should be able to dig in and modify things is very powerful.

Another way to look at it is in terms of discoverability: you are at one level of understanding (using the phone, clicking on things), and it should lead you to a deeper level of understanding (perhaps moving things around, modifying them). At each level, there are hooks inviting you deeper, drawing you in. Ideally you get down low enough to start programming, to actually understanding how assembly and the CPU works, so there is no longer any area of magic.

comment 9y ago · link · parent

Back in the 90s people used to have their pager connected to CERT to make sure they knew if anything happened. Of course no one uses pagers anymore, but there are places you should definitely pay attention to if you're looking at the software.

comment 9y ago · link · parent

It's worth investigating what Utah did, they have some nice internet. http://archive.sltrib.com/article.php?id=3062258&itype=CMSID (their internet has improved since that article, too). Those lucky people have multiple high speed providers.

It seems to be something that's easier to do at a local level.

10.

Hiring Behaviors That Would Work for Developers, Too(medium.com ↗)

3 points · by ktRolster · 9y ago · discuss

comment 9y ago · link · parent

Let's be honest: the corporations that hire us will drop us as soon as it becomes convenient to the bottom line, and as likely as not without a severance package.

You owe it to yourself to get the best possible compensation package, because no one else will do it for you.

comment 9y ago · link · parent

That article is a little deceptive. It is mainly tracking TARP, it doesn't track the money injected into banks by other methods (like the FED directly buying subprime loans and manipulating the market).

http://www.zerohedge.com/sites/default/files/images/user5/im...

comment 9y ago · link · parent

In retrospect (as the housing prices have mostly recovered: http://www.doctorhousingbubble.com/wp-content/uploads/2013/0... ), the hosing crisis can be seen as an irrational bubble, with the major problem being that the banks were under-capitalized for the risk they were taking on. After several years of injecting capital into the banks for several years, they are fine. Arguably the banks didn't worry about the risk because they trusted the government would help them out.

comment 9y ago · link · parent

It's not dead simple, it just seems that way because the router already comes configured for it. If you had a router already configured with a default firewall, that would seem dead simple, too.

comment 9y ago · link · parent

Hi! I can't imagine how you understood what I wrote. I specifically said to not use those C library string functions.

I fully admitted that string manipulation is absurdly bad and error-prone, then built on that by showing a way to make it better. Use ktStrcat() instead of strCat(), then you don't have to worry about truncation. Use ktSprintf() instead of snprintf(), then you don't have to worry about truncation. I wish you had understood.

comment 9y ago · link · parent

Oh yeah, you're right.

Another thing I've done that will work if you have a lot of strcat(), is make a string struct:

    ktString {
       int len;
       int memlen;
       char *str;
    }
It keeps track of the string's actual length, and the size of the underlying buffer. Then you can 'override' the various string functions:

    bool ktStrcat(ktString s1, ktString s2);
    bool ktSprintf(ktString s1, ...);
These functions will take care of buffer-size checking, and reallocation if necessary. For cases where you need to interface with pre-existing libraries, you can return a cstring(). Make it a function/macro to enable you to change the struct definition in the future:

     #define ktCstr(x) (x)->str

then you can pass it into write() or whatever you need:

    write(sock, ktCstr(s), s->len);

comment 9y ago · link · parent

I assume you're referring to OpenBSD here, they didn't use snprintf(). They used asnprintf(), which solves the problem of who should allocate (but not who should free).

comment 9y ago · link · parent

OpenBSD takes a fairly minimalist approach, which is vaguely described here: http://www.freebsdforums.org/forums/showthread.php?threadid=... They basically replace the unsafe functions with things that are easier to use. Their idea is that it isn't the format of the C-string that causes security issues (null-terminated string), it's the poorly defined functions (with weird corner cases that are hard to get right). It's worked well for their use cases.

DJB did something similar in qmail, I don't recall the details but you can look at the source code as easily as I can, and it eliminated security problems.

When I'm working in Java, I find that most of my string parsing uses the split() function. This is a pain in C, because even if you had a split() function you'd need to deal with memory allocations. Most of these are solved with a memory pool. In my own library, I also added runtime, grammar-based parsing functionality. So to parse a CSV line you might do something like this:

    char *g = " S   -> WORD | WORD , S;"
              "WORD -> [^,]";
    results = parsegram(g, inputString);
Grammar parsing + memory pools makes string parsing in C easier than in Java. The biggest difficulty with this kind of library is to do it right, you need to be something of a unicode expert, and that's tough.

comment 9y ago · link · parent

shrug It doesn't fall over. I've done it, the openBSD team has done it. DJB has done it. Maybe something is wrong with your implementation that I can help you with?

comment 9y ago · link · parent

It was quite state-of-the-art at the time.

Most of the criticisms you hear about C today (type safety, memory safety, no garbage collection) were criticisms that C got when it was first invented.

In fact there are fewer criticisms of C than there used to be: a lot of the early criticism centered around syntax, but the C syntax kind of won, so you don't hear that anymore.

comment 9y ago · link · parent

That particular problem (strlen/strcpy/memcpy) comes from the problems of the standard library string functions. It can be solved by creating your own string library. Then string manipulation is easy.

comment 9y ago · link · parent

For that situation, you would need to mark the end of the variable-length memory block at run-time.

comment 9y ago · link · parent

It's not just the mental ease, it's also the physical typing ease (and in some cases, the possibility).

For example, he points out that to connect C to existing parts of the system (which is the OS and OS level tools), all you have to do is call the functions. If you want to call a C library from a Java program, it's a lot more work. Furthermore, C has the capability of understanding Java structures (although it's awkward), but Java has no way of understanding C structures from within the language. There is no way to model a driver I/O port in Java, but in C there is.

The paper is worth thinking about. If you are creating a language, take interoperability between already existing languages into consideration. JNI is ok, but think how much better it could be if it did auto-marshalling of objects!

comment 9y ago · link · parent

You can, but you'll be dirt poor. Back when "dirt poor" was normal, and luxuries like "bathing every day" or "carpet" were uncommon, being dirt poor seemed acceptable. Now most people won't accept that as a lifestyle.

comment 9y ago · link · parent

Here you go, I uploaded an image of the file transfers showing just the html and javascript:

https://imgur.com/a/aTpj2

comment 9y ago · link · parent

I have no idea

comment 9y ago · link · parent

The whitespace is there because people design first for mobile, then port to desktop browsers as an afterthought. That's not going to change any time soon.

comment 9y ago · link · parent

You should check out Google's homepage sometime. One wouldn't expect that such a simple front would hide so many k of Javascript, but I guess it does a lot.

comment 9y ago · link · parent

I would roll my own. I'm totally confident I can do it better than the OpenSSL team. Of course, I would see what I could do with GnuTLS, first.

In practice, OpenSSL should not be considered secure. At best it can be considered as a way to stop script kiddies.

comment 9y ago · link · parent

Update: 4 of 535 members of Congress have computer science degrees.

That's higher than I expected.

12345
58