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
import java.io.*; | |
import java.util.*; | |
import java.text.*; | |
import java.math.*; | |
import java.util.regex.*; | |
public class Solution { | |
public static void main(String args[] ) throws Exception { | |
int[][] input = new int[][]{ |
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
// Physical memory allocator, intended to allocate | |
// memory for user processes, kernel stacks, page table pages, | |
// and pipe buffers. Allocates 4096-byte pages. | |
#include "types.h" | |
#include "defs.h" | |
#include "param.h" | |
#include "memlayout.h" | |
#include "mmu.h" | |
#include "spinlock.h" |
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
{'_node': 'spore-print-color', | |
'decisions': [['k', | |
{'_node': 'gill-size', | |
'decisions': [['n', | |
{'_node': 'population', | |
'decisions': [['s', {'label': 'p'}], | |
['v', | |
{'_node': 'cap-surface', | |
'decisions': [['y', | |
{'label': 'p'}], |
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
class Solution { | |
public int[] findDiagonalOrder(int[][] matrix) { | |
if (matrix.length == 0) { | |
return new int[0]; | |
} | |
int m = matrix.length, n = matrix[0].length; | |
int[] result = new int[m*n]; | |
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
docker run -it --rm --name certbot \ | |
-v "/etc/letsencrypt:/etc/letsencrypt" \ | |
-v "/var/lib/letsencrypt:/var/lib/letsencrypt" \ | |
-p 80:80 \ | |
certbot/certbot certonly |
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
FooMixin = Ember.Mixin.create({ | |
init: function () { | |
this._super(); // This will call Em.Object#init in the super chain | |
console.log('FooMixin#init'); | |
} | |
}); | |
BarMixin = Ember.Mixin.create({ | |
init: function () { | |
this._super(); // This will call FooMixin#init in the super chain |
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
from celery import shared_task, chord, chain, group | |
@shared_task() | |
def workflow_test(*args, name="", time=2): | |
print('name [%s] %s' % (name, args)) | |
sleep(time) | |
return name | |
chord( | |
header=group( |
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
-- The C compiler identification is AppleClang 8.0.0.8000042 | |
-- The CXX compiler identification is AppleClang 8.0.0.8000042 | |
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc | |
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works | |
-- Detecting C compiler ABI info | |
-- Detecting C compiler ABI info - done | |
-- Detecting C compile features | |
-- Detecting C compile features - done | |
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ | |
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works |
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
########################### | |
# Configuration | |
########################### | |
# use 256 term for pretty colors | |
set -g default-terminal "screen-256color" | |
# increase scroll-back history | |
set -g history-limit 5000 |
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
def rotate(row, angle, dim1, dim2): | |
radian = angle * pi / 180. | |
cos_alpha, sin_alpha = cos(radian), sin(radian) | |
x, y = row[dim1], row[dim2] | |
row[dim1] = cos_alpha * x - sin_alpha * y | |
row[dim2] = sin_alpha * x + cos_alpha * y | |
return row | |
def cartesian_to_spherical(x, y, z): |