Questions

How can I center an absolutely positioned element in a div?

I want to place a `div` (with `position:absolute;`) element in the center of the window. But I'm having problems doing so, because the . I tried the following CSS code, but it needs to be adjusted bec...

25 Jul at 09:50

Angular: conditional class with *ngClass

What is wrong with my Angular code? I am getting the following error: > Cannot read property 'remove' of undefined at BrowserDomAdapter.removeClass ``` <ol> <li *ngClass="{active: step==='step1'}" (...

How to check if a string is a substring of items in a list of strings

How do I search for items that contain the string `'abc'` in the following list? ``` xs = ['abc-123', 'def-456', 'ghi-789', 'abc-456'] ``` The following checks if `'abc'` is in the list, but does not...

11 Aug at 17:49

Stylesheet not loaded because of MIME type

I'm working on a website that uses [Gulp.js](https://en.wikipedia.org/wiki/Gulp.js) to compile and browser sync to keep the browser synchronised with my changes. The Gulp.js task compiles everything p...

29 Sep at 00:4

How to get GET (query string) variables in Express.js on Node.js?

Can we get the variables in the query string in Node.js just like we get them in `$_GET` in PHP? I know that in Node.js we can get the URL in the request. Is there a method to get the query string pa...

4 May at 12:1

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...

2 Aug at 15:39

Deleting DataFrame row in Pandas based on column value

I have the following DataFrame: ``` daysago line_race rating rw wrating line_date 2007-03-31 62 11 56 1.000000 56.000...

jQuery Ajax error handling, show custom exception messages

Is there some way I can show custom exception messages as an alert in my jQuery AJAX error message? For example, if I want to throw an exception on the server side via [Struts](http://en.wikipedia.org...

31 Mar at 09:10

How can I change CSS display none or block property using jQuery?

How can I change CSS display none or block property using jQuery?

6 May at 13:55

Homebrew install specific version of formula?

How do I install a specific version of a formula in homebrew? For example, postgresql-8.4.4 instead of the latest 9.0.

8 Aug at 11:50

How can I make a button redirect my page to another page?

I have been trying the following: ``` <form action="/home" class="inline"> <button class="float-left submit-button" >Home</button> </form> ``` It seems to work but it goes to the page "/home?" ...

3 Jul at 09:32

Convert JS object to JSON string

If I defined an object in JS with: ``` var j={"name":"binchen"}; ``` How can I convert the object to JSON? The output string should be: ``` '{"name":"binchen"}' ```

16 Oct at 15:42

Convert a PHP object to an associative array

I'm integrating an API to my website which works with data stored in objects while my code is written using arrays. I'd like a quick-and-dirty function to convert an object to an array.

31 Aug at 20:26

How to get current time and date in Android

How can I get the current time and date in an Android app?

17 Jan at 22:43

How to change the output color of echo in Linux

I am trying to print a text in the terminal using echo command. I want to print the text in a red color. How can I do that?

How to check a radio button with jQuery?

I try to check a radio button with jQuery. Here's my code: ``` <form> <div id='type'> <input type='radio' id='radio_1' name='type' value='1' /> <input type='radio' id='radio_2' na...

25 Jun at 15:1

Get JavaScript object from array of objects by value of property

Let's say I have an array of four objects: ``` var jsObjects = [ {a: 1, b: 2}, {a: 3, b: 4}, {a: 5, b: 6}, {a: 7, b: 8} ]; ``` Is there a way that I can get the third object (`{a: 5,...

15 Feb at 21:50

Undoing a git rebase

How do I easily undo a git rebase? A lengthy manual method is: 1. checkout the commit parent to both of the branches 2. create and checkout a temporary branch 3. cherry-pick all commits by hand 4. re...

7 Aug at 20:15

How to remove item from array by value?

Is there a method to remove an item from a JavaScript array? Given an array: ``` var ary = ['three', 'seven', 'eleven']; ``` I would like to do something like: ``` removeItem('seven', ary); ``` ...

29 Sep at 12:45

How can I undo pushed commits using git?

I have a project in a remote repository, synchronized with a local repository (development) and the server one (prod). I've been making some commited changes already pushed to remote and pulled from t...

27 Jan at 11:0

Converting string to byte array in C#

I'm converting something from VB into C#. Having a problem with the syntax of this statement: ``` if ((searchResult.Properties["user"].Count > 0)) { profile.User = System.Text.Encoding.UTF8.GetStr...

3 Mar at 22:14

How do I disable the resizable property of a textarea?

I want to disable the resizable property of a `textarea`. Currently, I can resize a `textarea` by clicking on the bottom right corner of the `textarea` and dragging the mouse. How can I disable this?...

21 Oct at 13:33

What is RESTful programming?

What exactly is [RESTful programming](https://en.wikipedia.org/wiki/Representational_state_transfer)?

10 Jul at 23:19

How do I create a list with numbers between two values?

How do I create an ascending list between two values? For example, a list between 11 and 16: ``` [11, 12, 13, 14, 15, 16] ```

17 Jul at 09:1

Vertically align text within a div

The code below (also available as [a demo on JS Fiddle](http://jsfiddle.net/9Y7Cm/3/)) does not position the text in the middle, as I ideally would like it to. I cannot find any way to vertically cent...

26 Jun at 09:16