Questions

How to verify an XPath expression in Chrome Developers tool or Firefox's Firebug?

How can I verify my XPath? I am using Chrome Developers tool to inspect the elements and form my XPath. I verify it using the Chrome plugin XPath Checker, however it does not always give me the resul...

GRANT EXECUTE to all stored procedures

Does the following command effectively give the user, "MyUser," permission to execute ALL stored procedures in the database? ``` GRANT EXECUTE TO [MyDomain\MyUser] ```

How to print to console in pytest?

I'm trying to use TDD (test-driven development) with `pytest`. `pytest` will not `print` to the console when I use `print`. I am using `pytest my_tests.py` to run it. The `documentation` seems to sa...

How do I detect if software keyboard is visible on Android Device or not?

Is there a way in Android to detect if the software (a.k.a. "soft") keyboard is visible on screen?

MySQL Data - Best way to implement paging?

My iPhone application connects to my PHP web service to retrieve data from a MySQL database, a request can return up to 500 results. What is the best way to implement paging and retrieve 20 items at a...

18 Feb at 16:57

How to reset sequence in postgres and fill id column with new data?

I have a table with over million rows. I need to reset sequence and reassign id column with new values (1, 2, 3, 4... etc...). Is any easy way to do that?

13 Jan at 08:37

How to fire a change event on a HTMLSelectElement if the new value is the same as the old?

I have the following markup: ``` <select onchange="jsFunction()"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> ``` When a user pulls ...

How to develop Android app completely using python?

I would like to develop a (rather simple) android app to be distributed via Play Store. I would like to do so completely in python. However, the online research hasn't quite enlightened me: most comme...

29 Mar at 22:46

How can I add the new "Floating Action Button" between two widgets/layouts

I guess you have seen the new Android design guidelines, with the new "Floating Action Button" a.k.a "FAB" For instance this pink button: ![enter image description here](https://i.stack.imgur.com/xC...

Prevent browser caching of AJAX call result

It looks like if I load dynamic content using `$.get()`, the result is cached in browser. Adding some random string in QueryString seems to solve this issue (I use `new Date().toString()`), but this ...

16 Mar at 06:49

What is the equivalent of Java's final in C#?

What is the equivalent of Java's `final` in C#?

6 Mar at 10:48

Checking host availability by using ping in bash scripts

I want to write a script, that would keep checking if any of the devices in network, that should be online all day long, are really online. I tried to use ping, but ``` if [ "`ping -c 1 some_ip_here`...

8 Aug at 10:6

Reset auto increment counter in postgres

I would like to force the auto increment field of a table to some value, I tried with this: ``` ALTER TABLE product AUTO_INCREMENT = 1453 ``` AND ``` ALTER SEQUENCE product RESTART WITH 1453; ERROR:...

29 Dec at 00:48

How to create an empty matrix in R?

I am new to R. I want to fill in an empty matrix with the results of my `for` loop using `cbind`. My question is, how can I eliminate the NAs in the first column of my matrix. I include my code below:...

17 Oct at 09:39

Getting return value from stored procedure in C#

I have the following query: ``` set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo].[Validate] @a varchar(50), @b varchar(50) output AS SET @Password = (SELECT Password FROM dbo.t...

17 Jun at 22:7

Switch statement for string matching in JavaScript

How do I write a switch for the following conditional? If the url "foo", then `settings.base_url` is "bar". The following is achieving the effect required but I've a feeling this would be more manage...

10 Nov at 02:37

Is there any difference between GROUP BY and DISTINCT

I learned something simple about SQL the other day: ``` SELECT c FROM myTbl GROUP BY C ``` Has the same result as: ``` SELECT DISTINCT C FROM myTbl ``` What I am curious of, is there anything di...

4 May at 22:19

Pandas join issue: columns overlap but no suffix specified

I have the following data frames: ``` print(df_a) mukey DI PI 0 100000 35 14 1 1000005 44 14 2 1000006 44 14 3 1000007 43 13 4 1000008 43 13 print(df_b) mukey niccdcd 0 1...

16 Oct at 08:41

Linker Error C++ "undefined reference "

> [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-a...

20 Jun at 09:12

The maximum value for an int type in Go

How does one specify the maximum value representable for an `unsigned` integer type? I would like to know how to initialize `min` in the loop below that iteratively computes min and max lengths from ...

11 Jul at 16:45

Border length smaller than div width?

I have following code ``` div { width: 200px; border-bottom: 1px solid magenta; height: 50px; } ``` ``` <div></div> ``` The div width is 200px so border-bottom is also 200px but what sho...

14 Jul at 10:33

Python function overloading

I know that Python does not support method overloading, but I've run into a problem that I can't seem to solve in a nice Pythonic way. I am making a game where a character needs to shoot a variety of ...

How do I put focus on a TextBox when a form loads?

I have a `TextBox` in my C# program. I need focus to be on this `TextBox` when the program starts. I tried this on Form_Load: ``` MyTextBox.Focus(); ``` but it doesn't work. How do I put focus on thi...

12 Aug at 04:22

Best way to select random rows PostgreSQL

I want a random selection of rows in PostgreSQL, I tried this: ``` select * from table where random() < 0.01; ``` But some other recommend this: ``` select * from table order by random() limit 1000; ...

8 Apr at 03:59

HttpClient not supporting PostAsJsonAsync method C#

I am trying to call a web API from my web application. I am using .Net 4.5 and while writing the code I am getting the error `HttpClient` does not contain a definition `PostAsJsonAsync` method. Below...