Kayıtlar

Mart, 2018 tarihine ait yayınlar gösteriliyor

for loops in python 3

These 2 loops are the same. subscriber_user_ids = [] #first loop for user_record in [2,3,4,5]:     subscriber_user_ids.append(user_record)     print(user_record) #second loop    str1 = ','.join(str(user_record) for user_record in [2,3,4,5]) print(str1) https://repl.it/repls/AstonishingInconsequentialRhombus

Git Reference Book - Free Book on Git

The Book is located in https://git-scm.com/book/en/v2

Git Remote Commands

Git Remote Commands Command Listing git status git remote add origin git@github.com:scm-ninja/git-demo.git git remote -v git push -u origin master git push origin master ls cd web/ mate index.html clear git commit -am "Updating index page for GH" git status git pull origin master git push origin master Command Reference Creating a remote repository reference git remote add remote-name remote-repository-location Using  git remote add  command allows us to associate a remote repository. Normally, you want to paste in the full URL for the remote repository given to you by your Git host (GitHub). By convention, the first or primary remote repository is named  origin . List Git's Remotes git remote -v The  git remote  command lists the names of all the remote repositories and the -v parameter (verbose) will display the full URL of the remote repository for each remote name listed Send Changes to Remote git push -u remote-name branch-name git push rem

Github - SSH Authentication Commands

SSH Authentication Commands Command Listing cd ~ cd .ssh mkdir .ssh cd .ssh pwd ssh-keygen -t rsa -C "jason@jasongtaylor.com" mate id_rsa.pub ssh -T git@github.com Command Reference Generating an SSH Key ssh-keygen -t rsa -C "your.name@your-company.com" Use your actual email address in the example above. Verify SSH authentication ssh -T git@github.com Above command uses  ssh  to connect to GitHub over the SSH protocol.

Git History / File Management Commands

Git History / File Management Commands Lecture Command Listing -- History git log git help log git log --oneline --graph --decorate --color Lecture Command Listing -- Removing Files pwd git status mate debug.log ls git status git add . git status git commit -m "adding log file that really does not belong here" clear git status git rm debug.log ls git status git commit -m "removing log file" clear mate info.log ls git add info.log git commit -m "adding info log" git status clear ls rm info.log ls git status git add . git add -u clear git status git commit -m "Removing info.log" Command Listing -- Moving Files ls mkdir web ls git mv index.html web cd web/ ll pwd cd .. ls git status git commit -m "Moving index.html file to web folder" clear Command Listing -- Ignoring Files mate application.log ls git status mate .iitignore git status ls -a git add .gitignore clear git status git commit -m "adding ignore file"

Sample Git Log

Gunay-Local:website gunaygultekin$ git log commit 157e29ed59534296f04695a0b253f7ffe8b60148 ( HEAD -> master ) Author: Günay Gültekin <gunaygultekin@gmail.com> Date:   Sun Mar 11 14:17:35 2018 +0300     Adding a message in Readme file commit 49814b4bcfd6a54db8ec44d47e55550ff6cc02ce Author: Günay Gültekin <gunaygultekin@gmail.com> Date:   Sun Mar 11 14:13:25 2018 +0300     Adding web project generated by initializr commit 06b3bb92616a09d7365c13d3677aa8a477a3e68e Author: Günay Gültekin <gunaygultekin@gmail.com> Date:   Sun Mar 11 13:58:13 2018 +0300     Adding more ipsum commit 01eea675e9c896df5e74df03a68099897d7981c7 Author: Günay Gültekin <gunaygultekin@gmail.com> Date:   Sun Mar 11 13:46:19 2018 +0300     Inline commit message commit 54e075f5e62968d578e48de6d42a2ad391df58d3 Author: Günay Gültekin <gunaygultekin@gmail.com> Date:   Sun Mar 11 13:32:44 2018 +0300     Initial commit Gunay-l

Git Working Locally Commands

