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
test |
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
<ol><li><p>You will use Django fixtures, a feature to upload data from JSON. On Django workspace under folder <em>myapp</em>, create folder with name <strong><em>fixtures</em></strong></p><figure><img src="https://img-c.udemycdn.com/redactor/raw/create_lab_editor/2022-11-04_14-20-21-d9fde732955de2be0fb1489751dc1bdb.png" width="300px"></figure><p> </p><figure><img src="https://img-c.udemycdn.com/redactor/raw/create_lab_editor/2022-11-04_14-20-21-94bc3cb7fe582809bf8128af3297f264.png"></figure><figure><img src="https://img-c.udemycdn.com/redactor/raw/create_lab_editor/2022-11-04_14-20-22-21fb95f7b3eea3c8e6e64738650f96fe.png" width="300px"></figure></li><li><p>Download initial JSON data file from task's asset and upload it into Django workspace, folder fixtures</p><figure><img src="https://img-c.udemycdn.com/redactor/raw/create_lab_editor/2022-11-04_14-20-22-1dbdcb6470cac6c0049954ad37f77730.png" width="300px"></figure><figure><img src="https://img-c.udemycdn.com/redactor/raw/create_lab_editor/2022-11-04_14-2 |
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
<ol><li><p>Create a Python data model with the name <strong>CarManufacturer</strong>. Edit file <em>myapp/models.py </em>and add the following code</p><pre class="prettyprint linenums">class CarManufacturer(models.Model): | |
name = models.CharField(max_length=255) | |
origin_country = models.CharField(max_length=255) | |
description = models.TextField(max_length=4000)</pre><figure><img src="https://img-c.udemycdn.com/redactor/raw/create_lab_editor/2022-11-02_23-59-33-e2bbc68d358677718060cd50c8115f78.png"></figure></li><li><p>In the terminal, make sure you are in folder <em>~/code</em> by using the command <code>cd ~/code</code> </p><figure><img src="https://img-c.udemycdn.com/redactor/raw/create_lab_editor/2022-11-02_23-59-33-73b1272f0e5dc51bde51a3d9d20d4b34.png"></figure></li><li><p>Create the automatic Python-to-MySQL database migration using Django. Use command <code>python3 manage.py makemigrations</code></p><figure><img src="https://img-c.udemycdn.com/redactor/raw/create |
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
package com.example.secure; | |
import java.io.UnsupportedEncodingException; | |
import java.security.InvalidKeyException; | |
import java.security.SecureRandom; | |
import java.time.LocalDateTime; | |
import java.time.temporal.ChronoUnit; | |
import java.util.concurrent.ThreadLocalRandom; | |
import javax.crypto.BadPaddingException; |
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
package com.example.secure; | |
import java.time.LocalDateTime; | |
import com.fasterxml.jackson.annotation.JsonFormat; | |
import lombok.AllArgsConstructor; | |
import lombok.Builder; | |
import lombok.Data; | |
import lombok.NoArgsConstructor; |
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
package com.example.secure; | |
import java.io.UnsupportedEncodingException; | |
import java.nio.charset.StandardCharsets; | |
import java.security.InvalidAlgorithmParameterException; | |
import java.security.InvalidKeyException; | |
import java.security.KeyFactory; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.PrivateKey; | |
import java.security.PublicKey; |
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
import java.time.LocalDate; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.stream.IntStream; | |
import org.apache.kafka.connect.data.Schema; | |
import org.apache.kafka.connect.data.SchemaBuilder; | |
import org.apache.kafka.connect.data.Struct; | |
import io.confluent.ksql.function.udf.UdfParameter; |
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
version: "3" | |
networks: | |
kafka-net: | |
name: kafka-net | |
driver: bridge | |
services: | |
zookeeper: | |
image: docker.io/bitnami/zookeeper:3.8 |
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
import io.confluent.ksql.function.udf.Udf; | |
import io.confluent.ksql.function.udf.UdfDescription; | |
import io.confluent.ksql.function.udf.UdfParameter; | |
@UdfDescription(name = "loan_installment", category = "LOAN", author = "Timotius Pamungkas", version = "1.0.0", description = "User defined function for sample scalar loan business logic.") | |
public class LoanUdf { | |
@Udf(description = "Estimate monthly loan installment for loan principal amount X, " | |
+ "with loan interest rate per year is Y %, " + "over loan period Z month(s), " | |
+ "roundest to 2 digit decimal. All parameters are mandatory and can only accept value greater than 1") |
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
plugins { | |
id 'java' | |
id 'com.github.johnrengelman.shadow' version "7.1.2" | |
} | |
group = 'com.course.kafka' | |
version = '4.0.0' | |
sourceCompatibility = '11' | |
repositories { |
NewerOlder