Like all APIs, C++ REST APIs need to be documented. If the documentation can be written together with the code, and maybe even generated from the code, that would be ideal.
This article will explain how one can generate C++ REST documentation from code.
I spy with my little eye
observations on things of interest...
Sunday, October 8, 2017
Friday, October 6, 2017
Profiling C++ applications on Ubuntu
Sometimes it is necessary to check the performance of applications at function level, in order to see what are the functions that consume the most time during program execution. I'm going to go through two methods of profiling and exploring the results in a graphical manner.
Sunday, September 4, 2016
HTTP chunked encoding using C++ and libcurl
HTTP chunked encoding is the way to transfer large amounts of data via HTTP. It is pretty easy to use with libcurl, if you have all the data in advance. In case you don't have all the data available when uploading, things get a bit tricky. This latter scenario is what this post will be focused on.
Labels:
c,
c++,
chunked transfer,
curl,
http,
http chunked encoding,
libcurl
Saturday, September 3, 2016
Replacing legacy C-style buffers
Since I've been working lately on legacy projects, filled with C-style buffer containers like void*, char*, byte*, I've started replacing these types of buffers with something a bit more safe and modern, if I might say so.
Sunday, June 12, 2016
iOS push notifications with sound from Amazon SNS
When sending push notifications from Amazon SNS, to iOS endpoints, with the default JSON format, they are received without sound.
The default format would look like this:
In order to get sound for push notifications on iOS, the JSON payload should look like this:
Why does the payload look like this? I have no idea. The point is that it works at the moment this article was written. I've found it somewhere on stackoverflow, but I can't find it again, so I'm just posting it here for whomever needs this information.
The default format would look like this:
{
"default" : "Message"
}
In order to get sound for push notifications on iOS, the JSON payload should look like this:
{
"default" : "Message",
{ "APNS":"{\"aps\":{\"alert\":{\"loc-key\":\"%@\", \"loc-args\":[\"Message\"]}, \"sound\":\"default\"} }" }
}
Why does the payload look like this? I have no idea. The point is that it works at the moment this article was written. I've found it somewhere on stackoverflow, but I can't find it again, so I'm just posting it here for whomever needs this information.
Saturday, January 23, 2016
Creating thumbnails for remote videos
You have some video files stored on some remote storage (dropbox, google drive) and you want to create thumbnails without downloading the whole file.
Labels:
avconv,
https,
libav,
mp4,
remote storage,
thumbnails,
video
Tuesday, January 12, 2016
Configuring ssh keys for git access on Ubuntu
To be able to connect to a git repository with ssh access (ssh://) use the following steps:
- copy your private key file to ~/.ssh
- create (if it doesn't exist) the file ~/.ssh/config and add the following content:
Host my_githost.com
HostName my_githost.com
User my_username
IdentityFile ~/.ssh/my_private_key_file
- change the permissions to the private key file:
chmod 400 ~/.ssh/my_private_key_file
Now you can clone your repository.
Subscribe to:
Posts (Atom)