HNHacker News
TopNewBestAskShowJobs

ratboy666

226 karma · joined May 17, 2013

submissionscomments
ratboy666··on Putting the Tesla HEPA Filter and Bioweapon Defense Mode to the Test
I am having a hard time understanding your reference to China.

Yes, China is "into" electric personal transportation.

http://qz.com/137518/consumers-the-world-over-love-electric-...

Yes, China has 200 million electric bicycles. At that adoption rate, I would have expected 50 million electric vehicles on the road in the US.

But, the USA appears to be in love with the car. China has 128 cars/1000, USA has 809 cars/1000.

For a great many people, the electric bike would be a great transportation option -- cheap and clean. However, there is no way to compete with China in manufacturing these.

The only hope the USA has is Tesla.

For this reason, I would expect subsidies! USA manufacturing, possible exports, and a cleaner environment.

I personally use an electric bike, for which I received no government rebate... but, I don't have to pay for gasoline, or insurance, so I come out ahead anyway.

ratboy666··on The Sad History of the Microsoft Posix Subsystem (2010)
I don't understand what you are trying to say -- you think expensive software is better or worse?

I don't know what Microsoft Office has to do with this.

ratboy666··on Satellite Pirates (1994)
Um, no. "Fred Martin" was my brother. Deceased (died in 2000 in a car accident; Used my name for that business, giving me a small claim to faim).

Ron MacDonald was also Canadian (lives in the Toronto area).

You can put together the rest on your own.

ratboy666··on Unintuitive Things I’ve Learned about Management
Understand that as a developer, you are more important than me. It is likely you make more money than I do (at most organizations I have been in).

But, say something goes wrong. The defect is then tracked back to your work. What happens? (PS. this is purely hypothetical, I just want to make it imaginable for you).

We talk, and I may bring up "Five Whys". Are you familiar with this technique? Assume you are not. We may discuss the role of process. Not for process sake, but process improvement. To make your life easier. Since you spend 1/3 of your life at work, you have an interest in this. I then suggest you google this, and that we should carry on this discussion in (say) a weeks time.

Note that this entire discussion takes 30 minutes. The follow-up will take 30 minutes a day over 4 days, but you will be doing the bulk of the talking. Because you want to. I don't get angry with you. I shield you as much as possible. But (again, this is hypothetical), this is your mistake. Everyone makes mistakes. What is interesting is that you know more about fixing this than I do. After all, I am but your manager. I want to teach you techniques to learn from what happens, listen, and propose approaches.

See? That is management. I will let you push the idea(s) to others. Actually, the modification of the idea that works for you.

Initially, I find I drive the conversation. But, as people become comfortable with me, they drive the dialog. I facilitate and eliminate problems to productivity.

Now, for the bonus answer -- rule #2 for an effective manager is to deal with issues immediately. Your desk should always be clear (as best as possible). I maintain all current open issues on a white-board, where status is immediately inspectable.

Back to "5 Whys" -- if I think that will be valuable to more people, I may create a training session -- which will be referred to in the 1 on 1s. And this is how I would manage a larger group (7 to 11 people). And, the value I can provide to being a "manager of managers"; value to the people I am indirectly managing.

Yes, I try to give 30 minutes a day for every team member.

FredW

ratboy666··on Unintuitive Things I’ve Learned about Management
The rule I use is "The rule of 11" -- you really can't have more than 11 direct reports.

I try to give 30 minutes to each direct report every day. This is not to "manage" them. This is not to "socialize" with them. I do not see them outside the office, and they are not my "friends".

Each person becomes invested in the job. They become better performers. They feel that the company is important. At 11, there are no longer enough hours -- so, if the number of direct reports gets to 11, you need another management layer.

The reason for this? If this is done, this is the easiest way to get maximum performance from the team members.

In your analysis, my team members each spend 30 minutes talking with me -- but 7.5 working. And, working more effectively. I am never surprised and schedules are always met.

What do we talk about? Process improvement. What is going wrong, with suggestions to fix it. Especially introverts, who can see what is happening, but are loath to communicate.

