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
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 |
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
''' | |
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') |
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
<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"> |
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
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 | |
{ |
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
//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 |
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
//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; | |
} |