HNHacker News
TopNewBestAskShowJobs

vlisivka

156 karma · joined February 7, 2009

http://linux.org.ua/

http://trac.assembla.com/bash-modules/

contact: gtalk:vlisivka@gmail.com , skype:vlisivka

submissionscomments
vlisivka··on Safe-r Bash Scripting
Use "set -u" to treat unset variables as an error when substituting. Use "||" operator to handle errors. My pattern:

an_command || { error "Cannot execute an_command. Exit code: $?." return 1 }

Always wrap variables with double quotes, unless you really need to parse variable value by bash. Use arrays, when you need to pass multiple arguments. And so on.

vlisivka··on Spread of HINI (Swine Flu) across the United States
> I was surprised to see the death rate for swine flu is not much different from the regular seasonal flu

Every human flu is actually an avian flu adapted by swine.

vlisivka··on Is BSD The New GPL?
If humans are "free", why I cannot capture them and sell as slaves? Are they really "free"?

Word "free" has lot of meanings in English language. In my native language, word "free" in context of BSD licensed code should be translated as "svoboda" (fully unrestricted state of something), and in context of GPL licensed code as "volya" (has it own rights, abilities, goals, like free human).

vlisivka··on [dead]
> When logging in from a home or work computer, a cookie can be stored so that no verification call is required.

Try XSS.

vlisivka··on Why Extreme Programming Fails
You are right in general case. In my case, I was responsible for few large subsystems (Linux and related stuff, automated testing and continuous building, packaging, deployment, automating of common tasks, configuring, support and troubleshooting, training, documentation, reviewing, enforcing best practices, developing of development standards, predicting future problems, etc.). I just cannot leave that project for long period of time, because large amounts of tickets must pass through me in some way (investigation, suggestion, implementation, reviewing/fixing, approving).

I solved problem by training team, which replaces me. Then I leaved my work (IMHO, crisis is best time for that). Team works slower than me. Their solutions are not so good, because nobody has picture of whole project in his head. However, they can continue to work, while I cannot. As I can see, this scenario is typical.

IMHO, problem with XP and SCRUM that they producing too much load on the few competent persons. Overall result is better than with traditional methods, but competent person burns much faster, because they contribute more than others.

It is hidden magic beyond the process - XP and SCRUM just delivers task to competent person much faster than any other process. The drawback is that there no reason to grow for other developers, thus load on competent persons tend to increase over time. Pair programming and peer reviewing helps when people are roughly equal, but that is rare.

If we try to model situation, then we will see few major stages in evolution of project and/or group:

  * fast growing of project and/or group until physical limit of few key people will be hit;
  * degradation of group, because key people leave project, until there no overloaded people;
  * stagnation.

PS. I spent last few months to improve me in sport-dancing. I meet new very funny girl. I plan to work next 2 months as instructor for wind-surfing at Black Sea (Eastern Europe). I hope, it will help.
vlisivka··on Why Extreme Programming Fails
XP and SCRUM can increase my productivity up to 300%. But, after 5 years of successful XP and SCRUM practice, I burned out. I just cannot think about work. Long vacations helps me a lot, but for short period of time - 1 month vacation restore my productivity for about 6 months only.

How to classify that? As success or as failure?

vlisivka··on Writing a language in 15 minutes
Lisp (and Scheme) has no syntax. Lisp code is Abstract Syntax Tree, which is written in text form. AST is intermediate form used by compilers or interpreters.

You can use XML or JSON to represent AST. You can write interpreter for AST representations in these formats very fast too. But somebody else need to write parser from language with real syntax into AST.

JavaScript is example of Scheme implementation with Java-like syntax. Write interpreter for this language in 15 minutes.

vlisivka··on Landmark study: DRM truly does make pirates out of us all
Congratulations for what? Law is not working due to weak government. I am afraid that if somebody will try to enforce DRM software to comply with law, law will be changed quickly.

I live in Ukraine (Eastern Europe).

vlisivka··on My Language Is More Agile Than Yours: A Study of Arc
Original blub code should look like that: frame.addKeyListener(new KeyListener() { public void keyTyped(KeyEvent event) { switch (event.getKeyChar()) { case 'j': drop(); break; case 'h': move(-1); break; case 'k': move(1); break; case 'u': rotate(); break; } }

      public void keyPressed(KeyEvent event) {
      }

      public void keyReleased(KeyEvent event) {
      }
    });
