Twelve Go Best Practices
Francesc Campoy Flores Gopher at Google @francesc http://campoy.cat/+
- Best practices
Twelve Go Best Practices
Francesc Campoy Flores Gopher at Google @francesc http://campoy.cat/+
Download and Install Emscripten
/home/user
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git checkout main
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
#pragma once | |
#include "RuntimeImGui.h" | |
#include "RuntimeInclude.h" | |
RUNTIME_MODIFIABLE_INCLUDE; | |
#include "IconsFontAwesome.h" // from https://github.com/juliettef/IconFontCppHeaders | |
#include "PlatformUtils.h" | |
namespace ImGui |
#define STB_IMAGE_IMPLEMENTATION | |
#define STB_IMAGE_WRITE_IMPLEMENTATION | |
#define STBI_ONLY_PNG | |
#define STBI_ONLY_JPEG | |
#define STBI_ONLY_BMP | |
#define STBI_ONLY_GIF | |
#include "stb_image.h" | |
#include "stb_image_write.h" |
COW, short for copy on write, is a way to implement mutable strings so that creating strings and logically copying strings, is reduced to almost nothing; conceptually they become free operations like no-ops.
Basic idea: to share a data buffer among string instances, and only make a copy for a specific instance (the copy on write) when that instance's data is modified. The general cost of this is only an extra indirection for accessing the value of a string, so a COW implementation is highly desirable. And so the original C++ standard, C++98, and its correction C++03, had special support for COW implementations, and e.g. the g++ compiler's std::string
implementations used COW.
So why was that support dropped in C++11?
In particular, would the same reason or reasons apply to a reference counted immutable string value class?
const int ENTRY_COUNT = 10; | |
const char* ENTRIES[ENTRY_COUNT] = | |
{ | |
"Entry 0", | |
"Entry 1", | |
"Entry 2", | |
"Entry 3", | |
"Entry 4", | |
"Entry 5", |
// tutorial05.c | |
// A pedagogical video player that really works! | |
// | |
// Code based on FFplay, Copyright (c) 2003 Fabrice Bellard, | |
// and a tutorial by Martin Bohme (boehme@inb.uni-luebeckREMOVETHIS.de) | |
// Tested on Gentoo, CVS version 5/01/07 compiled with GCC 4.1.1 | |
// With updates from https://github.com/chelyaev/ffmpeg-tutorial | |
// Updates tested on: | |
// LAVC 54.59.100, LAVF 54.29.104, LSWS 2.1.101, SDL 1.2.15 | |
// on GCC 4.7.2 in Debian February 2015 |
// [src] https://github.com/ocornut/imgui/issues/123 | |
// [src] https://github.com/ocornut/imgui/issues/55 | |
// v1.22 - flip button; cosmetic fixes | |
// v1.21 - oops :) | |
// v1.20 - add iq's interpolation code | |
// v1.10 - easing and colors | |
// v1.00 - jari komppa's original | |
#pragma once |
A week ago I was CC'd in on a thread about Linux packaging, and how to avoid doing it the wrong way (i.e. RPM, Deb, etc.). I've always used MojoSetup and I've never forced distributions to do any additional work, but this is still a new concept to a lot of people. Additionally, Amos suggested that I expand on Itch's FNA appendix, so here's a guide on how I package my games.
This is a bit of an expansion on my MAGFest 2016 presentation, which you can find here:
http://www.flibitijibibo.com/magfest2016/
https://www.youtube.com/watch?v=B83CWUh0Log
I would recommend looking at that first! After that, read on...
Grab ffmpeg from https://www.ffmpeg.org/download.html
It's a command line tool which means you will have to type things with your keyboard instead of clicking on buttons.
The most trivial operation would be converting gifs:
ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm
-crf
values can go from 4 to 63. Lower values mean better quality.-b:v
is the maximum allowed bitrate. Higher means better quality.