Questions

How to set session timeout in web.config

I have tried very hard but cannot find a solution on how to set session timeout value for in-process session for an ASP.Net web application. I am using VSTS 2008 + .Net 3.5 + C#. Here is what I wrote...

Use Font Awesome Icons in CSS

I have some CSS that looks like this: ``` #content h2 { background: url(../images/tContent.jpg) no-repeat 0 6px; } ``` I would like to replace the image with an icon from [Font Awesome](http://...

2 Nov at 09:17

Is it possible to print a variable's type in standard C++?

For example: ``` int a = 12; cout << typeof(a) << endl; ``` Expected output: ``` int ```

14 Sep at 12:57

htaccess redirect to https://www

I have the following htaccess code: ``` <IfModule mod_rewrite.c> RewriteEngine On RewriteCond !{HTTPS} off RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST...

Set Colorbar Range in matplotlib

I have the following code: ``` import matplotlib.pyplot as plt cdict = { 'red' : ( (0.0, 0.25, .25), (0.02, .59, .59), (1., 1., 1.)), 'green': ( (0.0, 0.0, 0.0), (0.02, .45, .45), (1., .97, ....

How to load an ImageView by URL in Android?

How do you use an image referenced by URL in an `ImageView`?

28 Jan at 16:49

CSS customized scroll bar in div

How can I customize a scroll bar via CSS (Cascading Style Sheets) for one `div` and not the whole page?

11 Jan at 20:59

How do you add a timed delay to a C++ program?

I am trying to add a timed delay in a C++ program, and was wondering if anyone has any suggestions on what I can try or information I can look at? I wish I had more details on how I am implementing t...

21 Apr at 17:34

How to get the last day of the month?

Is there a way using Python's standard library to easily determine (i.e. one function call) the last day of a given month? If the standard library doesn't support that, does the dateutil package supp...

28 Feb at 14:58

How to print struct variables in console?

How can I print (to the console) the `Id`, `Title`, `Name`, etc. of this struct in Golang? ``` type Project struct { Id int64 `json:"project_id"` Title string `json:"title"` Name...

11 Jan at 15:14

pull access denied repository does not exist or may require docker login

I am using Laravel 4.2 with docker. I setup it on local. It worked without any problem but when I am trying to setup online using same procedure then I am getting error: ``` pull access denied for <pr...

2 Sep at 17:49

How to call shell commands from Ruby

How do I call shell commands from inside of a Ruby program? How do I then get output from these commands back into Ruby?

10 Jan at 01:45

How do I connect to this localhost from another computer on the same network?

I'm currently working on a project and I would like to test it out on two laptops at home where one laptop connects to the localhost on the other. I am using XAMPP. How do I do this?

13 Mar at 10:27

What is the python keyword "with" used for?

What is the python keyword "with" used for? Example from: [http://docs.python.org/tutorial/inputoutput.html](http://docs.python.org/tutorial/inputoutput.html) ``` >>> with open('/tmp/workfile', 'r')...

2 Sep at 18:59

Difference between static class and singleton pattern?

What real (i.e. practical) difference exists between a static class and a singleton pattern? Both can be invoked without instantiation, both provide only one "Instance" and neither of them is thread-...

15 Nov at 15:2

Difference between 'struct' and 'typedef struct' in C++?

In , is there any difference between: ``` struct Foo { ... }; ``` and: ``` typedef struct { ... } Foo; ```

17 Apr at 18:28

jQuery: Check if div with certain class name exists

Using jQuery I'm programmatically generating a bunch of `div`'s like this: ``` <div class="mydivclass" id="myid1">Some Text1</div> <div class="mydivclass" id="myid2">Some Text2</div> ``` Somewhere ...

How to do a PUT request with cURL?

How do I test a RESTful PUT (or DELETE) method using cURL?

2 Apr at 06:10

Recursively add the entire folder to a repository

I am trying to add a branch to the master branch on GitHub and push a folder onto that branch. The folder structure of the branch looks like - SocialApp/SourceCode/DevTrunk/SocialApp and all the sour...

27 Dec at 01:34

How do I make a JSON object with multiple arrays?

I've never used JSON before so I'm not familiar with its syntax. At the moment I have multiple arrays containing different pieces of data. I would like to create one JSON object, that contains the m...

30 Dec at 15:18

How to check if an int is a null

I have an object called `Person`. it has several attributes in it; ``` int id; String name; ``` i set a person object like `Person p = new Person(1,"Joe");`. 1.) I need to check if the object is ...

6 Dec at 16:17

How do I run a shell script without using "sh" or "bash" commands?

I have a shell script which I want to run without using the "sh" or "bash" commands. For example: Instead of: `sh script.sh` I want to use: `script.sh` How can I do this? P.S. (i) I don't use shel...

13 Apr at 17:52

How to change href of <a> tag on button click through javascript

How to change the `href` attribute value of an `<a/>` tag through Javascript on button click ? ``` <script type="text/javascript"> function f1() { document.getElementById("abc").href="xyz.php...

24 May at 19:34

AngularJS For Loop with Numbers & Ranges

Angular does provide some support for a for loop using numbers within its HTML directives: ``` <div data-ng-repeat="i in [1,2,3,4,5]"> do something </div> ``` But if your scope variable includes ...

5 Dec at 12:6

How can I get current date in Android?

I wrote the following code ``` Date d = new Date(); CharSequence s = DateFormat.format("MMMM d, yyyy ", d.getTime()); ``` I want the current date in string format, like ``` 28-Dec-2011 ``` so that ...