kazuyamaa/multi-language-messages-01 huggingface dataset:
Task: Array length
C++: #include <array>
#include <iostream>
#include <string>

int main() 
{
    std::array<std::string, 2> fruit { "apples", "oranges" };
    std::cout << fruit.size();
    return 0;
}

Python: arr = ['apple', 'orange']  

def setup():
    println(len(arr))
Task: Array length
C++: #include <array>
#include <iostream>
#include <string>

int main() 
{
    std::array<std::string, 2> fruit { "apples", "oranges" };
    std::cout << fruit.size();
    return 0;
}

VB: Debug.Print "Array Length: " & UBound(Array("apple", "orange")) + 1
Task: Array length
C#: using System;

namespace ArrayLength
{
  class Program
  {
    public static void Main()
    {
      var array = new String[]("apple", "orange");
      Console.WriteLine(array.Count);
      delete(array);
    }
  }
}

Python: arr = ['apple', 'orange']  

def setup():
    println(len(arr))
Task: Array length
C#: using System;

namespace ArrayLength
{
  class Program
  {
    public static void Main()
    {
      var array = new String[]("apple", "orange");
      Console.WriteLine(array.Count);
      delete(array);
    }
  }
}

VB: Debug.Print "Array Length: " & UBound(Array("apple", "orange")) + 1
Task: Array length
Python: arr = ['apple', 'orange']  

def setup():
    println(len(arr))

VB: Debug.Print "Array Length: " & UBound(Array("apple", "orange")) + 1
Task: Array length
C: #include <stdio.h>

int main()
{    
    const char *fruit[2] = { "apples", "oranges" };

    
    

    
    
    

    
    
    int length = sizeof(fruit) / sizeof(fruit[0]);

    printf("%d\n", length);

    return 0;
}

PHP: print count(['apple', 'orange']); // Returns 2
Task: Array length
C#: using System;

namespace ArrayLength
{
  class Program
  {
    public static void Main()
    {
      var array = new String[]("apple", "orange");
      Console.WriteLine(array.Count);
      delete(array);
    }
  }
}

PHP: print count(['apple', 'orange']); // Returns 2
Task: Array length
C++: #include <array>
#include <iostream>
#include <string>

int main() 
{
    std::array<std::string, 2> fruit { "apples", "oranges" };
    std::cout << fruit.size();
    return 0;
}

PHP: print count(['apple', 'orange']); // Returns 2
Task: Array length
Python: arr = ['apple', 'orange']  

def setup():
    println(len(arr))

PHP: print count(['apple', 'orange']); // Returns 2
Task: Array length
VB: Debug.Print "Array Length: " & UBound(Array("apple", "orange")) + 1

PHP: print count(['apple', 'orange']); // Returns 2
Task: Hostname
C: #include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <unistd.h>
 
int main(void)
{
 char name[_POSIX_HOST_NAME_MAX + 1];
 return gethostname(name, sizeof name) == -1 || printf("%s\n", name) < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}

C#: System.Net.Dns.GetHostName();
Task: Hostname
C: #include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <unistd.h>
 
int main(void)
{
 char name[_POSIX_HOST_NAME_MAX + 1];
 return gethostname(name, sizeof name) == -1 || printf("%s\n", name) < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}

Go: package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Println(os.Hostname())
}
Task: Hostname
C: #include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <unistd.h>
 
int main(void)
{
 char name[_POSIX_HOST_NAME_MAX + 1];
 return gethostname(name, sizeof name) == -1 || printf("%s\n", name) < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}

Java: import java.net.*;
class DiscoverHostName {
 public static void main(final String[] args) {
  try {
   System.out.println(InetAddress.getLocalHost().getHostName());
  } catch (UnknownHostException e) { 
  }
 }
}
Task: Hostname
C: #include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <unistd.h>
 
int main(void)
{
 char name[_POSIX_HOST_NAME_MAX + 1];
 return gethostname(name, sizeof name) == -1 || printf("%s\n", name) < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}

Python: import socket
host = socket.gethostname()
Task: Hostname
C: #include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <unistd.h>
 
