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
| def evaluate_expression(nums, ops): | |
| r = nums[0] | |
| for i, op in enumerate(ops): | |
| if op == '+': r += nums[i + 1] | |
| elif op == '*': r *= nums[i + 1] | |
| else: r = r * (10 ** len(str(nums[i + 1]))) + nums[i + 1] | |
| return r | |
| def can_make_equation_part1(tv, nums): | |
| def try_combs(pos, ops): |
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
| def evaluate_expression_slow(nums, operators): | |
| """Evaluate expression with given numbers and operators.""" | |
| result = nums[0] | |
| for i in range(len(operators)): | |
| if operators[i] == '+': | |
| result += nums[i + 1] | |
| elif operators[i] == '*': | |
| result *= nums[i + 1] | |
| else: # '||' | |
| # Convert both numbers to strings, concatenate, then back to int |
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
| Get-Process -Name dotnet | |
| d:\devtools\sysinternals\procdump -accepteula -ma 1234 | |
| subst d: c:\temp\temp | |
| .load C:\Users\Jon Gyllenswärd\Downloads\sos.dll | |
| .cordll -I coreclr.dll -N -ve | |
| !runaway | |
| ~Xs | |
| !CLRStack -p |
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
| npm i -g azure-functions-core-tools@2.4.401 --unsafe-perm true |
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
| <?xml version="1.0"?> | |
| <log4net> | |
| <appender name="RollingFileInfoAppender" type="log4net.Appender.RollingFileAppender"> | |
| <param name="File" value="C:\\Logs\\WebLog_info_"/> | |
| <AppendToFile value="true"/> | |
| <MaxSizeRollBackups value="10"/> | |
| <MaximumFileSize value="10MB"/> | |
| <datePattern value="yyyyMMdd'.log'" /> | |
| <rollingStyle value="Composite" /> | |
| <staticLogFileName value="false" /> |
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
| Value objects are an important concept in DDD. This kata is made both to learn value objects and to learn better ways of testing. | |
| Write a probability value object. It should contain the following methods: | |
| Probability CombinedWith(Probability) | |
| Probability InverseOf() | |
| Probability Either(Probability) | |
| if you forget your probability math: | |
| Either:P(A) + P(B) - P(A)P(B) | |
| CombinedWith: P(A)P(B) |
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 PORT = 9999; | |
| var HOST = '127.0.0.1'; | |
| var dgram = require('dgram'); | |
| var server = dgram.createSocket('udp4'); | |
| server.on('listening', function () { | |
| var address = server.address(); | |
| console.log('UDP Server listening on ' + address.address + ":" + address.port); | |
| }); |
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
| param( | |
| [parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
| [string] | |
| $data, | |
| [parameter(Mandatory=$false, ValueFromPipeline=$true)] | |
| [string] | |
| $ip="127.0.0.1", | |
| [parameter(Mandatory=$false, ValueFromPipeline=$true)] |
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
| git remote -v | |
| git remote add upstream https://github.com/otheruser/repo.git | |
| git remote -v | |
| git fetch upstream | |
| git branch -va | |
| git checkout master | |
| git merge upstream/master |
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
| git fetch upstream | |
| git checkout master | |
| git reset --hard upstream/master | |
| git push origin master --force |
NewerOlder