04/30/19

What's the difference between getPath(), getAbsolutePath(), and getCanonicalPath() in Java?

What's the difference between `getPath()`, `getAbsolutePath()`, and `getCanonicalPath()` in Java? And when do I use each one?
C++

04/28/19

What's the purpose of using braces (i.e. {}) for a single-line if or loop?

I'm reading some lecture notes of my C++ lecturer and he wrote the following: > 1. Use Indentation // OK> 2. Never rely on operator precedence - Always use parentheses // OK > 3. Always... more

What do 'real', 'user' and 'sys' mean in the output of time(1)?

$ time foo real 0m0.003s user 0m0.000s sys 0m0.004s $ What do 'real', 'user' and 'sys' mean in the output of time? Which one is meaningful when benchmarking my app?

04/25/19

Recursively look for files with a specific extension?

I'm trying to find all files with a specific extension in a directory and its subdirectories with my bash (Latest Ubuntu LTS Release). This is what's written in a script file: #!/bin/bash ... more

04/25/19

How does "cat << EOF" work in bash?

I needed to write a script to enter multi-line input to a program (`psql`). After a bit of googling, I found the following syntax works: cat << EOF | psql ---params BEGIN; `pg_dump... more

04/22/19

How to symlink a file in Linux?

I want to make a symbolic link in Linux. I have written this bash command where the first path is the folder I want link into and the second path is the compiled source. ln -s... more

04/20/19

Why an ARM processor with 32 bits address bus can address 4 billion different bytes?

Why an ARM processor with 32 bits address bus can address 4 billion different bytes? I know that 2^32 is equal to about 4 billions, but shouldn't it be 4 billion bits and not bytes? Hence if I want... more

04/20/19

How to get full path of a file?

Is there an easy way I can print the full path of `file.txt` ? file.txt = /nfs/an/disks/jj/home/dir/file.txt The `<command>` dir> <command> file.txt should print ... more

04/20/19

Restarting cron after changing crontab file?

Do I have to restart cron after changing the crontable file?

04/20/19

How to grep a string in a directory and all its subdirectories' files in LINUX?

How to grep a string or a text in a directory and all its subdirectories'files in LINUX ??
Sql

04/19/19

What is the difference between "INNER JOIN" and "OUTER JOIN"?

Also how do `LEFT JOIN`, `RIGHT JOIN` and `FULL JOIN` fit in?
C

04/18/19

What is size_t in C?

I am getting confused with `size_t` in C. I know that it is returned by the `sizeof` operator. But what exactly is it? Is it a data type?Let's say I have a `for` loop: for(i = 0; i <... more

04/17/19

Can enums be subclassed to add new elements?

I want to take an existing enum and add more elements to it as follows: enum A {a,b,c} enum B extends A {d} // B is {a,b,c,d} Is this possible in Java?
C

04/16/19

static const vs "#define" vs "enum"?

Which one is better to use among the below statements in C? static const int var = 5;or #define var 5or enum { var = 5 };
Sql

04/11/19

What is the difference between UNION and UNION ALL?

What is the difference between `UNION` and `UNION ALL`?

04/04/19

How do I syntax check a Bash script without running it?

Is it possible to check a bash script syntax without executing it? Using Perl, I can run `perl -c 'script name'`. Is there any equivalent command for bash scripts?

03/29/19

What is the purpose of self?

What is the purpose of the `self` word in Python? I understand it refers to the specific object created from that class, but I can't see why it explicitly needs to be added to every function as a... more

03/28/19

The noun form of "well-defined"?

What’s the noun of *well-defined* (meaning that something is defined well in a mathematical sense). Also, could you show me more examples of the same structure/principle (of transforming the... more

03/27/19

Synonyms for "mixed in" or "mixed up"?

I decided that I actually don't need an answer to this question but I do not have an account and I do not know how to delete this question or if there is a way to. I am sorry.

03/20/19

How to quote a quote with added words?

The original text in the source is as follows: > "there is a psychological need for... [a] sense-making narrative" (Rosen 2008: xix). I would like to quote this line in a paper I'm writing. Do... more

03/18/19

How do I count the number of occurrences of a char in a String?

I have the string a.b.c.d. I want to count the occurrences of '.' in an idiomatic way, preferably a one-liner. (Previously I had expressed this constraint as "without a loop", in case you're... more

03/18/19

What is the difference between a symbolic link and a hard link?

Recently I was asked this during a job interview. I was honest and said I knew how a symbolic link behaves and how to create one, but do not understand the use of a hard link and how it differs... more

03/18/19

Word for a male aged 20 through 25?

I'm trying to come up with a word that describes a male aged from 20 through 25. Man feels too adult like and Young Adult feels like a teenager. The type of word I'm looking for is someone not... more
Sql

03/15/19

What is the fastest way to count the exact number of rows in a very large table?

I have come across articles that state that `SELECT COUNT(*) FROM TABLE_NAME` will be slow when the table has lots of rows and lots of columns. I have a table that might contain even billions of... more

Can hash tables really be O(1)?

It seems to be common knowledge that hash tables can achieve O(1), but that has never made sense to me. Can someone please explain it?

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.