Git Working Locally Commands Lecture Command Listing - Working Locally, Part One pwd git status mate README.md git status git add README.md git status git commit -m "Adding some ipsum" clear git status mate README.md git status git commit -am "Adding more ipsum" git status Lecture Command Listing - Working Locally, Part Two pwd git status clear mate index.html git status git add index.html git status mate README.md git status clear git status git add README.md git status git commit -m "A few changes for the website" clear mate README.md mate index.html git status git add . git status git commit -m "A few more changes for website" clear mate README.md git status git add README.md git status git reset HEAD README.md clear git status mate README.md git checkout -- README.md mate README.md git status Command Reference Express Commit for Tracked files git commit -am "Awesome commit message" Use the  -a  parameter with the

Git First Commit Commands

Git First Commit Commands Lecture Command Listing pwd ls mate README.md ls git status git add README.md git status git commit -m "Initial commit" clear git status Command Reference List ls Lists files and folders in current directory. Without parameters, will list non-hidden folders and files. Git Status git status Shows which files have been modified in the working directory vs Git's staging area. Git Add git add file-name Adds the new or newly modified  file-name  to Git's staging area (index). Git Commit git commit -m " A really good commit message " Commits all files currently in Git's staging area. The -m parameter allows for a commit message directly from the command line. Clear! clear Clears all previous commands from the terminal screen -- just a bit of clean up. All command line demos are preformed on the MacOS. Creating and editing files is done with Atom (free).

Git Starting Commands

Git Starting Commands Lecture Command Listing - Fresh Start pwd cd projects/ git init git-demo Lecture Command Listing - Start with Existing Project pwd cd projects/ cd website/ ls git init Command Reference Present Workding Directory pwd Change Directory cd folder-name Git initialization git init [ project-name ] project-name  parameter is optional. If not supplied, Git will initialize the current directory.

Git Help Commands

Git Help Commands Help commands here Lecture Command Listing git help git help config Command Reference Getting general help: git help Help Command Syntax -- getting help about a specific Git command: git help command

Configuration Commands

Configuration Commands Git Configuration Commands What's the current directory (present working directory)? pwd Git Config (Global/User-level) Syntax git config --global setting value Configure User and Email General Syntax: git config --global user.name "Your Name" git config --global user.email "you@someplace.com" Example using course author's information: git config --global user.name "Jason Taylor" git config --global user.email "jason@jasongtaylor.com" Listing All Global Configuration Settings git config --global --list Seeing Git's User-based Config file cat ~/.gitconfig
1dpi = 1 pixel px = dp * (dpi/160)

What is the difference between SAX and DOM?

Use a DOM parser with smaller files that fit in RAM. Use a SAX parser for large files that wont.

What are the pros and cons of monolithic vs microservice architectures?

A monolithic architecture means that your app is written as one cohesive unit of code whose components are designed to work together, sharing the same memory space and resources. A microservice architecture means that your app is made up of lots of smaller, independent applications capable of running in their own memory space and scaling independently from each other across potentially many separate machines. Monolithic pros : The major advantage of the monolithic architecture is that most apps typically have a large number of cross-cutting concerns, such as logging, rate limiting, and security features such audit trails and DOS protection. When everything is running through the same app, it’s easy to hook up components to those cross-cutting concerns. There can also be performance advantages, since shared-memory access is faster than inter-process communication (IPC). Monolithic cons : Monolithic app services tend to get tightly coupled and entangled as the application evol

What are the differences between ArrayList and Vector?

ArrayList  and  Vector  both implements List interface and maintains insertion order.But there are many differences between  ArrayList  and  Vector  classes... ArrayList  - ArrayList  is not synchronized. ArrayList  increments 50% of current array size if number of element exceeds from its capacity. ArrayList  is not a legacy class, it is introduced in JDK 1.2. ArrayList  is fast because it is non-synchronized. ArrayList  uses Iterator interface to traverse the elements. Vector  - Vector  is synchronized. Vector  increments 100% means doubles the array size if total number of element exceeds than its capacity. Vector  is a legacy class. Vector  is slow because it is synchronized i.e. in multithreading environment, it will hold the other threads in runnable or non-runnable state until current thread releases the lock of object. Vector  uses Enumeration interface to traverse the elements. But it can use Iterator also.