Why does Math.Round(2.5) return 2 instead of 3?
In C#, the result of `Math.Round(2.5)` is 2. It is supposed to be 3, isn't it? Why is it 2 instead in C#?
Matching special characters and letters in regex
I am trying to validate a string, that should contain letters numbers and special characters `&-._` only. For that I tried with a regular expression. ``` var pattern = /[a-zA-Z0-9&_\.-]/ var qry = 'a...
- Modified
- 19 Dec at 10:28
List of special characters for SQL LIKE clause
What is the complete list of all special characters for a SQL (I'm interested in SQL Server but other's would be good too) LIKE clause? E.g. ``` SELECT Name FROM Person WHERE Name LIKE '%Jon%' ``` ...
- Modified
- 25 Sep at 07:34
What is sys.maxint in Python 3?
I've been trying to find out how to represent a maximum integer, and I've read to use `"sys.maxint"`. However, in Python 3 when I call it I get: ``` AttributeError: module 'object' has no attribute '...
- Modified
- 18 Apr at 20:6
Get data from JSON file with PHP
I'm trying to get data from the following JSON file using PHP. I specifically want "temperatureMin" and "temperatureMax". It's probably really simple, but I have no idea how to do this. I'm stuck on ...
How to disable a ts rule for a specific line?
Summernote is a jQuery plugin, and I don't need type definitions for it. I just want to modify the object, but TS keeps throwing errors. The line bellow still gives me: error. ``` (function ($) { ...
- Modified
- 25 Apr at 23:12
NodeJS - Error installing with NPM
``` Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. C:\Windows\system32>npm install caress-server npm http GET https://registry.npmjs.org/caress-server npm h...
White space showing up on right side of page when background image should extend full length of page
Our webpage background images are having problems in FireFox as well as Safari in iOS on iPads/iPhones with white space showing up on the right side of the page. The background images extend fine on...
Spring RestTemplate - how to enable full debugging/logging of requests/responses?
I have been using the Spring RestTemplate for a while and I consistently hit a wall when I'am trying to debug it's requests and responses. I'm basically looking to see the same things as I see when I ...
- Modified
- 23 May at 12:26
Using SELECT result in another SELECT
So here is my query ``` SELECT * FROM Score AS NewScores WHERE InsertedDate >= DATEADD(mm, -3, GETDATE()); SELECT ROW_NUMBER() OVER( ORDER BY NETT) AS Rank, Name, Fl...
Redirecting to another page in ASP.NET MVC using JavaScript/jQuery
I want to redirect from one page to another page in ASP.NET MVC 3.0 using JavaScript/jQuery/Ajax. On button click event I have written JavaScript code like below. ``` function foo(id) { $.post('/...
- Modified
- 11 Oct at 15:36
Calculating moving average
I'm trying to use R to calculate the moving average over a series of values in a matrix. There doesn't seem to be a [built-in function](http://www.statmethods.net/management/functions.html) in R that ...
- Modified
- 8 Dec at 13:56
What does <> mean?
I have seen this before in SQL and VB, I am now reverse engineering an Excel speadsheet and have come across the following formula: I am converting it to ActionScript: ``` var result:String = [con...
Case-insensitive search
I'm trying to get a case-insensitive search with two strings in JavaScript working. Normally it would be like this: ``` var string="Stackoverflow is the BEST"; var result= string.search(/best/i); al...
- Modified
- 9 Oct at 21:17
Converting UTF-8 to ISO-8859-1 in Java - how to keep it as single byte
I am trying to convert a string encoded in java in UTF-8 to ISO-8859-1. Say for example, in the string 'âabcd' 'â' is represented in ISO-8859-1 as E2. In UTF-8 it is represented as two bytes. C3 A2 I...
- Modified
- 17 Mar at 20:42
Confusing "duplicate identifier" Typescript error message
Why am I getting this and many more errors of this kind? I am adding a link to the repo as well as key code snippets below. I think I have a basic misunderstanding of how the dependency and "include" ...
- Modified
- 29 Dec at 23:45
Maven: Failed to retrieve plugin descriptor error
I configured Maven 3.0.3 and tried to download a sample project using archetypes with this command: ``` mvn archetype:generate -DarchetypeGroupId=org.graniteds.archetypes -Da...
- Modified
- 24 Feb at 13:22
How to set background image in Java?
I am developing a simple platform game using Java using BlueJ as the IDE. Right now I have player/enemy sprites, platforms and other items in the game drawn using polygons and simple shapes. Eventuall...
- Modified
- 7 Feb at 16:30
Java ArrayList replace at specific index
I need help with this java please. I created an ArrayList of bulbs, and I'm trying to replace a bulb at specific index with another bulb. So with the following heading, how do I proceed? ``` public v...
How do you overcome the svn 'out of date' error?
I've been attempting move a directory structure from one location to another in Subversion, but I get an `Item '*' is out of date` commit error. I have the latest version checked out (so far as I c...
- Modified
- 6 Mar at 23:0
"SMTP Error: Could not authenticate" in PHPMailer
I'm using PHPMailer in a Simple Script For Send Email's Through Gmail, and I'm getting an "Unknown Error" (At least for me!): > SMTP Error: Could not authenticate. Error: SMTP Error: Could not au...
Where does the .gitignore file belong?
Does the .gitignore file belong in the .git folder structure somewhere or in the main source files?
detect back button click in browser
I have to detect if a user has clicked back button or not. For this I am using ``` window.onbeforeunload = function (e) { } ``` It works if a user clicks back button. But this event is also fired...
- Modified
- 15 Jun at 14:39
How to Get the Query Executed in Laravel 5? DB::getQueryLog() Returning Empty Array
I'm trying to view the log for a query, but `DB::getQueryLog()` is just returning an empty array: ``` $user = User::find(5); print_r(DB::getQueryLog()); ``` ``` Array ( ) ``` How can I view the...