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
| // The probe's x position increases by its x velocity. | |
| // The probe's y position increases by its y velocity. | |
| // Due to drag, the probe's x velocity changes by 1 toward the value 0; that is, it decreases by 1 if it is greater than 0, increases by 1 if it is less than 0, or does not change if it is already 0. | |
| // Due to gravity, the probe's y velocity decreases by 1. | |
| void Main() | |
| { | |
| var regEx = new Regex(@"(-?\d.+)\.{2}(-?\d+),.y=(-?\d+)..(-?\d+)"); | |
| var matches = regEx.Matches(input); | |
| var minX = int.Parse(matches[0].Groups[1].Value); |
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
| // The probe's x position increases by its x velocity. | |
| // The probe's y position increases by its y velocity. | |
| // Due to drag, the probe's x velocity changes by 1 toward the value 0; that is, it decreases by 1 if it is greater than 0, increases by 1 if it is less than 0, or does not change if it is already 0. | |
| // Due to gravity, the probe's y velocity decreases by 1. | |
| void Main() | |
| { | |
| var regEx = new Regex(@"(-?\d.+)\.{2}(-?\d+),.y=(-?\d+)..(-?\d+)"); | |
| var matches = regEx.Matches(input); | |
| var minX = int.Parse(matches[0].Groups[1].Value); |
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
| /* | |
| - first 3 bits version | |
| - second 3 bits type | |
| Type = 4 LITERAL VALUE | |
| encode a single binary number. To do this, the binary number is padded with leading zeroes until its length is a multiple of four bits, and then it is broken into groups of four bits. Each group is prefixed by a 1 bit except the last group, which is prefixed by a 0 bit. | |
| Type = ther than 4 are OPERATOR | |
| If literal value | |
| rest of the value chunk by five |
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 void Main() | |
| { | |
| var board = new Board(); | |
| board.Parse(input); | |
| for (int i = 0; i < 40; i++) | |
| { | |
| $"Step {i}".Dump(); | |
| board.Step(); | |
| } |
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 void Main() | |
| { | |
| var dots = input.Split("\r\n\r\n")[0]; | |
| var instructions = input.Split("\r\n\r\n")[1]; | |
| var board = new Board(); | |
| board.Parse(dots); | |
| board.Fold(instructions); | |
| board.Print(); | |
| $"Number of visible dots after ALL instructions: {board.Points.Count()}".Dump(); |
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
| /* | |
| ): 3 points. | |
| ]: 57 points. | |
| }: 1197 points. | |
| >: 25137 points. | |
| */ | |
| void Main() | |
| { | |
| var commands = input.Split("\r\n").ToArray(); | |
| var opening = new List<char>(new[] { '(', '[', '{', '<' }); |
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
| /* | |
| */ | |
| void Main() | |
| { | |
| var bord = new Bord(); | |
| bord.Parse(input); | |
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
| ASP.NET Community Standup YouTube playlist: https://www.youtube.com/playlist?list=PL0M0zPgJ3HSftTAAHttA3JQU4vOjXFquF | |
| Run this from eg. IE console: | |
| var links = ""; | |
| [].forEach.call(document.querySelectorAll('#pl-load-more-destination > tr a.pl-video-title-link'), function(link) { | |
| links += "<a href='" + link.href + "'>" + link.innerHTML.trim() + "</a>\r\n"; | |
| }); | |
| console.log(links); |
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
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |