You are on page 1of 23

WEEKLY REPORT 42

A. GIT:

Source control/ version control:


The system which helps us to store all changes to the source code.
Support multiple people to work at the same time.
Helping see who changed the code.
Reverting the changes, bring the code back to an earlier version, so we don't have to
worry about losing the code
What is the Git?
Git was created by Linus Torvalds in 2005 for development of the Linux kernel, with
other kernel developers contributing to its initial development. Since 2005, Junio
Hamano has been the core maintainer.
Every Git directory on every computer is a full-fledged repository with complete
history and full version-tracking abilities, independent of network access or a central
server.
There are 3 important concepts: repo, commit, branch.
+In Git, the Repository is a place to store and manage all the necessary information
(folders, files, images, videos, tables, data, etc.) as well as the revisions and history of
the entire project. When creating a new repository, you should create an additional
README file or an introductory information file about your project.
+Commit is an operation that tells the system that you want to save the current state,
record the history of processes such as adding, deleting, updating certain files or
folders on the repository.
+With the branch you can isolate the project's features, test new features, or you can
also use the branch to fix and complete a certain error of the project, etc. When
starting to initialize a repository or clone a branch repository, you will have a main
branch named master, this is the branch containing all the main source code in the
repository. From this master branch, during project execution, you can fork many
other branches depending on actual needs.
INSTALL GIT
MacOS
https://git-scm.com/download/mac
Window
https://git-scm.com/download/win
Linux
https://git-scm.com/download/linux
Basic commands:
git init:
Effect: Create a new or existing git repository 1 project.
Usage: git init in the project root directory.
git clone:
Effect: Copy a git repository from remote source.
Usage: git clone <:clone git url:>
git push/git pull
Effect: Push or pull changes to the remote. If you have added and committed changes
and you want to bring it up or your remote is up to date and you apply all those
changes on your code.
Usage: git pull <: remote:> <: branch:> and git push <: remote:> <: branch:>
git add:
Effect: To put a file in the Staging Area
Usage: git add name_file or want to add all files of the directory git add all
git log
Search, review, filter the commit history log information on git by git log command
with different settings, like pretty, show log graph
git log —decorate —graph —oneline:
git branch:
Branches represent specific versions of a repository detached from your main project.
Branch allows you to track experimental changes you make to the repository and can
revert to older versions.
Effect: list all branches (branches).
Usage: git branch or git branch –a
git checkout
Use git checkout to switch between branches. Just type git checkout followed by the
name of the branch you want to move to, or type git checkout master to return to the
master branch.
Effect: Switch to another branch
Usage: git checkout <: branch:> or ** _ git checkout -b <: branch:> if you want to
create and switch to a new branch.
git merge
The git merge command combines with pull requests to add changes from one branch
to another.
Effect: Merge 2 branches together.
Usage: Go to the branch you want to merge and then use git merge
<:branch_you_want_to_merge:>
B. SVN

Subversion (abbreviated SVN) is a version control system (VCS) introduced in 2000