Using this simple approach can give a "10x" multiplier to a team. The "kinds of people that can get work done well, in a steady state" also benefit. By telling me how to improve the "steady state".

FredW

ratboy666··on Make elites compete: Why the 1% earn so much and what to do about it
"not because they are cheaper, but because we can't get anyone here to do the job at reasonable rates."

Um... that is the definition of cheaper. In your own justification sentence. H1B must (should) be paid at your prevalent rate -- and this may not be what you consider a "reasonable" rate.

ratboy666··on An administrator accidentally deleted the production database
"Will" to "Shall" -- very important legal distinction. Thank the second reviewer. Your job in "software engineering consulting" was actually managing risk.
ratboy666··on Microsoft Has Just Blackmailed Linux Twice in One Single Week
Patents were never meant to protect investments.

Trade secrets protected in guild systems. These where out of the control of the government. Indeed, these guilds could be more powerful than the government. The Monarchy could offer a government backed monopoly in exchange for those secrets. Not sure if it is the best idea or not. Personally, I wouldn't mind stronger programming guilds.

ratboy666··on Microsoft Has Just Blackmailed Linux Twice in One Single Week
Not sure who invented or cloned what.

Are you saying that Microsoft invented POSIX?

ratboy666··on Microsoft Has Just Blackmailed Linux Twice in One Single Week
Some simple principles. The first to bear in mind is estoppel. If Microsoft releases a version of Linux, this indicates that they have accepted the GPL2. They cannot go back and argue that it is further encumbered by patents that they control. This would have prevented the release!

This applies to Microsoft, Oracle, IBM, and many other companies.

ratboy666··on How to Write a Video Player in Less Than 1000 Lines
So, my first thought on reading the title was "Good, someone has (re) discovered APL (or J, K, Q or another array language)." Could be a good algorithmic dive into mpeg. Mpeg decode and a simple player seems like a reasonable sub-1000 line APL project. I include mp3 audio decode, of course.

Complete disappointment -- I learn nothing.

ratboy666··on BMW Australia Refusing to Comply with Terms of GNU Public License
No, the offer for source must be to anyone -- the supply of a binary may be limited. BMW cannot be the "sole owner" of the copyright -- even if they own the part they wrote, they must still supply source for the GPL parts.
ratboy666··on Why Learn to Program in C?
Start with "Structure and Interpretation of Computer Programs".

Google it -- it's freely available on-line, along with a video lecture series.

It's different, in that it doesn't teach Scheme (Lisp). It teaches computation (aka CS).

Go from there.

ratboy666··on A Small, Nice Thing
Which brings you back to APL

  1 2 3 + 4 5 6
  5 7 9
ratboy666··on Once upon a time, memory allocators made sense
How about

  #include <stdio.h>

  typedef struct mystruct {
    int x;
    char *p;
  } mystruct;

  mystruct func(int n) {
    return (mystruct) { n, NULL };
  }

  int main(void) {
    mystruct v = func(1);
    printf("%d\n", v.x);
    printf("%d\n", func(2).x);
    return 0;
  }
Works fine with gcc 5.3.1. Multiple destructuring is (maybe) problematic, but if you really want this.
ratboy666··on A brief introduction to C++'s model for type- and resource-safety [pdf]
No, what I "hate" is the idea that C++ promotes "automatic" management of "ownership and lifetime" without a garbage collector.

Which works, except when it doesn't. Which results in stuff like reference counting in the codebase. Which, of course, changes on a whim.

Example: the CEF3 library (chromium embedded framework).

Reference counted objects. Which requires source code changes depending on the version of CEF 3 being used. Requires VERY deep analysis to determine what to change in the using code. Really -- because the objects participate in a multi-threaded library.

So, most code ends up as "cargo cult".

Since my code doesn't fit into the CEF3 object model, I do the contortions needed -- building another layer.

ratboy666··on A brief introduction to C++'s model for type- and resource-safety [pdf]
Guilty. Of writing C++ as if it were C. Sometimes even with classes. Yes, I use memcpy instead of copy constructors. I find "modern C++" horrible to read. Indication of object lifetime? Ownership?

