I wrote about the solutions to some problems I found from programming and data analytics. They may help you on your work. Thank you.
ezoic
Monday, May 22, 2017
Gang of Four design patterns
tutorials:
https://www.tutorialspoint.com/design_pattern/design_pattern_tutorial.pdf
http://edeleastar.github.io/design-patterns/topic00/pdf/c-logica-gof-catalogue.pdf
book:
http://www.uml.org.cn/c++/pdf/DesignPatterns.pdf
http://www.cesarkallas.net/arquivos/livros/informatica/Gang%20Of%20Four%20-%20Design%20Patterns,%20Elements%20Of%20Reusable%20Object%20Oriented%20Software%20-%20Addison%20Wesley%20-%20Site%2051.pdf
Sunday, May 21, 2017
Some computer books for general programming design
Some computer books for general programming design:
1. Design Patterns: Elements of Reusable Object-Oriented Software
1. Design Patterns: Elements of Reusable Object-Oriented Software
2. Head First Design Patterns
3. Clean Code: A Handbook of Agile Software Craftsmanship
4. The art of unix programming.
5. The Art of Computer Programming
6. Programming: Principles and Practice Using C++
7. c++ Primer
8. Introduction to Algorithms
5. The Art of Computer Programming
6. Programming: Principles and Practice Using C++
7. c++ Primer
8. Introduction to Algorithms
Friday, May 19, 2017
Boto3 check if a s3 folder exists
https://github.com/boto/boto3/issues/134
import boto3
import botocore
client = boto3.client('s3')
result = client.list_objects(Bucket="spark", Prefix="temp/temp2/file3" )
exists=False
if result:
exists=True
print exists
https://github.com/boto/botocore/issues/680
Wednesday, May 17, 2017
Install boto3 on python ubuntu
Install boto3 on python ubuntu command:
sudo python -m pip install boto3
Tuesday, May 16, 2017
Python, arguments, options argparse
Python command line, arguments, options, argparse, docs
https://pymotw.com/2/argparse/
https://docs.python.org/2/library/argparse.html
https://docs.python.org/3/library/optparse.html
getopt
https://docs.python.org/2/library/getopt.html
https://pymotw.com/2/getopt/
Design pattern:
https://softwareengineering.stackexchange.com/questions/307467/what-are-good-habits-for-designing-command-line-arguments
http://stackoverflow.com/questions/54421/what-is-the-design-pattern-for-processing-command-line-arguments
https://pymotw.com/2/argparse/
https://docs.python.org/2/library/argparse.html
https://docs.python.org/3/library/optparse.html
getopt
https://docs.python.org/2/library/getopt.html
https://pymotw.com/2/getopt/
Design pattern:
https://softwareengineering.stackexchange.com/questions/307467/what-are-good-habits-for-designing-command-line-arguments
http://stackoverflow.com/questions/54421/what-is-the-design-pattern-for-processing-command-line-arguments
Wednesday, May 10, 2017
Thursday, May 4, 2017
Wednesday, May 3, 2017
Monday, May 1, 2017
How to install scala 2.13.0
How to install scala 2.13.0
Versions:
https://www.scala-lang.org/download/2.13.0-M1.html
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.13.0-M1.deb
sudo dpkg -i scala-2.13.0-M1.deb
sudo apt-get update
sudo apt-get install scala
List, or Array, or RDD can not be used as data type solely in class on scala
For example, such program will have error, "type List takes Type parameters".
import java.io._ class
class Point(val xc: List, val yc: List)
{ var x: List= xc var y: List = yc
def move()
{ val result=x.intersect(y)
println ("Length of intersection" + result.length);
} }
object Demo { def main(args: Array[String])
{ val pt = new Point(List("a","u","r"),List("a","q","r"));
pt.move();
}
}
You need to write something like:
import java.io._ class
class Point(val xc: List[String], val yc: List[String])
{ var x: List[String]= xc var y: List[String]= yc
def move()
{ val result=x.intersect(y)
println ("Length of intersection" + result.length);
} }
object Demo { def main(args: Array[String])
{ val pt = new Point(List("a","u","r"),List("a","q","r"));
pt.move();
}
}
import java.io._ class
class Point(val xc: List, val yc: List)
{ var x: List= xc var y: List = yc
def move()
{ val result=x.intersect(y)
println ("Length of intersection" + result.length);
} }
object Demo { def main(args: Array[String])
{ val pt = new Point(List("a","u","r"),List("a","q","r"));
pt.move();
}
}
You need to write something like:
import java.io._ class
class Point(val xc: List[String], val yc: List[String])
{ var x: List[String]= xc var y: List[String]= yc
def move()
{ val result=x.intersect(y)
println ("Length of intersection" + result.length);
} }
object Demo { def main(args: Array[String])
{ val pt = new Point(List("a","u","r"),List("a","q","r"));
pt.move();
}
}
Subscribe to:
Posts (Atom)
looking for a man
I am a mid aged woman. I was born in 1980. I do not have any kid. no complicated dating before . I am looking for a man here for marriage...
-
I tried to commit script to bitbucket using sourcetree. I first cloned from bitbucket using SSH, and I got an error, "authentication ...
-
https://github.com/boto/boto3/issues/134 import boto3 import botocore client = boto3.client('s3') result = client.list_obje...
-
Previously, I wanted to install "script" on Atom to run PHP. And there was some problem, like the firewall. So I tried atom-runner...