Skip to content

Instantly share code, notes, and snippets.

View kPatch's full-sized avatar
😤
Vibing

Irvin | OpenDive kPatch

😤
Vibing
View GitHub Profile
@kPatch
kPatch / ros2-mac.md
Last active May 13, 2025 04:02
ROS2 MacBook Set up
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI='<CycloneDDS><Domain><General><AllowMulticast>true</AllowMulticast></General><Discovery><ParticipantIndex>auto</ParticipantIndex><MaxAutoParticipantIndex>32</MaxAutoParticipantIndex></Discovery></Domain></CycloneDDS>'
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
echo $RMW_IMPLEMENTATION
echo 'export RMW_IMPLEMENTATION=rmw_fastrtps_cpp' >> ~/.zshrc
# setup_ros2.sh
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
# each terminal
{
"sender":"0x9f628c43d1c1c0f54683cf5ccbd2b944608df4ff2649841053b1790a4d7c187d",
"sequence_number":"0",
"max_gas_amount":"100000",
"gas_unit_price":"100",
"expiration_timestamp_secs":"1681519507",
"payload":{
"type":"entry_function_payload",
"function":"0x1::coin::transfer",
"type_arguments":[
/////////////////////////////////////////////////////////////////////////
// Header File
/////////////////////////////////////////////////////////////////////////
#pragma onc
#ifndef COMPLEXNUM_H
#define COMPLEXNUM_H
class complexNum
{
private:
/////////////////////////////////////////////
// HPP file
/////////////////////////////////////////////
class Time
{
private :
int hour;
int minute;
int second;
public :
// LAB 8
// Overview
// Field / Playing board is a 6 x 6 grid
// e.g. 2 x 2 grid is as follows
// _____
// |__|__|
// |__|__|
// We RANDOMLY place ships in a specific
// 1 ship, 1 location (coordinate)
// firing ==> specify coordinate
/////////////////////////////////////////////////////////
// LAB 10/21/2021
/////////////////////////////////////////////////////////
//
// Lab7_LineJustify.cpp
// STEP 0: Process / Take user input
// as a string
// STEP 1: Every line should be exactly 80 characters long
// OVERVIEW "Arrays"
// An Array is simple a series of element of the same type
// place in contiguous memory locations
// can be individually referenced through an index
// NOTE: the first value is referenced through index 0
// SYNTAX
// type name[elements];
// type ====> int, float, double, string, ...
// name ====> a valid name
// OVERVIEW "function"
// A group of statements (code)
// A function make code re-usable
// There's at least one function in every C++ program
// , which is the main() function
// SYNTAX (how do we define a function)
// return_type function_name( parameter list) {
// body of function
// }
@kPatch
kPatch / lab_5_bmr.cpp
Last active September 30, 2021 14:08
// OVERVIEW (bmr.cpp)
// //////////////////////////////////////////////////
// Program should calculate Base Metabolic Rate (BMR)
// Using BMR, the program should output how many cookies a person can eat
// Note: a medium-size cookie contains 150 calories
// Note: BMR formula (women) => 655 + (4.3 * weight lb) + (4.7 * height inch) - (4.7 * age in years)
// Note: BMR formula (men) => 66 + (6.3 * weight lb) + (12.9 * heigh inch) - (6.8 * age in years)
// LOGIC
// //////////////////////////////////////////////////