ezoic

Friday, November 18, 2016

I finally got to know how to run a sql continuously and output the results to local driver on Netezza windows.

I am using Netezza windows to get some data from the database. The number of rows of the output exceeds 100,000 which is the limitation of the windows output on the screen.

And I tried something and find out, we can use  Workbench Command line Builder to finish it.

1. First, you open a  Workbench Command line Builder:








2. You save your SQL query in somewhere, and fill out the following, put the path of the SQL query file, output file path etc there.



3. Save the builder as CMD file:



4. You will get something containing a gear sign in the place where you save the CMD file. Double-click the sign, it will automatically run the SQL, and output the data to where you want them to be.



There are some other ways to do this. But I tested this way, and it works.

C programming language and the tutorials books.

C language is an old computer language. It is like one of the first programming languages.

dennis ritchie developed it based on B language,   and Unix.

It is old. But it is fast and efficient. Some software is still written in C, like SAS. 

Here are two tutorials of C language:

https://www.tutorialspoint.com/cprogramming/cprogramming_tutorial.pdf

http://markburgess.org/CTutorial/C-Tut-4.02.pdf

First one is shorter than second one. But the second one seems more official.

There is a book called C programming language:

https://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131103628

The c++ programming language seems more famous:

https://en.wikipedia.org/wiki/The_C%2B%2B_Programming_Language










Some suggestions that help you to write high quality python code

Some suggestions that help you to write high quality python code :

1. Using Assert
2. Using try  Exception, e
3. When swap two variables, try not to use intermediate variable.
Try this:
x,y=y,x

What Python can do

What Python can do:

1. Data analysis
2. Gaming logic programming
3. Scientific computation
4. System Ops
5. Artificial Intelligence.
6. Information security.

Thursday, November 17, 2016

The interaction between a pointer and an array in C language.

C language is an old language. It is fast and effective.

We need to know some data structures in it, such as array, struct, stack, queue, heap, hash, tree etc in C.

In C, the array starts with index 0.

And we initialize an array like below:

type_specifier array_name[size1]...[sizeN] = {value_list};

value_list is delimited by ','.

On dimension array is defined as:

type_specifier array_name[size] = {value_list};

Here is an example:

char hello[12] = {’H’,’e’,’l’,’l’,’o’,’,’,’ ’,’w’,’o’,’r’,’l’,’d’,’\0’};

'\0' is a must here. It tells C, that's an end of an array. If you define a string, you do not need the '\0'.

Equivalently, you can define equivalent string like below:

string hello = "Hello, world"

But you need to add 'string.h' at the beginning.

Or, you can declare like this:

char *hello = "Hello, world"; or char hello[] = "Hello, world";

And you got the char pointers array.  And you do not need to define the size as below:

char hello[] = {’H’,’e’,’l’,’l’,’o’,’,’,’ ’,’w’,’o’,’r’,’l’,’d’,’\0’};

You can use a loop to go through every item in an arrayL

 [...]

  int i;

  char hello[12] = {’H’,’e’,’l’,’l’,’o’,’,’,’ ’,’w’,’o’,’r’,’l’,’d’,’\0’};

  [...]

  for(i = 0; i < 12; i++){

  printf("%c",hello[i]);

  }

  printf("\n");

  [...]

One thing we need to remember, we can not make i to 12 since the index starts from 0.

sizeof(tyep_specifier)



Tuesday, November 15, 2016

Advanced SQL Programming tutorial pdf

Advanced SQL Programming tutorial pdf:



http://lsirwww.epfl.ch/courses/iis/2006ss/slides/slides-3-advancedSQL.pdf




http://indico.cern.ch/event/190324/contributions/1465900/attachments/269830/377598/SQLandAdvancedSQLmblaszczyk.pdf

http://www.nemug.com/handouts/ebtnow_AdvancedSQL_mason.pdf

There is a book called Advanced SQL programming:

https://www.amazon.com/Joe-Celkos-SQL-Smarties-Fourth/dp/0123820227








What's the fastest language?

What's the fastest language? 

C language?

Easiest one?

Python? 


A short Django tutorial

Django is a web development tool for Python. I ever worked on developing web service using python. Django might be a choice.

Here is a short tutorial for Python Django:

https://www.tutorialspoint.com/django/django_tutorial.pdf

After years of studying computer science, I got a trick, if you want to study something new, you'd better study a short tutorial of it, so at least, you will have a big picture at last. Definitely not a long one cause you will not have the time etc to finish it and got lost.  


Monday, November 14, 2016

A platform for Linux on windows

MobaXterm

http://mobaxterm.mobatek.net/





Spark and R Shiny

Spark:


Spark Tutorial from stanford

https://www.youtube.com/watch?v=E6eR4PSeFMY

https://www.youtube.com/watch?v=mL5dQ_1gkiA&spfreload=5
 


It seems that Scala, Python, Java can all be used on Spark. 


R Shiny

R 3-D 

R Shiny official tutorial 

https://www.youtube.com/watch?v=Gyrfsrd4zK0

https://www.youtube.com/watch?v=_0ORRJqctHE&spfreload=5

