Questions

C# Linq Where Date Between 2 Dates

I'm trying to get my linq statement to get me all records between two dates, and I'm not quite sure what I need to change to get it to work: `(a.Start >= startDate && endDate)` ``` var appointmentNoS...

5 Mar at 13:56

Running unittest with typical test directory structure

The very common directory structure for even a simple Python module seems to be to separate the unit tests into their own `test` directory: ``` new_project/ antigravity/ antigravity.py ...

8 Jun at 01:27

How do I replace multiple spaces with a single space in C#?

How can I replace multiple spaces in a string with only one space in C#? Example: ``` 1 2 3 4 5 ``` would be: ``` 1 2 3 4 5 ```

24 Sep at 03:19

Best way to disable button in Twitter's Bootstrap

I am confused when it comes to disabling a `<button>`, `<input>` or an `<a>` element with classes: `.btn` or `.btn-primary`, with JavaScript/jQuery. I have used a following snippet to do that: ``` $...

SQL Server: converting UniqueIdentifier to string in a case statement

We have a log table that has a message column that sometimes has an exception stack trace. I have some criteria that determines if the message has this. We do not want to show these messages to the cu...

8 Nov at 23:30

Python float to int conversion

Basically, I'm converting a float to an int, but I don't always have the expected value. Here's the code I'm executing: x = 2.51 ``` print("--------- 251.0") y = 251.0 print(y) print(int(y)) print...

31 May at 14:5

Difference between Git and GitHub

I have recently added a new project to Git using Eclipse, but do not see the project appear in my GitHub account. Why do they have the same account information and different repositories? Isn't Git ...

18 Jan at 09:3

How to zero pad a sequence of integers in bash so that all have the same width?

I need to loop some values, ``` for i in $(seq $first $last) do does something here done ``` For `$first` and `$last`, I need it to be of fixed length 5. So if the input is `1`, I need to add zer...

20 Jan at 22:2

Detect when an HTML5 video finishes

How do you detect when a HTML5 `<video>` element has finished playing?

15 Jul at 19:55

Java ArrayList Index

``` int[] alist = new int [3]; alist.add("apple"); alist.add("banana"); alist.add("orange"); ``` Say that I want to use the second item in the ArrayList. What is the coding in order to get the follo...

30 Nov at 12:2

How do I avoid the specification of the username and password at every git push?

I `git push` my work to a remote Git repository. Every `push` will prompt me to input `username` and `password`. I would like to avoid it for every push, but how to configure to avoid it?

28 Apr at 13:38

Open existing file, append a single line

I want to open a text file, append a single line to it, then close it.

14 May at 19:30

Gradle does not find tools.jar

I am using javadoc doclets with gradle, so I need to use the package tools.jar, which is in the lib folder from the jdk (1.6.0_26 in my case). The point is that gradle does not take it automatically,...

15 Mar at 06:11

How to detect page zoom level in all modern browsers?

1. How can I detect the page zoom level in all modern browsers? While this thread tells how to do it in IE7 and IE8, I can't find a good cross-browser solution. 2. Firefox stores the page zoom level ...

7 Feb at 10:29

How to apply a patch generated with git format-patch?

I have two local git repositories, both pointing to the remote repository. In one git repository, if I do `git format-patch 1`, how can I apply that patch to the other repository?

24 Apr at 16:22

PHP Get name of current directory

I have a php page inside a folder on my website. I need to add the name of the current directory into a variable for example: ``` $myVar = current_directory_name; ``` Is this possible?

15 Jun at 17:29

How to restart Activity in Android

How do I restart an Android `Activity`? I tried the following, but the `Activity` simply quits. ``` public static void restartActivity(Activity act){ Intent intent=new Intent(); int...

27 Nov at 11:16

Add centered text to the middle of a horizontal rule

I'm wondering what options one has in xhtml 1.0 strict to create a line on both sides of text like-so: I've thought of doing some fancy things like this: ``` <div style="float:left; width: 44%;"><...

15 Jul at 21:19

Datetime current year and month in Python

I must have the current year and month in datetime. I use this: ``` datem = datetime.today().strftime("%Y-%m") datem = datetime.strptime(datem, "%Y-%m") ``` Is there maybe another way?

19 Sep at 13:48

How should I use servlets and Ajax?

Whenever I print something inside the servlet and call it by the webbrowser, it returns a new page containing that text. Is there a way to print the text in the current page using Ajax?

20 Oct at 13:58

Make an image width 100% of parent div, but not bigger than its own width

I’m trying to get an image (dynamically placed, with no restrictions on dimensions) to be as wide as its parent div, but only as long as that width isn’t wider than its own width at 100%. I’ve tried t...

11 Aug at 23:34

Environment variable to control java.io.tmpdir?

I've used the `TMP` environment variable to control things like where gcc writes it's temporary files, but I can't seem to find an equivalent for java's [createTempFile](http://java.sun.com/javase/6/d...

When use ResponseEntity<T> and @RestController for Spring RESTful applications

I am working with Spring Framework 4.0.7, together with MVC and Rest I can work in peace with: - `@Controller`- `ResponseEntity<T>` For example: ``` @Controller @RequestMapping("/person") @Profile...

24 Oct at 13:56

libxml install error using pip

This is my error: ``` (mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install lxml Downloading/unpacking lxml Running setup.py egg_info for package lxml Building lxml version 2.3. B...

2 Jul at 03:12

Error: Java: invalid target release: 11 - IntelliJ IDEA

I am trying to build an application which was built using java 8, now it's upgraded to java 11. I installed [Java 11](https://www.oracle.com/technetwork/java/javase/downloads/index.html) using [an ora...

31 Oct at 18:36