Questions

Can I run HTML files directly from GitHub, instead of just viewing their source?

If I have a `.html` file in a GitHub repository, e.g. for running a a set of JavaScript tests, is there any way I can view that page directly—thus running the tests? For example, could I somehow actu...

8 Sep at 07:41

java.lang.OutOfMemoryError: GC overhead limit exceeded

I am getting this error in a program that creates several (hundreds of thousands) HashMap objects with a few (15-20) text entries each. These Strings have all to be collected (without breaking up into...

10 Aug at 14:17

SET versus SELECT when assigning variables?

What are the differences between the `SET` and `SELECT` statements when assigning variables in T-SQL?

Android global variable

How can I create global variable keep remain values around the life cycle of the application regardless which activity running.

7 Jun at 09:19

ROW_NUMBER() in MySQL

Is there a nice way in MySQL to replicate the SQL Server function `ROW_NUMBER()`? For example: ``` SELECT col1, col2, ROW_NUMBER() OVER (PARTITION BY col1, col2 ORDER BY col3 DESC) AS intR...

How can I find all of the distinct file extensions in a folder hierarchy?

On a Linux machine I would like to traverse a folder hierarchy and get a list of all of the distinct file extensions within it. What would be the best way to achieve this from a shell?

Simple proof that GUID is not unique

I'd like to prove that a GUID is not unique in a simple test program. I expected the following code to run for hours, but it's not working. How can I make it work? ``` BigInteger begin = new BigInteg...

3 May at 05:49

Counting DISTINCT over multiple columns

Is there a better way of doing a query like this: ``` SELECT COUNT(*) FROM (SELECT DISTINCT DocumentId, DocumentSessionId FROM DocumentOutputItems) AS internalQuery ``` I need to count the n...

C# : 'is' keyword and checking for Not

This is a silly question, but you can use this code to check if something is a particular type... ``` if (child is IContainer) { //.... ``` Is there a more elegant way to check for the "NOT" instan...

9 May at 06:59

Using CSS to affect div style inside iframe

Is it possible to change styles of a div that resides inside an iframe on the page using CSS only?

24 Feb at 21:46

How can I create a temp file with a specific extension with .NET?

I need to generate a unique temporary file with a .csv extension. What I do right now is ``` string filepath = System.IO.Path.GetTempFileName().Replace(".tmp", ".csv"); ``` However, this doesn't guar...

14 Oct at 11:56

Logging best practices

I'd like to get stories on how people are handling tracing and logging in real applications. Here are some questions that might help to explain your answer. What frameworks do you use? - - - - - ...

23 Feb at 03:25

Is there an upside down caret character?

I have to maintain a large number of classic ASP pages, many of which have tabular data with no sort capabilities at all. Whatever order the original developer used in the database query is what you'r...

Make Iframe to fit 100% of container's remaining height

I want to design a web page with a banner and an iframe. I hope the iframe can fill all the remaining page height and be resized automatically as the browser is resizing. Is it possible to get it done...

5 Sep at 21:27

Best practices with STDIN in Ruby?

I want to deal with the command line input in Ruby: ``` > cat input.txt | myprog.rb > myprog.rb < input.txt > myprog.rb arg1 arg2 arg3 ... ``` What is the best way to do it? In particular I want to...

7 Nov at 19:14

Invert "if" statement to reduce nesting

When I ran [ReSharper](http://en.wikipedia.org/wiki/ReSharper) on my code, for example: ``` if (some condition) { Some code... } ``` ReSharper gave me the above warning ...

30 Jun at 17:19

Oracle: how to UPSERT (update or insert into a table?)

The UPSERT operation either updates or inserts a row in a table, depending if the table already has a row that matches the data: ``` if table t has a row exists that has key X: update t set mystu...

27 Oct at 15:25

Access to Modified Closure

``` string [] files = new string[2]; files[0] = "ThinkFarAhead.Example.Settings.Configuration_Local.xml"; files[1] = "ThinkFarAhead.Example.Settings.Configuration_Global.xml"; //Resharper complains t...

23 May at 12:2

How do I get my C# program to sleep for 50 milliseconds?

How do I get my C# program to sleep (pause execution) for 50 milliseconds?

31 Aug at 21:29

How do I get the coordinates of a mouse click on a canvas element?

What's the simplest way to add a click event handler to a canvas element that will return the x and y coordinates of the click (relative to the canvas element)? No legacy browser compatibility requir...

28 Mar at 08:49

I get a "An attempt was made to load a program with an incorrect format" error on a SQL Server replication project

The exact error is as follows > Could not load file or assembly 'Microsoft.SqlServer.Replication, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. ...

6 Sep at 23:53

Error message "DevTools failed to load SourceMap: Could not load content for chrome-extension://..."

I'm trying to display an image selected from the local machine and I need the location of that image for a JavaScript function. But I'm unable to get the location. To get the image location, I tried u...

31 Jan at 04:57

Dockerfile if else condition with external arguments

I have dockerfile ``` FROM centos:7 ENV foo=42 ``` then I build it ``` docker build -t my_docker . ``` and run it. ``` docker run -it -d my_docker ``` Is it possible to pass arguments from ...

27 Apr at 10:5

Sizing elements to percentage of screen width/height

Is there a simple (non-LayoutBuilder) way to size an element relative to screen size (width/height)? For example: how do I set the width of a CardView to be 65% of the screen width. It can't be done ...

check if a key exists in a bucket in s3 using boto3

I would like to know if a key exists in boto3. I can loop the bucket contents and check the key if it matches. But that seems longer and an overkill. Boto3 official docs explicitly state how to do th...

21 Nov at 11:46