Capture screenshot of active window?
I am making a screen capturing application and everything is going fine. All I need to do is capture the active window and take a screenshot of this active window. Does anyone know how I can do this...
- Modified
- 11 Apr at 16:43
No mapping found for HTTP request with URI.... in DispatcherServlet with name
I checked out nearly every relevant article on stackoverflow already, but I just cant fix my problem. Here is the code: web.xml: ``` <display-name>Spring3MVC</display-name> <welcome-file-list> ...
- Modified
- 10 Feb at 10:50
Quick and easy file dialog in Python?
I have a simple script which parses a file and loads it's contents to a database. I don't need a UI, but right now I'm prompting the user for the file to parse using `raw_input` which is most unfriend...
- Modified
- 15 Apr at 02:23
How to change port number for apache in WAMP
I am new to WAMP server and installed it on my system but after installing it when I check it by going to localhost url like this `http://localhost/` in the browser it is not working. I am getting a...
Repeat a string in JavaScript a number of times
In Perl I can repeat a character multiple times using the syntax: ``` $a = "a" x 10; // results in "aaaaaaaaaa" ``` Is there a simple way to accomplish this in Javascript? I can obviously use a fun...
- Modified
- 22 Jan at 03:3
Summing elements in a list
Here is my code, I need to sum an undefined number of elements in the list. How to do this? ``` l = raw_input() l = l.split(' ') l.pop(0) ``` My input: `3 5 4 9` After input I delete first element ...
CSS I want a div to be on top of everything
How do I make an html div tag to be on top of everything? I tried adding `z-index: 1000`, but it remains the same.
How to compare two dates to find time difference in SQL Server 2005, date manipulation
I have two columns: ``` job_start job_end 2011-11-02 12:20:37.247 2011-11-02 13:35:14.613 ``` How would it be possible using T-SQL to find the raw amount of time ...
- Modified
- 24 Jun at 20:10
How to add line breaks to an HTML textarea
I’m editing a `<textarea>` with JavaScript. The problem is that when I make line breaks in it, they won’t display. How can I do this? I’m getting the value to write a function, but it won’t give line ...
- Modified
- 9 May at 00:57
How to get the filename without the extension in Java?
Can anyone tell me how to get the filename without the extension? Example: ``` fileNameWithExt = "test.xml"; fileNameWithOutExt = "test"; ```
How do I detect whether a variable is a function?
I have a variable, `x`, and I want to know whether it is pointing to a function or not. I had hoped I could do something like: ``` >>> isinstance(x, function) ``` But that gives me: ``` Traceback (mo...
- Modified
- 29 Nov at 00:12
How to convert QString to std::string?
I am trying to do something like this: ``` QString string; // do things... std::cout << string << std::endl; ``` but the code doesn't compile. How to output the content of qstring into the console ...
- Modified
- 14 Sep at 03:50
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2)
I'm getting this error `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2)` even though I have managed to start mysql via command line in ubuntu...
Force R not to use exponential notation (e.g. e+10)?
Can I force R to use regular numbers instead of using the `e+10`-like notation? I have: ``` 1.810032e+09 # and 4 ``` within the same vector and want to see: ``` 1810032000 # and 4 ``` I am cre...
- Modified
- 16 Jul at 18:5
Java Package Does Not Exist Error
So there's a folder `/usr/share/stuff` in the root directory in stuff there are a bunch of java files with `package org.name` definitions at the top I am running `javac test.java` where `test.java` ...
How can I force a component to re-render with hooks in React?
Considering below hooks example ``` import { useState } from 'react'; function Example() { const [count, setCount] = useState(0); return ( <div> <p>You c...
- Modified
- 23 Mar at 09:8
SQL Server PRINT SELECT (Print a select query result)?
I am trying to print a selected value, is this possible? Example: ``` PRINT SELECT SUM(Amount) FROM Expense ```
- Modified
- 1 Jan at 19:51
How do I prevent Conda from activating the base environment by default?
I recently installed anaconda2 on my Mac. By default Conda is configured to activate the base environment when I open a fresh terminal session. I want access to the Conda commands (i.e. I want the pat...
Setting Django up to use MySQL
I want to move away from PHP a little and learn Python. In order to do web development with Python I'll need a framework to help with templating and other things. I have a non-production server that...
How can I make a multipart/form-data POST request using Java?
In the days of version 3.x of Apache Commons HttpClient, making a multipart/form-data POST request was possible ([an example from 2004](http://www.theserverside.com/tt/articles/article.tss?l=HttpClien...
Find text string using jQuery?
Say a web page has a string such as "I am a simple string" that I want to find. How would I go about this using JQuery?
To the power of in C?
So in python, all I have to do is ``` print(3**4) ``` Which gives me 81 How do I do this in C? I searched a bit and say the `exp()` function, but have no clue how to use it, thanks in advance
SQL Server 2008 Windows Auth Login Error: The login is from an untrusted domain
When attempting to connect to a SQL Server 2008 Instance using Management Studio, I get the following error: > Login failed. The login is from an untrusted domain and cannot be used with Windows ...
- Modified
- 5 Nov at 21:25
Beginner Python: AttributeError: 'list' object has no attribute
The error says: ``` AttributeError: 'list' object has no attribute 'cost' ``` I am trying to get a simple profit calculation to work using the following class to handle a dictionary of bicycles: `...
- Modified
- 29 Mar at 22:3
console.log(result) prints [object Object]. How do I get result.name?
My script is printing `[object Object]` as a result of `console.log(result)`. Can someone please explain how to have `console.log` print the `id` and `name` from `result`? ``` $.ajaxSetup({ traditiona...
- Modified
- 2 Oct at 01:52