int main(void)
{
 char name[_POSIX_HOST_NAME_MAX + 1];
 return gethostname(name, sizeof name) == -1 || printf("%s\n", name) < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}

VB: Set objNetwork = CreateObject("WScript.Network")
WScript.Echo objNetwork.ComputerName
Task: Hostname
C#: System.Net.Dns.GetHostName();

Go: package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Println(os.Hostname())
}
Task: Hostname
C#: System.Net.Dns.GetHostName();

Java: import java.net.*;
class DiscoverHostName {
 public static void main(final String[] args) {
  try {
   System.out.println(InetAddress.getLocalHost().getHostName());
  } catch (UnknownHostException e) { 
  }
 }
}
Task: Hostname
Go: package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Println(os.Hostname())
}

Java: import java.net.*;
class DiscoverHostName {
 public static void main(final String[] args) {
  try {
   System.out.println(InetAddress.getLocalHost().getHostName());
  } catch (UnknownHostException e) { 
  }
 }
}
Task: Hostname
Java: import java.net.*;
class DiscoverHostName {
 public static void main(final String[] args) {
  try {
   System.out.println(InetAddress.getLocalHost().getHostName());
  } catch (UnknownHostException e) { 
  }
 }
}

Python: import socket
host = socket.gethostname()
Task: Hostname
Java: import java.net.*;
class DiscoverHostName {
 public static void main(final String[] args) {
  try {
   System.out.println(InetAddress.getLocalHost().getHostName());
  } catch (UnknownHostException e) { 
  }
 }
}

VB: Set objNetwork = CreateObject("WScript.Network")
WScript.Echo objNetwork.ComputerName
Task: Hostname
Go: package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Println(os.Hostname())
}

VB: Set objNetwork = CreateObject("WScript.Network")
WScript.Echo objNetwork.ComputerName
Task: Hostname
Go: package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Println(os.Hostname())
}

Python: import socket
host = socket.gethostname()
Task: Hostname
C: #include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <unistd.h>
 
int main(void)
{
 char name[_POSIX_HOST_NAME_MAX + 1];
 return gethostname(name, sizeof name) == -1 || printf("%s\n", name) < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}

PHP: echo $_SERVER['HTTP_HOST'];
Task: Hostname
Go: package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Println(os.Hostname())
}

PHP: echo $_SERVER['HTTP_HOST'];
Task: Hostname
Java: import java.net.*;
class DiscoverHostName {
 public static void main(final String[] args) {
  try {
   System.out.println(InetAddress.getLocalHost().getHostName());
  } catch (UnknownHostException e) { 
  }
 }
}

PHP: echo $_SERVER['HTTP_HOST'];
Task: Greatest element of a list
C: #include <assert.h>

float max(unsigned int count, float values[]) {
     assert(count > 0);
     size_t idx;
     float themax = values[0];
     for(idx = 1; idx < count; ++idx) {
          themax = values[idx] > themax ? values[idx] : themax;
     }
     return themax;
}

C#: int[] values = new int[] {1,2,3,4,5,6,7,8,9,10};

int max = values.Max();
Task: Greatest element of a list
C: #include <assert.h>

float max(unsigned int count, float values[]) {
     assert(count > 0);
     size_t idx;
     float themax = values[0];
     for(idx = 1; idx < count; ++idx) {
          themax = values[idx] > themax ? values[idx] : themax;
     }
     return themax;
}

C++: #include <algorithm>  
#include <iterator>   
#include <functional> 

template<class It, class Comp = std::less<>>
    
constexpr auto max_value(It first, It last, Comp compare = std::less{})
{
    
    return *std::max_element(first, last, compare);
}

template<class C, class Comp = std::less<>>
    
constexpr auto max_value(const C& container, Comp compare = std::less{})
{
    
    using std::begin; using std::end;
    return max_value(begin(container), end(container), compare);
}
Task: Greatest element of a list
C: #include <assert.h>

float max(unsigned int count, float values[]) {
     assert(count > 0);
     size_t idx;
     float themax = values[0];
     for(idx = 1; idx < count; ++idx) {
          themax = values[idx] > themax ? values[idx] : themax;
     }
     return themax;
}

Go: package main

