- Laws of Reflection https://blog.golang.org/laws-of-reflection
- Goalng Blog by William Kennady https://www.ardanlabs.com/blog/
- Practicle go by Dave Chaney https://dave.cheney.net/practical-go/presentations/qcon-china.html
- Effective go (official golang blog) https://golang.org/doc/effective_go.html
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
func main() { | |
type shivangi int32 | |
var a shivangi = 3 |
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
package main | |
import ( | |
"sync" | |
"fmt" | |
"time" | |
"https://github.com/uber-go/ratelimit" | |
) | |
var prev time.Time |
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
for running mapper reducer using python streaming | |
hadoop jar /usr/local/hadoop-streaming-2.7.2.jar -input input -output output3 -mapper mapper.py -reducer reducer.py | |
copy file form one user to another: | |
sudo cp /home/USER1/FNAME /home/USER2/FNAME |
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
/usr/local/hadoop-2.8.0/bin/hadoop jar ~/Downloads/ | |
hadoop-streaming-2.8.0.jar -mapper mapper.py -reducer reducer.py -file mapper_kmeans.py -file reducer_kmeans.py -input input/cluster.txt -output output_l |
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 os | |
directory = os.path.dirname("/Users/user-name/your-directory/") | |
# directory = (os.getcwd()); | |
# print directory | |
for filename in os.listdir(directory): | |
if filename.endswith(".txt"): | |
print(os.path.join(directory, filename)) | |
continue | |
else: |
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
Open a command prompt. | |
Go to the directory where you have your .java files | |
Create a directory "build" | |
Run java compilation from the command line | |
javac -d ./build *.java | |
#if there are multiple files to be jarred or | |
javac -d ./build file_name.java |
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) install python3 (numpy has one dependency which needs python3.4 so it is better to install python3) | |
2) install pip python3: | |
sudo apt install python3-pip | |
3) install sklearn: | |
pip3 install -U scikit-learn | |
4) test on python if it is successfully installed: | |
python3 | |
from sklearn.cluster import KMeans | |
if everything is imported successfully then its cool, else it will ask to install python numpy | |
5) install python numpy |
to see the log of git commits :
git log branchname
to change a commit messsage:(not tested this)
git commit --amend
if you wish to revert the changes of a single file use this command (when you file name does not match with any of the branch names):
git checkout filename
if your file name is similar to any of your branch names the use this command:
git checkout -- filename
NewerOlder