c sorgusu için yayınlar alaka düzeyine göre sıralanmış olarak gösteriliyor. Tarihe göre sırala Tüm yayınları göster
c sorgusu için yayınlar alaka düzeyine göre sıralanmış olarak gösteriliyor. Tarihe göre sırala Tüm yayınları göster

Bash Kısayollar (Shortcuts – Hotkeys )



Ctrl + aİmleci satır başına götürür
Ctrl + eİmleci satır sonuna götürür
Ctrl + bİmleç bir karakter geri gider
Ctrl + fİmleç bir karakter ileri gider
Alt + bİmleç bir kelime geri gider
Alt + fİmleç bir kelime ileri gider
Ctrl+xxİmleç her defasında mevcut konumu ve satır başı arasında ileri/geri gider.
Ctrl + lEkranı temizler ve imleç en üst satıra konumlanır. clear komutuyla aynı işleve sahip.
Ctrl + uİmlec konumundan satır başına kadar siler. (imlecin solundaki her şeyi siler )
Ctrl + kİmlec konumundan satır sonuna kadar siler. ((imlecin sağındaki her şeyi siler )
Ctrl + wimleç konumundan bir önceki kelime başına kadar olan kısmı siler. Eğer imleç bir kelimenin ortasında ise o kelimenin imleçten önceki kısmını siler
Ctrl + timleçten önceki iki karakteri yer değiştir.
Esc + timleçten önceki iki kelimeyi yer değiştir.
Ctrl + cAktif çalışan prosese kill sinyali gönderir.
Ctrl + zAktif çalışan prosesi arkaplana (background) atar. Bu durumda Proses askıya alınmıştır. bg ile arkaplanda çalışması devam ettirilir. İstenirse proses tekrar fg komutu ile öne alınır
Ctrl + dAktif shell oturumuna exit komutu gönderir.
TabDosya, dizin, komut vb isimleri için otomatik tamamlama sağlar.
Ctrl + hBackspace tuşu gibi davranır.
Ctrl + rDaha önce kullanılmış komutlar arasında (History / Geçmiş) arama yapmanızı ve kullanmanızı sağlar
Alt + cKelimenin ilk harfini büyük yap
Alt + uİmlecin sağındaki kelimeyi büyük harf yap
Alt + lİmlecin sağındaki kelimeyi küçük harf yap

Python Tarih Islemleri






#!/usr/bin/python
# -*- coding: utf-8 -*-


"""
Created on Sat May  5 22:11:55 2018
@author: MertogluE
"""

import time


#-----------------------------------------------------------------------------
# Python Tarih İşlemleri İçin Örneklerdir
#-----------------------------------------------------------------------------


#    %a hafta gününün kısaltılmış adı
#    %A hafta gününün tam adı
print("hafta gününün kısaltılmış adı:  ",time.strftime("%a"))


#   %b ayın kısaltılmış adı
#   %B ayın tam adı
print("ayın kısaltılmış adı:  ",time.strftime("%b"))


#    %c tam tarih, saat ve zaman bilgisi
print("tam tarih, saat ve zaman bilgisi:  ",time.strftime("%c"))


#    %d sayı değerli bir karakter dizisi olarak gün
print("ay'ın kaçıncı günü:  ",time.strftime("%d"))


#   %j belli bir tarihin, yılın kaçıncı gününe denk geldiğini gösteren 1-366 arası bir sayı
print("yılın kaçıncı günü:  ", time.strftime("%j"))


#   %m sayı değerli bir karakter dizisi olarak ay
print("kaçıncı ay:  ",time.strftime("%m"))



#   %U belli bir tarihin yılın kaçıncı haftasına geldiğini gösteren 0-53 arası bir sayı
print("yılın kaçıncı haftası: ",time.strftime("%U"))


#   %y yılın son iki rakamı
print("yılın son iki rakamı: ",time.strftime("%y"))


#   %Y yılın dört haneli tam hali
print("yılın dört haneli tam hali: ",time.strftime("%Y"))



#   %x tam tarih bilgisi
print("tam tarih bilgisi: ",time.strftime("%x"))


#   %X tam saat bilgisi
print("tam saat bilgisi: ",time.strftime("%X"))

Çıktımız aşağıdaki gibi olacaktır. 
hafta gününün kısaltılmış adı:      Sat
ayın kısaltılmış adı:               May
tam tarih, saat ve zaman bilgisi:   Sat May  5 22:09:43 2018
ay'ın kaçıncı günü:                 05
yılın kaçıncı günü:                 125
kaçıncı ay:                         05
yılın kaçıncı haftası:              17
yılın son iki rakamı:               18
yılın dört haneli tam hali:         2018
tam tarih bilgisi:                  05/05/18
tam saat bilgisi:                   22:09:43



C# HAKKINDA

                                             

C# Programlama Dili (si şarp şeklinde telaffuz edilir),

C# Microsoft'un geliştirmiş olduğu yeni nesil,Nesne yönelimli bir programlama dilidir.

C diline Nesneye Yönelimli Programlama(NYP) yapabilmek için eklentiler eklenmiş ve C++ dili oluşmuştur. Daha sonraki süreçte C++ diline yeni özellikler eklenmiş ve C# dili oluşturulmuştur.
Ancak C# ta işaretçiler(pointers)  kullanımı ortadan kaldırılmış ya da pek kullanılmaz denilebilir ancak kullanıldığı kimi durumlar da olabiliyor.

Syntax'ı(sözdizimi)  C, C++ ve Java'ya benzemektedir.

Java'ya altenatif olarak piyasaya sürülmüştür. Kullanımı Java'ya göre daha kolay olsa da piyasada Java hakimiyetini sürdürmekte, türkiye piyasadında C# daha çok tercih edilse de , dış piyasa da Java açık ara öndedir.

Daha fazla bilgi için C# vikipedi sayfasına bakınız

Python ile CSV dosyasını okuma ve yazma

Writing data into different types of CSV files

In the previous article, we learned how to read csv files in Python. In similar way, we can also write a new or edit existing csv files in Python.
In Python we use csv.writer() module to write data into csv files. This module is similar to the csv.reader() module.

Writing on Existing File

We have a people.csv file with following data.
SN, Name, City
1, John, Washington
2, Eric, Los Angeles
3, Brad, Texas
Now, we are going to modify people.csv file.

Example 1: Modifying existing rows of people.csv

import csv

row = ['2', ' Marie', ' California']

with open('people.csv', 'r') as readFile:
reader = csv.reader(readFile)
lines = list(reader)
lines[2] = row

with open('people.csv', 'w') as writeFile:
    writer = csv.writer(writeFile)
    writer.writerows(lines)

readFile.close()
writeFile.close()
When we open the people.csv file with text editor, then it will show:
SN, Name, City
1, John, Washington
2, Marie, California
3, Brad, Texas
In the above program, we modified the third row of people.csv and saved the result. At first, we read the people.csv file using csv.reader() function. Then, we used list() function to convert all the csv data in a list and store in lines. After that, we changed third row of csv file with row i.e lines[2] = row. Finally, we write the values of lines list to people.csv file.
Sometimes, we may need to add new rows in the existing csv file. So, we are going to append a new row to people.csv file used in Example 1.

Example 2: Appending new rows to people.csv file

import csv

row = ['4', ' Danny', ' New York']

with open('people1.csv', 'a') as csvFile:
    writer = csv.writer(csvFile)
    writer.writerow(row)

csvFile.close()
When we open people.csv file with text editor, then it will show :
SN, Name, City
1, John, Washington
2, Marie, California
3, Brad, Texas
4, Danny, New York
In the above program, we append a new row into people.csv. For this, we opened the csv file in 'a' append mode. Then, we write the value of row after the last line of the people.csv file.

Normal CSV File

We create a normal csv file using writer() method of csv module having default delimiter comma(,).

Example 3: Write a python list into person.csv file

import csv

csvData = [['Person', 'Age'], ['Peter', '22'], ['Jasmine', '21'], ['Sam', '24']]

with open('person.csv', 'w') as csvFile:
    writer = csv.writer(csvFile)
    writer.writerows(csvData)

csvFile.close()
When we open the person.csv file with text editor, then it will show :
Person,Age
Peter,22
Jasmine,21
Sam,24
In the above program, we use csv.writer() function to write data from a list csvData into a csv file person.csv.
Note: The writerow() method writes one row at a time. If you need to write all the data at once you can use writerows() method.

CSV Files with quotes

We can write the csv file with quotes, by registering new dialects using csv.register_dialect() class of csv module.

Example 4 : Write into person1.csv file

import csv

person = [['SN', 'Person', 'DOB'],
['1', 'John', '18/1/1997'],
['2', 'Marie','19/2/1998'],
['3', 'Simon','20/3/1999'],
['4', 'Erik', '21/4/2000'],
['5', 'Ana', '22/5/2001']]

csv.register_dialect('myDialect',
quoting=csv.QUOTE_ALL,
skipinitialspace=True)

with open('person1.csv', 'w') as f:
    writer = csv.writer(f, dialect='myDialect')
    for row in person:
        writer.writerow(row)

f.close()
When we open person1.csv file, we get following output :
"SN","Person","DOB"
"1","John","18/1/1997"
"2","Marie","19/2/1998"
"3","Simon","20/3/1999"
"4","Erik","21/4/2000"
"5","Ana","22/5/2001"
In above program, we register a dialect named myDialect. Inside myDialect we use quoting=csv.QUOTE_ALL to write the double quote on all the values.

CSV files with Custom Delimiters


A delimiter is a string used to separate fields. The default value is comma(,).
We can write csv file having custom delimiter by registering a new dialect with the help of csv.register_dialect().

Example 5 : Writing with custom delimiter as pipe(|)

import csv

person = [['SN', 'Person', 'DOB'],
['1', 'John', '18/1/1997'],
['2', 'Marie','19/2/1998'],
['3', 'Simon','20/3/1999'],
['4', 'Erik', '21/4/2000'],
['5', 'Ana', '22/5/2001']]

csv.register_dialect('myDialect',
delimiter = '|',
quoting=csv.QUOTE_NONE,
skipinitialspace=True)

with open('dob.csv', 'w') as f:
    writer = csv.writer(f, dialect='myDialect')
    for row in person:
        writer.writerow(row)

f.close()
When we open dob.csv file, we get following output:
SN|Person|DOB
1|John|18/1/1997
2|Marie|19/2/1998
3|Simon|20/3/1999
4|Erik|21/4/2000
5|Ana|22/5/2001
In the above program, we register a dialect with delimiter as pipe(|). Then we write a list into a csv file dob.csv.

CSV File with a Lineterminator

A lineterminator is a string used to terminate lines produced by writer. The default value is \r\n.
We can write csv file with a lineterminator in Python by registering new dialects using csv.register_dialect() class of csv module

Example 6 : Writing csv file using a lineterminator

import csv

csvData = [['Fruit', 'Quantity'], ['Apple', '5'], ['Orange', '7'], ['Mango', '8']]

csv.register_dialect('myDialect', delimiter = '|', lineterminator = '\r\n\r\n')

with open('lineterminator.csv', 'w') as f:
    writer = csv.writer(f, dialect='myDialect')
    writer.writerows(csvData)

f.close()
When we open the lineterminator.csv file, we get following output:
Fruit|Quantity
Apple|5
Orange|7
Mango|8
In above code, we register a new dialects as myDialect. Then, we use delimiter='|' where a | is considered as column separator. After that, we use lineterminator='\r\n\r\n' where each row separates after every two lines.
Note : Python's CSV module only accepts \r\n, \n or \r as lineterminator.

CSV File with quotechars

We can write the csv file with custom quote characters, by registering new dialects using csv.register_dialect() class of csv module.

Example 7: Writing CSV FIle with quotechars

import csv

csvData = [['SN', 'Items'], ['1', 'Pen'], ['2', 'Book'], ['3', 'Copy']]

csv.register_dialect('myDialect',
delimiter = '|',
quotechar = '"',
quoting=csv.QUOTE_ALL,
skipinitialspace=True)

with open('quotechars.csv', 'w') as csvFile:
    writer = csv.writer(csvFile, dialect='myDialect')
    writer.writerows(csvData)

print("writing completed")

csvFile.close()
Output:
"SN"|"Items"
"1"|"Pen"
"2"|"Book"
"3"|"Copy"
In the above program, we register a dialect called myDialect. Then we use delimiter as pipe(|) and quotechar as doublequote '"'.

Writing CSV file into a Dictionary

Using DictWriter() class of csv module, we can write a csv file into a dictionary. It works similar to the writer() function but creates an object which maps data into a dictionary. The keys are given by the fieldnames parameter.

Example 8: Writing dictionary into peak.csv file

import csv

data = [{'mountain' : 'Everest', 'height': '8848'},
      {'mountain' : 'K2 ', 'height': '8611'},
      {'mountain' : 'Kanchenjunga', 'height': '8586'}]

with open('peak.csv', 'w') as csvFile:
    fields = ['mountain', 'height']
    writer = csv.DictWriter(csvFile, fieldnames=fields)
    writer.writeheader()
    writer.writerows(data)

print("writing completed")

csvFile.close()
When we open peak.csv file, it will contain following output :
mountain,height
Everest,8848
K2,8611
Kangchenjunga,8586
In the above program, we use fieldnames as headings of each column in csv file. Then, we use a DictWriter() to write dictionary data into peak.csv file.

Example 9: Writing dictionary into grade.csv file with custom dialects

import csv

csv.register_dialect('myDialect', delimiter = '|', quoting=csv.QUOTE_ALL)

with open('grade.csv', 'w') as csvfile:
    fieldnames = ['Name', 'Grade']
    writer = csv.DictWriter(csvfile, fieldnames=fieldnames, dialect="myDialect")
    writer.writeheader()
    writer.writerows([{'Grade': 'B', 'Name': 'Alex'},
                 {'Grade': 'A', 'Name': 'Bin'},
                 {'Grade': 'C', 'Name': 'Tom'}])

print("writing completed")
When we open grade.csv file, it will contain following output:
"Name"|"Grade"
"Alex"|"B"
"Bin"|"A"
"Tom"|"C"
In the above program, we create a custom dialect called myDialect with pipe(|) as delimiter. Then, use fieldnames as headings of each column in csv file. Finally, we use a DictWriter()to write dictionary data into grade.csv file.


Kaynak : https://www.programiz.com/python-programming/working-csv-files#quotechars-files