Convert ^M (Windows) line breaks to normal line breaks
Vim shows `^M` on every line ending. How do I replace this with a normal line break in a file opened in Vim?
- Modified
- 12 Oct at 17:22
When to use an interface instead of an abstract class and vice versa?
This may be a generic OOP question. I wanted to do a generic comparison between an interface and an abstract class on the basis of their usage. ?
- Modified
- 24 Sep at 04:2
Experimental decorators warning in TypeScript compilation
I receive the warning... > Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option `to remove this warning. ... even t...
- Modified
- 25 Mar at 17:49
Why does Node.js' fs.readFile() return a buffer instead of string?
I'm trying to read the content of `test.txt`(which is on the same folder of the Javascript source) and display it using this code: ``` var fs = require("fs"); fs.readFile("test.txt", function (err, ...
- Modified
- 9 Oct at 03:23
How to find the Git commit that introduced a string in any branch?
I want to be able to find a certain string which was introduced in any commit in any branch, how can I do that? I found something (that I modified for Win32), but `git whatchanged` doesn't seem to be ...
How can I add a box-shadow on one side of an element?
I need to create a box-shadow on some `block` element, but only (for example) on its right side. The way I do it is to wrap the inner element with `box-shadow` into an outer one with `padding-right` a...
- Modified
- 24 Apr at 04:51
What are the differences between git branch, fork, fetch, merge, rebase and clone?
I want to understand the difference between a branch, a fork and a clone in Git? Similarly, what does it mean when I do a `git fetch` as opposed to a `git pull`? Also, what does `rebase` mean in co...
What is the difference between include and require in Ruby?
My question is similar to "[What is the difference between include and extend in Ruby?](https://stackoverflow.com/questions/156362/what-is-the-difference-between-include-and-extend-in-ruby)". What's ...
How do I determine if a port is open on a Windows server?
I'm trying to install a site under an alternative port on a server, but the port may be closed by a firewall. Is there a way to ping out or in, on a specific port, to see if it is open?
- Modified
- 3 Aug at 16:7
How to sort strings in JavaScript
I have a list of objects I wish to sort based on a field `attr` of type string. I tried using `-` ``` list.sort(function (a, b) { return a.attr - b.attr }) ``` but found that `-` doesn't appear...
- Modified
- 22 Jul at 00:17
WARNING in budgets, maximum exceeded for initial
When building my Angular 7 project with --prod, I receive a warning in `budgets`. I have an Angular 7 project. I am trying to build it, but I keep getting the following warning: ``` WARNING in budgets...
- Modified
- 14 Oct at 10:13
How to find out "The most popular repositories" on Github?
Once upon a time, we can watch the most popular repositories (Most forked or Most watched) at this page ([https://github.com/popular/watched](https://github.com/popular/watched)) of Github. like this:...
- Modified
- 12 Jun at 03:47
How to read a local text file in the browser?
I’m trying to implemennt a simple text file reader by creating a function that takes in the file’s path and converts each line of text into a char array, but it’s not working. ``` function readTextFil...
- Modified
- 2 Aug at 15:39
Is there a naming convention for git repositories?
For example, I have a RESTful service called Purchase Service. Should I name my repository: 1. purchaserestservice 2. purchase-rest-service 3. purchase_rest_service 4. or something else? What's the...
- Modified
- 8 Feb at 15:10
Clean up a fork and restart it from the upstream
I have forked a repository, then I made some changes and it looks like I've messed up everything. I wish to start it again from scratch, using the current upstream/master as the base for my work. S...
- Modified
- 15 Jul at 00:15
Get the last 4 characters of a string
I have the following string: `"aaaabbbb"` How can I get the last four characters and store them in a string using Python?
What's the difference between [ and [[ in Bash?
I looked at bash man page and the `[[` says it uses Conditional Expressions. Then I looked at Conditional Expressions section and it lists the same operators as `test` (and `[`). So I wonder, what is...
- Modified
- 5 Feb at 20:11
Preventing console window from closing on Visual Studio C/C++ Console application
This is a probably an embarasing question as no doubt the answer is blindingly obvious. I've used Visual Studio for years, but this is the first time I've done any 'Console Application' development. ...
- Modified
- 5 Aug at 22:5
Hashset vs Treeset
I've always loved trees, that nice `O(n*log(n))` and the tidiness of them. However, every software engineer I've ever known has asked me pointedly why I would use a `TreeSet`. From a CS background, I ...
How can I compare two lists in python and return matches
I want to take two lists and find the values that appear in both. ``` a = [1, 2, 3, 4, 5] b = [9, 8, 7, 6, 5] returnMatches(a, b) ``` would return `[5]`, for instance.
Formula to determine perceived brightness of RGB color
I'm looking for some kind of formula or algorithm to determine the brightness of a color given the RGB values. I know it can't be as simple as adding the RGB values together and having higher sums be...
- Modified
- 11 Apr at 14:32
Short description of the scoping rules?
What are the Python scoping rules? If I have some code: ``` code1 class Foo: code2 def spam..... code3 for code4..: code5 x() ``` Where is `x` found? Some possibl...
MySQL Error 1153 - Got a packet bigger than 'max_allowed_packet' bytes
I'm importing a MySQL dump and getting the following error. ``` $ mysql foo < foo.sql ERROR 1153 (08S01) at line 96: Got a packet bigger than 'max_allowed_packet' bytes ``` Apparently there are at...
- Modified
- 23 Sep at 15:42