Why is reading lines from stdin much slower in C++ than Python?
I wanted to compare reading lines of string input from stdin using Python and C++ and was shocked to see my C++ code run an order of magnitude slower than the equivalent Python code. Since my C++ is r...
- Modified
- 4 Feb at 18:49
How to Debug Variables in Smarty like in PHP var_dump()
I have some variables inside a template and I don't know where I assigned them. I need to know what is inside a particular variable; for instance, say I have a variable in smarty called `member`. I tr...
Force re-download of release dependency using Maven
I'm working on a project with dependency X. X, in turn, depends on Y. I used to explicitly include Y in my project's pom. However, it was not used and to make things cleaner, I instead added it to X'...
- Modified
- 24 Dec at 15:8
Should I use <i> tag for icons instead of <span>?
Facebook's HTML and Twitter Bootstrap HTML (before v3) both use the `<i>` tag to display icons. However, from the [HTML5 spec](http://www.w3.org/International/questions/qa-b-and-I-tags/): > The I elem...
- Modified
- 14 Feb at 11:32
Unicode character for "X" cancel / close?
I want to create a close button using CSS only. I'm sure I'm not the first to do this, so does anyone know which font has an 'x' the same width as height, so that it can be used cross-browser to look...
Colouring plot by factor in R
I am making a scatter plot of two variables and would like to colour the points by a factor variable. Here is some reproducible code: ``` data <- iris plot(data$Sepal.Length, data$Sepal.Width, col=da...
Force Java timezone as GMT/UTC
I need to force any time related operations to GMT/UTC, regardless the timezone set on the machine. Any convenient way to so in code? To clarify, I'm using the DB server time for all operations, but ...
GridView Hide Column by code
I want to hide ID column in my GridView, I knew the code ``` GridView1.Columns[0].Visible = false; ``` but the surprise was that my count property for my `GridView` columns is 0 !!! while I can se...
SQL server 2008 backup error - Operating system error 5(failed to retrieve text for this error. Reason: 15105)
Can anyone help me, I'm trying to backup a database located on localhost\SQLEXPRESS but i keep getting the following error: ``` Backup failed for Server 'localhost\SqlExpress'. (Microsoft.SqlServer....
- Modified
- 16 Oct at 01:58
Thread pooling in C++11
: About C++11: - [C++11: std::thread pooled?](https://stackoverflow.com/questions/12993451/c11-stdthread-pooled)- [Will async(launch::async) in C++11 make thread pools obsolete for avoiding expensiv...
- Modified
- 23 May at 12:18
How to change Android version and code version number?
How to change Android version and code version number Android Studio? I want to change apk file (app) on Google Play and I need to change Android version and code version number. I tried with this in ...
- Modified
- 10 Apr at 15:24
How to validate numeric values which may contain dots or commas?
I need a regular expression for validation `two or one` numbers then `,` or `.` and again `two or one` numbers. So, these are valid inputs: ``` 11,11 11.11 1.1 1,1 ```
- Modified
- 25 Sep at 03:28
How to use z-index in svg elements?
I'm using the svg circles in my project like this, ``` <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 120"> <g> <g id="one"> <circle fill="green" cx="100" cy="105" r...
- Modified
- 18 Feb at 11:12
Count table rows
What is the MySQL command to retrieve the count of records in a table?
- Modified
- 23 Jun at 22:20
C++ display stack trace on exception
I want to have a way to report the stack trace to the user if an exception is thrown. What is the best way to do this? Does it take huge amounts of extra code? To answer questions: I'd like it to be...
- Modified
- 6 Jan at 22:50
how to empty recyclebin through command prompt?
Usually we delete the recycle bin contents by right-clicking it with the mouse and selecting "Empty Recycle Bin". But I have a requirement where I need to delete the recycle bin contents using the com...
- Modified
- 9 Dec at 15:4
Is there a need for range(len(a))?
One frequently finds expressions of this type in python questions on SO. Either for just accessing all items of the iterable ``` for i in range(len(a)): print(a[i]) ``` Which is just a clumbers...
Rails Root directory path?
How do I get my Rails app's root directory path?
- Modified
- 19 Sep at 08:19
How to iterate through a list of objects in C++?
I'm very new to C++ and struggling to figure out how I should iterate through a list of objects and access their members. I've been trying this where `data` is a `std::list` and `Student` a class. ```...
Difference in Months between two dates in JavaScript
How would I work out the difference for two Date() objects in JavaScript, while only return the number of months in the difference? Any help would be great :)
- Modified
- 20 Jul at 15:6
Generate a heatmap using a scatter data set
I have a set of X,Y data points (about 10k) that are easy to plot as a scatter plot but that I would like to represent as a heatmap. I looked through the examples in Matplotlib and they all seem to al...
- Modified
- 30 Aug at 16:17
You cannot call a method on a null-valued expression
I am simply trying to create a powershell script which calculates the md5 sum of an executable (a file). My .ps1 script: ``` $answer = Read-Host "File name and extension (ie; file.exe)" $someFilePat...
- Modified
- 23 May at 12:26
Push Notifications in Android Platform
I am looking to write an app that receives pushed alerts from a server. I found a couple of methods to do this. 1. SMS - Intercept the incoming SMS and initiate a pull from the server 2. Poll the ...
LIKE operator in LINQ
Is there any way to compare strings in a C# LINQ expression similar to SQL's `LIKE` operator? Suppose I have a string list. On this list I want to search a string. In SQL, I could write: ``` SELECT ...
Serializing and submitting a form with jQuery and PHP
I'm trying to send a form's data using jQuery. However, data does not reach the server. Can you please tell me what I'm doing wrong? My HTML form: ``` <form id="contactForm" name="contactForm" metho...
- Modified
- 20 Mar at 17:12