Questions

javascript filter array multiple conditions

I want to simplify an array of objects. Let's assume that I have following array: ``` var users = [{ name: 'John', email: 'johnson@mail.com', age: 25, address: 'USA' }, { ...

19 Jul at 10:21

Convert Unicode to ASCII without errors in Python

My code just scrapes a web page, then converts it to Unicode. ``` html = urllib.urlopen(link).read() html.encode("utf8","ignore") self.response.out.write(html) ``` But I get a `UnicodeDecodeError`:...

Simplest way to detect a mobile device in PHP

What is the simplest way to tell if a user is using a mobile device to browse my site using PHP? I have come across many classes that you can use but I was hoping for a simple if condition! Is ther...

16 May at 04:56

How to escape regular expression special characters using javascript?

I need to escape the regular expression special characters using java script.How can i achieve this?Any help should be appreciated. --- Thanks for your quick reply.But i need to escape all the sp...

13 Sep at 14:53

Render basic HTML view?

I have a basic Node.js app that I am trying to get off the ground using the Express framework. I have a `views` folder where I have an `index.html` file. But I receive the following error when loading...

How do I install a custom font on an HTML site

I am not using flash or php - and I have been asked to add a custom font to a simple HTML layout. "KG June Bug" I have it downloaded locally - is there a simple CSS trick to accomplish this?

11 Apr at 22:4

How can I generate Javadoc comments in Eclipse?

Is there a way to generate Javadoc comments in Eclipse? If so, what is it?

23 May at 11:33

How to check iOS version?

I want to check if the `iOS` version of the device is greater than `3.1.3` I tried things like: ``` [[UIDevice currentDevice].systemVersion floatValue] ``` but it does not work, I just want a: ```...

7 Aug at 13:42

How to properly make a http web GET request

i am still new on c# and i'm trying to create an application for this page that will tell me when i get a notification (answered, commented, etc..). But for now i'm just trying to make a simple call t...

9 Jul at 14:6

How can I shuffle an array?

I want to shuffle an array of elements in JavaScript like these: ``` [0, 3, 3] -> [3, 0, 3] [9, 3, 6, 0, 6] -> [0, 3, 6, 9, 6] [3, 3, 6, 0, 6] -> [0, 3, 6, 3, 6] ```

23 May at 11:47

How can one change the timestamp of an old commit in Git?

The answers to [How to modify existing, unpushed commits?](https://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in-git) describe a way to amend previous commit messages...

How can I add 1 day to current date?

I have a current Date object that needs to be incremented by one day using the JavaScript Date object. I have the following code in place: ``` var ds = stringFormat("{day} {date} {month} {year}", { ...

2 Nov at 10:26

Determine if map contains a value for a key?

What is the best way to determine if a STL map contains a value for a given key? ``` #include <map> using namespace std; struct Bar { int i; }; int main() { map<int, Bar> m; Bar b = {0...

25 Aug at 03:48

How do I copy items from list to list without foreach?

How do I transfer the items contained in one `List` to another in C# without using `foreach`?

25 Oct at 19:11

Using parameters in batch files at Windows command line

In Windows, how do you access arguments passed when a batch file is run? For example, let's say I have a program named `hello.bat`. When I enter `hello -a` at a Windows command line, how do I let ...

Can I access variables from another file?

Is it possible to use a variable in a file called `first.js` inside another file called `second.js`? `first.js` contains a variable called `colorcodes`.

31 Jan at 04:26

Exposing a port on a live Docker container

I'm trying to create a Docker container that acts like a full-on virtual machine. I know I can use the EXPOSE instruction inside a Dockerfile to expose a port, and I can use the `-p` flag with `docker...

12 Mar at 13:26

How to Resize a Bitmap in Android?

I have a bitmap taken of a Base64 String from my remote database, (`encodedImage` is the string representing the image with Base64): ``` profileImage = (ImageView)findViewById(R.id.profileImage); by...

1 Mar at 12:37

What is the purpose of Node.js module.exports and how do you use it?

What is the purpose of Node.js `module.exports` and how do you use it? I can't seem to find any information on this, but it appears to be a rather important part of Node.js as I often see it in source...

9 Apr at 20:40

How to order by with union in SQL?

Is it possible to order when the data is come from many select and union it together? Such as ``` Select id,name,age From Student Where age < 15 Union Select id,name,age From Student Where Name like "...

25 Nov at 16:42

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

I tried to restart my Apache server on CentOS 5.0 and got this message: > httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName Here is the `/e...

4 Dec at 15:21

C#: how to get first char of a string?

Can the first `char` of a string be retrieved by doing the following? ``` MyString.ToCharArray[0] ```

7 Oct at 04:59

How to make Bootstrap 4 cards the same height in card-columns?

I am using Bootstrap 4 alpha 2 and taking advantage on cards. Specifically, I am working with [this example](http://v4-alpha.getbootstrap.com/components/card/#columns) taken from the official docs. H...

Why am I suddenly getting a "Blocked loading mixed active content" issue in Firefox?

This morning, upon upgrading my Firefox browser to the latest version (from 22 to 23), some of the key aspects of my back office (website) stopped working. Looking at the Firebug log, the following e...

How to set textbox value in jQuery?

How do I properly load the a certain value into a textbox using jQuery? Tried the one below but I get the `[object Object]` as output. Please enlighten me on this, I'm new to jQuery. ``` proc = functi...

14 Apr at 10:9