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
| package com.sufyan97.learn_log4j; | |
| import org.apache.logging.log4j.Level; | |
| import org.apache.logging.log4j.LogManager; | |
| import org.apache.logging.log4j.Logger; | |
| public class LevelLogCustom { | |
| private static Logger log = LogManager.getLogger(LevelLogCustom.class); | |
| //custom BAHAYA_TA |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Configuration status="INFO"> | |
| <Appenders> | |
| <Console name="Console" target="SYSTEM_OUT"> | |
| <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" /> | |
| </Console> | |
| <File name="MyFile" fileName="all.log" immediateFlush="false" append="false"> | |
| <PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/> | |
| </File> | |
| </Appenders> |
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
| package com.sufyan97.learn_log4j; | |
| import org.apache.logging.log4j.LogManager; | |
| import org.apache.logging.log4j.Logger; | |
| public class LevelLog { | |
| private static Logger log = LogManager.getLogger(LevelLog.class); | |
| public static void main(String[] args) { | |
| log.trace("Hai ini trace"); |
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 cx_Oracle | |
| try: | |
| con = cx_Oracle.connect('demouser/demouser@localhost:1521/XEPDB1') | |
| print(con.version) | |
| cursor = con.cursor() | |
| print(cursor) |
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
| /* | |
| * Blink NodeMCU Build In | |
| * sufyan97 | |
| */ | |
| #define LED D0 //LED BUILD IN NodeMCU ada di GPIO16 (D0) | |
| void setup() { | |
| // put your setup code here, to run once: | |
| pinMode(LED, OUTPUT); |
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 AccessLambda { | |
| interface Clickable { | |
| void onClick(); | |
| } | |
| private Clickable action; | |
| void setClickAction(Clickable action) { | |
| this.action = action; | |
| } |
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 GameLambda { | |
| interface Clickable { | |
| void onClick(); | |
| } | |
| private Clickable action; | |
| void setClickAction(Clickable action) { | |
| this.action = action; | |
| } |
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 java.math.BigDecimal; | |
| public class NoArgument { | |
| interface Reference{ | |
| public BigDecimal getGravitionalEnergyValue(); | |
| } | |
| public void doCalculateForce() { | |
| Reference refInner= new Reference() { | |
| public BigDecimal getGravitionalEnergyValue() { |
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 Animalia{ | |
| class Carnivora { | |
| public void showPrey() { | |
| System.out.println("carnivora eat the meat"); | |
| } | |
| } | |
| public void discoverTiger(){ | |
| Carnivora tiger = new Carnivora(){ | |
| public void showPrey(){ |
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 Engine { | |
| interface Diesel { | |
| public void showFuelStatus(); | |
| } | |
| public void startEngine() { | |
| class V12Engine implements Diesel { | |
| Double fuelPercentage = 50.0; | |
| @Override |