Skip to content

Instantly share code, notes, and snippets.

@mikigom
mikigom / client.py
Created May 12, 2025 08:01
Websocket Multiple Session
import asyncio
import websockets
import sys
# 로깅 설정 (클라이언트 측에서도 필요시 사용)
# import logging
# logging.basicConfig(level=logging.INFO)
async def send_messages(websocket):
"""

Most Extreme Difference Albums

Top-20 Most Overrated Albums

Rank Album Artist Release Date Pitchfork's Score (Z-score) Others' Score (Z-score) Z-score Difference
1 Orbits Starkey Dec 4, 2012 80.0 (0.82) 50.0 (-1.68) +2.50
2 Blueberry Boat The Fiery Furnaces Jul 13, 2004 96.0 (2.14) 69.1 (-0.16) +2.30
3 Star Wars Headspace Various Artists Mar 18, 2016 69.0 (-0.09) 42.0 (-2.25) +2.16
4 Kid A Radiohead Oct 3, 2000 100.0 (2.47)
import numpy as np
from sklearn.metrics import roc_auc_score
n_class_0 = 50000
n_class_1 = 100
def main():
# Suppose imblanced classification dataset
labels = n_class_0 * [False] + n_class_1 * [True]
y_true = n_class_0 * [0] + n_class_1 * [1]
import ogr
import osr
high_ref = osr.SpatialReference()
low_ref = osr.SpatialReference()
coord_topleft = pixel2coord(high_res_raster, (col_high_res, row_high_res))
high_ref.ImportFromWkt(high_res_raster.GetProjection())
low_ref.ImportFromWkt(low_res_raster.GetProjection())
@mikigom
mikigom / tf_bilinear_additive_upsampling.py
Created July 24, 2017 10:41
Tensorflow Implementation of Bilinear Additive Upsampling
import tensorflow as tf
"""
Author : @MikiBear_
Tensorflow Implementation of Bilinear Additive Upsampling.
Reference : https://arxiv.org/abs/1707.05847
"""
def bilinear_additive_upsampling(x, to_channel_num, name):
from_channel_num = x.get_shape().as_list()[3]
assert from_channel_num % to_channel_num == 0

Task 1) Pintos Thread System

1. How the switching between threads occur?

schedule() is responsible for switching threads in threads/thread.c.

static void
schedule (void) 
{
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct nameTag{
char fname[20]; char lname[20];
};
struct nameTag * wrong_getname(void){
struct nameTag newname;
import tensorflow as tf
slim = tf.contrib.slim
class Unet(object):
def __init__(self, input, class_num, reuse = False):
self.input = input
self.reuse = reuse
self.class_num = class_num
self.build_model()
module multiplexer(Y, A, B, C, D);
output Y;
input A, B, C, D;
assign Y = (A&B)|(C&D);
endmodule
module D_ff(Q, CLK, D);
output Q;
input CLK, D;
import subprocess
import unittest
import sys
import filecmp
bash_call = './' + sys.argv[1]
def subprocess_pipe(cmd_list):
prev_stdin = None
last_p = None