Your server process has received a SIGPIPE writing to a socket. This usually happens when you write to a socket fully closed on the other (client) side. This might be happening when a client program doesn't wait till all the data from the server is received and simply closes a socket (using close function). In a C program you would normally try setting to ignore SIGPIPE signal … [Read more...]
How to remove a directory from git repository?
Remove directory from git and local You could checkout 'master' with both directories; git rm -r one-of-the-directories // This deletes from filesystem git commit . -m "Remove duplicated directory" git push origin (typically 'master', but not always) Remove directory from git but NOT local As mentioned in the comments, what you usually want to do is remove this directory … [Read more...]
How to parse this string in Java?
If you want to split the String at the / character, the String.split method will work: For example: String s = "prefix/dir1/dir2/dir3/dir4"; String tokens = s.split("/"); for (String t : tokens) System.out.println(t); Output prefix dir1 dir2 dir3 dir4 Edit Case with a / in the prefix, and we know what the prefix is: String s = "slash/prefix/dir1/dir2/dir3/dir4"; String … [Read more...]
Hide scroll bar, but while still being able to scroll
^=, -= and += symbols in Python
As almost any modern language, python has Assignment Operators so they can use them every time you want to assign a value to a variable after doing some arithmetic or logical operation, both (assignment and operation)are expressed compact way in one statement.... When you compute X = X + Y you are actually returning the sum of X and Y into a new variable, which, in your … [Read more...]
How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loops
Regular expressions are used for Pattern Matching. To use in Excel follow these steps: Step 1: Add VBA reference to "Microsoft VBScript Regular Expressions 5.5" Select "Developer" tab (I don't have this tab what do I do?) Select "Visual Basic" icon from 'Code' ribbon section In "Microsoft Visual Basic for Applications" window select "Tools" from the top menu. Select … [Read more...]
What is the difference between range and xrange functions in Python 2.X?
In Python 2.x: range creates a list, so if you do range(1, 10000000) it creates a list in memory with 9999999 elements. xrange is a sequence object that evaluates lazily. In Python 3: range does the equivalent of Python 2's xrange. To get the list, you have to explicitly use list(range(...)). xrange no longer exists. range creates a list, so if you do range(1, … [Read more...]
What is the file node.exe for?
node.exe is full Node.JS executable, containing everything you need to run Node.JS applications on Windows. You used the default installer, so it got installed to C:Program Filesnodejsnode.exe. But you can also download it separately (Windows Binary option), and, for example, bundle it with your application package to simplify the installation on many machines. There's no real … [Read more...]
Git refusing to merge unrelated histories on rebase
The default behavior has changed since Git 2.9: "git merge" used to allow merging two branches that have no common base by default, which led to a brand new history of an existing project created and then get pulled by an unsuspecting maintainer, which allowed an unnecessary parallel history merged into the existing project. The command has been taught not … [Read more...]
How do I tell if a regular file does not exist in Bash?
The test command ([ here) has a "not" logical operator which is the exclamation point (similar to many other languages). Try this: if [ ! -f /tmp/foo.txt ]; then echo "File not found!" fi Bash File Testing -b filename - Block special file -c filename - Special character file -d directoryname - Check for directory Existence -e filename - Check for file existence, … [Read more...]