What does “<

<() is called process substitution in the manual, and is similar to a pipe but passes an argument of the form /dev/fd/63 instead of using stdin. < reads the input from a file named on command line. Together, these two operators function exactly like a pipe, so it could be rewritten as find /bar -name … Read more

How to use the read command in Bash?

The read in your script command is fine. However, you execute it in the pipeline, which means it is in a subshell, therefore, the variables it reads to are not visible in the parent shell. You can either move the rest of the script in the subshell, too: echo hello | { read str echo … Read more

Python sum, why not strings? [closed]

Python tries to discourage you from “summing” strings. You’re supposed to join them: “”.join(list_of_strings) It’s a lot faster, and uses much less memory. A quick benchmark: $ python -m timeit -s ‘import operator; strings = [“a”]*10000’ ‘r = reduce(operator.add, strings)’ 100 loops, best of 3: 8.46 msec per loop $ python -m timeit -s ‘import … Read more

Performance of built-in types : char vs short vs int vs. float vs. double

Float vs. integer: Historically, floating-point could be much slower than integer arithmetic. On modern computers, this is no longer really the case (it is somewhat slower on some platforms, but unless you write perfect code and optimize for every cycle, the difference will be swamped by the other inefficiencies in your code). On somewhat limited … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)