class Solution {
public int solution2(int n) {
// get rid of right-hand zeros
while (n != 0 && (n & 1) == 0) {
n >>>= 1;
}
System.out.println("n--->"+n);
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
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
curl -i -H "Authorization: token ${GITHUB_TOKEN}" -d '{"name": "Artificial_Intelligence", "auto_init": true, "private": true, "gitignore_template": "nanoc"}' https://api.github.com/user/repos |
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 | |
# store the current dir | |
CUR_DIR=$(pwd) | |
# Let the person running the script know what's going on. | |
echo "\n\033[1mCommitting all the latest changes for all repositories...\033[0m\n" | |
# Find all git repositories and update it to the master latest revision | |
for i in $(find . -name ".git" | cut -c 3-); do |
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 | |
# store the current dir | |
CUR_DIR=$(pwd) | |
# Let the person running the script know what's going on. | |
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
# Find all git repositories and update it to the master latest revision | |
for i in $(find . -name ".git" | cut -c 3-); do |
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 | |
#Name : download_all_github_repositories.sh | |
#Description : Clone all repos at once from GitHub for a particular user. | |
#Example : ./download_all_github_repositories.sh sm2774us [ Clone all repos for the user 'sm2774us' ] | |
#name="sm2774us" | |
access_token="63f41db90871183d7fc8cb3626a7d6bd9895d910" | |
if [ -z "$1" ]; then | |
#echo "waiting for the following arguments: username + max-page-number" |