ezoic

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
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 

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







Tuesday, May 16, 2017

Another useful file.

Another useful file.

https://github.com/chriskiehl/Gooey/blob/master/gooey/python_bindings/config_generator.py


Python arguments, command


Python arguments, command

https://gist.github.com/olooney/8155400


Python positional arguments in chinese


Python positional arguments in chinese



https://docs.python.org.tw/3/howto/argparse.html


http://python.usyiyi.cn/python_278/library/argparse.html


Positional arguments, python

Positional arguments, python:

https://docs.python.org/2/howto/argparse.html


Python positional arguments.


Python positional arguments.

http://stackoverflow.com/questions/6892036/should-i-also-parse-mandatory-arguments-with-getopt


Python *args and **kwargs


Python *args and **kwargs :


https://pythontips.com/2013/08/04/args-and-kwargs-in-python-explained/


python argparse document

python argparse document

https://dmorgan.info/posts/argparse-intro/


Python positional argument


Python positional argument:

https://www.quora.com/What-is-a-positional-argument-in-Python-programming


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











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();
 }
}





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...