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
Warganegara | Jumlah Emas | |
---|---|---|
Joni | 10gr | |
Agus | 20gr | |
Siti | 20gr | |
Sur | 1gr |
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
// Command | |
$ solana-keygen pubkey | |
// Return | |
<PUBKEY> |
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
// Conditional statement | |
// https://docs.swift.org/swift-book/LanguageGuide/ControlFlow.html | |
if tomato.name.contains("Swift") { | |
print("Good for you!") | |
}else{ | |
print("That's fine. You can use Flutter or ReactNative too. It even cross platfrom solution!") | |
} | |
// Loop | |
let languages = ["Python", "Golang", "Swift", "Java"] |
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 version | |
class TomatoClass { | |
var name: String | |
var state: Bool // true=active, false=pause | |
var start_time: Date | |
var finish_time: Date? | |
var elapsed_time: TimeInterval? | |
init(name: String, state: Bool, start_time: Date){ |
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
""" | |
This project will get the latest information about earthquake from bmkg.go.id | |
""" | |
import requests | |
from bs4 import BeautifulSoup | |
author = 'Eko SW' | |
date = '1 November 2022' | |
url = 'https://www.bmkg.go.id/' |
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
""" | |
This project will get the latest information about earthquake from bmkg.go.id | |
""" | |
from bs4 import BeautifulSoup | |
author = 'Eko SW' | |
date = '1 November 2022' | |
url = 'https://www.bmkg.go.id/' | |
import requests |
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
""" | |
This project will get the latest information about earthquake from bmkg.go.id | |
""" | |
author = 'Eko SW' | |
date = '1 November 2022' | |
url = 'https://www.bmkg.go.id/' | |
import requests | |
result = requests.get(url) | |
print(result.status_code) |
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
beautifulsoup4==4.10.0 | |
certifi==2021.10.8 | |
charset-normalizer==2.0.7 | |
idna==3.3 | |
requests==2.26.0 | |
soupsieve==2.2.1 | |
urllib3==1.26.7 |
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
struct Tomato { | |
var name: String | |
var state: Bool // true=active, false=pause | |
var start_time: Date | |
var finish_time: Date | |
var elapsed_time: TimeInterval | |
mutating func toggle() { | |
state = !state | |
} |
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
var current_time = String(DateFormatter.localizedString( | |
from: Date(), | |
dateStyle: .none, | |
timeStyle: .medium)) | |
current_time = current_time.replacingOccurrences(of: ".", with: ":") | |
// change into function | |
func getCurrentTime()->String{ | |
var start_time = String(DateFormatter.localizedString( | |
from: Date(), |