Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1 @@
(system "hostname -f")

View file

@ -0,0 +1,13 @@
' FB 1.05.0 Win64
' On Windows 10, the command line utility HOSTNAME.EXE prints the 'hostname' to the console.
' We can execute this remotely and read from its 'stdin' stream as follows:
Dim As String hostname
Open Pipe "hostname" For Input As #1
Input #1, hostname
Close #1
Print hostname
Print
Print "Press any key to quit"
Sleep

View file

@ -0,0 +1 @@
? NetName()

View file

@ -0,0 +1 @@
(net_adm:localhost)

View file

@ -0,0 +1 @@
[web_request->httpHost]

View file

@ -0,0 +1,35 @@
define host_name => thread {
data
public initiated::date, // when the thread was initiated. Most likely at Lasso server startup
private hostname::string // as reported by the servers hostname
public onCreate() => {
.reset
}
public reset() => {
if(lasso_version(-lassoplatform) >> 'Win') => {
protect => {
local(process = sys_process('cmd',(:'hostname.exe')))
#process -> wait
.hostname = string(#process -> readstring) -> trim&
#process -> close
}
else
protect => {
local(process = sys_process('/bin/hostname'))
#process -> wait
.hostname = string(#process -> readstring) -> trim&
#process -> close
}
}
.initiated = date(date -> format(`yyyyMMddHHmmss`)) // need to set format to get rid of nasty hidden fractions of seconds
.hostname -> size == 0 ? .hostname = 'undefined'
}
public asString() => .hostname
}
host_name

View file

@ -0,0 +1,6 @@
sx = xtra("Shell").new()
if the platform contains "win" then
hostname = sx.shell_cmd("hostname", ["eol":RETURN]).line[1] -- win 7 or later
else
hostname = sx.shell_cmd("hostname", RETURN).line[1]
end if

View file

@ -0,0 +1 @@
answer the hostName

View file

@ -0,0 +1,5 @@
import posix
const size = 64
var s = cstring(newString(size))
discard s.getHostname(size)
echo s

View file

@ -0,0 +1,2 @@
var sys = frequire('Sys::Hostname');
var host = sys.hostname;

View file

@ -0,0 +1 @@
var host = `hostname`.chomp;

View file

@ -0,0 +1 @@
print(ProcessInfo.processInfo.hostName)

View file

@ -0,0 +1 @@
out (ursa.net.localhost.name) endl console