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
| # Only for Chef client 11 family! | |
| # Bug was fixed in https://github.com/opscode/chef/commit/d6f6928fd1097709189cd78689e89032d4c9318d | |
| class Chef | |
| module Mixin | |
| module ShellOut | |
| def shell_out(*command_args) | |
| cmd = Mixlib::ShellOut.new(*run_command_compatible_options(command_args)) | |
| cmd.live_stream ||= io_for_live_stream | |
| cmd.run_command |
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
| var canvas=document.getElementById("canvas"); | |
| var ctx=canvas.getContext("2d"); | |
| var width=canvas.width=window.innerWidth; | |
| var height=canvas.height=window.innerHeight; | |
| var n=100; | |
| var xMin=-10; | |
| var xMax=10; | |
| var yMin=-10; | |
| var yMax=10; | |
| window.onload=function(){ |
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
| var canvas=document.getElementById("canvas"); | |
| var ctx=canvas.getContext("2d"); | |
| var width=canvas.width=window.innerWidth; | |
| var diff=Math.PI/6; | |
| height=canvas.height=window.innerHeight; | |
| function line(x1, y1, x2, y2) { | |
| ctx.beginPath(); | |
| ctx.strokeStyle='#abcdef'; | |
| ctx.moveTo(x1, y1); | |
| ctx.lineTo(x2, y2); |
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
| var canvas = document.getElementById("canvas"); | |
| var ctx = canvas.getContext("2d"); | |
| var width = canvas.width = window.innerWidth; | |
| var height = canvas.height = window.innerHeight; | |
| var centerX = height / 2; | |
| var diff = Math.PI / 3; | |
| var trunk = 100; | |
| function line(x1, y1, x2, y2) { | |
| ctx.beginPath(); |
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
| var cols, rows; | |
| var w = 5; | |
| var grid = []; | |
| var stack = []; | |
| current = grid[0]; | |
| function index(i, j) { | |
| if (i < 0 || j < 0 || i > cols-1 || j > rows-1) { | |
| return -1; | |
| } | |
| return i + j * cols; |
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
| var canvas=document.getElementById("canvas"); | |
| var ctx=canvas.getContext("2d"); | |
| var width=canvas.width=window.innerWidth; | |
| var height=canvas.height=window.innerHeight; | |
| var w=20; | |
| var x=100; | |
| var y=100; | |
| window.onload=function(){ | |
| ctx.beginPath(); |
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 Solution { | |
| private int[][] dp; | |
| public boolean isInterleave(String s1, String s2, String s3) { | |
| if (s1.length() + s2.length() != s3.length()) { | |
| return false; | |
| } | |
| if (s3.length() == 0) { | |
| return true; | |
| } | |
| dp = new int[s1.length()][s2.length()]; |
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
| C++: | |
| class Solution { | |
| public: | |
| vector<vector<int> > generateMatrix(int n) { | |
| // Start typing your C/C++ solution below | |
| // DO NOT write int main() function | |
| if(n<=0) return vector<vector<int>>(); | |
| vector<vector<int>> result(n,vector<int>(n)); | |
| int xBeg=0,xEnd=n-1; | |
| int yBeg=0,yEnd=n-1; |
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
| C++: | |
| class Solution { | |
| public: | |
| vector<vector<int> > generateMatrix(int n) { | |
| // Start typing your C/C++ solution below | |
| // DO NOT write int main() function | |
| if(n<=0) return vector<vector<int>>(); | |
| vector<vector<int>> result(n,vector<int>(n)); | |
| int xBeg=0,xEnd=n-1; | |
| int yBeg=0,yEnd=n-1; |
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
| <html> | |
| <head> | |
| <script type="text/javascript"> | |
| window.onload = draw; | |
| function draw(){ |