If you get this error while uploading a new theme, your web server is rejecting the upload due to the overall size of the file. WordPress is unfortunately giving you a rather ambiguous message in response. This is not a theme issue or bug. In order to increase your PHP . . . Read more
In this post I have described how to manually renew Let’s Encrypt SSL certificate. Here I describe how to configure a cronjob to automatically renew my certificates when they are about to expire. Setup default AMI editor to nano:
Add the following:
17 */12 * * * mv /var/www/html/.htaccess /var/www/html/.htaccess_ && /usr/local/letsencrypt/letsencrypt-auto certonly --webroot -w /var/www/html -d lucaslouca.com -d www.lucaslouca.com --config /etc/letsencrypt/config.ini --agree-to --quiet && mv /var/www/html/.htaccess_ /var/www/html/.htaccess && rm -rf /var/www/html/.well-known/
The && operator makes sure . . . Read more
Seing as how many people are interested in my video-conference-webrtc project, I have decided to develop a random video chat website using WebRTC. The project is called rtcrandom and is hosted on GitHub. A live demo is also available at test.tengmo.chat. Pitch RTCRandom is an online (video)chat website that allows . . . Read more
DISCLAIMER: The information below is for information purposes only. I happened to be browsing on SPIEGEL Online the other day and noticed that articles published for non SPIEGEL Plus subscribers were still partially available on the article’s page in readable form while the largest portion of the text was blurred . . . Read more
I was searching the net for a very, very simple token field for AngularJS the other day to use on a side project that I was working on. Unfortunately I couldn’t find anything that suits my requirements. So I implemented my own. Here is how to use it. (Optional) Install . . . Read more
In this post I will explain a less intuitive approach of implementing a ceil() function in Java, that is faster than known comparison approaches. A few known facts Fact 1 Dividing two integers and in Java will always floor the result:
int a, b;
int ans = a/b; // is the same as Math.floor(a/b)
well almost. Actually Math.floor(a/b) rounds towards negative infinity, . . . Read more
Problem statement Given a word , consisting of characters a-z, A-Z and 0-9, compute the next lexicographical word , with 0-9 < A-Z < a-z. Sample Input
word = list(w)
cursor = len(w) - 1
carry = True
while carry and cursor >= 0:
carry = False
word[cursor] = chr(ord(word[cursor]) + 1)
if ord(word[cursor]) == 58:
# '9' -> 'A'
word[cursor] = "A"
elif ord(word[cursor]) == 91:
# 'Z' -> 'a'
word[cursor] = "a"
elif ord(word[cursor]) == 123:
# 'z' -> '0'
if cursor > 0:
word[cursor] = "0"
cursor -= 1
carry = True
word = "k7"
Notebook file https://github.com/lucaslouca/coding-problems/tree/master/python/NextWord
Full code https://github.com/lucaslouca/parallax-scrolling
The following code reads a CSV file and converts it to List<Map<String, String>> in Java. Each row is represented by a Map<String, String> entry in the resulting List. Map<String, String> maps column name (header value) to value.
Problem statement Suppose you have a query whose result needs to be exported as a CSV file. In addition some fields need to be parsed into a different format and columns need to be renamed. The SPOOL command The SPOOL command causes SQL*Plus to write the results to a file. . . . Read more