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.
156 karma · joined February 7, 2009
http://trac.assembla.com/bash-modules/
contact: gtalk:vlisivka@gmail.com , skype:vlisivka
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.
Every human flu is actually an avian flu adapted by swine.
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).
Try XSS.
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.How to classify that? As success or as failure?
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.
I live in Ukraine (Eastern Europe).
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?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
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. ;-)
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.
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.
fd=open("...");
transaction_begin(fd);
write(fd, ...); close(fd);
rename(fd);
transaction_end(fd);
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?
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.
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.
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.
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. :-(
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.
Look at Spring Dependency Injection Framework for example. It supports lot of libraries, which are written in traditional style.
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.
It helps, really.
Replace "company" by whatever you need. I used it to check myself, to check my firm, to check my solutions, etc.