Getting activity from context in android
This one has me stumped. I need to call an activity method from within a custom layout class. The problem with this is that I don't know how to access the activity from within the layout. ## Profil...
- Modified
- 29 Apr at 08:55
Excel VBA - exit for loop
I would like to exit my `for` loop when a condition inside is met. How could I exit my `for` loop when the `if` condition has been met? I think some kind of exit at the end of my `if` statement, but d...
Binding multiple events to a listener (without JQuery)?
While working with browser events, I've started incorporating Safari's touchEvents for mobile devices. I find that `addEventListener`s are stacking up with conditionals. A standard event listener: ...
- Modified
- 20 Oct at 12:49
Using "like" wildcard in prepared statement
I am using prepared statements to execute mysql database queries. And I want to implement a search functionality based on a keyword of sorts. For that I need to use `LIKE` keyword, that much I know....
- Modified
- 21 Jan at 01:34
How to catch an Exception from a thread
I have Java main class, in the class, I start a new thread, in the main, it waits until the thread dies. At some moment, I throw a runtime exception from the thread, but I can't catch the exception th...
- Modified
- 16 Mar at 15:37
getActivity() returns null in Fragment function
I have a fragment (F1) with a public method like this ``` public void asd() { if (getActivity() == null) { Log.d("yes","it is null"); } } ``` and yes when I call it (from the Activity...
- Modified
- 26 Nov at 21:56
How to get started with developing Internet Explorer extensions?
Does anyone here have experience with/in developing IE extensions that can share their knowledge? This would include code samples, or links to good ones, or documentation on the process, or anything. ...
- Modified
- 16 May at 02:44
Non-recursive depth first search algorithm
I am looking for a non-recursive depth first search algorithm for a non-binary tree. Any help is very much appreciated.
How to print binary tree diagram in Java?
How can I print a binary tree in Java so that the output is like: ``` 4 / \ 2 5 ``` My node: ``` public class Node<A extends Comparable> { Node<A> left, right; A data; public N...
- Modified
- 30 Jun at 00:2
String.format() to format double in Java
How can I use `String.format(format, args)` to format a double like below? `2354548.235` -> `2,354,548.23`
- Modified
- 8 Mar at 08:46
AutoMapper vs ValueInjecter
Everytime I'm looking for [AutoMapper](http://automapper.codeplex.com/) stuff on StackOverflow, I'm reading something about [ValueInjecter](http://valueinjecter.codeplex.com/). Can somebody tell me t...
- Modified
- 5 Dec at 14:45
Work on a remote project with Eclipse via SSH
I have the following boxes: a) A Windows box with Eclipse CDT, b) A Linux box, accessible for me only via SSH. Both the compiler and the hardware required to build and run my project is only on machin...
- Modified
- 18 Dec at 10:44
How to ALTER multiple columns at once in SQL Server
I need to `ALTER` the data types of several columns in a table. For a single column, the following works fine: ``` ALTER TABLE tblcommodityOHLC ALTER COLUMN CC_CommodityContractID NUMERIC(18,0) ...
- Modified
- 13 Jan at 10:35
How can I convert a file pointer ( FILE* fp ) to a file descriptor (int fd)?
I have a `FILE *`, returned by a call to `fopen()`. I need to get a file descriptor from it, to make calls like `fsync(fd)` on it. What's the function to get a file descriptor from a file pointer?
Truncating all tables in a Postgres database
I regularly need to delete all the data from my PostgreSQL database before a rebuild. How would I do this directly in SQL? At the moment I've managed to come up with a SQL statement that returns all ...
- Modified
- 23 Oct at 04:3
Where to install Android SDK on Mac OS X?
Where should the Android SDK be installed on Mac OS X?
- Modified
- 21 Feb at 14:9
How can I get zoom functionality for images?
Is there a common way to show a big image and enable the user to zoom in and out and pan the image? Until now I found two ways: 1. overwriting ImageView, that seems a little bit too much for such ...
GIT clone repo across local file system in windows
I am a complete Noob when it comes to GIT. I have been just taking my first steps over the last few days. I setup a repo on my laptop, pulled down the Trunk from an SVN project (had some issues with...
Display the current time and date in an Android application
How do I display the current date and time in an Android application?
- Modified
- 16 Dec at 14:47
String was not recognized as a valid DateTime " format dd/MM/yyyy"
I am trying to convert my string formatted value to date type with format `dd/MM/yyyy`. ``` this.Text="22/11/2009"; DateTime date = DateTime.Parse(this.Text); ``` What is the problem ? It has a se...
What is the HtmlSpecialChars equivalent in JavaScript?
Apparently, this is harder to find than I thought it would be. And it even is so simple... Is there a function equivalent to PHP's [htmlspecialchars](https://www.php.net/manual/en/function.htmlspecial...
- Modified
- 15 Jun at 21:51
How to use C++ in Go
In the new [Go](http://golang.org/) language, how do I call C++ code? In other words, how can I wrap my C++ classes and use them in Go?
What's the difference between echo, print, and print_r in PHP?
I use `echo` and `print_r` much, and almost never use `print`. I feel `echo` is a macro, and `print_r` is an alias of `var_dump`. But that's not the standard way to explain the differences.
- Modified
- 2 Feb at 11:37