What are Makefile.am and Makefile.in?

Makefile.am is a programmer-defined file and is used by automake to generate the Makefile.in file (the .am stands for automake). The configure script typically seen in source tarballs will use the Makefile.in to generate a Makefile. The configure script itself is generated from a programmer-defined file named either configure.ac or configure.in (deprecated). I prefer .ac … Read more

How to get a time zone from a location using latitude and longitude coordinates?

Time Zone Location Web Services Google Maps Time Zone API Bing Maps Time Zone API Azure Maps Time Zone API GeoNames Time Zone API TimeZoneDB API AskGeo – commercial (but arguably more accurate than GeoNames) GeoGarage Time Zone API – commercial, focusing on Nautical time zones. Raw Time Zone Boundary Data Timezone Boundary Builder – … Read more

How dangerous is it to compare floating point values?

First of all, floating point values are not “random” in their behavior. Exact comparison can and does make sense in plenty of real-world usages. But if you’re going to use floating point you need to be aware of how it works. Erring on the side of assuming floating point works like real numbers will get … Read more

How to remove all event handlers from an event

I found a solution on the MSDN forums. The sample code below will remove all Click events from button1. public partial class Form1 : Form { public Form1() { InitializeComponent(); button1.Click += button1_Click; button1.Click += button1_Click2; button2.Click += button2_Click; } private void button1_Click(object sender, EventArgs e) => MessageBox.Show(“Hello”); private void button1_Click2(object sender, EventArgs e) => … Read more

Why do many examples use `fig, ax = plt.subplots()` in Matplotlib/pyplot/python

plt.subplots() is a function that returns a tuple containing a figure and axes object(s). Thus when using fig, ax = plt.subplots() you unpack this tuple into the variables fig and ax. Having fig is useful if you want to change figure-level attributes or save the figure as an image file later (e.g. with fig.savefig(‘yourfilename.png’)). You … Read more

Real differences between “java -server” and “java -client”?

This is really linked to HotSpot and the default option values (Java HotSpot VM Options) which differ between client and server configuration. From Chapter 2 of the whitepaper (The Java HotSpot Performance Engine Architecture): The JDK includes two flavors of the VM — a client-side offering, and a VM tuned for server applications. These two … Read more

How to set limits for axes in ggplot2 R plots?

Basically you have two options scale_x_continuous(limits = c(-5000, 5000)) or coord_cartesian(xlim = c(-5000, 5000)) Where the first removes all data points outside the given range and the second only adjusts the visible area. In most cases you would not see the difference, but if you fit anything to the data it would probably change the … Read more

Stop on first error [duplicate]

Maybe you want set -e: www.davidpashley.com/articles/writing-robust-shell-scripts.html#id2382181: This tells bash that it should exit the script if any statement returns a non-true return value. The benefit of using -e is that it prevents errors snowballing into serious issues when they could have been caught earlier. Again, for readability you may want to use set -o errexit.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)