This file contains 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
run: main | |
./main | |
a.o: a.c | |
gcc $^ -c -o $@ | |
b.o: b.c | |
gcc $^ -c -o $@ | |
foo.a: a.o b.o |
This file contains 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
Get-Process | Where-Object {($_.Name -eq 'dwm' -and $_.PagedMemorySize64 -gt 2147483648) -or ($_.Name -eq 'YourPhoneServer' -and $_.PagedMemorySize64 -gt 1073741824)} | ForEach-Object {$_.Kill()} |
This file contains 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
impl Solution { | |
pub fn word_break(s: String, word_dict: Vec<String>) -> Vec<String> { | |
fn helper<'a>( | |
answer: &mut Vec<String>, | |
current: &mut Vec<&'a str>, | |
str: &str, | |
dict: &'a [String], | |
) { | |
if str.is_empty() { | |
answer.push(current.join(" ")); |
This file contains 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
let timezoneOffset = 8 * 60; // in minutes | |
function timeshift(date) { | |
return new Date(+date + timezoneOffset * 60000); | |
} | |
// Seconds and Milliseconds are always same as timezone offset is always multiple of 0.5 | |
for (let name of ['Date', 'Day', 'FullYear', 'Hours', 'Minutes', 'Month']) { | |
Date.prototype['get' + name] = function () { | |
return timeshift(this)['getUTC' + name](); |
This file contains 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
/* | |
* Copyright (c) 2015, Gary Guo | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* * Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* * Redistributions in binary form must reproduce the above copyright |
This file contains 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
#include <functional> | |
#include <cstdio> | |
#include <vector> | |
#include <queue> | |
#include <memory> | |
#include "Coroutine.h" | |
using norlit::coroutine::Coroutine; |
This file contains 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
#include <iostream> | |
#include <vector> | |
int main(){ | |
int length; | |
std::cin >> length; | |
int* data = new int[length]; | |
for(int i=0;i<length;i++){ | |
std::cin >> data[i]; | |
} |
This file contains 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
[bits 64] | |
[global norlit.lib.zeroinitialize] | |
[extern memset] | |
norlit.lib.zeroinitialize: | |
mov r8, rdx | |
mov rdx, 0 | |
jmp memset | |
[extern putchar] | |
[extern getchar] | |
[global main] |
This file contains 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
function wrap(num) { | |
return ' ' + num + ' '; | |
} | |
function singleStep(ans, a, b, arr, i, target, sym) { | |
arr[i] = ans; | |
return (target = calc24(arr, target)) && | |
target.replace(wrap(ans), '(' + wrap(a) + sym + wrap(b) + ')'); | |
} |
This file contains 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
#!/bin/bash | |
# vim: set ts=2 sw=2 tw=0 et : | |
# | |
# apt-cyg: install tool for cygwin similar to debian apt-get | |
# | |
# Copyright (C) 2005-9, Stephen Jungels | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 |
NewerOlder