Skip to content

Instantly share code, notes, and snippets.

View trickre's full-sized avatar
:octocat:
make make something...

Ogino Hiroaki trickre

:octocat:
make make something...
  • Chikushino-shi,Fukuoka,Japan
View GitHub Profile
@trickre
trickre / LICENSE
Created August 8, 2021 12:34
This license applies to all public gists https://gist.github.com/trickre
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@trickre
trickre / spirograph.py
Created January 17, 2018 12:57
plot Spirograph
'''
making spirograph
'''
import matplotlib.pyplot as plt
import numpy as np
def main():
#plot
raws = 1
figure = plt.figure(num=None, figsize=(10,10), dpi=80, facecolor='w', edgecolor='b')
@trickre
trickre / main_lifegame.xaml
Created December 25, 2017 14:29
lifegame's xaml
<Page
x:Class="LifeSim.MainPage"
x:Name="page_root"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:LifeSim"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:UI="using:Microsoft.Advertising.WinRT.UI"
mc:Ignorable="d" Width="750" HorizontalAlignment="Center">
@trickre
trickre / main_lifegame.xaml.cs
Created December 25, 2017 14:28
lifegame's code
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;
namespace LifeSim
{
@trickre
trickre / print_var_bits.c
Last active December 15, 2017 14:54 — forked from felipewer/print_char_bits.c
Print bits of unsigned char
//This program enable you to see bit of variable(char and int).
#include <stdio.h>
void printbits(unsigned char v) {
int i; // for C89 compatability
for(i = 7; i >= 0; i--) putchar('0' + ((v >> i) & 1));
}
void printbits_int(int v) {//for 32bit variable
//return bit reverse of x
uint32_t get_reverse(uint32_t x){
uint32_t ans = 0;
uint32_t movbit = 1;
uint32_t addbit = 0x80000000;//=0b1000...000
for(int i =0;i<32;i++){
if(((movbit<<i)&x) >0){ans = ans|addbit>>i;}
}
return ans;
}