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 How to Wake Up Ready to Rock
I bought Philips "Wake-up-light" and I am happy with it.
vlisivka··on Java Was Strongly Influenced by Objective-C

  if(foo instanceof SomeClassObject) ...
or

  if(SomeClassObject.isInstance(foo)) ...
vlisivka··on Java Was Strongly Influenced by Objective-C

  Class c = SomeRandomClass.class;
  Object x=c.newInstance();
vlisivka··on Matt Cutts: Installing Android development environment on Ubuntu 9.04
Why not just make some .deb's and repository instead, like here: http://www.newlc.com/en/deb-packages-android-sdk-bleeding-ed... ?

The only thing I unlike more than installation itself is installation instruction.

vlisivka··on Why 30.1% of numbers start with 1
Linear data is measured using logarithmic scale (..., 0.1, 1, 10, 100, ...).

If you saw logarithmic scale ( http://www.ieer.org/log.gif ), you know that distance between 1 and 2 on logarithmic scale is much wider than between 2 and 3, and so on. So, no surprise, if you seed linear data through logarithmic (non-linear) filter, then numbers will follow pattern of logarithmic scale.

vlisivka··on Secrets of Looking Good on the Dance Floor
When I watching myself on video, I notice these things:

1) bad posture;

2) improper positions of head, hands, hips, foots, etc.;

4) small steps or movements without power;

3) incorrect movements or steps.

So +1 on good posture, which is result of proper emotion. I even created special trainer for that. :-)

PS. 4 years in ballroom sport dancing (10 dances).

vlisivka··on Why Poor Countries Are Poor
There is no difference in behaviour of two systems, when each element of the system behaves like corresponding element of the another system.

It will be much easier to understand what happen in Cameroon, if you imagine similar system you can understand.

Imagine, you have group of web-servers. You hire administrator to administrate your dedicated servers in dedicated data centre. He changed all locks, root passwords, identity information, and then installed his own servers in addition to your own. The only right you have now is to pay bills. His servers produces too much load on your system, his incompetent administration causes outages, so your own income is suffers down. There is no "provider" to complain to.

What you can do in that situation?

a) Pay more to administrator, so he will take some courses and will provide more competent service in future;

b) register new web-domain, create new, separate, data centre, hire new administrator;

c) hire a gang to kill old administrator, blow up doors, reformat hard drives, hire new administrator.

vlisivka··on Writing English as a Second Language
It has. Common prefix(es) + common (Latin) root(s) + common suffix(es).
vlisivka··on Writing English as a Second Language
> The russian language has a special term set aside for this kind of round-about linguistic constructionism – "fish language". It's like the English "legalese", but with no relation to lawyers specifically.

You talking about "Канцелярит" (kantceliaryt?). "Канцелярия" means "office". Suffix "ит" here means language or disease. So "канцелярит" means "official language/disease". See http://ru.wikipedia.org/wiki/%D0%9A%D0%B0%D0%BD%D1%86%D0%B5%... http://zhivoeslovo.ru/content/view/85/143/

"Fish" (рыба) - is template or form: you need just to fill gaps between prewritten sentences. It looks like "fish bones".

vlisivka··on Ask HN: Seeking a cofounder
Me too - I spent whole year on that, then abandoned it. :-)

I targeted Linux (or Linux like) users: Ubuntu, Fedora, Android. I leveraged existing working and well tested infrastructure used in Linux. It is simple and working well (for Linux users), but I have no money to push it forward any more...

vlisivka··on Maven builds are an infinite cycle of despair
Maven mixes many programming tools in one program: project building (make), dependency management(apt/yum), project management, etc.

I replaced maven by ant+RPM+yum+Hudson in one large project, and everybody is happy.

vlisivka··on Ask HN: How do you organize your code on your machine?
~/projects/PROJECT — my personal projects (no longer used);

~/projects/package-gen/dst/PROJECT — my personal projects in RPM package format, with automatic build system, various templates for new packages, repository of built binary and source packages;

~/work/PROJECT — work;

~/bin — various personal scripts and programs;

~/tmp — scratch, e.g. ~/tmp/1 or ~/tmp/foobar;

~/gtd/projects — various stuff, sorted by purpose, tag or/and date. Links from here to many other places;

~/gtd/income — various stuff, to be sorted;

~/examples — various working snippets;

