ezoic

Wednesday, December 28, 2016

Install c/c++ compiler on ubuntu

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential 

It works on my ubuntu.

To compile c program

gcc -o hello1 hello1.c

To compile c++ program

g++ -o hello2 hello2.cpp


How to install scala and sbt on ubuntu

Install scala

sudo apt-get update
sudo apt-get install scala

There may need to install some dependencies.


To install sbt

echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt

How to install Java on ubuntu

How to install Java by ubuntu, step by step:

https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get

It works on my ubuntu.


Friday, December 23, 2016

Linux mint seems to be a good OS

Linux mint seems to be a good OS

https://www.linuxmint.com/

https://en.wikipedia.org/wiki/Linux_Mint

And this girl recommended it

https://www.youtube.com/watch?v=7G7TJyZPKPo

She has a good channel for Linux etc.

https://www.youtube.com/channel/UCBE-FO9JUOghSysV9gjTeHw



10 best youtube channels to learn programming and coding

10 best youtube channels to learn programming and coding:

https://techxerl.net/10-best-youtube-channels-to-learn-programming/


Job and interviews, referral etc

Job and interviews, referral, practicing etc.

https://www.interviewbit.com/


OOP for beginners in PHP

OOP for beginners in PHP

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


Learn python in one video

Learn python in one video. It is for Python 3.X version. It is good.

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


C programming step by step

-std=gnu99

to compile below, we need to use
 gcc -o 9th 9th.c -std=gnu99

since test is initialized in the for loop

#include <stdio.h>

void main ()
{
for ( int  test=10;test>0;test=test-2)
{printf("test=%d\n",test);
}}

There are some other c compile options, like previously we mentioned -lm.  

Apache Spark big data tutorial

Apache Spark big data tutorial

http://researcher.ibm.com/researcher/files/il-SHELLY/HUJISparkShelly.pdf




Apache Spark API by examples.

Apache Spark API by examples. Seems to be a good one.

http://homepage.cs.latrobe.edu.au/zhe/files/SparkAPIMaster.pdf




I found an interesting website, there are some primers to some language.

I found an interesting website, there are some primers to some language.

It has primers to several languages, C, awk, html, shell etc

http://vc.airvectors.net/idx_smap.html


The primers are concise, and full of examples.

Here is the C primer. I mainly read it currently.

http://vc.airvectors.net/tscpp.html


Analysis of algorithms

Analysis of algorithms can be divided into two parts, time complexity analysis and space complexity analysis.

time complexity

in computer science , the time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the string representing the input.



space complexity 

Space complexity is a measure of the amount of working storage an algorithm needs. That means how much memory, in the worst case, is needed at any point in the algorithm. As with time complexity, we're mostly concerned with how the space needs grow, in big-Oh terms, as the size N of the input problem grows.

Here are two examples for space complexity analysis

               int sum (int a[], int n)
              { int r=0;
                for ( int i=0; i<n; ++i)
              { r+=a[i];
              }
               return r;
              }

requires N units for a, plus space for nr and i, so it's O(N).

            int sum( int x, int y, int z)
              { int r=x+y+z;
                 return r;
               }


requires 3 units of space for the parameters and 1 for the local variable, and this never changes, so this is O(1).


And mainly you do the counting when analyzing the algorithms

This video showed it:


Here is a gentle guide



How to learn to code

How to learn to code. This video told us, there were five steps.

https://www.youtube.com/watch?v=1uEUTijqoE0


1. Pick one language and stick to it. Most ppl suggest python. It is concise. But the youtuber said that she would have picked javascript.

2. Find free tutorials online

On youtube her favorite is Jake wright and derek banas

codecademy and the odin project

3. dedicate one hour/day of coding.

4. Join coding community online

her favorite on reddit,  learn programming, webdesign. webdev, learn javascript, programmer humor.

5. Build things from what you learn.

