Documentation on debugging issue for creating database

While running the crawler code to extract data about the categories(Beauty -> Tools and Accessories  products) in amazon.in,  I had come across the following error. I will be showing what I had done to rectify the error.

runfile(‘C:/Users/Dell/Documents/Quilt/quilt-beauty/quilt-beauty/amazon_beauty_skin_crawler.py’, wdir=’C:/Users/Dell/Documents/Quilt/quilt-beauty/quilt-beauty’)

Error tokenizing data. C error: Expected 7 fields in line 68, saw 8

If you look at the database, the database will be empty.

To look at the database, open the ‘db.sqlite3’ file using DB Browser (SQLite) application.

To rectify the error, we need to open the .csv in a normal word editor e.g. notepad++

You will be able to see the ‘ ” ’ double quotes at the beginning and at the end.

Remove the double quotes and save the text file.

NOTE: If there are already data in the database, to remove the data from the database do the following.

Open the db.sqlite3 file using DB Browser (SQLite) application.

Go to ‘Execute SQL’ tab

Type the following command

delete from file_name

delete from beauty_skin_categories

The above command will delete the data that was present in the database.

To execute the command run the command, click the run button.

After running the command click ‘Write Changes’

Then open Spyder and run the code. This time it should work.

The database for the beauty_skin_categories table will be created.

 

Install Alice3 on Ubuntu 18.04

~Saranya

Alice 3 for Ubuntu 18.04

Step 1: Install oracle JDK (download the .deb file from this link  and inside the link select the  file call Java SE 11.0.3 (LTS) for ubuntu 18.04)

Step 2: Set Path

Type this command in terminal:

sudo nano /etc/profile.d/jdk11.r  then give Enter

It will open a vi file there you type the below line in vi file:

export JAVA_HOME=”/usr/lib/jvm/jdk-11.0.3”

export PATH=”$PATH:${JAVA_HOME}/bin”

Press Control+x to exit the file

Step 3: Check JAVA version:

Command: java -version

Step 4: Make the Alice3 file excutable 

Go to that alice directory and type below command

Command: chmod +x filename then give enter

Step 5:Run the file by using ./filename

How to use Git in Eclipse(Cloning a respiratory)

–  Prabaharan

1.Open your Gitlab

To copy the URL that you want to clone in your local respiratory.

Go to: Project -> Details

Select “Clone” and under “Clone with HTTPS”press on the “copy URL to clipboard”

 

2. Open Eclipse

Go to:  Windows -> Preference -> Open Preferences -> Other

‘Open Properties’ window will pop up

Select ‘Git folder’ in that as shown below and press ‘Open’

‘Source Git Repository’ window will pop up

Paste the copied URL in the URL text box under the ‘Location’ tab

Also provide the ‘User ‘ and ‘Password’ for gitlab.com under the ‘Authentication ‘ tab.

Press Next

‘Branch Selection’ window will pop up

Select the respective branch that you need

Press Next

The directory where the repository to be cloned will be shown.

After that select ‘Finish’

Select the folder which you want to import.

Right click on the folder and select ‘Import Projects’ from the dropdown.

This will lead to location of your local directory.

Click ‘Finish’ to complete.

 

 

 

Learning Percentages and Discounts using Graph

The 8th graders were working on percentages  and finding the discounts. Sanjeev, taught the children on how to find the discount for a percentage using a graph sheet. Let’s see how to find discounts using graph sheet.

Question:

A book costs Rs. 500. The shopkeeper sells the book with 10% discount. What is the cost of the book?

1. Darw the X-axis and Y-axis.

2. Then on the X-axis mark the percentage(upto 100 with 1cm = 10 units)

3. On the Y-axis mark the amount of the book(upto 500 with 1cm = 100 units)

4. Then mark the point where the 100 from X-axis and 500 from Y-axis intersects.

5. Draw a ray from the point 0, crossing the point where the 100 from X-axis and 500 from Y-axis intersects.

6. Then for 10% discount we know that it is less 10 less than 100. So, it would be 90. So, from 90 in the draw a line that intersects the middle line.

7. Now, from the point that intersects the middle line from 90 draw a straight line to Y-axis.

8. This will give the amount which is 450.

 

 

Ron-documentation

What is ssh?

ssh is a kind of network protocol to communicate between two or more computer. communication between client to server.

ssh is default install in all ubuntu pc’ s.

ssh -client tool to communicate to the server.

We need to install the open ssh server in the server pc’ s.

