Skip to content

Instantly share code, notes, and snippets.

@orontee
orontee / machine-desc_light.json
Created October 26, 2017 12:13
Packer log and files for amazon-ebsvolume failure
{
"description": "Sample for debug",
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"region": "eu-west-1"
},
"builders": [
{
"type": "amazon-ebsvolume",
;;; mule-cmds.el --- commands for multilingual environment -*-coding: iso-2022-7bit -*-
;; Copyright (C) 1997-2013 Free Software Foundation, Inc.
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H14PRO021
;; Copyright (C) 2003
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H13PRO009
@orontee
orontee / lexarith.py
Last active December 27, 2015 14:09
Arithmetic expressions lexer and parser
import argparse
import operator
sym_tokens = {'unary_operators': (r'+', r'-'),
'binary_operators': (r'+', r'-', r'*', r'/'),
'grouping_open': (r'(',),
'grouping_close': (r')',)}
semantic = {'binary_operators': {r'+': operator.add,
r'-': operator.sub,
(add-to-list 'electric-layout-rules '(123 . before))
#include <iostream>
int main()
{
float f(32767); // 32768
signed short sshf = static_cast<signed short>(f);
signed short rshf = *(reinterpret_cast<signed short*>(&f));
std::cout << "As float: "
<< f << " (" << sizeof(float) << ")\n"
#include <iostream>
const float GAIN(1.5);
void
multiply(float *f)
{
(*f) *= GAIN;
}
#include <iostream>
#include <cstring>
const int ARRAY_SIZE = 2000;
int main()
{
float *const a = new float[ARRAY_SIZE];
std::memset(a, 0, ARRAY_SIZE * sizeof(float));
#include <iostream>
bool false_val;
bool other_false_val(); // Function declaration, its value will translated to false...
bool other_other_false_val = bool();
int main()
{
bool true_val();
bool val;
#include <iostream>
bool false_val;
bool other_false_val = bool();
int main()
{
bool true_val();
bool val;
@orontee
orontee / test.c
Created September 25, 2013 09:14
int
with_signed (int arg)
{
return arg/64;
}
unsigned
with_unsigned (unsigned arg)
{