My year-end pc laptop purchase experience and installing ubuntu on Asus laptop etc

I bought a laptop pc at the end of 2016.  My experience. told me one thing


Do not buy PC during black Friday that period. Usually during that period, you won't get best deal. Sometimes, sometime after that period, you can get better deal. Like this year, there was a microsoftstore 12 days of deal in Dec. One can get some good deal then. Like some good dell or asus under $500

Another thing is that SSD is much better than HDD cause HDD pc can make some noise, and not so stable.

And I tried to install ubuntu on Asus. One problem is that it is hard to get the boot option 1 to be usb. I turned the secure boot to be disabled, and enable CSM, and switched between f2 and f10. And I finally boot from usb to get the ubuntu installed.

And I first installed ubuntu 16.04. There was some problem with 16.04. There was no sound. And I did a lot of things to make the laptop sound. And still some bug there.

So, I switched ubuntu 14.04. It is better. There was sound when I just  installed it.

Tuesday, December 20, 2016

Python editions and python 2.7 tutorials

Currently, Python has two versions, one is the standard 2.7.13 version. Currently, in industry, 90% of the python scripts are written in 2.7.X. And one is 3.5.2. It is the newest version.

You can get the two versions from here:

https://www.python.org/downloads/

I mainly use 2.7.13 version. There are more libraries modules there.

Here are some python 2.7 tutorials:

https://www.youtube.com/watch?v=UQi-L-_chcc&list=PLA175E8A1816CD64B








C programming step by step

I am learning C language currently.

Here is a full c programming tutorial:

https://www.youtube.com/watch?v=-CpG3oATGIs&t=2s

This is a quite good one.

A simple hello world c program  is like this:

#include <stdio.h>

int main () {

printf("Hello World! \n");

return 0;

}

Then to compile it:

gcc hello.c -o hello

To run;

./hello

If you want to have some math function, you need to add math.h



#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main() {
const double a=3.1;
double b;
b=cos(a);
printf("%f \n",b);
return 0;
}
To compile it:
gcc -o 5th 5th.c -lm


i.e. you need to add -lm in the end. 








Two lists of top tutorials for C and Python respectively

Two lists of top tutorials for C and Python respectively:

1. Python:

http://www.fromdev.com/2014/03/python-tutorials-resources.html

2. C:

http://www.fromdev.com/2013/10/c-programming-tutorials.html

Two good references.


Sunday, December 18, 2016

cmder, a better command promt

cmder, a better command prompt:



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

Can download from here:

http://cmder.net/






Top 4 best websites to learn programming


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

The above website shows top 4 best websites to learn programming

1. https://teamtreehouse.com/
2. https://www.codeschool.com/
3. https://www.codeavengers.com/
4.  https://www.codecademy.com/


There is another one that I found is good:

https://www.udemy.com/








Which computer programming language to learn first

Which programming language to learn first:


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

The above video showed which programming language to learn first. The answer is Python since it is simple. And he said we needed to avoid some difficult language like c, c++, c# , any of the c language  at the beginning. Their syntax difficulty level is high.


Thursday, December 15, 2016

Python tutorial for beginners, in one video. top 10 languages to learn in 2017

Python tutorial for beginners:

1:
https://www.youtube.com/watch?v=cpPG0bKHYKc

2:

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

3:

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

4:

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



Python tutorial in one video:

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

Top 10 languages to learn in 2017

https://www.youtube.com/watch?v=-UlRoUNl0H8




Some tip for choosing laptop on holiday season

Two trusty places for getting PC laptop are:

http://www.bestbuy.com/

https://www.microsoftstore.com/store/msusa/en_US/home

And microsoft store is having their 12 days of deals.


https://www.microsoftstore.com/store/msusa/en_US/cat/PC-sale/categoryID.69325700?icid=en_US_homepage_hero_1_12DD_Day11_161215

Some deals can be as cheap as $399. It is a deal.