by the company CollabNet (http://subversion.tigris.org). This is a very effective
teamwork support system.
Version Control System (VCS) is a software that helps software developers to work
together and maintain a complete history of their work.
Following are the goals of a Version Control System.
+Allow developers to work simultaneously.
+Do not overwrite each other’s changes.
+Maintain history of every version of everything.
Version Control Terminologies
Repository: A repository is the heart of any version control system. It is the central
place where developers store all their work. Repository not only stores files but also
the history. Repository is accessed over a network, acting as a server and version
control tool acting as a client. Clients can connect to the repository, and then they can
store/retrieve their changes to/from repository. By storing changes, a client makes
these changes available to other people and by retrieving changes, a client takes other
people's changes as a working copy.
Trunk: The trunk is a directory where all the main development happens and is
usually checked out by developers to work on the project.
Tags : The tags directory is used to store named snapshots of the project. Tag
operation allows to give descriptive and memorable names to specific version in the
repository.
For example, LAST_STABLE_CODE_BEFORE_EMAIL_SUPPORT is more
memorable than
Repository UUID: 7ceef8cb-3799-40dd-a067-c216ec2e5247 and
Revision: 13
Branches: Branch operation is used to create another line of development. It is useful
when you want your development process to fork off into two different directions. For
example, when you release version 5.0, you might want to create a branch so that
development of 6.0 features can be kept separate from 5.0 bug-fixes
Working copy: Working copy is a snapshot of the repository. The repository is
shared by all the teams, but people do not modify it directly. Instead each developer
checks out the working copy. The working copy is a private workplace where
developers can do their work remaining isolated from the rest of the team
Commit changes: Commit is a process of storing changes from private workplace to
central server. After commit, changes are made available to all the team. Other
developers can retrieve these changes by updating their working copy.
Below is a table of differences between GIT and SVN:
GIT SVN
Git is open source distributed vice Apache Subversion is an open source
control software version and revision control
system developed by Linus Torvalds in system under Apache license.
2005. It
emphasis on speed and data integrity
Git has a Distributed Model. SVN has a Centralized Model.
In git every user has their own copy of In SVN there is central repository has
code on their local like their own branch. working copy that also make changes
and committed in central repository.
In git we do not required any Network to In SVN we required Network for runs
perform git operation. the SVN operation.
Git is more difficult to learn. It has more SVN is much easier to learn as
concepts and commands. compared to git.
Git deals with large number of files like SVN control the large number of binary
binary files that change quickly that why files easily.
it become slow.
In git we create only .git directory In SVN we create .svn directory in each
folder.
It does not not have good UI as SVN has simple and better user interface
compared to SVN.
C. JIRA

What is jira?
Jira:
Jira Software unlocks the power of agile by giving your team the tools to easily create
& estimate stories, build a sprint backlog, identify team commitments & velocity,
visualize team activity, and report on your team's progress.
To give your team a tour through a complete project, the following guide contains two
tutorials that show a simple agile workflow at a small software company. This guide
touches on some of the most used features and follows the development team at
Teams in Space as they work to improve their next generation space travel software.
In this simple workflow, a manager sets up and runs a project while individual users
add content and work with issues within a sprint. The following pages are set up to
follow this structure and are divided into two tutorials:
Getting Started as a Jira Software Manager: A guide for managers who set up and run
the agile project
Getting Started as a Jira Software User: A guide for users who work on and resolve
issues
Main feature:
Manage and track project progress
Manage bugs, features, work, improvements or any issues
Search quickly with the JIRA Query Language filter
Build workflows that are compatible with each project's requirements
Provide many types of statistical reports with many different types of charts suitable
for many types of projects, many users
Easy integration with other systems (such as Email, Excel, RSS...)
Can run on most hardware platforms, operating systems and databases
Advantages:
Easily choose a variety of projects with different purposes
Easily plan, divide tasks for members
Create an efficient workflow
Easily manage multiple software projects at the same time
JIRA Query Language filter for quick search
Easily provide project analysis reports quickly, accurately and efficiently
Over 950 add-ons offering advanced features
User-friendly interface, clear, easy to operate, suitable for all types of users
Disadvantages:
High cost, after 7 days trial, the larger the business, the more it will cost: $10 per
month for up to 10 accounts; from 11-100 accounts is $7/account/month
It takes a lot of time and effort to set up, so it is only effective for large projects, not
suitable for small and medium projects (under 3 months).

English language with many difficult terms to use


Complicated workflow requires thorough understanding
The basic ingredients of Jira:
Roles: Define the project's roles, This section confirms who participates in the project,
only those who add to the role can create Resource Allocation and project team later.
More than one person can be in one role.
Issue: are tasks, bugs, features or any other type of project work.
Project: This function is used to authorize approve worklog for project members.
Whoever is the team lead of any group will be approved for the worklog for the
member of that group. Project management has the right to approve for all project
members.
Component is the product of the project. Here will import all the products of the
project taken from the sales plan file. If the project follows Scrum, it will be the
Product of the corresponding Sprint.
Workflow: As a JIRA administrator, you can configure workflow triggers, conditions,
validations, and post functions. This page will provide an overview and basic steps for
each part of your job.
Priority: Is the priority of a defect. There are 4 levels, choose according to the datalist.
Status: Represents the location of the issue in the workflow.
Getting started as a Jira Software user
Find your issue
1.Select Boards from the top menu, and then select a board from the drop-down list.
2.Select Active sprints to see the issues in the sprint of the selected board.
3.Issues are represented by issue cards in the Active sprints of your board. The cards
show quick reference information, like issue keys, assignees, and descriptions. Locate
the top card in the To Do column and drag it to the In Progress column. By doing this,
you are actually moving to assign the issue to yourself, and start working on it

Work on an issue
1.In the Active sprints of your board, select the issue in the In Progress column. The
issue is displayed in the Issue Detail view.
2.In the Issue Detail view, select Edit from the 'cog' drop-down. The 'Edit Issue'
dialog will be displayed.
3.If the issue is not assigned to you yet, type your name in the Assignee field.
4.Add some technical details about the issue as necessary.
5.Note, you may want to specify a component or a version (if components and
versions have been configured for your project), or add attachments as needed, etc.
When you're done adding technical details, click the Update button.
Collaborate with your team
1.Select the issue to add a comment.
2.In the Issue Detail view, locate and click the Comment button.
3.In the Comment text box, type your comment.
4.To email other users about your comment, simply mention these users in the
Comment text box (by typing @User's Name). An email will be sent to the users'
email addresses that are registered with their Jira accounts.
5.Click the Add button to save the comment.
Create a branch
1.Select the issue for which you want to create a branch.
2.In the Issue Detail view, locate the Development panel, and click Create branch.
The Create branch dialog will be displayed.
3.Include the issue key in the branch name. If you have workflow triggers configured,
the status of the issue may automatically transition to 'In Progress'. See Configuring
workflow triggers for more information.
4.Enter other details for the branch as necessary.
5.Click the Create branch button. Your branch will be created in your source
repository.
Finish your work
1.Locate your card in the Active sprints of your board.
2.Drag and drop the card to the Done column. If you have workflow triggers
configured, the status of the issue may automatically transition to 'Closed'. You can
skip the next steps. See Configuring workflow triggers for more information.
3.Select the Resolution for the issue from the drop-down menu.
4.Provide details as necessary.
5.Select Close Issue.
D. Eclipse debugger IDE

What is Eclipse?
In the context of computing, Eclipse is an integrated development environment (IDE)
for developing applications using the Java programming language and other
programming languages such as C/C++, Python, PERL, Ruby etc.

The Eclipse platform which provides the foundation for the Eclipse IDE is composed
of plug-ins and is designed to be extensible using additional plug-ins. Developed
using Java, the Eclipse platform can be used to develop rich client applications,
integrated development environments and other tools. Eclipse can be used as an IDE
for any programming language for which a plug-in is available.

The Java Development Tools (JDT) project provides a plug-in that allows Eclipse to
be used as a Java IDE, PyDev is a plugin that allows Eclipse to be used as a Python
IDE, C/C++ Development Tools (CDT) is a plug-in that allows Eclipse to be used for
developing application using C/C++, the Eclipse Scala plug-in allows Eclipse to be
used an IDE to develop Scala applications and PHPeclipse is a plug-in to eclipse that
provides complete development tool for PHP.

Licensing
Eclipse platform and other plug-ins from the Eclipse foundation is released under the
Eclipse Public License (EPL). EPL ensures that Eclipse is free to download and
install. It also allows Eclipse to be modified and distributed.
What programming language is used to make Eclipse?
Eclipse IDE is written mostly in Java and some native parts are written in C/C++.
Eclipse can run on major operating systems like Windows, Mac and Linux. So if you
are using Eclipse IDE, you are actually running a Java application.
Advantages:
Facilitate seamless integration of tools within each and across different content types
and tool providers.
Supports building multiple tools.
Supports an unlimited set of tool vendors, including independent software vendors
(ISVs).
Tools for manipulating any content type (including HTML, Java, C, JSP, EJB, XML,
and GIF) are supported.
Supports both GUI and non-GUI-based application development environments.
Runs on many operating systems, including Windows and Linux.
Take advantage of the popularity of the Java language to write tools.
Due to using SWT/JFace, it probably loads faster
Disadvantages:
Complicated installation
Hardware-consuming Eclipse is also quite memory-intensive to install, so now eclipse
has fixed it with Eclipse Luna version, no need to install it.
Consume machine memory: running eclipse also consumes a lot of computer
memory, so to use it your machine also needs a relatively high configuration.
Lack of consistency because there are too many plugins

E.PYTHON

Hello word in python

List
len(list) Trả về độ dài của list

max(list) Trả về phần tử có giá trị lớn nhất


trong list

min(list) Trả về phần tử có giá trị nhỏ nhất


trong list

list(seq) Chuyển đổi một tuple thành list


list.append(obj) Phụ thêm đối tượng obj vào cuối
list

list.count(obj) Đếm xem có bao nhiêu lần mà obj xuất


hiện trong list

list.extend(seq) Phụ thêm các nội dung của seq vào cuối
list

list.insert(index, obj) Chèn đối tượng obj vào trong list tại index
đã cho

list.remove(obj) Xóa đối tượng obj từ list

list.reverse() Đảo ngược thứ tự các đối tượng

list.sort([func])
Sắp xếp các đối tượng của list, sử dụng
hàm so sánh nếu được cung cấp

Tuples
Lists and Tuples contains items separated by commas.
Difference between them:
+Lists are enclosed within square brackets [ ]. And their elements and size can be
changed.
+Tuples are enclosed within parentheses ( ). And cannot be updated.
+Tuples can be thought of as read-only lists.

Access Tuple Items

Change Tuple Values

Using Asterisk*

Dictionary
Python’s dictionary work like associative arrays or hashes found in Perl and consist of
key-value pairs.
Dictionaries are enclosed by curly braces { }.
values can be assigned and accessed using square braces [ ].
Dictionary Items

Access Dictionary Items


Decision Making
Python programming language provides 3 types of decision making statements:
+if statements.
+if...else statements.
+and nested if statements

Function
Define function with def keyword, the function in python also have arguments and
return value

pyserial
check com port:
Configure the serial connections (the parameters differs on the device you are connecting to)

ser = serial.Serial(
port='/dev/ttyUSB1',
baudrate=9600,
parity=serial.PARITY_ODD,
stopbits=serial.STOPBITS_TWO,
bytesize=serial.SEVENBITS
)

Check if the port is open:


ser.isOpen()

ser.read() will only return 1 byte at a time.


ser.read(5) it will read 5 bytes (less if timeout occurs before 5 bytes arrive.)
ser.readline() If you know that your input is always properly terminated with EOL
characters, this is the better way to use
Even if you get ser.read() or ser.readline() to return multiple bytes, Since you are
iterating over the return value you will
Escape
for line in ser.read():
and just say:
line = ser.readline()
Example: The convention is to send a message as 12431\n indicating a line.
import serial

ser = serial.Serial(
port='COM5',\
baudrate=9600,\
parity=serial.PARITY_NONE,\
stopbits=serial.STOPBITS_ONE,\
bytesize=serial.EIGHTBITS,\
timeout=0)

print("connected to: " + ser.portstr)

#this will store the line


line = []

while True:
for c in ser.read():
line.append(c)
if c == '\n':
print("Line: " + ''.join(line))
line = []
break

ser.close()

ser.write("data") write data


ser.close() close the serial

Daily report 20/10/2021


Json
What is JSON?
JSON is a standard format for data exchange, inspired by JavaScript. Basically, JSON
is in the form of a string or text. JSON stands for J ava S cript O bject N otation.
Method Describe

  dumps() Encode to JSON objects

  dump() String encoding recorded in file

  loads() Decode JSON string


  load() Decoding while reading a JSON file

Python to JSON (Encoding)


The dumps() method converts the python dictionary object to the JSON string data
format.

JSON to Python (Decode)


Let's see a basic example of reading JSON in Python with the help of json.loads()
function
JSON code format (makes it easier to print)
The goal is to write clearly formatted code that is easy for the reader to understand.
With the help of beautiful printing, the source code can be easily read and understood
by anyone.
To format the code use of indent and 4 shows number of space and use of separator is
not necessary but standard way to write code of particular function.

Sort JSON code


The sort_keys property in the dumps() function argument sorts the keys in the JSON
in ascending order. The sort_keys argument is a Boolean property. Sorting is
performed if the value is set to True, and vice versa.

Encoding and decoding Complex Objects in Python


JSON serialization class overview
The JSONEncoder class is used to serialize any Python object while doing the
encoding. It contains three different encryption methods

 default(o) - Implemented in the subclass and returns the serialized object for o.
 encode(o) - Like the json.dumps() method, it returns a JSON string of a Python
data structure.
 iterencode(o) – Represents strings one by one and encodes the object o.
With the help of the encode() method of the JSONEncoder class, we can also encode
any Python object.

JSON deserialization layer overview


The JSONDecoder class is used to decode the serialization of any Python object while
doing the decoding. It contains three different decoding methods
 default(o) - Implemented in the subclass and returns the decode object.
 decode(o) - Like the json.loads() method, it returns a Python data structure of a
string or JSON data.
 raw_decode(o) – Represents each Python dictionary and decodes the object o.
With the help of decode() method of JSONDecoder class, we can also decode JSON
string.

Fabric
Fabric is a powerful Python library used as a tool to interact between SSH and
computer system more easily. It will help automate a wide range of tasks from app
deployment to system administration.
sudo apt install fabric

run (fabric.operations.run/fabric.api.run)

sudo (fabric.operations.sudo/fabric.api.sudo)
 local: executes only one local command.
 run: execute a remote command.
 sudo: execute a sudo remote command.
get (fabric.operations.get/fabric.api.get)

Get this command is quite similar to scp command. Its main purpose is to copy/move
file(s) from the remote system to your computer. When using get, you need to pay
attention to 2 parameters:
 remote_path
 local_path
put (fabric.operations.put/fabric.api.put)

Put and get vice versa. Put push data to the remote and get pull data from the remote.
prompt (fabric.operations.prompt/fabric.api.prompt)

Prompt the user if they want to custom and return an input.


reboot (fabric.operations.reboot/fabric.api.reboot)

It will reboot the remote system.You can set that time wait by parameter wait.
cd (fabric.context_managers.cd/fabric.api.cd

cd allows you to go to a directory and perform operations in that directory.


Connecting to remote servers

Example:

You run the following command to have it do it automatically:


Fab run

You might also like