This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"plate_number": 1, | |
"name": "Adana", | |
"location": { | |
"latitude": "37.0000", | |
"longitude": "35.3213" | |
}, | |
"population": 2183167, | |
"region": "Akdeniz" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN TRANSACTION; | |
CREATE TABLE musteri(musteri_no int PRIMARY KEY, | |
ad text, | |
yas int, | |
cinsiyet char, | |
gelir money, | |
meslek char, | |
sehir char); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"city": "Adana", | |
"plate": 1, | |
"museum": [ | |
{ | |
"name": "Adana Arkeoloji Müzesi", | |
"description": "1945 yılında kurulan müze bugünkü binasında 1972 yılında hizmete girmiştir. Önemli bir sikke koleksiyonunun yanı sıra boğaların çektiği araba üzerinde betimlenen | |
Hitit Tanrısı Tarhunda Heykeli dünyaca önemli bir parçadır. Heykelin kenarlarındaki yazıtta 'Ben Adana'nın Tanrısıyım' yazmaktadır. Ayrıca Achilleus Lahti, Antropoid Lahit, | |
Bronz Romalı Senatör Heykeli, , Hitit ve geç Hitit kabartmaları görülmeye değerdir.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby -r ./subtitle-for-everyone.rb -e "translate('yandex_translate_id','altyazı_dosyasının_konumu','cevirilmesini_istediğiniz_dilin_kodu')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def translate(yandex_translate_id,subtittle_file,language) # 3 değişkenli bir fonksiyon oluşturduk | |
require 'yandex-translator' # çeviri için kullanacağımız kütüphaneyi ekledik | |
translator = Yandex::Translator.new(yandex_translate_id) # yandex_translate_id yi fonksiyondan çekeceğiz | |
file = File.open(subtittle_file) # çevirilecek altyazı dosyasını fonksiyondan çekeceğiz , aktyazı dosyasını açıyoruz | |
file_data = file.readlines.map(&:chomp) # okuduğumuz dosyayı satır satır diziye ekledik | |
a = 0 # dizi eklediğimiz her satırı kontrol etmak için , ilk elemandan başladık | |
while a < file_data.length do # dizinin içindeki bütün elemanlara bakmak için dizinin boyutuna baktık | |
if !file_data[a].start_with?(/[0-9]/) and !file_data[a].empty? #burada dosyadan aldığımız her satır için | |
#sayı ile başlıyor mu diye kontrol ediyoruz.Fakat başına ! koyduğumuz için tam tersi oluyor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CarElement | |
def accept(visitor) | |
raise NotImpelementedError.new | |
end | |
end | |
module Visitable | |
def accept(visitor) | |
visitor.visit(self) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Car | |
def initialize(engine) | |
@engine = engine | |
end | |
end | |
class StraightSixEngine | |
def start | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Account | |
attr_accessor :name, :balance | |
def initialize(name, balance) | |
@name = name | |
@balance = balance | |
end | |
def <=>(other) | |
balance <=> other.balance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QuestionHandler | |
attr_reader :successor | |
def initialize(successor = nil) | |
@successor = successor | |
end | |
def process_request(request) | |
if accept_request(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UIButton | |
attr_reader :command | |
def initialize(command) | |
@command = command | |
end | |
def press_button | |
@command.execute | |
end |
NewerOlder