https://www.youtube.com/watch?v=UwwQrEcXtfc

https://www.youtube.com/watch?v=0Pw3mz6XXVs

https://www.youtube.com/watch?v=789ZcPHlg7w

https://www.youtube.com/watch?v=_aSJUPXOPos

https://www.youtube.com/watch?v=z5bUzdIbIyg

https://www.youtube.com/watch?v=Q9sRKkaNveI


etc.





How to select a windows pc on thanksgiving and quick checklist

The thanksgiving is approaching. It is a good time to find deals. Some people may want to buy a windows pc. And nowadays, windows pc are as delicate as mac almost. Brands to recommend are Thankpad t450, t460, Asus, Surface. But I checked on BestBuy, Dell, HP pcs are also very delicate and beautiful. All the pcs are similar to mac from outside.

If you want to buy a pc, there is a quick checklist:

1. make sure cpu is i5 and above.
2. RAM is  at least 8g.
3. make sure it is ssd.
4. screen is at least 1080p.

You can  set alert on dealsea or slickdeals  and try to find deals.

And you can use fatwallet to save money.

Here is an article. 

http://www.makeuseof.com/tag/a-simple-tip-that-will-save-money-with-fatwallet-slickdeals/




Friday, November 11, 2016

My job interview preparation books

My interview questions seem more difficult than other.

Here are some my interview preparation books that I refer to:

SQL:

Advanced SQL Programming:

https://www.amazon.com/Joe-Celkos-SQL-Smarties-Fourth/dp/0123820227

Probability:

Practical Guide to Quantitative Finance Interviews 

 https://www.amazon.com/Practical-Guide-Quantitative-Finance-Interviews/dp/1438236662


Coding:

https://leetcode.com/

Others statistics, problem solving:

Google.com


Data Structure and Algorithms  in Python:


https://www.amazon.com/Structures-Algorithms-Python-Michael-Goodrich/dp/1118290275

I will put more coding problems and solutions here. 














Wednesday, November 9, 2016

Create a python package (simple example)

Create a python package (simple example)

http://pythoncentral.io/how-to-create-a-python-package/




How to pratically learn python from zero: chapter four: Classes

There is a concept called OOP in computer science.It is called object-oriented programming.

Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data.

In Python, accordingly, there is a concept called 'classes', it makes the Python programming become OOP. It mainly groups some functions together and make a class. If you feel OOP is difficult to understand or something, you can interpret class to be a bunch of functions grouped together to fulfill a task etc.

Since class is a list of functions, first we need to learn to write a function in python. It has the following format:

def functionname( parameters ):
   "function_docstring"
   function_suite
   return [expression]
 
 
Here is a simple example:
 
def cal1(x,y):
     z=x+y
     return z
print cal1(5,6)
 
output:
 
11
 
Python naming convention:
 
1. Never use the characters 'l' (lowercase letter el), 'O' (uppercase letter oh), or 'I' (uppercase letter eye) as single character 
variable names.
2. Package and Module Names:
Modules should have short, all-lowercase names.  Underscores can be used in the module name if it improves readability. 
 Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.
3. Class names should normally use the CapWords convention.
     
 
Basic format of a class in python is like:
 
class ClassName:
    <statement-1>
    ......
   <statement-n>
 
And in a class, there is an instantiation operation which is for a specific initial state. Therefore a class may define a 
special method named __init__  like this: 
 
def __init__(self):
    self.data=[]

But for some of the classes, we can skip the initial steps, i.e. not include __init__ in our class. 
 
After the __init__, we can add more functions. 
 
Here is simple class called Dog:
 
class Dog:

    def __init__(self, name):
        self.name = name
        self.tricks = []    # creates a new empty list for each dog

    def add_trick(self, trick):
        self.tricks.append(trick)
 
And we can start a class instance like below:
 
d=Dog('Puppy')
And use the function in the class:
d.add_tricks('roll over')
 
And the original class will change the values:
d.tricks
['roll over']
 
  
 
    


 

Latex Manual

Latex Manual, which includes chinese tex.

http://math.ecnu.edu.cn/~latex/docs/Eng_doc/LaTeX_Manual_8_6.pdf


Linux Command Reference

Linux Command Reference:

https://courseweb.pitt.edu/bbcswebdav/institution/Pitt%20Online/MLIS_Pitt_Online/LIS%202600/Intro%20Module/LIS_2600_%20M1_Shotts%202009.pdf


Thursday, November 3, 2016

Big O notation, time and space complexity



Big O notation, time and space complexity is a very important concept on algorithm analysis.

You can first write up the programming and then analyze it and optimize it. Or, you can first design it and then write up the programming and then analyze it and optimize it. It is a back-forth problem.

Here is a good introduction:

https://www.interviewcake.com/article/java/big-o-notation-time-and-space-complexity


Space complexity:

https://people.cs.clemson.edu/~goddard/texts/theoryOfComputation/18.pdf



Here is a good youtube video on it:

https://www.youtube.com/watch?v=8mBxpDWEKNw






looking for a man

 I am a mid aged woman. I live in southern california.  I was born in 1980. I do not have any kid. no compliacted dating.  I am looking for ...