Questions

Task not serializable: java.io.NotSerializableException when calling function outside closure only on classes not objects

Getting strange behavior when calling function outside of a closure: - - > Task not serializable: java.io.NotSerializableException: testing The problem is I need my code in a class and not an obje...

26 Sep at 05:32

Extract a dplyr tbl column as a vector

Is there a more succinct way to get one column of a dplyr tbl as a vector, from a tbl with database back-end (i.e. the data frame/table can't be subset directly)? ``` require(dplyr) db <- src_sqlite(...

30 Jul at 22:3

Using Moq to mock an asynchronous method for a unit test

I am testing a method for a service that makes a Web `API` call. Using a normal `HttpClient` works fine for unit tests if I also run the web service (located in another project in the solution) locall...

31 Dec at 15:51

How can I list ALL DNS records?

Is there any way I can list ALL DNS records for a domain? I know about such things as dig and nslookup but they only go so far. For example, if I've got a subdomain A record as ``` test A somedomain...

11 Oct at 16:28

Moving Git repository content to another repository preserving history

I am trying to move only the contents of one repository (`repo1`) to another existing repository (`repo2`) using the following commands: ``` git clone repo1 git clone repo2 cd repo1 git remote rm ori...

27 Jan at 05:36

Is there a way to put multiple projects in a git repository?

For some reason, I only have to use. But I have including `java` projects, `PHP scripts` and `Android` apps projects. Now my problem is, I have to put them to different inside the repository I use ...

13 Sep at 15:13

Unable to load DLL 'SQLite.Interop.dll'

Periodically I am getting the following exception: `Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)` I am using 1.0.82.0. versi...

23 Oct at 10:25

postgresql - add boolean column to table set default

Is this proper postgresql syntax to add a column to a table with a default value of `false` ``` ALTER TABLE users ADD "priv_user" BIT ALTER priv_user SET DEFAULT '0' ``` Thanks!

13 Aug at 16:43

git stash -> merge stashed change with current changes

I made some changes to my branch and realized I forgot I had stashed some other necessary changes to said branch. What I want is a way to merge my stashed changes with the current changes. Is ther...

24 Jun at 12:33

Count the number of commits on a Git branch

I found this answer already: [Number of commits on branch in git](https://stackoverflow.com/questions/10913892/number-of-commits-on-branch-in-git) but that assumes that the branch was created from mas...

23 May at 12:34

Get the value of checked checkbox?

So I've got code that looks like this: ``` <input class="messageCheckbox" type="checkbox" value="3" name="mailId[]"> <input class="messageCheckbox" type="checkbox" value="1" name="mailId[]"> ``` I ...

24 Jul at 00:50

Can't find how to use HttpContent

I am trying to use `HttpContent`: ``` HttpContent myContent = HttpContent.Create(SOME_JSON); ``` ...but I am not having any luck finding the DLL where it is defined. First, I tried adding referenc...

8 Jun at 00:53

How to get the current directory of the cmdlet being executed

This should be a simple task, but I have seen several attempts on how to get the path to the directory where the executed cmdlet is located with mixed success. For instance, when I execute `C:\temp\my...

24 Nov at 06:27

Trust Anchor not found for Android SSL Connection

I am trying to connect to an IIS6 box running a godaddy 256bit SSL cert, and I am getting the error : ``` java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. ...

30 May at 08:44

Configuration System Failed to Initialize

I'm currently creating a Login form and have this code: ``` string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; try { using (OdbcConnection conne...

X-UA-Compatible is set to IE=edge, but it still doesn't stop Compatibility Mode

I am quite confused. I should be able to set ``` <meta http-equiv="X-UA-Compatible" content="IE=edge" /> ``` and IE8 and IE9 should render the page using the latest rendering engine. However, I ju...

MySQL select one column DISTINCT, with corresponding other columns

``` ID FirstName LastName 1 John Doe 2 Bugs Bunny 3 John Johnson ``` I want to select `DISTINCT` results from the `FirstName` column, but I need the correspon...

24 Dec at 05:30

How do I format a string using a dictionary in python-3.x?

I am a big fan of using dictionaries to format strings. It helps me read the string format I am using as well as let me take advantage of existing dictionaries. For example: ``` class MyClass: de...

8 Nov at 04:27

How to remove all callbacks from a Handler?

I have a [Handler](http://developer.android.com/reference/android/os/Handler.html) from my sub-Activity that was called by the main [Activity](http://developer.android.com/reference/android/app/Activi...

14 Dec at 14:35

Eclipse "Invalid Project Description" when creating new project from existing source

I am trying to create a new project from existing source code. I keep getting the following error: "Invalid Project Description", project path "overlaps the location of another project" with the same ...

23 May at 11:54

How do I check (at runtime) if one class is a subclass of another?

Let's say that I have a class Suit and four subclasses of suit: Heart, Spade, Diamond, Club. ``` class Suit: ... class Heart(Suit): ... class Spade(Suit): ... class Diamond(Suit): ... cla...

4 Mar at 00:3

Force SSL/https using .htaccess and mod_rewrite

How can I force to SSL/https using .htaccess and mod_rewrite page specific in PHP.

17 May at 15:18

Getting the folder name from a full filename path

``` string path = "C:\folder1\folder2\file.txt"; ``` What objects or methods could I use that would give me the result `folder2`?

27 Jun at 21:56

Why Response.Redirect causes System.Threading.ThreadAbortException?

When I use Response.Redirect(...) to redirect my form to a new page I get the error: > A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll An excep...

5 Oct at 09:3

Convert XmlDocument to String

Here is how I'm currently converting to ``` StringWriter stringWriter = new StringWriter(); XmlTextWriter xmlTextWriter = new XmlTextWriter(stringWriter); xmlDoc.WriteTo(xmlTextWriter); return st...

9 Mar at 07:43