About Arc code:

    (on-key-press frame
      'u     (rotate-shape)
      'j     (drop-shape)
      'h     (move-shape -1)
      'k     (move-shape 1))
Is this code ADDS NEW key event handler OR OVERRIDES old one? When it is invoked - when key is PRESSED or when key is TYPED?
vlisivka··on Landmark study: DRM truly does make pirates out of us all
In my country, DRM is unlawful de-jure (but is in use, de-facto), because it violates bunch of laws.
vlisivka··on Ask HN: how do you prevent computer related eye fatigue?
I use program to force short breaks (see workrave.org). I also use short play of fast arcade game (sopwith to first death, 20-30 seconds) to relax a bit.
vlisivka··on New worm can infect home modem/routers
The network equipment producers use cheapest programmers, which never ever will read Red Book ( http://www.amazon.com/UNIX-System-Administration-Handbook-3r... ), or File System Hierarchy Standard, or any other standard.

My mobile phone (Motorola A1200 with MontaVista Linux) has "root" user with empty password. It was very non-trivial to change password, because root file system is read only. :-)

IMHO, equipment producers should use persons with experience in both programming and administration (like me ;-) ), or use experienced administrators to review embedded systems before they are shipped to end users.

Government should also try regulate minimal acceptable level of security in network-connected devices, because ignorance of these security related problems creates huge risk for everybody. Imagine robots, which are controlled by hackers. Network devices can steal your credit card number and/or open doors for other trojans. Robots can steal your credit card and/or open door for breakers.

See also: "Researchers Demo BIOS Attack That Survives Disk Wipes" http://it.slashdot.org/article.pl?sid=09/03/23/1248214

vlisivka··on US Navy Laboratory Scientists: Possible cold fusion breakthrough
> "We're talking about a new field of science that's a hybrid between chemistry and physics."

I already saw articles about that in Russian magazine "Technic for youngers" ("Техника - молодёжи"/"Tehnika - molodeji") about 20 years ago. A man (I cannot find article) experimented with middle energy range (around 0.1MeV) nuclear reactions. He used modified welding machine to generate high power, which he used to fuse alloy of metals. Then he analysed results and found new metals and non-metals in alloy. He created theory about stable nuclear fractions, similar to chemistry, which can be transmitted between nucleus at much lower energies than typical nuclear reaction without damaging of nucleus.

However, magazine was very popular due to science fiction. ;-)

vlisivka··on The Javascript Trap
I have same thoughts as RMS.

As leader of our national Ukrainian Linux Users Group, I involved in fixing of various problems with support for Ukrainain language in foreign programs.

