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
# Demo JST -> Backpropagation | |
# Operasi logika AND | |
import numpy as np | |
# Fungsi aktivasi sigmoid | |
def sigmoid(x): | |
return 1 / (1 + np.exp(-x)) | |
# Fungsi turunan dari sigmoid |
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
# JST -> Feed Forward | |
# DEMO Operasi Logika OR | |
import numpy as np | |
# Fungsi aktivasi Step | |
def step(x): | |
return 1 if x >= 2 else 0 | |
# Data pelatihan |
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
# JST -> Feed Forward | |
# DEMO Operasi Logika AND | |
import numpy as np | |
# Fungsi aktivasi Step | |
def step(x): | |
return 1 if x >= 1 else 0 | |
# Data pelatihan |
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
""" | |
https://blog.galih.eu | |
""" | |
# Cek bilangan genap | |
bilangan = [5, 7, 4, 9, 11] | |
bil_genap = [a%2==0 for a in bilangan] | |
print(f"Ada bilangan genap? {any(bil_genap)}") | |
# Luaran > Ada bilangan genap? True |
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
""" | |
https://blog.galih.eu | |
""" | |
# Cara 1 - Pengurutan metode selection sort | |
list_data = [70, 60, 90, 86, 75, 50, 80] | |
jumlah_cari = 3 | |
for i, bil in enumerate(list_data): | |
lbaru = list_data[i:] |
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
""" | |
https://blog.galih.eu | |
Menampilkan bilangan antara 300 dan 500 yang mana angka 4 hanya muncul satu kali | |
""" | |
from collections import Counter | |
bmin = 300 | |
bmaks = 500 | |
angka = 4 # angka wajib muncul |
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
""" | |
https://blog.galih.eu | |
""" | |
angka = [70,80,90,70,80,80,65,75,90,65,70] | |
print("List") | |
# mengumpulkan jumlah angka | |
temp_angka, temp_jumlah = [], [] |
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
# https://blog.galih.eu | |
def deret_prima_v3(bmin, bmaks): | |
bukan_prima = set([i for i in range(bmin, bmaks + 1) for j in range(2, i) if i % j == 0]) | |
return list(set(range(bmin, bmaks + 1)).symmetric_difference(bukan_prima)) | |
print(deret_prima_v3(2, 10)) | |
# output: [2, 3, 5, 7] | |
print(deret_prima_v3(200, 300)) | |
# output: [257, 263, 269, 271, 277, 281, 283, 293, 211, 223, 227, 229, 233, 239, 241, 251] |
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
""" | |
Galih Hermawan | |
https://blog.galih.eu | |
""" | |
# pemeriksaan bilangan prima | |
def prima(angka): | |
for i in range(2, angka): | |
if angka%i == 0: | |
return False |
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
Option Explicit | |
' Koneksi VB6 & MySQL/MariaDB | |
' Developed by Galih Hermawan | |
' https://galih.eu | |
Dim koneksi As MYSQL_CONNECTION | |
Private Sub Command1_Click() | |
Set koneksi = New MYSQL_CONNECTION | |
Const host = "localhost" |
NewerOlder