Instantly share code, notes, and snippets.

# Galih Hermawan galihboy

Created August 1, 2023 10:14
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
Created August 1, 2023 10:13
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
Created August 1, 2023 10:12
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
Created January 8, 2022 09:29
Fungsi all dan any praktis
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
Last active January 8, 2022 00:34
Pengambilan data terbesar dan terkecil
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:]
Created December 31, 2021 12:58
Menampilkan bilangan antara 300 dan 500 yang mana angka 4 hanya muncul satu kali
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
Created December 30, 2021 13:32
Mengetahui data list dengan kemunculan terbanyak
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 = [], []
Last active December 29, 2021 17:02
deret prima dengan kode pendek
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]
Created December 18, 2021 10:53
Deret bilangan bukan prima
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
Created November 6, 2021 10:47
vb6 mysql 01
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"