Here is my experience: MS: some problems still around for more than 20 years (from MS DOS era till today); SUN: almost 10 years to fix trivial problem; Apple: good support; IBM: good support of official standards, not so good support for net standards; Google: some problems are still around for years, nobody response to my letters, no way to fix. Linux/*BSD/GNU: very easy to fix (or create) problem in any supported program, much harder when program in no longer in development (need to maintain our own version of program in our own distribution).

All these problems are trivial (charset support, proper charset translation, national keyboard support, message translations, etc.), so they are very easy to fix. Currently, then only OS'es that have no problems with Ukrainian language is GNU/Linux. Even Non-GNU/Linux systems are easy to fix in most cases.

I agree with Stallman: web services are closed, so they introduce high risk for our freedom.

vlisivka··on Let It Die: Rushkoff on the economy
> Yesterday it was comparing the US today with the Weimar Republic.

He comparing two economic systems. What wrong?

> The great cathedrals were built as tourist attractions.

Yes, that is right. ( s/tourist/believer/ ) Attractive church gathered tons of gold.

vlisivka··on Introduction to the ad auction
Carrot should be placed very close to donkey head. "Just one cent above my bid! Beat it!"
vlisivka··on How to rewrite files in Linux
The time to invent transactions in filesystem?

fd=open("...");

transaction_begin(fd);

write(fd, ...); close(fd);

rename(fd);

transaction_end(fd);

vlisivka··on The Y Combinator in Arc and Java
Somebody, please, kill the author of that article!

If you are green, then you should think about effectiveness of your code. I mean, how much watts your code will use. Ideal program should produce result without using of any computation at all. Programs with lazy evaluation is very close to that ideal. Y Combinator is very green in such languages. But Y Combinator in call-by-value languages? Code, which produces code, to run code, which produces new code, to run code, which produces new code, ...? Author want to boil our planet?

vlisivka··on Ask HN: Content Serving Cluster
I recommend to look at GlusterFS. It fast, modularized, layered clustering file system. It is not tied to Linux kernel because it built for (patched) Fuse. With Infiniband hardware, it is fastest clustered system available for free. See http://www.gluster.org/docs/index.php/GlusterFS_1.3.pre2-VER... for example.
vlisivka··on Stop Catching Exceptions
Imagine following example: you signed contact to guarantee 99,999 uptime - 8-9 hours of downtime per year. First your downtime is 12 hours. Now you need to work more than 1 year without any errors. Any "500" error code can cost hundreds of thousands of dollars.

How you will do error handling and exception handling in that case? If there 1 chance per million that something will work incorrectly due to solar radiation or power fluctuation, how much such temporary failures you will see when your system handling more than 100 millions of requests per day? If you restarted database and all connections to database are broken, should all your current users see 500 error code?

PS. That is real story. ;-)

PPS. I used RecoveryManager to handle errors in the my system. It is very simple: when it receiving an error, it uses it configuration to determine action to take (e.g. call helper method) and responding to caller with code to indicate what caller should do: throw exception to higher level or just try again for few times.

vlisivka··on The Hacker's Diet: Losing weight the hacker way
While on diet, you need more vitamins than usual.

Fruits and vegetables has calories too. Look at tables: http://www.fatfreekitchen.com/calories.html

1 apple is about 200g (five apples per 1kg), thus it is equivalent to 2 tablespoons of sugar.

vlisivka··on The Hacker's Diet: Losing weight the hacker way
You right. So you do not need to eat less. You need to eat less calories, right? Eat meat instead of burger - you will be satiated for much longer time with much less calories. Also you need to eat vitamins - they will help organism to convert fat into energy when necessary and you will be less hungry in average.
vlisivka··on Writing unit tests is reinventing functional programming in non-functional languages
It is not a problem. Execution of any code in any language can have side effects, like garbage in memory or stack overflow or OutOfMemoryException. Usually, you just ignore these side effects.

Use code convention to define which flags, registers, and memory areas, IO registers, etc. must be preserved by the called function. Just ignore any other changes.

vlisivka··on Tricks for Getting Out of Bed in the Morning
I have "Wake-up Light" made by Philips, which slowly turns light on at the morning to simulate sun raising. It helps me too.

PS. But it badly designed because it power adapter produces some low noise during night, which I can hear by one ear. It display is too bright and it built-in speaker is too cheap. :-(

vlisivka··on Writing unit tests is reinventing functional programming in non-functional languages
> I'd encourage him to build something so awesome with a functional language that the rest of us can't help but be blown away.

Functional language helps a lot in building of side effect free code. But such code can be written even in pure assembler. I writing in such style in any language, including Bash.

Sometimes I need to refactor somebody else code. Code functionality remains exact same after refactoring. Things that changed are: better code clarity, better reusability, and better testability as part of reusability.

Unit tests creates additional contexts, in which main code can be used, thus they force to improve reusability of the code, thus code forced to make less or none side effects, thus programmer forced to rewrite code in functional style.

vlisivka··on Writing unit tests is reinventing functional programming in non-functional languages
Dependency Injection allows to assemble program on the fly. It allows to assemble programs written in different styles, including functional.

Look at Spring Dependency Injection Framework for example. It supports lot of libraries, which are written in traditional style.

vlisivka··on Galaxy has 'billions of Earths'
Earth is complex product. Tides, created by the Moon, are important to mix water and to clean coasts. Metal core of the Earth is producing magnetic shield. All that is created due to collision of Earth with large object, which is comparable to Earth, and capturing it.

It is unlikely, that our Galaxy will contain too many systems created by two objects with comparable mass, because such systems are unstable. We can calculate this number by comparing number of star systems with two comparable stars in the system to number of regular stars.

vlisivka··on The Secret to Start-Up Success: Save Customers Money
The Ultimate Question: "How likely is it that you would recommend this company to a friend or colleague?"

It helps, really.

Replace "company" by whatever you need. I used it to check myself, to check my firm, to check my solutions, etc.

vlisivka··on Ask HN: When was the last really transformational idea in programming languages?
Inversion Of Control principle and Dependency Injection - 2002-2005. That is single possible answer.
vlisivka··on Programming Your PDP-11: Part 0
I still remember machine codes for PDP-11 instructions. I used clone of PDP-11 in my school: cheap school computer with two processors and 192KB of both main and video memory (UKNС). Computer has built-in console debugger, so it was lot of fun to plug computer in and start typing programs in machine code, explore registers, co-processor memory, alter various tables, like font table to draw sprites instead of letters, etc. :-)
← PreviousPage 6 of 6