Questions

How do I create a folder in VB if it doesn't exist?

I wrote myself a little downloading application so that I could easily grab a set of files from my server and put them all onto a new pc with a clean install of Windows, without actually going on the...

1 Feb at 05:36

Ignore mapping one property with Automapper

I'm using Automapper and I have the following scenario: Class OrderModel has a property called 'ProductName' that isn't in the database. So when I try to do the mapping with: ``` Mapper.CreateMap<Ord...

Sorting using Comparator- Descending order (User defined classes)

I want to sort my objects in descending order using comparator. ``` class Person { private int age; } ``` Here I want to sort a array of Person objects. How can I do this?

26 Sep at 06:44

How to redirect output of systemd service to a file

I am trying to redirect output of a `systemd` service to a file but it doesn't seem to work: ``` [Unit] Description=customprocess After=network.target [Service] Type=forking ExecStart=/usr/local/b...

11 Jun at 15:50

Defining private module functions in python

According to [http://www.faqs.org/docs/diveintopython/fileinfo_private.html](http://www.faqs.org/docs/diveintopython/fileinfo_private.html): > Like most languages, Python has the concept of private el...

20 Jun at 09:12

MySQL Sum() multiple columns

I have a table of student scorecard. here is the table, ``` subject | mark1 | mark2 | mark3 |......|markn stud1 | 99 | 87 | 92 | | 46 stud2 |.................................... ...

19 Dec at 19:52

Twitter Bootstrap Tabs: Go to Specific Tab on Page Reload or Hyperlink

I'm developing a web page in which I'm using Twitter's Bootstrap Framework and their [Bootstrap Tabs JS](http://twitter.github.com/bootstrap/javascript.html#tabs). It works great except for a few mino...

Verifying that a string contains only letters in C#

I have an input string and I want to verify that it contains: - - - To clarify, I have 3 different cases in the code, each calling for different validation. What's the simplest way to achieve this ...

25 Apr at 21:26

What is the difference between Tomcat, JBoss and Glassfish?

I am starting to look into Enterprise Java and the book I am following mentions that it will use JBoss. Netbeans ships with Glassfish. I have used Tomcat in the past. What are the differences between...

How should I use Outlook to send code snippets?

As a programmer at a big corporation, I frequently send Outlook emails that contain code samples. I'll actually type code directly into an email. This inevitably causes problems, as Outlook really l...

2 Oct at 18:6

How to get the last characters in a String in Java, regardless of String size

I'm looking for a way to pull the last characters from a String, regardless of size. Lets take these strings into example: ``` "abcd: efg: 1006746" "bhddy: nshhf36: 1006754" "hfquv: nd: 5894254" ``` ...

19 Nov at 02:13

Convert a Map<String, String> to a POJO

I've been looking at Jackson, but is seems I would have to convert the Map to JSON, and then the resulting JSON to the POJO. Is there a way to convert a Map directly to a POJO?

28 Aug at 11:43

http://localhost/ not working on Windows 7. What's the problem?

I have a big problem opening [http://localhost/](http://localhost/) on Windows 7 (beta). I installed this os and everything went great; when I installed Wamp I saw that localhost is not working at all...

1 Mar at 07:11

How to quickly edit values in table in SQL Server Management Studio?

Aside from context menu -> "Edit Top 200 Rows" from Object Explorer, is there a quick way to open a table in Edit mode where I can just quickly modify the value of a cell? I need to be able to page...

8 Oct at 03:30

C# Change A Button's Background Color

How can the background color of a button once another button is pressed? What I have at the moment is: ``` ButtonToday.Background = Color.Red; ``` And it's not working.

13 Sep at 16:23

Best way to concatenate List of String objects?

What is the best way to concatenate a list of String objects? I am thinking of doing this way: ``` List<String> sList = new ArrayList<String>(); // add elements if (sList != null) { String list...

13 Sep at 18:39

php.ini & SMTP= - how do you pass username & password

`My ISP` account requires that I send a username & password for outbound `SMTP` mail. How do I get `PHP` to use this when executing `php.mail()?` The `php.ini` file only contains entries for the ser...

5 Jun at 19:33

Run AVD Emulator without Android Studio

is there a way to run the emulator without starting the Android Studio first. Perhaps from the command line. I know that this feature was available in older versions and has vanished since then. But p...

26 Oct at 12:1

Error: Selection does not contain a main type

I am trying to run some java files in a new project. So I make the project, put the files in it and I try to run the main file so my game starts. I get an error that says `selection does not contain...

Removing packages installed with go get

I ran `go get package` to download a package before learning that I needed to set my `GOPATH` otherwise that package sullies my root Go install (I would much prefer to keep my Go install clean and sep...

9 Dec at 21:54

How to copy folders to docker image from Dockerfile?

I tried the following command in my Dockerfile: `COPY * /` and got mighty surprised at the result. Seems the naive docker code traverses the directories from the glob and then dumps the each file in t...

13 Jun at 13:37

COPY with docker but with exclusion

In a Dockerfile, I have ``` COPY . . ``` I want to exclude an entire directory, in my case, node_modules directory. Something like this: ``` COPY [all but **/node_modules/**] . ``` Is this poss...

2 May at 21:48

Access denied for user 'homestead'@'localhost' (using password: YES)

I'm on a Mac OS Yosemite using Laravel 5.0. While in my environment, I run `php artisan migrate` I keep getting : > Access denied for user 'homestead'@'localhost' (using password: YES) Here is my `...

Access restriction: The type 'Application' is not API (restriction on required library rt.jar)

Here is the code: ``` package mscontroller; import javax.swing.*; import com.apple.eawt.Application; public class Main { public static void main(String[] args) { Application app = n...

8 Feb at 17:24

Returning binary file from controller in ASP.NET Web API

I'm working on a web service using ASP.NET MVC's new WebAPI that will serve up binary files, mostly `.cab` and `.exe` files. The following controller method seems to work, meaning that it returns a f...

2 Mar at 22:37