This file contains hidden or 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
import numpy as np | |
import random | |
import matplotlib.pyplot as plt | |
# Define the coordinates of cities | |
city_names = ["Gliwice", "Cairo", "Rome", "Krakow", "Paris", "Alexandria", "Berlin", "Tokyo", "Hong Kong", "Rio"] | |
x = [0, 3, 6, 7, 15, 10, 16, 5, 8, 1.5] | |
y = [1, 2, 1, 4.5, -1, 2.5, 11, 6, 9, 12] | |
city_coords = dict(zip(city_names, zip(x, y))) |
This file contains hidden or 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
import numpy as np | |
import pandas as pd | |
# Define the Perceptron class (reuse the provided implementation) | |
class Perceptron: | |
def __init__(self, n_features, learning_rate=0.01, n_iters=100, initial_weights=None): | |
# Initialize weights with provided values or small random values between -1 and 1 | |
if initial_weights is not None: | |
self.weights = np.array(initial_weights) | |
else: |
This file contains hidden or 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
-> Android manifest | |
<service | |
android:name=".service.LocationService" | |
android:enabled="true" | |
android:exported="true" /> | |
----------------------------------------------------------------------------------------------------------------- | |
-> public class locationSevices |
This file contains hidden or 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
-> Android manifest | |
<service | |
android:name=".service.LocationService" | |
android:enabled="true" | |
android:exported="true" /> | |
----------------------------------------------------------------------------------------------------------------- | |
-> public class locationSevices |
This file contains hidden or 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
-> Android manifest | |
<service | |
android:name=".service.LocationService" | |
android:enabled="true" | |
android:exported="true" /> | |
----------------------------------------------------------------------------------------------------------------- | |
-> public class locationSevices |
This file contains hidden or 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
ViewHolder (Kotlin) | |
val rlBackground = itemView.findViewById<RelativeLayout>(R.id.rlBackground) | |
// init color parse | |
Int color = Color.parseColor("#ff0000") | |
// init background color | |
rlBackground.setBackgroundColor(check) |
This file contains hidden or 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
imageView.image = Qiscus.image(named: "ar_record")?.withRenderingMode(.alwaysTemplate) | |
imageView.layer.cornerRadius = 42 | |
imageView.clipsToBounds = true | |
imageView.tintColor = UIColor.red | |
imageView.backgroundColor = UIColor.white | |
This file contains hidden or 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
a: [866, 7920, 5963, 194, 262, 8640, 4270, 4677, 4496, 9983, 4757, 5561, 4330, 4293, 1729, 6863, 4856, 385, 6528, 2557, 6466, 9925, 3908, 3334, 8456, 2636, 2115, 2399, 3582, 5177, 6277, 7729, 9504, 3436, 6132, 1891, 5826, 8201, 1367, 9537, 6238, 7177, 3577, 7404, 6402, 2109, 6541, 8948, 4178, 1890, 686, 1919, 625, 7936, 5426, 5514, 6433, 7422, 8870, 3995, 2800, 4755, 3424, 2561, 124, 5007, 6171, 5142, 5830, 7374, 2192, 7624, 9092, 419, 5382, 1602, 214, 51, 5994, 4155, 7945, 9545, 3569, 5550, 6377, 6726, 2259, 8703, 6729, 6429, 6138, 5074, 256, 497, 8635, 4092, 6835, 1833, 3868, 6741, 9833, 5406, 6762, 141, 4322, 7555, 4104, 6494, 9568, 509, 9700, 3886, 5164, 6082, 9390, 1915, 5022, 4411, 3422, 9844, 1970, 3730, 9694, 697, 8820, 1819, 3160, 9549, 5344, 4167, 6639, 4417, 3009, 925, 5563, 7686, 8262, 3895, 9214, 6311, 2834, 914, 8317, 9163, 5388, 6638, 192, 8396, 5940, 2648, 2959, 462, 4597, 9453, 8993, 9706, 9599, 362, 9865, 3701, 4113, 4191, 1617, 3811, 3766, 5812, 7723, 6352, 3676, 6938, 8040, 7493, 412, 9138 |
This file contains hidden or 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
Qiscus.getChatConfig().setNotificationClickListener(new NotificationClickListener() { | |
@Override | |
public void onClick(final Context context, QiscusComment qiscusComment) { | |
QiscusChatRoom savedRoom = Qiscus.getDataStore().getChatRoom(qiscusComment.getRoomId()); | |
if (savedRoom != null) { | |
openChatroom(context, savedRoom); | |
} else { | |
QiscusApi.getInstance() | |
.getChatRoom(qiscusComment.getRoomId()) | |
.subscribeOn(Schedulers.io()) |
This file contains hidden or 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
public class FirebaseService extends QiscusFirebaseService { | |
@Override | |
public void onMessageReceived(RemoteMessage remoteMessage) { | |
Map<String, String> data = remoteMessage.getData(); | |
Log.d("onMessageReceived", "onMessageReceived: " + data.toString()); | |
if (QiscusFirebaseService.handleMessageReceived(remoteMessage)) { // SDK PN, contains key qiscus_sdk |
NewerOlder