/usr/share/bash-modules/ - various typical functions for bash scripts, e.g. "backtrace" or "..." (recently created as alternative to ~/examples/bash-..., see http://vlisivka.pp.ua/en/bash_modules ).

I use very simple tagging tool to speedup sorting, e.g. "s foo.tar.gz foo bar" will create two hard links to "foo.tar.gz" file in ~/gtd/projects/foo/ and in ~/gtd/projects/bar/ directories, and so on.

Currently, I use RPM packages only for my own projects, because they are easy to install/uninstall/upgrade, they contains documentation, changelog, and description, they are easy to verify or rebuild, and so on.

vlisivka··on The Puzzling Paradox of Sign Language
> And processing language is a hard problem for people (and computers!)

Processing of some human languages (like English)...

vlisivka··on Ask HN: What hosting do you use for personal projects?
RackSpace Cloud ($10 per month for 256MB instance w/o traffic). RSC allows me to follow modern administration practice ( http://vlisivka.pp.ua/en/modern_administration ) even at my own private host.
vlisivka··on Recursive Regular Expressions
Perl6 already contains grammars.

Perl5 backported "named captures" from perl6:

  #!/usr/bin/perl
  use warnings;
  use strict;
  use feature qw(switch say);
  #use locale;
  #use re 'debug';

  my $expression = qr{
      (?(DEFINE)
            (?<expr>       (?&space)* (?&term) (?&space)* (?&opterm)? (?&space)* ; (?&space)* )
            (?<term>       (?&identifier)
                           | (?&number)
                           | (?&string)
            )
            (?<opterm>     (?&space)* (?&operator) (?&space)* (?&term) (?&space)* (?&opterm)? (?&space)* )
            (?<operator>   [=+*/-]                                          )
            (?<identifier> [A-Za-z_][A-Za-z0-9_]+            )
            (?<number>     [0-9]+                                           )
            (?<string>     (?&quote) ( (?&char) | (?&bsquote) )*? (?&quote) )
            (?<quote>      \"                                               )
            (?<char>       [^\\\"]                                          )
            (?<bsquote>    \\.                                              )
            (?<space>      [ \t]                                            )
      )
      (?&expr)
    }x;

  while (<>) {
  chomp;
  if ( /^ $expression $/x ) {
    say "Correct expression: $_";
  }else {
    say "Incorrect expression: $_";
  }
  }
vlisivka··on Termite : Erlang-style concurrency for Gambit Scheme
Erlang-style messaging in bash 4.0 :-)

http://vlisivka.pp.ua/uk/erlang_sh

vlisivka··on Bill Clementson's Blog: JavaScript and Lisp
arguments.callee is deprecated in javascript 1.4. Use function name instead, so interpreter will have chance to perform tail recursion. Give names to your anonymous functions anyway: it will be much easier to trace them.

Example of anonymous recursive function with arguments.callee:

  var factorial=function(n) {
     return (!(n>1))? 1 : arguments.callee(n-1)*n;
  }
Example of anonymous recursive function without arguments.callee:

  var factorial=function factorial(n) {
     return (!(n>1))? 1 : factorial(n-1)*n;
 }
vlisivka··on Bill Clementson's Blog: JavaScript and Lisp
JavaScript is implementation of Scheme (dialect of Lisp) with Java-like syntax.
vlisivka··on A common bug in published code
int runs = (int) Math.random() * 1000000;

is equivalent to int runs = (int) (Math.random() * 1000000);

This search is better ( "\s?[;)]" is added at the end): http://www.google.com/codesearch?hl=en&lr=&q=\%28int...

vlisivka··on Ban The Debugger
If your program cannot say you where is the problem, it is better to invest your time into better code: add more self-diagnostic, constraints, asserts, and automated test cases.

If you waste your time on debugger, then you will have just bug fixed and nothing else.

If you invest your time into code, you will have bug fixed AND much better code.

Computers can catch bugs much faster than humans. Programming is invented for that. Think like you already have programmable debugger inside your program. Invest your time into useful tools, which you can use to trace and check your program.

vlisivka··on Ask HN: What tool makes you most productitive?
1) bash/perl(regexps)/other command line tools;

2) trackers, task focusing software: GTD-free, Trac, Mylyn, pyroom, etc.;

3) blind typing (to type fast), workrave (to stop typing);

4) somebody else, which will review my work.

