This file contains hidden or 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
{ | |
"background": "#171717", | |
"black": "#000000", | |
"blue": "#6688AA", | |
"brightBlack": "#222222", | |
"brightBlue": "#90B0D1", | |
"brightCyan": "#87CEEB", | |
"brightGreen": "#B1D631", | |
"brightPurple": "#8181A6", | |
"brightRed": "#FF6A6A", |
This file contains hidden or 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
import pandas as pd | |
df_day1 = pd.read_csv("day1_processed.csv") | |
df_day2 = pd.read_csv("day2_processed.csv") | |
# Each has columns like: ["relative_time_s", "CPU_usage", "FPS", ...]. | |
# We assume day1["relative_time_s"]=0 at the start of Day 1's test, day2["relative_time_s"]=0 at start of Day 2's test, etc. | |
# Hypothetical times in seconds from the start of each day's recording | |
STEP_TIMES = { |
This file contains hidden or 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
# Goals | |
# Label each dataset with its day or config (e.g., “6 cores” vs. “10 cores”). | |
# Combine them into a single DataFrame (or keep them separate if you prefer). | |
# Align them by time so you can compare performance around similar test phases. | |
import pandas as pd | |
# Read each day, convert timestamp, label config | |
df_day1 = pd.read_csv("day1_raw.csv") | |
df_day1["timestamp"] = pd.to_datetime(df_day1["timestamp"]) |
This file contains hidden or 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
import pandas as pd | |
# 1. Read raw PresentMon CSV | |
df = pd.read_csv("presentmon_raw.csv") | |
# 2. Convert "TimeInSeconds" to a time-based index (Step 1) | |
df["timestamp"] = pd.to_timedelta(df["TimeInSeconds"], unit="s") | |
df.set_index("timestamp", inplace=True) | |
# ------------------ |
This file contains hidden or 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
import pandas as pd | |
# 1. Read raw CSV | |
df = pd.read_csv("raw_data.csv") | |
# 2. Convert the timestamp column to datetime (adjust column name/format as necessary) | |
df["timestamp"] = pd.to_datetime(df["timestamp"]) | |
# 3. Make the timestamp the index | |
df.set_index("timestamp", inplace=True) |
This file contains hidden or 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
import sys | |
s = input() | |
# pdb uses stdin to be interactive; this switches stdin to be the teletype interface | |
# (terminal and keyboard) after getting the redirected input | |
sys.stdin = open("/dev/tty") | |
breakpoint() |
This file contains hidden or 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
def reverse_word_order(text): | |
newText = "" | |
position = 0 | |
for t in text: | |
if t == " ": | |
newText = text[position:text.find(t, position)] + " " + newText | |
position = text.find(t, position) + 1 | |
newText = text[position:] + " " + newText |
This file contains hidden or 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
public class Kata | |
{ | |
public static string CreatePhoneNumber(int[] numbers) | |
{ | |
return long.Parse(string.Concat(numbers)).ToString("(000) 000-0000"); | |
} | |
} |
This file contains hidden or 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.Text.RegularExpressions; | |
public class Kata | |
{ | |
public static string CreatePhoneNumber(int[] numbers) => | |
new Regex("(...)(...)(....)").Replace(String.Concat(numbers), "($1) $2-$3"); | |
} |
This file contains hidden or 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
class Clock extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = {date: new Date()}; | |
} | |
componentDidMount() { | |
this.timerID = setInterval( | |
() => this.tick(), | |
1000 |