Following is the Find and Replace with syntax, make sure the Regular expression is selected
Find: (\w)(\w+)
Replace with: \u\1\2
Following is the Find and Replace with syntax, make sure the Regular expression is selected
Find: (\w)(\w+)
Replace with: \u\1\2
First we define a function which contains all the needed procedures. and save the script in
(define (batch-reduce-img-size pattern reduceby) (let* ((filelist (cadr (file-glob pattern 1)))) (while (not (null? filelist)) (let* ((filename (car filelist)) (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (imageWidth (car (gimp-image-width image))) (imageHeight (car (gimp-image-height image))) (newWidth (* imageWidth reduceby)) (newHeight (* imageHeight reduceby)) (drawable (car (gimp-image-get-active-layer image)))) (gimp-image-scale image newWidth newHeight) (gimp-file-save 1 image drawable filename filename) (gimp-image-delete image)) (set! filelist (cdr filelist)))))
gimp -i -b '(batch-reduce-img-size "*.JPG" 0.5)' -b '(gimp-quit 0)
Traditional Function | ES6 Arrow Function |
function myFunction() { | const myFunction = () => { |
function myFunction(name) { ... } | const myFunction = (name) => { ... } const myFunction = name => { ... } |
function add(n, m) { | const add = (n, m) => n+m;if a single line return then the return keyword and the curly brackets can be omitted |
const newArray = [...oldArray, 1, 2];
const newObject = {...oldObject, newProerty:newValue}
function sortArgs(...args) {
return args.sort();
}
[a, b] = ["Hello", "World"]
console.log(a) // Hello
console.log(b) // World
{name} = {"name": "Aang", "age" : 112}
console.log(name) // Aang
console.log(age) // undefined
<html> <body> <canvas id="drawArea" width="1024" height="768"></canvas> </body> <script> var canvas = document.getElementById("drawArea"); var canvasContext = canvas.getContext("2d"); canvasContext.fillStyle = "black"; canvasContext.beginPath(); canvasContext.arc(100, 100, 50, 0, Math.PI*2, true); canvasContext.fill(); </script> </html>
canvasContext.fillStyle="black";
canvasContext.beginPath();canvasContext.moveTo(100,100); canvasContext.lineTo(150,100); canvasContext.arc(100, 100, 50, 0, Math.PI/2, false); canvasContext.lineTo(100, 100); canvasContext.fill();
canvasContext.storeStyle="black"; canvasContext.beginPath(); canvasContext.moveTo(100,100); canvasContext.lineTo(150,100); canvasContext.arc(100, 100, 50, 0, Math.PI/2, false); canvasContext.lineTo(100, 100); canvasContext.stroke();
#include <stdio.h> void sayHello() { printf("Hello world, from C\n"); }
public class HelloWorld { private native void callCHello(); static { System.loadLibrary("chello"); } public static void main(String[] args) { new HelloWorld().callCHello(); } }Here we are loading the chello C library (we will be creating in the later part) which contains the implementation for the native method callCHello()
javac HelloWorld.java
javah HelloWorld
#include <jni.h> #include <stdio.h> #include "HelloWorld.h"#include "hello.c" JNIEXPORT void JNICALL Java_HelloWorld_callCHello(JNIEnv *env, jobject obj) { sayHello(); return; }
gcc chello.c -I $JAVA_HOME/include/ -I $JAVA_HOME/include/linux/ -shared -o libhello.so -fPIC
java HelloWorld
public class SampleClassMediator extends AbstractMediator {
private static final Log log = LogFactory.getLog(SampleClassMediator.class);
public boolean mediate(MessageContext messageContext) {
log.info("This is a sample class mediator");
return true;
}
}