vlisivka··on Handling out of memory conditions in C
Older JVM's behave in such way: in the OOM situation they runs Garbage Collection process to reclaim some unused memory. GC itself requires some memory to operate, so JVM reserves some memory to GC.
vlisivka··on If you had 5 dollars and 2 hours, how would you make as much money as possible?
See 2 year old sample photo here: http://sites.google.com/site/vlisivka/zatoka
vlisivka··on If you had 5 dollars and 2 hours, how would you make as much money as possible?
My trainer use that method for more than 50 years: he started at 18 years in 1958. ;-)

Rules are simple: pay $1 and throw ball to basketball basket 6 times. 5-6 hits - $10-$20 worth ball, 4-3 hits - 10c worth prise, 1-2 hits - a sweet.

He started with single ball.

vlisivka··on Handling out of memory conditions in C
Allocate 1MB of memory upfront. When OOM happens, free that memory and run recovery mechanism.

Similar policy is used in Linux for disk space: 10% of disk space is reserved for root.

PS. Linux OOMKiller already do something similar: it just kills a process to free some memory.

vlisivka··on If you had 5 dollars and 2 hours, how would you make as much money as possible?
First team: regular work. Second team: speculation. Third team: ads.

Where is direct marketing team?

My solutions:

Receipt one: * by bunch of cheap sport items; * walk to the park; * lease them; * hire and teach other people to do that instead of you for half of income. (Tested).

Receipt two: * by a sport item (e.g. ball); * walk to the street; * encourage people to play a casual game with you, alone, or with other people; * hire and teach other people to do that instead of you for half of income. (Tested).

vlisivka··on X-Windows for Embedded Systems
I already can use XWindow on my phone - I have GPE with XWindow installed on my phone (Motorola A1200): http://gpe.handhelds.org/ .

GPE/X11 works much faster than QT/FB.

vlisivka··on Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
I saw no new terms to add to my dictionary in that presentation.

If you looking for new ideas to add to your language, then look at the world:

* hibernate mode decreased computer boot time from minutes to seconds. Is your new supper-pupper language supports that? Can you freeze your program and distribute it in that frozen mode?

* web-applications provide instant access to ready to work application. Is your new supper-pupper language supports that? Is your language support instant access, like built-in access to SQL data base or XMLRPC service?

* Is Map-Reduce supported directly by your language?

* Is your language has support for regular expressions in language?

* Can you create parallel constructs with ease, like "foo | bar" in shell?

* Did your language supports built-in tree system ("boxes", "DOM", file system, etc.) and ICRUD, XPATH, CSS for these trees?

* Can your language automatically take corrective actions in case of error? Like "on SQL error FooBar: rescue database OR restore database from backup OR switch to new database".

* Can your code depend on something? Can you write "Class FooBar. Requires application mysql >= 5.0, external resource myapp-application-scheme >= 1.2. Conflicts with module FooBarBaz. Provides fooBarBaz. Obsoletes FooB."?

* Can you upgrade your application on the fly without restart and losing data or breaking anything?

* Can you compose program without editing files, just by creating and copying of files and directories? (dot-dir pattern)

And so on.

vlisivka··on A Square Is Not A Rectangle
If you use setFoo() and getFoo() then you are not using OOP at all.

Encapsulation is simple thing - just write setters and getters for all your internal data and you done. ;-)

PS.

«If the classes are immutable, there is no problem with this state of affairs. Circles satisfy all invariants of ellipses; and an (immutable) circle can be used in any context where an immutable ellipse is expected.»

vlisivka··on Switching to Linux: A Windows developer’s view
Ext4 - is badly configured Ext3 (data=writeback mode) with extents support. By default, in recent kernels, Ext3 is configured in same way as Ext4 (data=writeback). In RedHat/Fedora/CentOS/etc., Ext4 is configured properly (data=ordered): "Don't worry about the new default journaling mode for ext3 planned for 2.6.30 (data=writeback, which is much faster than the old default, data=ordered, but has enormous security and data integrity problems). No distro would ship this as the default. The only way it could happen at Red Hat is over the dead bodies of the security team, who, let me tell you, keep an eagle eye on file system data leaks like this."

Ext4 is not alone - other file systems (Ext3, XFS, maybe others) are patched to support new file rewrite semantic too.

PS. I saw lot of zero-padded files on XFS until switched to Ext3 with data=ordered.

← PreviousPage 5 of 6Next →