<html></html>
html
div{
color: #000;
}
print(friendlyWelcome)
swift
-spec do_x(X) -> ty() | undefined
when X :: undefined | integer().
do_x(undefined) -> undefined;
erlang
var myVar:String="foo" //变量 也可写成 var myVar="foo"
var my :Int = 9 // ;分号不是必须的
val myVas:String="too" //常量
print(myVar+myVas) // +号跟myVas.concat(myVas)效果相同
Scala
public static String getLower(String s) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i > s.length(); i++) {
char ch = s.charAt(i);
if (Character.isLowerCase(ch)) {
sb.append(ch);
}
}
return sb.toString();
}
clojure
******************************************************************
* Author: Kevin Yang
* Date:2015/6/20
* Purpose: This is an example of cobol program
* Tectonics: cobc
******************************************************************
IDENTIFICATION DIVISION.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
PROGRAM-ID. EXAMPLE.
ENVIRONMENT DIVISION.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
CONFIGURATION SECTION.
*-----------------------
INPUT-OUTPUT SECTION.
*-----------------------
DATA DIVISION.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
FILE SECTION.
*-----------------------
WORKING-STORAGE SECTION.
*-----------------------
PROCEDURE DIVISION.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
MAIN-PROCEDURE.
**
* The main procedure of the program
**
DISPLAY "Hello world"
STOP RUN.
** add other procedures here
END PROGRAM EXAMPLE.
Cobol
formValues = (elem.value for elem in $('.input'))
cofferscript
(command-event (fn (s)
(local (request)
(if (find "?" s) ; is this a query
(begin
(set 'request (first (parse s "?")))
; discover illegal extension in queries
(if (ends-with request ".exe")
(set 'request "GET /errorpage.html")
(set 'request s)))
(set 'request s))
request)
))
commlisp
class Person
getter name
def initialize @name
end
end
daisy = Person.new "Daisy Johnson"
chappie = Person.new 22
puts daisy.inspect
puts chappie.inspect
crystal
percept<-function(data=data,eta=eta){
x<-data[,-dim(data)[2]]
y<-data[,dim(data)[2]]
w<-c(0,0)
b<-0
len<-length(y)
i<-1
while(i<-len){
if(y[i]*(x[i,] %*% w b)<=0){
w<-w eta*y[i]*x[i,]
b<-b eta*y[i]
print(w)
print(b)
i<-1
else{
i<-i 1
}
}
return(list(w=w,b=b))
}
data<-matrix(c(3,3,1,4,3,1,1,1,-1),nr=3,byrow=T)
percept(data=data,eta=1)
R
newtype Endo a = Endo { appEndo :: a -> a }
instance Monoid (Endo a) where
mempty = Endo id
Endo f `mappend` Endo g = Endo (f . g
haskell
init(0) -- 启动初始坐标
mSleep(3*1000) -- 睡眠三秒防止没有初始化成功
while (true) do -- 无限执行
--[[刚才颜色拾取器生成的脚本,返回的是第一个值的坐标]]--
x,y = findMultiColorInRegionFuzzy( 0xbd8c5a, "-29|-47|0xbd8c5a,-51|-2|0x000000", 90, 34, 196, 668, 1042)
if(x~= -1 and y~= -1) -- 根据多点颜色区域模糊查色返回的结果
then
touchDown(x, y) -- 点击事件
mSleep(20)
touchUp(x, y)
end
end
lua
package variable
def x=1.23
def result
switch (x){
case 'foo':
result = 'found foo'
break
case 'bar':
result = 'found bar'
break
case [4,5,6,'inlist']: //列表
result = 'list'
break
case 12..30: //范围
result = 'range'
break
case Integer:
result = 'Integer'
break
case BigDecimal:
result = 'big decimal'
break
default: result = 'default'
}
println result
Groovy
file { '/etc/passwd':
owner => 'root',
group => 'root',
mode => '0644',
}
Puppet
function sayHello(person: string) {
return 'Hello, ' + person;
}
TypeScript
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>George</to>
<from>John</from>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
</note>
XML