The PC deals come fast and go away fast. Some deals , they stay at the price for one day, and later, the prices go up. You need to catch the deals. Some deals of  laptops on slickdeals are really that low. They later on raised the prices. I thought they gave the wrong deals. No. Deals won't last long. Prices go up after several days.






Linux distributions and where to download their ISO

One crucial thing for installing Linux is to install their ISO. Here is a list of Linux distributions and where to get their ISO.

1. Red Hat

ISO:

https://www.redhat.com/wapps/store/catalog.html



2.Ubuntu

ISO:

https://www.ubuntu.com/download/alternative-downloads





3.Debian


ISO:

http://www.debian.org/CD/http-ftp/






4. CentOS

ISO:

https://www.centos.org/download/



5. Linux Mint

ISO:

https://www.linuxmint.com/download.php

How to on youtube:

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






Here are some other Linux:

http://linuxlookup.com/linux_iso






To get chat room on ICQ

To get chat room on ICQ :


https://www.youtube.com/watch?v=shFZ9yl0VLY&app=desktop


Another chat IRC:

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



Ubuntu can be installed on both HDD and SSD computers, for dual boot, better use the bootlaoders to install ubuntu

Ubuntu can be installed on both HDD and SSD computers. And for dual boot, better use the bootlaoders to install ubuntu

On my old laptop, I installed ubuntu there. And it was dual boot.  When I turn on the computer, I will see the screen:


Here is the full video. They used bootloader, grub.

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


You can select which one to use, windows or ubuntu.

But I tried this one

https://www.youtube.com/watch?v=K3lxFlM-3Rw

And for some reason, I can not dual boot between windows and ubuntu.

I am trying to fix it.

So to get dual boot, better try bootloaders, guru, Unetbootin etc.

I posted the link before:

https://builtvisible.com/the-ubuntu-installation-guide/#Install-from-USB

They used Unetbootin. In summary, there are a few steps:

1. format the usb to fat32 (right click the usb)
2. download ubuntu iso file:

Here are all version of Ubuntu iso including the latest one:

https://www.ubuntu.com/download/alternative-downloads

3. Download Unetbootin or Grub2:

https://unetbootin.github.io/

4. Install ubuntu
On some newer pc, you need to turn off secure boot before installing linux. You can restart your computer and go to set up screen ( I pressed f12 when the my pc is turning on)

follow the steps to install ubuntu:

https://builtvisible.com/the-ubuntu-installation-guide/#Install-from-USB

And restart, you can choose which one to use, ubuntu or windows:














Bloomberg live is a good place to get news etc

https://www.bloomberg.com/live

Bloomberg live, they have all kinds of news, bloomberg west etc.

Fox tech news etc is a good source for etch news too.

And google tech news:

https://news.google.com/news/section?ned=us&topic=t






Wednesday, December 14, 2016

here are two useful videos for booting, installing, ubuntu

here are two useful videos for booting, installing,  ubuntu:



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

https://www.youtube.com/watch?v=K3lxFlM-3Rw






Unetbootin and grub are two bootloaders for installing ubuntu, the key of install ubuntu is to download IOS desktop

To install ubuntu on your computer, you can use USB and bootloaders.

Unetbootin and grub are two bootloaders.

Here are a list of bootloaders.


http://www.tecmint.com/best-linux-boot-loaders/

And the key to install ubuntu is to download IOS desktop first:

https://www.ubuntu.com/download/desktop

Hit the first "download" on the webpage. Save the IOS somewhere.



And here is a complete article on how to install ubuntu:

http://www.howtogeek.com/214571/how-to-dual-boot-linux-on-your-pc/

From there, we can learn, we need to disable secure boot before installing linux.






Youtube is one of the best free ways to learn programming etc

Youtube is one of the best free ways to learn programming etc.