What is open ssh?

Open ssh is the server to running inside the server

For example:-

Go to the terminal, and type this command

~ssh student@10.10.221.104 (It will access the remote server)

~Exit

fs is meant by file system (tries to access the file system -direct access(directory))

Here is the setup process for ron and roff for all system :-Setup_ron_roff_Documentation

Here is the code for ron and roff:  ron and roff code

~Sandhiya

 

Inspiration “Secret of concentration”

Transferred to the next group this week 🙂 , and worked on the secret of Concentration.

The following passages were translated to Tamil and read with the children in both English and Tamil.

From the teachings of Swami Vivekananda :

——————————————————-

To me the very essence of education is concentration of mind,not the collecting of facts.If i had to do my education over again,and had any voice in the matter,i would not study facts at all.I would develop the power of concentration and detachment,and then with a perfect instrument i could collect facts at will.

How has all the knowledge in the world been gained but by the concentration of the powers of the mind?The world is ready to give up its secrets if we only know how to knock,how to give it the necessary blow.The strength and force of the blow come through concentration.There is no limit to the power of the human mind.The more concentrated it is,the more power is brought to bear on one point;that is the secret.

Do you see,simply by the observance of strict brahmacharya(continence)all learning can be mastered in a very short time-one has an unfailing memory of what one hears or knows but once.It is owing to this want of continence that everything is on the brink of of ruin in our country.

Herein is the difference between man and the animals-man has the greater power of concentration.The difference in their power of concentration also constitutes the difference between man and man.Compare the lowest with the highest man.The difference is in the degree of concentration.This is the only difference

Take one idea,Make that one idea your life;Think of it,dream of ir,live on that idea.Let the brain,muscles,nerves,every part of your body,be full of that idea,and just leave every other idea alone.This is the way to success,and this is the way spiritual giants are produced.Others are talking machines.

How are we to know that the mind has become concentrated?Because the idea of time will vanish.The more time pass unnoticed the more concentrated we are.In common life we see that when we are interested in a book we do not note the time at all; and when we leave the book,we are often surprised to find how many hours have passed.


During the whole week(201906 22-29) and the sleep over the children worked on creating their own drawings and depicted the following story.

Group members: Shakthi, Murali, Ajay, Kalai, Jagathishwari, Sundar(Newcomer), Adhiyaman, Hemavarshini, Parimila, Stella

link to PDF: Arjuna Secret of Concentration

20190706 – children creating their own presentations:

link to PDF: Secret of Concentration V1

 

Sample WebScraping

########### Source code for webscraping ############

from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
driver = webdriver.Chrome("/home/ranjith/Documents/Software/Chrome/chromedriver_linux64/chromedriver")
products=[] #List to store name of the product
prices=[] #List to store price of the product
driver.get("https://www.flipkart.com/laptops/~buyback-guarantee-on-laptops-/pr?sid=6bo%2Cb5g&uniq")
content = driver.page_source
soup = BeautifulSoup(content)
for a in soup.findAll('a', attrs={'class':'_31qSD5'}):
    name=a.find('div', attrs={'class':'_3wU53n'})
    price=a.find('div', attrs={'class':'_1vC4OE _2rQ-NK'})
    rating=a.find('div', attrs={'class':'hGSR34 _2beYZw'})
    try:
        products.append(name.text)
    except:
        products.append("-----")
    try:
        prices.append(price.text)
    except:
        prices.append('-----')
df = pd.DataFrame({'Product Name':products,'Price':prices}) 
print(df)

######## OUTPUT ###########

                                        Product Name    Price
