Java: Get last element after split
I am using the String split method and I want to have the last element. The size of the Array can change. ``` String one = "Düsseldorf - Zentrum - Günnewig Uebachs" String two = "Düsseldorf - Madis...
Set HTTP header for one request
I have one particular request in my app that requires Basic authentication, so I need to set the Authorization header for that request. I read about [setting HTTP request headers](http://docs.angularj...
- Modified
- 26 Nov at 16:15
How do I calculate a point on a circle’s circumference?
How can the following function be implemented in various languages? Calculate the `(x,y)` point on the circumference of a circle, given input values of: - - -
- Modified
- 14 Apr at 02:33
Save multiple plots in a single PDF file
### plotting module ``` def plotGraph(X,Y): fignum = random.randint(0,sys.maxint) plt.figure(fignum) ### Plotting arrangements ### return fignum ``` ### main module ``` import m...
- Modified
- 8 Jun at 04:17
PostgreSQL DISTINCT ON with different ORDER BY
I want to run this query: ``` SELECT DISTINCT ON (address_id) purchases.address_id, purchases.* FROM purchases WHERE purchases.product_id = 1 ORDER BY purchases.purchased_at DESC ``` But I get this...
- Modified
- 30 May at 12:42
PHP Echo text Color
How do I change the color of an echo message and center the message in the PHP I've written. The line I have is: `echo 'Request has been sent. Please wait for my reply!';`
How to store image in SQL Server database tables column
I Have a table named `FEMALE` in my database. It has `ID` as `Primary Key`, it has an `Image` column. My Question is how do I store an image using a SQL Query?
- Modified
- 13 Dec at 10:24
Run Batch File On Start-up
Is there a way to start multiple programs in a batch file on system start-up? In addition to that, in that batch file, I would like to be able to say: Once I execute a program, wait until that program...
- Modified
- 19 Jan at 15:0
Terminal error: zsh: permission denied: ./startup.sh
I am running a command ``` ./startup.sh nginx:start ``` and I am getting this error message ``` zsh: permission denied: ./startup.sh ``` why could this be happening?
How is a JavaScript hash map implemented?
I currently work with OpenLayers and have a huge set of data to draw into a vector layer (greater than 100000 vectors). I'm now trying to put all these vectors into a JavaScript hash map to analyze t...
- Modified
- 22 Aug at 15:41
List submodules in a Git repository
I have a Git repository that has several submodules in it. How do I list the names of all the submodules after `git submodule init` has been run? The `git submodule foreach` command could echo the na...
- Modified
- 21 Aug at 10:36
How can I format DateTime to web UTC format?
I have a DateTime which I want to format to "`2009-09-01T00:00:00.000Z`", but the following code gives me "`2009-09-01T00:00:00.000+01:00`" (both lines): ``` new DateTime(2009, 9, 1, 0, 0, 0, 0, Date...
How to set base url for rest in spring boot?
I'm trying to to mix mvc and rest in a single spring boot project. I want to set base path for all rest controllers (eg. example.com/api) in a single place (I don't want annotate each controller with ...
- Modified
- 24 Feb at 02:36
Change image size with JavaScript
I'm trying to change the size of an image with JavaScript. The jS file is separate from the HTML page. I want to set the height and width of an image in the JS file. Any good ways on doing this?
- Modified
- 15 Feb at 22:33
Css height in percent not working
I have the following simple code: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xht...
How to return a value from a Form in C#?
I have a main form (let's call it frmHireQuote) that is a child of a main MDI form (frmMainMDI), that shows another form (frmImportContact) via ShowDialog() when a button is clicked. When the user cl...
- Modified
- 27 Sep at 21:32
How does the modulus operator work?
Let's say that I need to format the output of an array to display a fixed number of elements per line. How do I go about doing that using modulus operation? Using C++, the code below works for displa...
What is the maximum length of a table name in Oracle?
What are the maximum length of a table name and column name in Oracle?
- Modified
- 8 Apr at 11:26
extract the date part from DateTime in C#
The line of code `DateTime d = DateTime.Today;` results in `10/12/2011 12:00:00 AM`. How can I get only the date part.I need to ignore the time part when I compare two dates.
- Modified
- 12 Oct at 13:0
Hide horizontal scrollbar on an iframe?
I need to hide the horizontal scollbar on an iframe using css, jquery or js.
What is the difference between a web API and a web service?
Is there any difference between a and a ? Or are they one and the same ?
- Modified
- 25 Jun at 15:44
How can I get the SQL of a PreparedStatement?
I have a general Java method with the following method signature: ``` private static ResultSet runSQLResultSet(String sql, Object... queryParams) ``` It opens a connection, builds a `PreparedStatem...
- Modified
- 4 Mar at 20:53
What version of Python is on my Mac?
I have a mac, when I do: ``` python --version ``` I got: ``` Python 2.7.6 ``` but when I got to: ``` /System/Library/Frameworks/Python.framework/Versions/3.3 ``` where is 2.7.6 located ? any ...
Write bytes to file
I have a hexadecimal string (e.g `0CFE9E69271557822FE715A8B3E564BE`) and I want to write it to a file as bytes. For example, ``` Offset 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 00000000 ...
How do I read the first line of a file using cat?
How do I read the first line of a file using `cat`?