There is one saying, reading is always profitable. If you want to learn something like a computing language, you need to learn and read, watch something carefully at beginning. And you can learn a lot of tips from there. One free source for this is youtube. You can learn some tips from there by watching a video. The tips even seem new for someone who uses the language for a long time.

Below is an R video. I watched it thoroughly. I use R for a long time. I still learned some new tips from there. Some tip like

1. Use the script editor, use  the tile thing vertically,
2.drag the file directory to console,
3.set working directory,
4.the 'Run' shortcut button,
5.check to see if the data was loaded correctly  using fix, str ,
6. control + L to clean the screen.

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



Tuesday, December 13, 2016

A tip for making powerpoint slides

Here is a tip for making powerpoint slides:

Try to use pic as much as possible and try to be concise on words as much as possible.

In a presentation, people usually can not pay a lot of attention to your slides especially if there are a lot of words on the slides. If you pic more pics there, compared to words, pics make it easier for people to  understand fully  at one glance. And pics are more attractive than words. Too many words may make people feel dizzy and sleepy.


Friday, December 9, 2016

SSD and HDD comparison

SSD and HDD comparison:

http://www.pcmag.com/article2/0,2817,2404258,00.asp


The data science area trends

Currently the data positions in industry is thriving. Some companies like insurance companies, IT companies, some hospitals, they all have Data Analyst/data Science positions.

This area is changing. Some new things/techs appear from time to time. Currently, they focus on Big Data ( hadoop, spark), and machine learning ( including deep learning).

Here are some sample questions for a data position, we can see the trends of this area:

1. Project introduction
2. Probability questions (Bayes formula)
3. Machine learning concepts, over-fitting, theory of SVM, evaluation of a model, optimization-Gradient descent
4. Reservoir Sampling

https://gregable.com/2007/10/reservoir-sampling.html

5. deep learning, and how to practice
6. Big data,    implement kmeans using hadoop
7. Intersections of two linked lists


The interview questions are becoming more and more difficult. And it follows the trends in the area. 


the windows PCs are more delicate and beautiful

the windows PCs are more delicate and beautiful. They look more like Mac:





Thursday, December 8, 2016

Suggestions for green hand to buy a new good laptop

Assuming you are a green hand on buying laptop, and you want to buy a good and new laptop.

Here are some of my experience and suggestion on buying good and new laptop.

First make sure the laptop has most of the things on laptop selection checklist

1. SSD
2. core i5 or core i7
3. at least 8gb memory
4 1080p screen


And two suggested windows laptops brands  are ASUS, and surface

If you are a green hand, do not have much experience on selecting laptop, you can try some trusty  websites for PC laptop:

http://www.bestbuy.com/


https://www.microsoftstore.com/

If you want to buy something cheaper, you can focus on their deals, sales etc.

Some other websites like below are also ok.

http://www.costco.com/

http://www.staples.com/

http://www.frys.com/

Or you can go to manufacturers' websites to buy, like dell, hp etc their websites, to buy.

If you are a green hand, you'd better not go some websites like amazon, ebay yourself  to buy laptops. dealsea, slickdeals sometimes suggest some deals from amazon, ebay. That kind of deals are usually trusty. But other than that, if you are a green hand, if you want to buy a new and good laptop, do not go to amazon, ebay to select laptop yourself, you may go to some traps there. But dealsea, slickdeals' suggestions on ebay, amazon are usually ok, especially dealsea.  On slickdeals sometimes, their prices on the lists are not the true prices of the laptops, i.e. when you click the deals on sellers' websites, the prices may be higher than they are shown on slickdeals.

All in all, if you are a green hand, if you want to buy new and good laptop, usually go to bestbuy, or microsoft store to buy, that's the safest way. I once liked a laptop on bestbuy, but I decided to find other things on other websites. But finally, I find the sale on bestbuy is still good compared to laptops from other websites.















Wednesday, December 7, 2016

Most of the big data tools are open source and they can be installed on your computer

Most of the big data tools are open source and they can be installed on your computer.