Um... why? If the development support does not include a garbage collector, I have to be very careful about these things. And, I am. Very careful indeed. I just use the approach I do in C, and assume NOTHING from C++. Honestly, I do NOT assume that the language system, compiler or run-time can do it properly. I have been bitten too many times.

I do presume a garbage collector at the very next level up.

Yes, you may find my code "horrible to read". And, yes, I have gone into profane rages over C++ code. It happens when the code bullies me -- with hopeless error messages for simple typos. When simple changes cause the application to no longer link. When simple changes cause massive explosions in object size. In fact C++ is so complex, it encourages cargo cult programming. Not just use of libraries, but enforced cargo-cult when USING the libraries. Because, raisons.

Not just a language -- hell-spawn. Sorry, "modern hell-spawn".

ratboy666··on Knuth: Computer Programming as an Art (1974)
"more or less what art meant"

To which I reply: Did you actually read the essay? Since you started the ad hominem argument, I feel free to continue in that vein.

What is interesting is that most "programming" is exactly "capturing and distilling human experiences using allusions and associations to (re)create those experiences". What else is coding a front-end to an application that saves time and/or labour, and/or makes possible things that were, before the program, impossible? An Art, a Craft or a Science? From your very definition, "Art" would be the answer.

And yet, you begin your criticism with "It's simply nonsense"

ratboy666··on Eternal September
Because 1993 was also the year that advertising on the internet was born.

Before 1993, it was considered ill-mannered to promote commercial products on the internet. We didn't mind commercial transactions, but certainly frowned on promotions. After all, they were (and are) delivered on the end-users dime.

ratboy666··on Eternal September

  # sdate - Eternal September Date
  #
  # date -d '1993-09-01 UTC 8130 days'
  #
  # ce: .mshell;
  #
  s=`date --date="1993-09-01 UTC" +%s`
  if [ -z $1 ]; then
    n=`date +%s`
  else
    n=`date --date="$1" +%s`
  fi
  d=`expr \( $n - $s \) / 86400 + 1`
  if [ $d -ge 1 ]; then
    echo September $d, 1993
  else
    echo Error: date not in Eternal September epoch
  fi
And today is:

September 8153, 1993

Yes, I mourn the internet.

ratboy666··on OpenBSD Jumpstart: Learn to Tame OpenBSD Quickly
mozumder -- um... what?

But, here is an answer - 10,000 requests per second is 100 microseconds per request. At 100Mbps network speed, this gives (roughly) 10 characters per microsecond or a budget of 1,000 characters combined per request. We will take 100 characters for the request, and 900 characters for the reply. Of course, you could go with 1Gps network service, and multiply this by 10. But, you will need at least 20kpps "per core".

However, you also have to contend with disk i/o and/or the database layer.

Which OS? I think you are probably a long way from being able to answer that question. Note that OpenBSD will not be as "multicore performant" but that may not matter in your application.

ratboy666··on Review of the URB-E electric scooter
Illegal in New York City

http://www.nydailynews.com/new-york/exclusive-police-crackdo...

So, $1500 -- and it will be confiscated. Another set of fines could be applied $500 + no insurance, no registration, possibly no motorcycle license. These things cannot be registered -- so no way to make them legal under current New York legislation.

Ignorantia juris non excusat

ratboy666··on Time to Bring Cuba Online
Right. A USian, who would be reasonably presumed to have, um, connections with the US Government, that had imposed trade embargos on Cuba for.. um 50 years... Attempting sedition... from a country that has been activily hostile for 50 years. Furthermore the US had a travel ban to Cuba at the time -- he could NOT have been a tourist.

I guess that after 40 years of a trade embargo, allow "humanitarian" exports is a thing -- Thanks, Clinton.

I am not sure that Internet is a humanitarian export. That point could be argued.

With the claim that the Cubans doing the incoming inspection SHOULD have known what the embargoed equipment was... having never seen it. They wouldn't have known what a fuel injector was!

