Questions

How can I quickly delete a line in VIM starting at the cursor position?

I want to be able to delete the remainder of the line I'm on starting at the cursor's position in VIM. Is there an easy command to do this? To help illustrate, this is before the command. ``` The qu...

28 Nov at 13:28

Syntax highlighting/colorizing cat

Is there a method to colorize the output of `cat`, the way `grep` does. For `grep`, in most consoles it displays a colored output highlighting the searched keywords. Otherwise, you can force it by ca...

Replace Fragment inside a ViewPager

I'm trying to use Fragment with a `ViewPager` using the `FragmentPagerAdapter`. What I'm looking for to achieve is to replace a fragment, positioned on the first page of the `ViewPager`, with another ...

Calculating arithmetic mean (one type of average) in Python

Is there a built-in or standard library method in Python to calculate the arithmetic mean (one type of average) of a list of numbers?

22 Feb at 13:29

CSS – why doesn’t percentage height work?

How come a percentage value for `height` doesn’t work but a percentage value for `width` does? [For example](http://jsfiddle.net/g3Yzt/): ``` <div id="working"></div> <div id="not-working"></div> ``...

6 Jan at 09:29

How do I remove the old history from a git repository?

I'm afraid I couldn't find anything quite like this particular scenario. I have a git repository with a lot of history: 500+ branches, 500+ tags, going back to mid-2007. It contains ~19,500 commits. ...

Match two strings in one line with grep

I am trying to use `grep` to match lines that contain two different strings. I have tried the following but this matches lines that contain either which not what I want. ``` grep 'string1\|string2...

10 Jul at 22:57

Generate C# class from XML

Can I generate a C# class from an XML file?

5 Jun at 10:39

find without recursion

Is it possible to use the `find` command in some way that it will not recurse into the sub-directories? For example, ``` DirsRoot |-->SubDir1 | |-OtherFile1 |-->SubDir2 | |-OtherFile2 ...

21 Oct at 15:18

How to get element by innerText

How to get tag in html page, if I know what text tag contains. E.g.: ``` <a ...>SearchingText</a> ```

28 Jun at 14:27

Regex (grep) for multi-line search needed

I'm running a `grep` to find any *.sql file that has the word `select` followed by the word `customerName` followed by the word `from`. This select statement can span many lines and can contain tabs a...

3 Nov at 14:52

How often does python flush to a file?

1. How often does Python flush to a file? 2. How often does Python flush to stdout? I'm unsure about (1). As for (2), I believe Python flushes to stdout after every new line. But, if you overloa...

7 May at 06:42

Exploitable PHP functions

I'm trying to build a list of functions that can be used for arbitrary code execution. The purpose isn't to list functions that should be blacklisted or otherwise disallowed. Rather, I'd like to have ...

19 Oct at 17:28

Git submodule update

I'm not clear on what the following means (from the [Git submodule update](http://git-scm.com/docs/git-submodule) documentation): > ...will make the submodules HEAD be detached, unless `--rebase` or ...

16 Jun at 08:58

How to add a string to a string[] array? There's no .Add function

``` private string[] ColeccionDeCortes(string Path) { DirectoryInfo X = new DirectoryInfo(Path); FileInfo[] listaDeArchivos = X.GetFiles(); string[] Coleccion; foreach (FileInfo FI in...

13 Feb at 17:8

What browsers support HTML5 WebSocket API?

I am going to develop an instant messaging application that runs in the browser. What browsers support the [WebSocket API](http://en.wikipedia.org/wiki/WebSocket)?

Assembly code vs Machine code vs Object code?

What is the difference between object code, machine code and assembly code? Can you give a visual example of their difference?

21 Jan at 20:17

Maximum filename length in NTFS (Windows XP and Windows Vista)?

I'm designing a database table which will hold filenames of uploaded files. What is the maximum length of a filename in NTFS as used by Windows XP or Vista?

How to change the value of ${user} variable used in Eclipse templates

Instead of hardcoding the default @author template I would like Eclipse to use user's real name taken from account information (in Linux - but Windows solution is also welcome). Entering it somewhere ...

7 Jul at 07:50

How do I drag and drop files into an application?

I've seen this done in Borland's [Turbo C++](https://en.wikipedia.org/wiki/Turbo_C++) environment, but I'm not sure how to go about it for a C# application I'm working on. Are there best practices or ...

6 Aug at 16:58

xlrd.biffh.XLRDError: Excel xlsx file; not supported

I am trying to read a macro-enabled Excel worksheet using `pandas.read_excel` with the xlrd library. It's running fine in local, but when I try to push the same into PCF, I am getting this error: ``` ...

8 Feb at 14:50

How do I upgrade to Python 3.6 with Conda?

I want to get the latest version of Python to use [f-strings](https://en.wikipedia.org/wiki/Python_(programming_language)#Expressions) in my code. Currently my version is (`python -V`): ``` Python 3.5...

21 Feb at 01:3

Difference between Spring MVC and Spring Boot

I have just started learning Spring. In my next step, I would like to develop bigger web applications. Now I am wondering if I should start with Spring Boot or Spring MVC. I have already read some s...

12 Jul at 15:11

How to execute Python code from within Visual Studio Code

[Visual Studio Code](https://code.visualstudio.com/) was recently released and I liked the look of it and the features it offered, so I figured I would give it a go. I downloaded the application from ...

19 Nov at 02:37

Can I update a component's props in React.js?

After starting to work with React.js, it seems like `props` are intended to be static (passed in from the parent component), while `state` changes based upon events. However, I noticed in the docs a ...

6 Mar at 14:36