Bagi teman-teman sekalian yang pengen belajar Latex, saya akan memberikan buku ala kadarnya yang jauh dari kesempurnaan. Semoga bisa dinikmati
Untuk downloadnya di:
Sesungguhnya shalat itu mencegah dari (perbuatan-perbuatan) keji dan mungkar
Q.S. Al-'Ankabut Ayat 45
$ref_file = get-content ./1.srt $cari = [regex] "^[1-9][0-9]{0,3}\b\s*$"; $cari1 = [regex] "-->"; $temp = ""; $i= 0; foreach($item in $ref_file){ if($item -match $cari){$i = [int]$item; } if($item -match $cari1){$temp = $item ; } } $temp = $temp.split("-->")[3].replace("\s+", "").split("[:,\,]"); $i++; # geser sedikit dalam microsecond $temp[3] = 200; ( get-content ./2.srt) | foreach-object{ $sambung = ""; if($_ -match $cari1){ $hasil = $_ -split $cari1 ; $first = $hasil[0].split("[:,\,]"); $second = $hasil[1].split("[:,\,]"); $first[3] = [int]$first[3] + $temp[3]; if([int] $first[3] -gt 1000){ $first[2] = [int]$first[2] + 1; $first[3] = [int]$first[3] - 1000; } $first[2] = [int] $first[2] + $temp[2]; if([int] $first[2] -gt 60){ $first[1] = [int]$first[1] + 1; $first[2] = [int]$first[2] - 60; } $first[1] = [int] $first[1] + $temp[1]; if([int] $first[1] -gt 60){ $first[0] = [int]$first[0] + 1; $first[1] = [int]$first[1] - 60; } $first[0] = [int] $first[0] + $temp[0]; $second[3] = [int] $second[3] + $temp[3]; if([int] $second[3] -gt 1000){ $second[2] = [int]$second[2] + 1; $second[3] = [int]$second[3] - 1000; } $second[2] = [int] $second[2] + $temp[2]; if([int] $second[2] -gt 60){ $second[1] = [int]$second[1] + 1; $second[2] = [int]$second[2] - 60; } $second[1] = [int] $second[1] + $temp[1]; if([int] $second[1] -gt 60){ $second[0] = [int]$second[0] + 1; $second[1] = [int]$second[1] - 60; } $second[0] = [int] $second[0] + $temp[0]; $sambung = $first[0]+":"+$first[1]+":"+$first[2]+","+$first[3]+" --> "+$second[0]+":"+$second[1]+":"+$second[2]+","+$second[3]; } # sebenarnya nomornya mau dirubah juga tapi g jadi # $_ -replace "^.*-->.*$" , $sambung -replace $cari , $i ; $_ -replace "^.*-->.*$" , $sambung ; # if($_ -match $cari){ # $i++; # } } | set-content ./2_baru.srt;
\allowframebreak
tapi itu ada masalah. Masalahnya adalah perintah itu akan mematikan overlay. Jadi tidak akan ada lagi efek warna-warni dalam presentasi anda. Cara yang paling bagus adalah menggunakan perintah \setcounter
. Perhatikan cuplikan berikut
% enumi penomoran asli Latex, sementara saveenumi adalah buatan kita \newcounter{saveenumi} \newcommand{\simpan}{\setcounter{saveenumi}{\value{enumi}}} \newcommand{\ambil}{\setcounter{enumi}{\value{saveenumi}}} \begin{frame} \begin{enumerate} \item Item satu \item Item dua % dst \item Item yang masih muat \simpan % simpan hitungan default \end{enumerate} \end{frame} \begin{frame} \begin{enumerate} \ambil % ambil hitungan yang disimpan \item Item seterusnya \end{enumerate} \end{frame}
package fjr.lain; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.Random; public class Criptografi1 { // ini adalah program kriptografi sederhana yang tidak mungkin bisa di decode kembali // kecuali jika anda bisa memahami benar pseudo random generator di java // istilahnya (pseudo) one-way cryptic static StringBuilder result ; public static String getResult(String input){ result = new StringBuilder(); String[] split = input.split("\\s"); Random rand = new Random(); for(int i=0; i< split.length; i++){ char[] temp = split[i].toCharArray(); if(!(rand.nextInt(2) == 0)){ //biar masih kebaca for(int j = 0; j< temp.length; j++){ int c = rand.nextInt(temp.length); char cc = temp[j]; temp[j] = temp[c]; temp[c] = cc; } } result .append(String.copyValueOf(temp)).append(" "); } return result.toString().toLowerCase(); } public static void main(String[]args){ BufferedReader br = null; try{ br = new BufferedReader(new FileReader(new File("D:/source.txt"))); String res = ""; while((res = br.readLine())!= null){ System.out.println(Criptografi1.getResult(res)); } }catch(Exception e){ } } }paad tulisan ini saya kana memberikan esbuha siiup untukmu eanosgr ho wahai skikaeh punaja aith aku kat uath apakah iin ubgsa abig tanesehka nautnjkgu yang jelas tiap lmmaa kua sangat rnidkmumneua aku ahner mengapa uka ibtuge taeg membiarkanku epabrhar aaudmp kau selalu mbripemi gabminaaa asnyaar ibas uesbebruht denganmu uka selalu berharap suatu tsaa aku jadi janda kau kana kuangkat jadi seorang ibu negara jkai aku nanti jadi presiden
# untuk mencari perintah tertentu pada isi suatu file program # dan mencari tahu pada baris mana perintah tersebut berada $a = dir ;# directory saat ini # string yang akan dicari, dalam hal ini perintah tertentu pada fortran $my_regex = [regex] "In+\spoute_2D" # iterasi untuk seluruh isi directory saat ini foreach($item in $a ){ # baca isi dari file masing-masing file $content = get-content $item; # iterasi terhadap baris dalam file $i = 0 ; # untuk menentukan pada baris mana perintah tersebut berada foreach($line in $content){ $hasilcari = $my_regex.matches($line) ; $hasilcari = $hasilcari[0]; # jika ditemukan setidaknya satu kali saja perintah tersebut if($hasilcari.success){ $i++ write-host "dapat di file $item, pada baris $i, pada perintah: $line" } } }Dan hasil eksekusinya bisa dilihat pada gambar berikut:
package fjr.booksample; import org.omg.CORBA.Environment; import javafx.scene.transform.Rotate; import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.geometry.Orientation; import javafx.scene.Group; import javafx.scene.GroupBuilder; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.scene.control.Slider; import javafx.scene.control.SliderBuilder; import javafx.scene.image.Image; import javafx.scene.image.ImageViewBuilder; import javafx.scene.layout.StackPane; /** * cari gambar sebanyak 46 buah (bisa juga sejumlah lain tapi biar mudahnya pake 46).. * kemudian namakan dengan pic1.jpg, pic2.jpg dst.... liat method getArrayImage di bawah.. :D * * @author meta alias trisna utami yang pacarnya suka ama lev landau... :D */ public class MakeABall extends Application { static final int NUM_ARRAY = 46; private void init(Stage primaryStage) { final Group root = new Group(); StackPane mainPane = new StackPane(); mainPane.setMinSize(800, 600); primaryStage.setScene(new Scene(mainPane)); Image[] images = MakeABall.getArrayImage(); final Group mainEnsembel = new Group(); int a = 0; Image[] imageA = new Image[12]; for (int i = 0; i < imageA.length; i++) { imageA[i] = images[a]; a++; } ImageEnsembel ensembelA = new ImageEnsembel(imageA, 0, 153); ensembelA.setTranslateX(200); ensembelA.setTranslateY(200); // ensembelA.ry.setAngle(12); mainEnsembel.getChildren().add(ensembelA); Image[] imageB = new Image[10]; for (int i = 0; i < imageB.length; i++) { imageB[i] = images[a]; a++; } Group ensembelB = new ImageEnsembel(imageB, 30, 140); ensembelB.setTranslateX(200); ensembelB.setTranslateY(290); mainEnsembel.getChildren().add(ensembelB); Image[] imageC = new Image[10]; for (int i = 0; i < imageC.length; i++) { imageC[i] = images[a]; a++; } ImageEnsembel ensembelC = new ImageEnsembel(imageC, 30, 140); ensembelC.setTranslateX(200); ensembelC.setTranslateY(150); ensembelC.rz.setAngle(180); mainEnsembel.getChildren().add(ensembelC); Image[] imageD = new Image[6]; for(int i =0 ;i < imageD.length; i++){ imageD[i] = images[a]; a++; } ImageEnsembel ensembelD = new ImageEnsembel(imageD, 65, 110); ensembelD.setTranslateX(200); ensembelD.setTranslateY(355); mainEnsembel.getChildren().add(ensembelD); Image[] imageE = new Image[6]; for(int i =0 ; i< imageE.length ; i++){ imageE[i] = images[a] ; a++; } // ImageEnsembel ensembelE = new ImageEnsembel(imageE, 65, 110); ensembelE.setTranslateX(200); ensembelE.setTranslateY(85); ensembelE.rz.setAngle(180); mainEnsembel.getChildren().add(ensembelE); Image[] imageF = new Image[2]; for(int i =0 ; i< imageF.length ; i++){ imageF[i] = images[a] ; a++; } // ImageEnsembel ensembelF = new ImageEnsembel(imageA, 0, 180); // ensembelF.setTranslateX(210); // ensembelF.setTranslateY(210); // ensembelF.rz.setAngle(90); // mainEnsembel.getChildren().add(ensembelF); mainEnsembel.setRotationAxis(Rotate.Y_AXIS); // mainEnsembel.setRotate(90); root.getChildren().add(mainEnsembel); final Group xGroup = new Group(); xGroup.getChildren().add(root); final Slider slider = SliderBuilder.create() .orientation(Orientation.VERTICAL).minWidth(50).minHeight(50) .value(50).maxHeight(70).translateX(-230).translateY(-200) .build(); slider.valueProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue arg0, Number arg1, Number arg2) { root.setRotationAxis(Rotate.X_AXIS); if (slider.getValue() < 50) { root.setRotate(slider.getValue() - 50); } else { root.setRotate(slider.getValue() - 50); } } }); final Slider slider2 = SliderBuilder.create() .orientation(Orientation.VERTICAL).minWidth(50).minHeight(50) .maxHeight(70).translateX(-200).translateY(-200).build(); slider2.valueProperty().addListener(new ChangeListener () { @Override public void changed(ObservableValue arg0, Number arg1, Number arg2) { mainEnsembel.setRotationAxis(Rotate.Y_AXIS); mainEnsembel.setRotate(slider2.getValue() * 2); } }); root.setRotationAxis(Rotate.X_AXIS); mainPane.getChildren().add(xGroup); mainPane.getChildren().addAll(slider, slider2); primaryStage.setResizable(true); } class ImageEnsembel extends Group implements Cloneable { final Rotate rx = new Rotate(0, Rotate.X_AXIS); final Rotate ry = new Rotate(0, Rotate.Y_AXIS); final Rotate rz = new Rotate(0, Rotate.Z_AXIS); public ImageEnsembel(Image[] images, double angles, double space) { super(); double angle = 0; double jarak = 360 / images.length; getTransforms().addAll(rx,ry,rz); for (int i = 0; i < images.length; i++) { Xform xform = new Xform(); xform.getChildren() .add(ImageViewBuilder.create().image(images[i]) .fitWidth(60).fitHeight(50) .preserveRatio(false) .rotationAxis(Rotate.Y_AXIS).rotate(90).build()); xform.rz.setAngle(angles); xform.setTranslateX(space); Xform xform1 = new Xform(); xform1.getChildren().add(xform); xform1.ry.setAngle(angle); getChildren().add(xform1); angle += jarak; } } public Object clone() throws CloneNotSupportedException{ return super.clone(); } } static String[] getArrayString() { String[] array = new String[NUM_ARRAY]; String a = "pic"; for (int i = 0; i < array.length; i++) { array[i] = a.concat(Integer.toString(i + 1).concat(".jpg")); } return array; } static Image[] getArrayImage() { Image[] array = new Image[NUM_ARRAY]; String[] arrStr = getArrayString(); for (int i = 0; i < array.length; i++) { array[i] = new Image(MakeABall.class.getResource(arrStr[i]) .toExternalForm()); } return array; } class Xform extends Group { final Rotate rx = new Rotate(0, Rotate.X_AXIS); final Rotate ry = new Rotate(0, Rotate.Y_AXIS); final Rotate rz = new Rotate(0, Rotate.Z_AXIS); public Xform() { super(); getTransforms().addAll(rz, ry, rx); } } @Override public void start(Stage primaryStage) throws Exception { init(primaryStage); primaryStage.show(); } public static void main(String[] args) { launch(args); } }
package fjr.booksample; import javafx.scene.transform.Rotate; import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.geometry.Orientation; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.scene.control.Slider; import javafx.scene.control.SliderBuilder; import javafx.scene.layout.StackPane; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.scene.shape.RectangleBuilder; //author fajar public class MakeABall extends Application { private void init(Stage primaryStage) { final Group root = new Group(); StackPane mainPane = new StackPane(); mainPane.setMinSize(500, 500); primaryStage.setScene(new Scene(mainPane)); Group ensembel = new Group(); double angle = 0; for (int i = 0; i < 10; i++) { Rectangle rect = RectangleBuilder.create().width(100).height(100) .rotationAxis(Rotate.Y_AXIS).rotate(90).fill(getColor()[i]) .build(); Xform xform = new Xform(); xform.getChildren().add(rect); xform.rz.setAngle(45); xform.setTranslateX(200); Xform xform1 = new Xform(); xform1.getChildren().add(xform); xform1.ry.setAngle(angle); ensembel.getChildren().add(xform1); angle += 36; } ensembel.setTranslateX(200); ensembel.setTranslateY(200); ensembel.setRotationAxis(Rotate.Z_AXIS); root.getChildren().add(ensembel); final Slider slider = SliderBuilder.create() .orientation(Orientation.VERTICAL).minWidth(50).minHeight(50) .maxHeight(70).translateX(-230).translateY(-200).build(); slider.valueProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue arg0, Number arg1, Number arg2) { root.setRotationAxis(Rotate.X_AXIS); root.setRotate(slider.getValue()); } }); final Slider slider2 = SliderBuilder.create() .orientation(Orientation.VERTICAL).minWidth(50).minHeight(50) .maxHeight(70).translateX(-190).translateY(-200).build(); slider2.valueProperty().addListener(new ChangeListener () { @Override public void changed(ObservableValue arg0, Number arg1, Number arg2) { root.setRotationAxis(Rotate.Y_AXIS); root.setRotate(slider2.getValue()); } }); mainPane.getChildren().add(root); mainPane.getChildren().addAll(slider, slider2); primaryStage.setResizable(true); } Color[] getColor() { Color[] colors = new Color[10]; colors[0] = Color.ALICEBLUE; colors[1] = Color.RED; colors[2] = Color.YELLOW; colors[3] = Color.YELLOWGREEN; colors[4] = Color.ALICEBLUE; colors[5] = Color.AQUAMARINE; colors[6] = Color.BISQUE; colors[7] = Color.BLUEVIOLET; colors[8] = Color.BROWN; colors[9] = Color.BURLYWOOD; return colors; } class Xform extends Group { final Rotate rx = new Rotate(0, Rotate.X_AXIS); final Rotate ry = new Rotate(0, Rotate.Y_AXIS); final Rotate rz = new Rotate(0, Rotate.Z_AXIS); public Xform() { super(); getTransforms().addAll(rz, ry, rx); } } @Override public void start(Stage primaryStage) throws Exception { init(primaryStage); primaryStage.show(); } public static void main(String[] args) { launch(args); } }