Skip to content

Instantly share code, notes, and snippets.

View Mooophy's full-sized avatar
😏

Yue Wang Mooophy

😏
  • Auckland, New Zealand
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
public class Program
{
@Mooophy
Mooophy / 2014s3.cs
Created June 18, 2015 04:11
2014s3 q4
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Reflection.Emit;
#include <iostream>
#include <vector>
#include <tuple>
#include <algorithm>
std::pair<int, int> max_min(int lhs, int rhs)
{
return lhs > rhs ? std::make_pair(lhs, rhs) : std::make_pair(rhs, lhs);
}
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#define NUM_THREADS 1
// The function executed by each thread
void *PrintHello(void *threadid)
{
// Print greeting with thread ID info
auto optval = 1;
setsockopt(soc, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof optval);
auto bind_result = bind(soc, (struct sockaddr *)&my_addr, sizeof(my_addr));
if (bind_result != 0)
printf("%d\n", errno);
/***************************************************************************
* @file main.cpp
* @author Alan.W
* @date 11 Mar 2014
* @remark This code is for the exercises from C++ Primer 5th Edition
* @note
***************************************************************************/
//!
//! Exercise 18.1:
//! What is the type of the exception object in the following throws?
np.percentile([1,2,3,4,5,6,7,8,9,10], 50)
#5.5
np.percentile([1,2,3,4,5,6,7,8,9,10], 25)
#3.25
np.percentile([1,2,3,4,5,6,7,8,9,10], 75)
#7.75
# from https://leetcode.com/problems/range-sum-query-immutable/
class NumArray(object):
def __init__(self, nums):
self.sums = []
sum = 0
for num in nums:
sum += num
self.sums.append(sum)
#include <string>
#include <iostream>
#include "dll.h"
#include "aes.h"
using CryptoPP::AES;
#include "modes.h"
using CryptoPP::CBC_Mode;
<?php
date_default_timezone_set ("Pacific/Auckland");
$url = 'https://wholesale.layer2.co.nz/api/login';
$content = array('username' => 'omnitech.b2b', 'password' => 'Omnit3ch1119');
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n} ",
'method' => 'POST',
'content' => http_build_query($content),