But, you need to install Linux first:

http://easyprog99.blogspot.com/2016/04/one-way-to-install-linux-on-your-pc.html

http://linux-training.be/linuxfun.pdf

Then you can install hadoop on your linux on your computer:

http://www.bogotobogo.com/Hadoop/BigData_hadoop_Install_on_ubuntu_single_node_cluster.php

Install Spark on linux:

http://blog.prabeeshk.com/blog/2014/10/31/install-apache-spark-on-ubuntu-14-dot-04/

Install Flink on Linux:

https://ci.apache.org/projects/flink/flink-docs-release-0.8/setup_quickstart.html

Install Storm on Linux:

http://opensourceeducation.net/how-to-install-and-configure-apache-strom

Install Mongodb on Linux:

https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04

Install Hbase on Linux:

http://www.hadooptpoint.com/hbase-installation-on-linux-ubuntu/


















What's unstructured data, and how it works

What's unstructured data, and how it works .

Unstructured data is a generic label for describing data that is not contained in a database or some other type of data structure. Unstructured data can be textual or non-textual. Textual unstructured data is generated in media like email messages, PowerPoint presentations, Word documents, collaboration software and instant messages. Non-textual unstructured data is generated in media like JPEG images, MP3 audio files and Flash video files.

Mongdb and Hbase are two systems for unstructured data.


https://www.mongodb.com/scale/unstructured-data-in-big-data


https://hbase.apache.org/poweredbyhbase.html


And there is a new concept, NoSQL:


https://www.mongodb.com/nosql-explained


A NoSQL (often interpreted as Not only SQL) database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Motivations for this approach include simplicity of design, horizontal scaling, and finer control over availability.

http://nosql-database.org/



Mongodb is a NoSQL database. And it is for unstructured data.






Big data systems and the tools




See the above pics. We have Mongo, Hadoop, dhfs on the back, and the Spark, Flink, Storm, Hive in the front.

Spark:

http://spark.apache.org/


Flink:


https://flink.apache.org/


Storm:


http://storm.apache.org/

Hive:

https://hive.apache.org/


And for back, we can have Mongodb, Hadoop, Hbase:


Mongodb:


https://www.mongodb.com/community/licensing


Hadoop:

http://hadoop.apache.org/

Hbase:

https://hbase.apache.org/


If you want to use them on your computer , first of all, you need to install linux on your computer:

http://easyprog99.blogspot.com/2016/04/one-way-to-install-linux-on-your-pc.html















Tuesday, December 6, 2016

A relative new concept, deep learning

Deep learning is a relatively new concept for data area.

Deep learning (also known as deep structured learning, hierarchical learning or deep machine learning ) is a branch of machine learning based on a set of algorithms that attempt to model high level abstractions in data. In a simple case, you could have two sets of neurons: ones that receive an input signal and ones that send an output signal. When the input layer receives an input it passes on a modified version of the input to the next layer. In a deep network, there are many layers between the input and output ( and the payers are not made of neurons but it can help to think of it that way), allowing the algorithms to use multiple processing layers, composed of multiple linear and non-linear transformations. 

Here are  two deep learning examples:



Deep learning tutorials:

















A more official C tutorial

A more official  C tutorial. Relatively long, 410 pages.


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




What's Apache Spark, and how it works II

First two Apache Spark Tutorials:

http://www.cloudera.com/documentation/enterprise/5-6-x/PDF/cloudera-spark.pdf

https://www.tutorialspoint.com/apache_spark/apache_spark_tutorial.pdf

Spark works on Big data. It is Open Source.

Here is how to install Spark on Ubuntu:

http://blog.prabeeshk.com/blog/2014/10/31/install-apache-spark-on-ubuntu-14-dot-04/



It is considered to be the successor to MapReduce for general purpose data processing on Apache Hadoop clusters. In MapReduce the highest-level unit of computation is a job. In Spark, the highest-level unit of computation is an application.