0  Apple MacBook Air Core i5 5th Gen - (8 GB/128 ...  ₹67,990
1  HP 15 Core i3 6th Gen - (4 GB/1 TB HDD/Windows...  ₹28,997
2  Apple MacBook Air Core i5 5th Gen - (8 GB/256 ...  ₹92,500
3  Lenovo Core i5 7th Gen - (8 GB/1 TB HDD/DOS/2 ...  ₹52,990
4  Lenovo Core i3 6th Gen - (4 GB/1 TB HDD/Window...  ₹30,550
5  Lenovo Ideapad Core i3 6th Gen - (4 GB/1 TB HD...  ₹32,990
6  Lenovo Core i5 7th Gen - (8 GB/2 TB HDD/Window...  ₹75,500

GCD and LCM using Sympy in Python

##########Source code for finding GCD and LCM using Sympy in python#########
from sympy import *
x = Symbol('x')
expression1, expression2 = x**2 + 4*x - 12, x**2 - 5*x + 6
def findGCD(expression1, expression2):
    print("########### Find GCD ############")
    factorsExpr1, factorsExpr2 = factor(expression1), factor(expression2)
    print("factorsExpr1 : ", factorsExpr1)
    print("factorsExpr2 : ", factorsExpr2)
    GCD = gcd(expression1, expression2)
    print("GCD : ", GCD)
    return GCD
def findLCM(expression1, expression2, GCD):
    print("########### Find LCM ############")
    factorsExpr1, factorsExpr2 = factor(expression1), factor(expression2)
    LCM = factor(lcm(expression1, expression2))
    print("LCM of Expr1 and Expr2 : ", LCM)
    print("f(x)*g(x) = ", factor(expression1*expression2))
    print("(f(x)*g(x))/GCD = {0}/{1}".format(factor(expression1*expression2),GCD))
    LCM = simplify((factorsExpr1*factorsExpr2)/GCD)
    print('Finding LCM using (f(x)*g(x))/GCD" : ', LCM)
    return LCM
GCD = findGCD(expression1, expression2)
LCM = findLCM(expression1, expression2, GCD))
######## OUTPUT #############
########### Find GCD ############
factorsExpr1 :  (x - 2)*(x + 6)
factorsExpr2 :  (x - 3)*(x - 2)
GCD :  x - 2
########### Find LCM ############
LCM of Expr1 and Expr2 :  (x - 3)*(x - 2)*(x + 6)
f(x)*g(x) =  (x - 3)*(x - 2)**2*(x + 6)
(f(x)*g(x))/GCD = (x - 3)*(x - 2)**2*(x + 6)/x - 2
Finding LCM using (f(x)*g(x))/GCD" :  (x - 3)*(x - 2)*(x + 6)

Inspiration

At Isaiambalan school a project on value with Swammy Krishnan Maharaj was started last week(20190615) and children along with teachers were split into six groups each with a specific title . Our group was given the topic “True Education” whose avatar was “Narasimha”. Each group had a set of values and their corresponding meaning in terms of the groups name.

The following was ours:

1. Respect: Respect your parents, teachers, and elders
2. Love: Love your Country, your culture and your ancestors
3. Self Discipline: Discipline your body, your senses and our mind.
4. Self Control: Control your words, your thoughts and your actions.
5. Faith:Have faith in yourself, in others an in god.
6. Discrimination: Discrimination between good and bad, real and unreal, vice and virtue.
7. Concentration: Concentrate whole heartedly while studying or playing.
8. Truthfulness: Be truthful in words and actions.
9. Hard work : Work hard to acquire knowledge, skills, and wisdom.
10. Strength : Be strong physically, mentally, intellectually, morally, and spiritually.
11. Conviction: Have conviction in the power of goodness, purity, and honesty
12. Devotion: Have devotion for duty, scriptures, holy people and God.
13. Habits : Cultivate regular habits of prayer, meditation, and reading inspiring and strengthening literature.
14. Same Sightedness: Feel the presence of the divine in all beings and treat them with the same standard as you treat yourself.
15. Firm Determination: Have firm determination strong will power to cultivate good habits in order to achieve permanent happiness, peace, success and fulfillment in life.

Children were asked to write what they understood of these and we shared in group what it meant for each person and translated it to Tamil.

Today(20190622) we read the story of Prahlada and the children were asked to reflect on it by next Saturday.

Link to story : Prahlada

During sleep over (26/06/2019) our team drawn the story. In that story we captured the main thing and drew it. Whatever question we had regarding the story we asked and it got clarified by Anita. On saturday (29/06/2019) we discussed the question we came up and it got clarified. We started preparing the script for drama. We wrote a script with help of our children and teachers.

to be cont..

Group members : Saranya, Kishore, Pravin Kumar, Vasiga, Monkia, AasisKumar, Jagathambal, Sanjith, Prajan, Vimal and Sundar

Installation of Python3.7, PIP3, JDK, Eclipse in Ubuntu 64x

Installing Python 3.7

sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa

sudo apt-get install python3.7

python3.7 –version

Installing pip3

sudo apt install python3.7-pip

Installing JDK

sudo add-apt-repository ppa:linuxuprising/java

sudo apt install oracle-java11-installer

installing eclipse

(placed the extracted file in downloads)

cd Downloads/

cd eclipse-inst-linux64/

cd eclipse-installer/

./eclipse-inst