Questions

How to capitalize the first character of each word in a string

Is there a function built into Java that capitalizes the first character of each word in a String, and does not affect the others? Examples: - `jon skeet``Jon Skeet`- `miles o'Brien``Miles O'Brien`-...

Can I use multiple versions of jQuery on the same page?

A project I'm working on requires the use of jQuery on customers' Web pages. Customers will insert a chunk of code that we'll supply which includes a few `<script>` elements that build a widget in a `...

20 Apr at 10:10

Show just the current branch in Git

Is there a Git command equivalent to: ``` git branch | awk '/\*/ { print $2; }' ```

8 Jul at 06:44

contenteditable change events

I want to run a function when a user edits the content of a `div` with `contenteditable` attribute. What's the equivalent of an `onchange` event? I'm using jQuery so any solutions that uses jQuery is...

How do I do an OR filter in a Django query?

I want to be able to list the items that either a user has added (they are listed as the creator) or the item has been approved. So I basically need to select: ``` item.creator = owner or item.moder...

16 Apr at 06:4

curl: (60) SSL certificate problem: unable to get local issuer certificate

``` root@sclrdev:/home/sclr/certs/FreshCerts# curl --ftp-ssl --verbose ftp://{abc}/ -u trup:trup --cacert /etc/ssl/certs/ca-certificates.crt * About to connect() to {abc} port 21 (#0) * Trying {abc}...

Adding a legend to PyPlot in Matplotlib in the simplest manner possible

> How can one create a legend for a line graph in `Matplotlib`'s `PyPlot` without creating any extra variables? Please consider the graphing script below: ``` if __name__ == '__main__': PyPlot....

4 Feb at 02:39

How to solve the “failed to lazily initialize a collection of role” Hibernate exception

I have this problem: > org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: mvc3.model.Topic.comments, no session or session was closed Here is the model: ...

27 Jun at 06:22

Concatenate multiple files but include filename as section headers

I would like to concatenate a number of text files into one large file in terminal. I know I can do this using the cat command. However, I would like the filename of each file to precede the "data dum...

Resize HTML5 canvas to fit window

How can I automatically scale the HTML5 `<canvas>` element to fit the page? For example, I can get a `<div>` to scale by setting the `height` and `width` properties to 100%, but a `<canvas>` won't sc...

21 Jul at 03:36

Enum "Inheritance"

I have an enum in a low level namespace. I'd like to provide a class or enum in a mid level namespace that "inherits" the low level enum. ``` namespace low { public enum base { x, y, z ...

16 Apr at 20:4

How to use `@ts-ignore` for a block?

The `// @ts-ignore` comment enables the TypeScript compiler to ignore the line below it. How can one ignore a whole block of code with TypeScript?

4 Oct at 16:24

gradlew: Permission Denied

I am attempting to run gradlew from my command line, but am constantly facing the following error. ``` Brendas-MacBook-Pro:appx_android brendalogy$ ./gradlew compileDebug --stacktrace -bash: ./gradle...

23 May at 11:55

Remove xticks in a matplotlib plot?

I have a semilogx plot and I would like to remove the xticks. I tried: ``` plt.gca().set_xticks([]) plt.xticks([]) ax.set_xticks([]) ``` The grid disappears (ok), but small ticks (at the place of t...

30 May at 23:14

How can I get multiple counts with one SQL query?

I am wondering how to write this query. I know this actual syntax is bogus, but it will help you understand what I want. I need it in this format, because it is part of a much bigger query. ``` SELECT...

7 Feb at 03:38

How to convert JSON data into a Python object?

I want to convert JSON data into a Python object. I receive JSON data objects from the Facebook API, which I want to store in my database. My current View in Django (Python) (`request.POST` contains t...

19 Sep at 19:11

Where does PHP store the error log? (PHP 5, Apache, FastCGI, and cPanel)

I am on shared hosting and have [cPanel](https://en.wikipedia.org/wiki/CPanel), Apache, and PHP is run by [FastCGI](https://en.wikipedia.org/wiki/FastCGI). Where does PHP store the error log? Is ther...

26 Sep at 13:40

What's is the difference between include and extend in use case diagram?

What is the difference between `include` and `extend` in a [use case diagram](http://en.wikipedia.org/wiki/Use_case_diagram)?

How can I download and save a file from the Internet using Java?

There is an online file (such as `http://www.example.com/information.asp`) I need to grab and save to a directory. I know there are several methods for grabbing and reading online files (URLs) line-by...

11 Oct at 19:8

Resolve build errors due to circular dependency amongst classes

I often find myself in a situation where I am facing multiple compilation/linker errors in a C++ project due to some bad design decisions (made by someone else :) ) which lead to circular dependencies...

What is the difference between Θ(n) and O(n)?

Sometimes I see Θ(n) with the strange Θ symbol with something in the middle of it, and sometimes just O(n). Is it just laziness of typing because nobody knows how to type this symbol, or does it mean ...

30 Sep at 09:46

When would you use the different git merge strategies?

From the man page on git-merge, there are a number of merge strategies you can use. - - This can only resolve two heads (i.e. the current branch and another branch you pulled from) using 3-way me...

2 Sep at 06:4

How to pass arguments to addEventListener listener function?

The situation is somewhat like- ``` var someVar = some_other_function(); someObj.addEventListener("click", function(){ some_function(someVar); }, false); ``` The problem is that the value of `s...

30 Jan at 12:37

In C++, what is a virtual base class?

I want to know what a "" is and what it means. Let me show an example: ``` class Foo { public: void DoSomething() { /* ... */ } }; class Bar : public virtual Foo { public: void DoSpecific()...

1 Mar at 13:37

What does 'x packages are looking for funding' mean when running `npm install`?

I usually get `"x packages are looking for funding."` when running `npm install` on a `react` project. Any idea what that means?

14 Jan at 14:23