Skip to content

Instantly share code, notes, and snippets.

View andraantariksa's full-sized avatar
🦀

Andra Antariksa andraantariksa

🦀
View GitHub Profile
Programming Assignment
Quiz
Presentation
Mid Test*
Final Test*
*Maybe there or not
Additional class
Wednesday and Thursday
#include <windows.h>
#include <vector>
#include <iostream>
#include <winternl.h>
#pragma comment(lib, "Ntdll.lib")
typedef struct
_SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION_R {
LARGE_INTEGER IdleTime;
@andraantariksa
andraantariksa / sample.cpp
Created July 4, 2020 14:53
Windows Simple Socket Server Code
// From https://docs.microsoft.com/en-us/windows/win32/winsock/complete-server-code
#undef UNICODE
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdlib.h>
#include <stdio.h>
/*
** WS2TCPIP.H - WinSock2 Extension for TCP/IP protocols
**
** This file contains TCP/IP specific information for use
** by WinSock2 compatible applications.
**
** Copyright (c) Microsoft Corporation. All rights reserved.
**
** To provide the backward compatibility, all the TCP/IP
** specific definitions that were included in the WINSOCK.H
#include <LiquidCrystal_I2C.h>
#include <dht.h>
//#define SERIALPRINT 1
#define DHT_ANALOG_PIN A0
#define SOIL_MOISTURE_ANALOG_PIN A1
#define RAINDROP_ANALOG_PIN A2
// TODO
// Subtraction!
// Explanation
//
// unsigned long long int ranging from 18446744073709551615 (9 digit maximum)
// ...
// So, we choose to deal with base 1*10^9
// Uncomment this to turn off testing
Answer author note:
0b prefix means binary
0o prefix means octal
0x prefix means hexadecimal
Group Assignment (3 per group)
1. Hexadecimal conversions:
a. Convert to hexadecimal: 2345.67, Round to two digits past the hexadecimal point.
b Convert your answer to binary. and then to octal
[workspace]
name = "MyGame"
[workspace.assetmanager]
installmode = "local"
required = [
"shaderboi.coolshaders",
"shaderboi.coolshadersv2"
]
#include <SDL.h>
#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <ctime>
#include <stdexcept>
#include <vector>
@andraantariksa
andraantariksa / vorbis_decode.cpp
Created January 13, 2020 16:29
Vorbis OGG decode
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *