- SQLite’s datetime functions are all UTC, but they don’t explicitly include the timezone information
- In JavaScript (browsers & Node.js) datetimes without explicit timezone information are interpreted as local time
- In servers (for example, DigitalOcean & GitHub Actions machines) the timezone is usually set to UTC
- In development, the timezone is set to the user’s timezone
- We can change the timezone for the Node.js process in macOS/Linux with the TZ=UTC environment variable
- On Windows, the only solution is to temporarily change the OS timezone
- This sounds too heavy-handed and storing datetimes without an explicit timezone seems like a bad idea, anyway
- So the best solution that works everywhere is to avoid using SQLite datetime functions for generating values that will be stored in the database (it’s still fine to use them for queries)
- To be exact, I’m talking about SQLite’s CURRENT_TIMESTAMP, datetime() and so forth
- The correct way of doing it is using the more generic SQLite datetime function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "H264_Decoder.h" | |
H264_Decoder::H264_Decoder(h264_decoder_callback frameCallback, void* user) | |
:codec(NULL) | |
,codec_context(NULL) | |
,parser(NULL) | |
,fp(NULL) | |
,frame(0) | |
,cb_frame(frameCallback) | |
,cb_user(user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <libgen.h> | |
#include <openssl/ssl.h> | |
#include <openssl/bio.h> | |
#include <openssl/err.h> | |
#include <openssl/pem.h> | |
#include <uv.h> | |
#include <vector> | |
#include <iterator> | |
#include <algorithm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installing CYGWIN with SSH | |
1) Download cygwin setup.exe from http://www.cygwin.com | |
- Execute setup.exe | |
- Install from internet | |
- Root directory: `c:\cygwin` + all users | |
- Local package directory: use default value | |
- Select a mirror to download files from | |
- Select these packages: | |
- editors > xemacs 21.4.22-1 | |
- net > openssh 6.1-p |
Some time has past (three years!) since I last wrote about API specifically about coroutines style APIs so I thought why not write another one about a different API type I encounter relatively often. The builder API.
Now first let me take a step back and put this into 20,000 feet view on where builder APIs are located in the grant scheme. In general everything in computing is separated into input, processing and finally output. In its most basic form I am currently typing on my keyboard. All pressed keys are processed from the OS up to the browser I am writing this in and finally rendered and displayed on the screen as output. Of course this example is very user centric
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <roxlu/experimental/Image.h> | |
namespace roxlu { | |
Image::Image() | |
:width(0) | |
,height(0) | |
,pixels(NULL) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EXPERIMENTAL: Copy frameworks from extern/lib/mac/frameworks, to the install dir and set the @executable paths | |
# frameworks from the extern/lib/mac/frameworks dir | |
# ---------------------------------------------------------------------------- | |
foreach(framework_name in ${roxlu_frameworks}) | |
set(framework_dir ${roxlu_base_dir}/extern/lib/mac/frameworks/${framework_name}.framework) | |
if(IS_DIRECTORY ${framework_dir}) | |
set(framework_dest_dir ${roxlu_app_install_dir}/lib/) | |
set(framework_file ${framework_dest_dir}${framework_name}.framework/${framework_name}) | |
get_filename_component(framework_file ${framework_file} ABSOLUTE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <roxlu/core/Utils.h> | |
#include <roxlu/core/Log.h> | |
#include "YUV420PGrabber.h" | |
YUV420PGrabber::YUV420PGrabber() | |
:y_prog(0) | |
,y_vert(0) | |
,y_frag(0) | |
,uv_prog(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "testApp.h" | |
#include "Error.h" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofEnableNormalizedTexCoords(); | |
ofDisableArbTex(); | |
int w = ofGetWidth(); | |
int h = ofGetHeight(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <roxlu/core/Log.h> | |
#include <roxlu/core/Utils.h> | |
#include <video/X264Encoder.h> | |
X264Encoder::X264Encoder() | |
:in_width(0) | |
,in_height(0) | |
,in_pixel_format(AV_PIX_FMT_NONE) | |
,out_width(0) | |
,out_height(0) |
NewerOlder