It exposes APIs for Java, Python and Scala and consists of Spark core and several related projects.

Spark SQL-Module for working with structured data. Allows you to seamlessly mix SQL queries with Spark programs

Spark Streaming-API that allows you to build scalable fault-tolerant streaming applications.

MLlib-API that implements common machine learning algorithms.

GraphX-API for graphs and graph-parallel computation.

Here is an example of how an Apache Spark application works.

The simplest way to run a Spark application is by using the Scala or Python shells.

1. To start one of the shell applications, run one of the following commands:

-Scala
$SPARK_HOME/bin/spark-shell

-Python
$SPARK_HOME/bin/pyspark

2. To run the classic Hadoop word count application, copy an input file to HDFS:

$hdfs dfs -put input

3. Within a shell, run the word count application using the following code exmaples, submitting for namenode_host, path/to/input, and path/to/output

Scala:

scala > val myfile=sc.textFile("hdfs://namenode_host:8020/path/to/input")
scala > val counts=myfile.flatMap (line=>lin.split(" ").map(word =>(word,1)).reduceByKey(_+_)
scala > counts.saveAsTextFile("hdfs://namenode:8020/path/to/output")

Python:

>>>myfile =sc.textFile("hdfs://namenode_host:8020/path/to/input")
>>>counts=myfile.flatMap(lambda line : line.split(" ")).map(lambda word: (word, 1)).reduceByKey(lambda v1,v2:v1+v2)
>>>counts.saveAsTextFile("hdfs://namenode:8020/path/to/output")


The above code works on core Spark. We can also build Spark applications.

Here are some Spark books:

Mastering Apache Spark by Mike Frampton

https://www.amazon.com/Mastering-Apache-Spark-Mike-Frampton-ebook/dp/B0119R8J00

Spark Cookbook by Rishi Yadav

https://www.amazon.com/Rishi-Yadav/e/B012UW5VZE/ref=pd_sim_351_bl_3?_encoding=UTF8&refRID=TNS2TCMGB0KY4NNM9MJ9













Monday, December 5, 2016

What's Spark Apache and how it works I


Apache Spark is an open source cluster computing framework. Originally developed at the University of California, Berkeley's AMPLab

Apache Spark provides programmers with an application programming interface centered on a data structure called the resilient distributed dataset (RDD), a read-only multiset of data items distributed over a cluster of machines, that is maintained in a fault-tolerant way. It was developed in response to limitations in the MapReduce cluster computing paradigm, which forces a particular linear dataflow structure on distributed programs: MapReduce programs read input data from disk, map a function across the data, reduce the results of the map, and store reduction results on disk. Spark's RDDs function as a working set for distributed programs that offers a (deliberately) restricted form of distributed shared memory



Spark has Spark Core, Spark Streaming and Spark SQL.

Spark can be written in Java, Scala, Python etc.


Here are some tutorials and slides  for Spark.


https://www.tutorialspoint.com/apache_spark/apache_spark_tutorial.pdf


http://lintool.github.io/SparkTutorial/slides/day1_context.pdf

http://www.bigdataeverywhere.com/files/israel/BDE-OverviewApacheSpark-GULMAN.pdf








Google's products work better on Chrome

I use google's products, blogger, docs, gmail, youtube etc.

One day I was writing something on docs using firefox. And it crushed. I switched to chrome. It worked ok.

And I found that google's products, blogger, docs, youtube etc work better on Chrome.

How to choose pc laptop and find deals

It is the end of the year. Good time to buy a pc.

For the pc checklist, you want to make sure the following points:

1. ssd
2. core i7, or i5
3. 1080p
4. 8 gm ram , 256 gm and above

And you go to dealsea.com, slickdeals.net to set alert and get deals. You can set some keywords like 'dell laptop 14-inch  ssd' and get alert in emails and etc, and but deals.

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


 

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