Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
1
Task/Hostname/Arc/hostname.arc
Normal file
1
Task/Hostname/Arc/hostname.arc
Normal file
|
|
@ -0,0 +1 @@
|
|||
(system "hostname -f")
|
||||
13
Task/Hostname/FreeBASIC/hostname.freebasic
Normal file
13
Task/Hostname/FreeBASIC/hostname.freebasic
Normal 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
|
||||
1
Task/Hostname/Harbour/hostname.harbour
Normal file
1
Task/Hostname/Harbour/hostname.harbour
Normal file
|
|
@ -0,0 +1 @@
|
|||
? NetName()
|
||||
1
Task/Hostname/LFE/hostname.lfe
Normal file
1
Task/Hostname/LFE/hostname.lfe
Normal file
|
|
@ -0,0 +1 @@
|
|||
(net_adm:localhost)
|
||||
1
Task/Hostname/Lasso/hostname-1.lasso
Normal file
1
Task/Hostname/Lasso/hostname-1.lasso
Normal file
|
|
@ -0,0 +1 @@
|
|||
[web_request->httpHost]
|
||||
35
Task/Hostname/Lasso/hostname-2.lasso
Normal file
35
Task/Hostname/Lasso/hostname-2.lasso
Normal 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
|
||||
6
Task/Hostname/Lingo/hostname.lingo
Normal file
6
Task/Hostname/Lingo/hostname.lingo
Normal 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
|
||||
1
Task/Hostname/LiveCode/hostname.livecode
Normal file
1
Task/Hostname/LiveCode/hostname.livecode
Normal file
|
|
@ -0,0 +1 @@
|
|||
answer the hostName
|
||||
5
Task/Hostname/Nim/hostname.nim
Normal file
5
Task/Hostname/Nim/hostname.nim
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import posix
|
||||
const size = 64
|
||||
var s = cstring(newString(size))
|
||||
discard s.getHostname(size)
|
||||
echo s
|
||||
2
Task/Hostname/Sidef/hostname-1.sidef
Normal file
2
Task/Hostname/Sidef/hostname-1.sidef
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
var sys = frequire('Sys::Hostname');
|
||||
var host = sys.hostname;
|
||||
1
Task/Hostname/Sidef/hostname-2.sidef
Normal file
1
Task/Hostname/Sidef/hostname-2.sidef
Normal file
|
|
@ -0,0 +1 @@
|
|||
var host = `hostname`.chomp;
|
||||
1
Task/Hostname/Swift/hostname.swift
Normal file
1
Task/Hostname/Swift/hostname.swift
Normal file
|
|
@ -0,0 +1 @@
|
|||
print(ProcessInfo.processInfo.hostName)
|
||||
1
Task/Hostname/Ursa/hostname.ursa
Normal file
1
Task/Hostname/Ursa/hostname.ursa
Normal file
|
|
@ -0,0 +1 @@
|
|||
out (ursa.net.localhost.name) endl console
|
||||
Loading…
Add table
Add a link
Reference in a new issue