To use less space in vim I decided to go with only two spaces for each tab stop. This also improves readability in my eyes. I set the following in my .vimrc
which I found here:
set tabstop=4 " The number of spaces count for a TAB.
set softtabstop=2 " The number of spaces inserted when typing TAB. If not expandtab, type TAB twice, will get one TAB.
set shiftwidth=2 " The number of spaces when auto-indent.
set expandtab " Use the spaces only.
set smarttab " Insert appropriate spaces in front of line according to shiftwidth, tabstop, softtabstop.
set autoindent
set smartindent
When building a Visual Studio solution, I had the problem that I got a TargetInvocationException
when calling a method from a referenced DLL file. When running the unit tests on the DLL file, everything seemed to work fine and I could not track down the problem. The inner exception of the exception brought me then on the right track: The Newtonsoft.JSON module was installed in different versions across each DLL file and the main project.
' Write the exception to the console.
Try
response = Await client.Login("a", "b")
Catch ex As Exception
Console.WriteLine(ex.InnerException)
End Try
PM> Update-Package Newtonsoft.JSON -reinstall
PM> Update-Package Newtonsoft.JSON
My first post on this blog was in December 2015 and since then, this blog is running with Jekyll. I want to take the time to summarize my experiences with Jekyll over the past year.
The first thing I did, was creating a build script which I then used within a git-hook. The build script just runs jekyll build
and then uses rsync
to synchronize the changes to my webserver. This way, I can keep the webserver very light, serving only HTML, CSS and some JavaScript. This script is located in the root folder of the site.
#!/bin/bash
jekyll build
rsync --update --progress -r _site/* [email protected]:/.../html/
body
tag which keeps the loading times very low. Google Page Speed Insights rates this page currently with a score of 71/100 for mobile and 85/100 for desktop. This is obviously far away from the optimal solution and will be a topic in another post. What I can see so far, the changes to the code should be minor and can be easily integrated into the build script.
The theme for this site is from the page Jekyllthemes. This page hosts a lot of open source themes for Jekyll which are ready to use. A theme consists of a bunch of files, which have to be places in the the main folder. An easy to understand tutorial can be found here.
Overall my experience with Jekyll is very positive and it makes creating a website very easy. Of course one loses a lot of dynamic features, but the point that I don’t have to worry about any security issue ever, justifies this decision. Also, load times are much fast, especially on a shared server.
To merge two lists l1
, l2
in python, one can use the following
p1
, p2
l1[p1]
to result
and increment p1
and p2
by 1l1[p1] < l2[p2]
, then add l1[p1]
to result
, then increment p1
l1[p1] > l2[p2]
, then add l2[p2]
to result
, then increment p2
result
Just a quick reminder for the syntax of the crontab for cronjobs:
# 1. Entry: Minute when the process will be started [0-60]
# 2. Entry: Hour when the process will be started [0-23]
# 3. Entry: Day of the month when the process will be started [1-28/29/30/31]
# 4. Entry: Month of the year when the process will be started [1-12]
# 5. Entry: Weekday when the process will be started [0-6] [0 is Sunday]
#
# all x min = */x