That was a prime example of USian arrogance. Good for him he got out in 5 years.

ratboy666··on A guide to Linux signals
sigaction() returns the old action. This permits chaining of the actions. Specifically for SIGSEGV, if Library B does not want the signal, it can invoke Library A (without caring what it is). Similarily, A can invoke B. "Unloading" cannot be done, unless you are aware of the load order. This is a general issue -- dlclose() is reference counted, and you wouldn't know if it actually unloaded the library.
ratboy666··on A guide to Linux signals
Linux (Unix) signals are per-process. What is hard about making signals cooperate? Are you referring to a signal generated while in a signal handler? raise() is supported on Windows, but kill() isn't (directly, signals don't seem to be well supported as an IPC mechanism on Windows -- although there appear to be kill() style mechanisms).
ratboy666··on Show HN: WOPR – A markup for rich terminal reports
Haven't tried this. Just want to know -- what advantage does this give over using gnu plot with sixel output?

I can see the advantage over tek 4010 (this could be dynamic). If this is static (again, haven't tried yet), with multiple pages, why not just use tek 4010?

I also don't understand the admonish to use something other than xterm. What is the issue that was observed?

Ratboy

ratboy666··on Environment Variables and Path in Windows 10
So...

Environment change to send (something) to UI process(es). Plural here -- these could be window manager, shell, or applications. Since application subsumes window manager and shell, we will ignore that. Unless the application is forced to say "I am interested" to (say) systemd. Or dbus.

Then, accept the environment changes. But, those will have to be filtered -- this could be user input. Indeed, the application may have an application starter, and one the jobs of the application starter may be to filter the environment. The application starter may never expect an environment change, but the application started may (in our "new world" API). This could result in security holes (especially for large daemon processes). Interestingly, the main purpose of this change would be to allow the environment to change dynamically for those daemons.

The "extra clever" is the easy case -- make changes in .bashrc This will get read by new tabs in your terminal emulator.

Having an application starter that is responsible for the environment is the (current) solution. Of course, this does not permit environment changes. But these are impossible anyway -- int main(int ac, char av, char envp) implies that the environment passed to main must not be altered. Of course SUSv3 doesn't specify it, and getenv() putenv() should be used. Hoever, extern char environ; is allowed, which is the same as char envp.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/en...

http://pubs.opengroup.org/onlinepubs/9699919799/functions/ge...

So, an application can do char path = getenv("PATH"); to obtain the PATH. After which, char path will not change (as long as getenv(), setenv, unsetenv() or putenv() is not called, and environ is not written).

Which means that it is very difficult to "inject" a PATH change -- it should be impossible. Another mechanism must be put into place for this, but POSIX semantics should be maintained.

In my code, I tend to do strdup(getenv("PATH")) or something along those lines (note that getenv() may invalidate a previous getenv() so it is not safe to store the result char* of getenv()).

Ratboy

ratboy666··on Black Screen: A modern terminal emulator based on Electron
xterm supports tektronix vector graphics... And sixel (and regis). You can cat the graphics, and it will display (may have to build xterm from source -- Fedora enables tek, but not sixel, for example). GNU plot supports sixel.
ratboy666··on Hints on Programming Language Design (1973) [pdf]
"even integers are boxed by default"

Um... why? For example, 2 is.. 2. 2 is not 3. If I "box" 2, can I then make it 3?

Some very old FORTRAN implementations actually allowed this:

subroutine x(j)

write(,)j

j = 3

return

do 1 i = 1,2

1 x(4)

4

3

(sorry... it's been years). Note that the reference is immutable (j refers to a single location) -- but the value is boxed (4 is put into a memory location). And this is why this can even work.

FredW

ratboy666··on Use lock addresses to enforce uniform locking order. Avoid deadlock
This solution is brilliant. No interface is exposed. The observation is that locks themselves have addresses, and these addresses have an order. That gives the order that locking is to be done in to ensure no deadlocking.

Indeed, this extends quite naturally to locks that are not related from modules that are not aware of each other.

I repeat, just brilliant.

← PreviousPage 6 of 7Next →