This variation of a clustered force layout uses D3’s circle-packing layout to initialize node positions.
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
Step 1. | |
Rename C:\code\ifrs17\.git\hooks\prepare-commit-msg.sample | |
and remove .sample | |
Step 2. | |
copy/paste the following bash script into prepare-commit-msg | |
#!/bin/bash |
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
Use /J to create a hard link pointing to a directory, also known as a directory junction: | |
mklink /J Link Target | |
e.g mklink /J C:\LinkToFolder C:\Users\Name\OriginalFolder | |
Use quotes "" around the links if the names have spaces | |
e.g. mklink /J "C:\Link To Folder" "C:\Users\Name\Original Folder" | |
source - https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/ |
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 yaml | |
a = [0, 1, ['a', 'b', 'c'], 2, 3, 4] | |
print yaml.dump(a) |
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
JavaScript's Math object provides a method for rounding to whole numbers. If we want to round to a set number of decimal places, then we have to handle that ourselves. This post doesn't get into the details of floating-point arithmetic, but the short of it is most programming languages use a binary floating-point representation which can only approximate many decimal fractions. This results in rounding errors for the most common approaches to rounding in JavaScript. | |
Rounding Errors | |
The most common solutions for rounding to a decimal place is to either use Number.prototype.toFixed(), or multiply the float by some power of 10 in order to leverage Math.round(). Both of these work, except sometimes a decimal of 5 is rounded down instead of up. | |
Number((1.005).toFixed(2)); // 1 instead of 1.01 | |
Math.round(1.005*100)/100; // 1 instead of 1.01 | |
A Better Solution | |
The rounding problem can be avoided by using numbers represented in exponential notation: |
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
url - https://forums.aws.amazon.com/message.jspa?messageID=671934 | |
You could verify that they match a regular expression that describes every access key and every secret key (the AWS Security Blog has regexes you could use), but there's no way for the SDK to check if your credentials are valid without sending a request to a service. (Otherwise, the SDK would need to ship with everyone's access keys embedded in its source.) | |
If you do make a call to a service, though, the remote service will be able to validate your credentials and respond accordingly. If you call $s3Client->listBuckets() before calling $s3Client->registerStreamWrapper(), the client will call the service and convert the error to an exception if your credentials are invalid. |
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
url - https://aws.amazon.com/blogs/security/a-safer-way-to-distribute-aws-credentials-to-ec2/ | |
Finding hard-coded credentials in your code | |
Hopefully you’re excited about deploying credentials to EC2 that are automatically rotated. Now that you’re using Roles, a good security practice would be to go through your code and remove any references to AKID/Secret. We suggest running the following regular expressions against your code base: | |
Search for access key IDs: (?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9]). In English, this regular expression says: Find me 20-character, uppercase, alphanumeric strings that don’t have any uppercase, alphanumeric characters immediately before or after. | |
Search for secret access keys: (?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=]). In English, this regular expression says: Find me 40-character, base-64 strings that don’t have any base 64 characters immediately before or after. | |
If grep is your preferred tool, run a recursive, Perl-compatible search using the following commands |
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
var a = function(y) { | |
var z = 1; //shared between instances, accessible via prototype method | |
var x = 2; //shared between instances | |
var self = this; | |
this.y = null; //not shared | |
var impl = function(y) { | |
}; | |
var init = function(y) { |
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
*** 1. Remove --no-act for run the commands for real. | |
*** 2. Find out the range of your kernel version numbers and replace the numbers below. e.g. {start..end} | |
Finding out versions: | |
dpkg -l | grep linux-image | |
Purging the images: | |
sudo dpkg -P --no-act --force-depends linux-image-3.13.0-{32..46}-generic | |
sudo dpkg -P --no-act --force-depends linux-image-extra-3.13.0-{32..46}-generic | |
sudo dpkg -P --no-act --force-depends linux-headers-3.13.0-{32..46}-generic |
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
app.directive("child", function() { | |
return { | |
... | |
require: ["^parent", "child"], | |
link: function(scope, elem, attrs, ctrls) { | |
var parentController = ctrls[0], | |
childController = ctrls[1]; | |
childController.setParent(parentController); | |
}, |
NewerOlder