import (
    "fmt"

    "github.com/gonum/floats"
)

func main() {
	fmt.Println(floats.Max([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
	fmt.Println(floats.Min([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
}
Task: Greatest element of a list
C: #include <assert.h>

float max(unsigned int count, float values[]) {
     assert(count > 0);
     size_t idx;
     float themax = values[0];
     for(idx = 1; idx < count; ++idx) {
          themax = values[idx] > themax ? values[idx] : themax;
     }
     return themax;
}

Python: max(values)
Task: Greatest element of a list
C#: int[] values = new int[] {1,2,3,4,5,6,7,8,9,10};

int max = values.Max();

C++: #include <algorithm>  
#include <iterator>   
#include <functional> 

template<class It, class Comp = std::less<>>
    
constexpr auto max_value(It first, It last, Comp compare = std::less{})
{
    
    return *std::max_element(first, last, compare);
}

template<class C, class Comp = std::less<>>
    
constexpr auto max_value(const C& container, Comp compare = std::less{})
{
    
    using std::begin; using std::end;
    return max_value(begin(container), end(container), compare);
}
Task: Greatest element of a list
C++: #include <algorithm>  
#include <iterator>   
#include <functional> 

template<class It, class Comp = std::less<>>
    
constexpr auto max_value(It first, It last, Comp compare = std::less{})
{
    
    return *std::max_element(first, last, compare);
}

template<class C, class Comp = std::less<>>
    
constexpr auto max_value(const C& container, Comp compare = std::less{})
{
    
    using std::begin; using std::end;
    return max_value(begin(container), end(container), compare);
}

Java: public static float max(float[] values) throws NoSuchElementException {
    if (values.length == 0)
        throw new NoSuchElementException();
    float themax = values[0];
    for (int idx = 1; idx < values.length; ++idx) {
        if (values[idx] > themax)
            themax = values[idx];
    }
    return themax;
}
Task: Greatest element of a list
C++: #include <algorithm>  
#include <iterator>   
#include <functional> 

template<class It, class Comp = std::less<>>
    
constexpr auto max_value(It first, It last, Comp compare = std::less{})
{
    
    return *std::max_element(first, last, compare);
}

template<class C, class Comp = std::less<>>
    
constexpr auto max_value(const C& container, Comp compare = std::less{})
{
    
    using std::begin; using std::end;
    return max_value(begin(container), end(container), compare);
}

Python: max(values)
Task: Greatest element of a list
C++: #include <algorithm>  
#include <iterator>   
#include <functional> 

template<class It, class Comp = std::less<>>
    
constexpr auto max_value(It first, It last, Comp compare = std::less{})
{
    
    return *std::max_element(first, last, compare);
}

template<class C, class Comp = std::less<>>
    
constexpr auto max_value(const C& container, Comp compare = std::less{})
{
    
    using std::begin; using std::end;
    return max_value(begin(container), end(container), compare);
}

VB: functioni FindMax(...) as double
    dim x as integer
        
    for x = 1 to ParamValCount
        IF ParamVal(x) > Result THEN Result = ParamVal(x)
    next
End functioni

Print FindMax(50, 20, 65, 20, 105)
Task: Greatest element of a list
C#: int[] values = new int[] {1,2,3,4,5,6,7,8,9,10};

int max = values.Max();

Python: max(values)
Task: Greatest element of a list
C#: int[] values = new int[] {1,2,3,4,5,6,7,8,9,10};

int max = values.Max();

VB: functioni FindMax(...) as double
    dim x as integer
        
    for x = 1 to ParamValCount
        IF ParamVal(x) > Result THEN Result = ParamVal(x)
    next
End functioni

Print FindMax(50, 20, 65, 20, 105)
Task: Greatest element of a list
Java: public static float max(float[] values) throws NoSuchElementException {
    if (values.length == 0)
        throw new NoSuchElementException();
    float themax = values[0];
    for (int idx = 1; idx < values.length; ++idx) {
        if (values[idx] > themax)
            themax = values[idx];
    }
    return themax;
}

Python: max(values)
Task: Greatest element of a list
Go: package main

import (
    "fmt"

    "github.com/gonum/floats"
)

func main() {
	fmt.Println(floats.Max([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
	fmt.Println(floats.Min([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
}

Python: max(values)
Task: Greatest element of a list
Go: package main

import (
    "fmt"

    "github.com/gonum/floats"
)

func main() {
	fmt.Println(floats.Max([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
	fmt.Println(floats.Min([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
}

VB: functioni FindMax(...) as double
    dim x as integer
        
    for x = 1 to ParamValCount
        IF ParamVal(x) > Result THEN Result = ParamVal(x)
    next
End functioni

Print FindMax(50, 20, 65, 20, 105)
Task: Greatest element of a list
Python: max(values)

VB: functioni FindMax(...) as double
    dim x as integer
        
    for x = 1 to ParamValCount
        IF ParamVal(x) > Result THEN Result = ParamVal(x)
    next
End functioni

Print FindMax(50, 20, 65, 20, 105)
Task: Greatest element of a list
C: #include <assert.h>

float max(unsigned int count, float values[]) {
     assert(count > 0);
     size_t idx;
     float themax = values[0];
     for(idx = 1; idx < count; ++idx) {
          themax = values[idx] > themax ? values[idx] : themax;
     }
     return themax;
}

VB: functioni FindMax(...) as double
    dim x as integer
        
    for x = 1 to ParamValCount
        IF ParamVal(x) > Result THEN Result = ParamVal(x)
    next
End functioni

Print FindMax(50, 20, 65, 20, 105)
Task: Greatest element of a list
C++: #include <algorithm>  
#include <iterator>   
#include <functional> 

template<class It, class Comp = std::less<>>
    
constexpr auto max_value(It first, It last, Comp compare = std::less{})
{
    
    return *std::max_element(first, last, compare);
}

template<class C, class Comp = std::less<>>
    
constexpr auto max_value(const C& container, Comp compare = std::less{})
{
    
    using std::begin; using std::end;
    return max_value(begin(container), end(container), compare);
}

Go: package main

import (
    "fmt"

    "github.com/gonum/floats"
)

func main() {
	fmt.Println(floats.Max([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
	fmt.Println(floats.Min([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
}
Task: Greatest element of a list
C#: int[] values = new int[] {1,2,3,4,5,6,7,8,9,10};

int max = values.Max();

Go: package main

import (
    "fmt"

    "github.com/gonum/floats"
)

func main() {
	fmt.Println(floats.Max([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
	fmt.Println(floats.Min([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
}
Task: Greatest element of a list
Go: package main

import (
    "fmt"

    "github.com/gonum/floats"
)

func main() {
	fmt.Println(floats.Max([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
	fmt.Println(floats.Min([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
}

Java: public static float max(float[] values) throws NoSuchElementException {
    if (values.length == 0)
        throw new NoSuchElementException();
    float themax = values[0];
    for (int idx = 1; idx < values.length; ++idx) {
        if (values[idx] > themax)
            themax = values[idx];
    }
    return themax;
}
Task: Greatest element of a list
C: #include <assert.h>

float max(unsigned int count, float values[]) {
     assert(count > 0);
     size_t idx;
     float themax = values[0];
     for(idx = 1; idx < count; ++idx) {
          themax = values[idx] > themax ? values[idx] : themax;
     }
     return themax;
}

Java: public static float max(float[] values) throws NoSuchElementException {
    if (values.length == 0)
        throw new NoSuchElementException();
    float themax = values[0];
    for (int idx = 1; idx < values.length; ++idx) {
        if (values[idx] > themax)
            themax = values[idx];
    }
    return themax;
}
Task: Greatest element of a list
C#: int[] values = new int[] {1,2,3,4,5,6,7,8,9,10};

int max = values.Max();

Java: public static float max(float[] values) throws NoSuchElementException {
    if (values.length == 0)
        throw new NoSuchElementException();
    float themax = values[0];
    for (int idx = 1; idx < values.length; ++idx) {
        if (values[idx] > themax)
            themax = values[idx];
    }
    return themax;
}
Task: Greatest element of a list
Java: public static float max(float[] values) throws NoSuchElementException {
    if (values.length == 0)
        throw new NoSuchElementException();
    float themax = values[0];
    for (int idx = 1; idx < values.length; ++idx) {
        if (values[idx] > themax)
            themax = values[idx];
    }
    return themax;
}

VB: functioni FindMax(...) as double
    dim x as integer
        
    for x = 1 to ParamValCount
        IF ParamVal(x) > Result THEN Result = ParamVal(x)
    next
End functioni

Print FindMax(50, 20, 65, 20, 105)
Task: Greatest element of a list
C: #include <assert.h>

float max(unsigned int count, float values[]) {
     assert(count > 0);
     size_t idx;
     float themax = values[0];
     for(idx = 1; idx < count; ++idx) {
          themax = values[idx] > themax ? values[idx] : themax;
     }
     return themax;
}

PHP: max($values)
Task: Greatest element of a list
C#: int[] values = new int[] {1,2,3,4,5,6,7,8,9,10};

int max = values.Max();

PHP: max($values)
Task: Greatest element of a list
C++: #include <algorithm>  
#include <iterator>   
#include <functional> 

template<class It, class Comp = std::less<>>
    
constexpr auto max_value(It first, It last, Comp compare = std::less{})
{
    
    return *std::max_element(first, last, compare);
}

template<class C, class Comp = std::less<>>
    
constexpr auto max_value(const C& container, Comp compare = std::less{})
{
    
    using std::begin; using std::end;
    return max_value(begin(container), end(container), compare);
}

PHP: max($values)
Task: Greatest element of a list
Go: package main

import (
    "fmt"

    "github.com/gonum/floats"
)

func main() {
	fmt.Println(floats.Max([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
	fmt.Println(floats.Min([]float64{63, 70, 37, 34, 83, 27, 19, 97, 9, 17})) 
}

PHP: max($values)
Task: Greatest element of a list
Java: public static float max(float[] values) throws NoSuchElementException {
    if (values.length == 0)
        throw new NoSuchElementException();
    float themax = values[0];
    for (int idx = 1; idx < values.length; ++idx) {
        if (values[idx] > themax)
            themax = values[idx];
    }
    return themax;
}

PHP: max($values)
Task: Greatest element of a list
VB: functioni FindMax(...) as double
    dim x as integer
        
    for x = 1 to ParamValCount
        IF ParamVal(x) > Result THEN Result = ParamVal(x)
    next
End functioni

Print FindMax(50, 20, 65, 20, 105)

PHP: max($values)
Task: Events
C: #include <stdio.h>
#include <unistd.h>

int main()
{
	int p[2];
	pipe(p);
	if (fork()) {
		close(p[0]);
		sleep(1);
		write(p[1], p, 1);
		wait(0);
	} else {
		close(p[1]);
		read(p[0], p + 1, 1);
		puts("received signal from pipe");
	}
	return 0;
}

C#: using System;
using System.Timers;

class Program
{
    static void Main()
    {
        var timer = new Timer(1000);
        timer.Elapsed += new ElapsedEventHandler(OnElapsed);
        Console.WriteLine(DateTime.Now);
        timer.Start();
        Console.ReadLine();
    }

    static void OnElapsed(object sender, ElapsedEventArgs eventArgs)
    {
        Console.WriteLine(eventArgs.SignalTime);
        ((Timer)sender).Stop();
    }
}
Task: Events
C: #include <stdio.h>
#include <unistd.h>

int main()
{
	int p[2];
	pipe(p);
	if (fork()) {
		close(p[0]);
		sleep(1);
		write(p[1], p, 1);
		wait(0);
	} else {
		close(p[1]);
		read(p[0], p + 1, 1);
		puts("received signal from pipe");
	}
	return 0;
}

Go: package main

import (
    "log"
    "os"
    "time"
)

func main() {
    l := log.New(os.Stdout, "", log.Ltime | log.Lmicroseconds)
    l.Println("program start")
    event := make(chan int)
    go func() {
        l.Println("task start")
        <-event
        l.Println("event reset by task")
    }()
    l.Println("program sleeping")
    time.Sleep(1 * time.Second)
    l.Println("program signaling event")
    event <- 0
    time.Sleep(100 * time.Millisecond)
}
Task: Events
C: #include <stdio.h>
#include <unistd.h>

int main()
{
	int p[2];
	pipe(p);
	if (fork()) {
		close(p[0]);
		sleep(1);
		write(p[1], p, 1);
		wait(0);
	} else {
		close(p[1]);
		read(p[0], p + 1, 1);
		puts("received signal from pipe");
	}
	return 0;
}

Python: import threading
import time


def wait_for_event(event):
    event.wait()
    print("Thread: Got event")

e = threading.Event()

t = threading.Thread(target=wait_for_event, args=(e,))
t.start()

print("Main: Waiting one second")
time.sleep(1.0)
print("Main: Setting event")
e.set()
time.sleep(1.0)
print("Main: Done")
t.join()
Task: Events
C#: using System;
using System.Timers;

class Program
{
    static void Main()
    {
        var timer = new Timer(1000);
        timer.Elapsed += new ElapsedEventHandler(OnElapsed);
        Console.WriteLine(DateTime.Now);
        timer.Start();
        Console.ReadLine();
    }

    static void OnElapsed(object sender, ElapsedEventArgs eventArgs)
    {
        Console.WriteLine(eventArgs.SignalTime);
        ((Timer)sender).Stop();
    }
}

Go: package main

import (
    "log"
    "os"
    "time"
)

func main() {
    l := log.New(os.Stdout, "", log.Ltime | log.Lmicroseconds)
    l.Println("program start")
    event := make(chan int)
    go func() {
        l.Println("task start")
        <-event
        l.Println("event reset by task")
    }()
    l.Println("program sleeping")
    time.Sleep(1 * time.Second)
    l.Println("program signaling event")
    event <- 0
    time.Sleep(100 * time.Millisecond)
}
Task: Events
C#: using System;
using System.Timers;

class Program
{
    static void Main()
    {
        var timer = new Timer(1000);
        timer.Elapsed += new ElapsedEventHandler(OnElapsed);
        Console.WriteLine(DateTime.Now);
        timer.Start();
        Console.ReadLine();
    }

    static void OnElapsed(object sender, ElapsedEventArgs eventArgs)
    {
        Console.WriteLine(eventArgs.SignalTime);
        ((Timer)sender).Stop();
    }
}

Python: import threading
import time


def wait_for_event(event):
    event.wait()
    print("Thread: Got event")

e = threading.Event()

t = threading.Thread(target=wait_for_event, args=(e,))
t.start()

print("Main: Waiting one second")
time.sleep(1.0)
print("Main: Setting event")
e.set()
time.sleep(1.0)
print("Main: Done")
t.join()
Task: Events
Go: package main

import (
    "log"
    "os"
    "time"
)

func main() {
    l := log.New(os.Stdout, "", log.Ltime | log.Lmicroseconds)
    l.Println("program start")
    event := make(chan int)
    go func() {
        l.Println("task start")
        <-event
        l.Println("event reset by task")
    }()
    l.Println("program sleeping")
    time.Sleep(1 * time.Second)
    l.Println("program signaling event")
    event <- 0
    time.Sleep(100 * time.Millisecond)
}

Python: import threading
import time


def wait_for_event(event):
    event.wait()
    print("Thread: Got event")

e = threading.Event()

t = threading.Thread(target=wait_for_event, args=(e,))
t.start()

print("Main: Waiting one second")
time.sleep(1.0)
print("Main: Setting event")
e.set()
time.sleep(1.0)
print("Main: Done")
t.join()
Task: Variadic function
C: #include <stdio.h>
#include <stdarg.h>

void varstrings(int count, ...)   
{
    va_list args;
    va_start(args, count);
    while (count--)
        puts(va_arg(args, const char *));
    va_end(args);
}

varstrings(5, "Mary", "had", "a", "little", "lamb");

C#: using System;

class Program {
    static void Main(string[] args) {
        PrintAll("test", "rosetta code", 123, 5.6);
    }

    static void PrintAll(params object[] varargs) {
        foreach (var i in varargs) {
            Console.WriteLine(i);
        }
    }
}