WeixiangYan/CodeTransOcean huggingface dataset:
Task: Search a list







Python: haystack=["Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo"]

for needle in ("Washington","Bush"):
  try:
    print haystack.index(needle), needle
  except ValueError, value_error:
    print needle,"is not in haystack"


VB: Function IsInArray(stringToBeFound As Variant, arr As Variant, _
    Optional start As Integer = 1, Optional reverse As Boolean = False) As Long

    Dim i As Long, lo As Long, hi As Long, stp As Long
    
    IsInArray = -1
    If reverse Then
        lo = UBound(arr): hi = start: stp = -1
    Else
        lo = start: hi = UBound(arr): stp = 1
    End If
    For i = lo To hi Step stp 
        If StrComp(stringToBeFound, arr(i), vbTextCompare) = 0 Then
            IsInArray = i
            Exit For
        End If
    Next i
End Function
Public Sub search_a_list()
    Dim haystack() As Variant, needles() As Variant
    haystack = [{"Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo"}]
    needles = [{"Washington","Bush"}]
    For i = 1 To 2
        If IsInArray(needles(i), haystack) = -1 Then
            Debug.Print needles(i); " not found in haystack."
        Else
            Debug.Print needles(i); " is at position "; CStr(IsInArray(needles(i), haystack)); ".";
            Debug.Print " And last position is ";
            Debug.Print CStr(IsInArray(needles(i), haystack, 1, True)); "."
        End If
    Next i
End Sub
Task: Search a list



C#: using System;
using System.Collections.Generic;

class Program {
    static void Main(string[] args) {
        List<string> haystack = new List<string>() { "Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty", "Charlie", "Bush", "Bozo" };

        foreach (string needle in new string[] { "Washington", "Bush" }) {
            int index = haystack.IndexOf(needle);
            
            if (index < 0) Console.WriteLine("{0} is not in haystack",needle);                
            else Console.WriteLine("{0} {1}",index,needle);
        }
    }
}


Go: package main

var haystack = []string{"Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty",
    "Charlie", "Bush", "Bozo", "Zag", "mouse", "hat", "cup", "deodorant",
    "television", "soap", "methamphetamine", "severed cat heads", "foo",
    "bar", "baz", "quux", "quuux", "quuuux", "bazola", "ztesch", "foo",
    "bar", "thud", "grunt", "foo", "bar", "bletch", "foo", "bar", "fum",
    "fred", "jim", "sheila", "barney", "flarp", "zxc", "spqr", ";wombat",
    "shme", "foo", "bar", "baz", "bongo", "spam", "eggs", "snork", "foo",
    "bar", "zot", "blarg", "wibble", "toto", "titi", "tata", "tutu", "pippo",
    "pluto", "paperino", "aap", "noot", "mies", "oogle", "foogle", "boogle",
    "zork", "gork", "bork", "sodium", "phosphorous", "californium",
    "copernicium", "gold", "thallium", "carbon", "silver", "gold", "copper",
    "helium", "sulfur"}
Task: Search a list





Java: import java.util.List;
import java.util.Arrays;

List<String> haystack = Arrays.asList("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");

for (String needle : new String[]{"Washington","Bush"}) {
    int index = haystack.indexOf(needle);
    if (index < 0)
        System.out.println(needle + " is not in haystack");
    else
        System.out.println(index + " " + needle);
}




VB: Function IsInArray(stringToBeFound As Variant, arr As Variant, _
    Optional start As Integer = 1, Optional reverse As Boolean = False) As Long

    Dim i As Long, lo As Long, hi As Long, stp As Long
    
    IsInArray = -1
    If reverse Then
        lo = UBound(arr): hi = start: stp = -1
    Else
        lo = start: hi = UBound(arr): stp = 1
    End If
    For i = lo To hi Step stp 
        If StrComp(stringToBeFound, arr(i), vbTextCompare) = 0 Then
            IsInArray = i
            Exit For
        End If
    Next i
End Function
Public Sub search_a_list()
    Dim haystack() As Variant, needles() As Variant
    haystack = [{"Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo"}]
    needles = [{"Washington","Bush"}]
    For i = 1 To 2
        If IsInArray(needles(i), haystack) = -1 Then
            Debug.Print needles(i); " not found in haystack."
        Else
            Debug.Print needles(i); " is at position "; CStr(IsInArray(needles(i), haystack)); ".";
            Debug.Print " And last position is ";
            Debug.Print CStr(IsInArray(needles(i), haystack, 1, True)); "."
        End If
    Next i
End Sub
Task: Search a list

C: #include <stdio.h>
#include <string.h>

const char *haystack[] = {
  "Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty", "Charlie",
  "Bush", "Boz", "Zag", NULL
};

int search_needle(const char *needle, const char **hs)
{
  int i = 0;
  while( hs[i] != NULL ) {
    if ( strcmp(hs[i], needle) == 0 ) return i;
    i++;
  }
  return -1;
}

int search_last_needle(const char *needle, const char **hs)
{
  int i, last=0;
  i = last = search_needle(needle, hs);
  if ( last < 0 ) return -1;
  while( hs[++i] != NULL ) {
    if ( strcmp(needle, hs[i]) == 0 ) {
      last = i;
    }
  }
  return last;
}

int main()
{
  printf("Bush is at %d\n", search_needle("Bush", haystack));
  if ( search_needle("Washington", haystack) == -1 )
    printf("Washington is not in the haystack\n");
  printf("First index for Zag: %d\n", search_needle("Zag", haystack));
  printf("Last index for Zag: %d\n", search_last_needle("Zag", haystack));
  return 0;
}





Java: import java.util.List;
import java.util.Arrays;

List<String> haystack = Arrays.asList("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");

for (String needle : new String[]{"Washington","Bush"}) {
    int index = haystack.indexOf(needle);
    if (index < 0)
        System.out.println(needle + " is not in haystack");
    else
        System.out.println(index + " " + needle);
}
Task: Search a list

C: #include <stdio.h>
#include <string.h>

const char *haystack[] = {
  "Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty", "Charlie",
  "Bush", "Boz", "Zag", NULL
};

int search_needle(const char *needle, const char **hs)
{
  int i = 0;
  while( hs[i] != NULL ) {
    if ( strcmp(hs[i], needle) == 0 ) return i;
    i++;
  }
  return -1;
}

int search_last_needle(const char *needle, const char **hs)
{
  int i, last=0;
  i = last = search_needle(needle, hs);
  if ( last < 0 ) return -1;
  while( hs[++i] != NULL ) {
    if ( strcmp(needle, hs[i]) == 0 ) {
      last = i;
    }
  }
  return last;
}

int main()
{
  printf("Bush is at %d\n", search_needle("Bush", haystack));
  if ( search_needle("Washington", haystack) == -1 )
    printf("Washington is not in the haystack\n");
  printf("First index for Zag: %d\n", search_needle("Zag", haystack));
  printf("Last index for Zag: %d\n", search_last_needle("Zag", haystack));
  return 0;
}






PHP: $haystack = array("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");

foreach (array("Washington","Bush") as $needle) {
  $i = array_search($needle, $haystack);
  if ($i === FALSE) // note: 0 is also considered false in PHP, so you need to specifically check for FALSE
    echo "$needle is not in haystack\n";
  else
    echo "$i $needle\n";
}
Task: Search a list



C#: using System;
using System.Collections.Generic;

class Program {
    static void Main(string[] args) {
        List<string> haystack = new List<string>() { "Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty", "Charlie", "Bush", "Bozo" };

        foreach (string needle in new string[] { "Washington", "Bush" }) {
            int index = haystack.IndexOf(needle);
            
            if (index < 0) Console.WriteLine("{0} is not in haystack",needle);                
            else Console.WriteLine("{0} {1}",index,needle);
        }
    }
}




PHP: $haystack = array("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");

foreach (array("Washington","Bush") as $needle) {
  $i = array_search($needle, $haystack);
  if ($i === FALSE) // note: 0 is also considered false in PHP, so you need to specifically check for FALSE
    echo "$needle is not in haystack\n";
  else
    echo "$i $needle\n";
}
Task: Search a list


C++: #include <string>
#include <algorithm>
#include <iterator>
#include <cstddef>
#include <exception>
#include <iostream>


class not_found: public std::exception
{
public:
  not_found(std::string const& s): text(s + " not found") {}
  char const* what() const throw() { return text.c_str(); }
  ~not_found() throw() {}
private:
  std::string text;
};


std::size_t get_index(std::string* haystack, int haystack_size, std::string needle)
{
  std::size_t index = std::find(haystack, haystack+haystack_size, needle) - haystack;
  if (index == haystack_size)
    throw not_found(needle);
  else
    return index;
}



template<typename FwdIter>
 typename std::iterator_traits<FwdIter>::difference_type fwd_get_index(FwdIter first, FwdIter last, std::string needle)
{
  FwdIter elem = std::find(first, last, needle);
  if (elem == last)
    throw not_found(needle);
  else
    return std::distance(first, elem);
}


template<typename InIter>
 typename std::iterator_traits<InIter>::difference_type generic_get_index(InIter first, InIter last, std::string needle)
{
  typename std::iterator_traits<InIter>::difference_type index = 0;
  while (first != last && *first != needle)
  {
    ++index;
    ++first;
  }
  if (first == last)
    throw not_found(needle);
  else
    return index;
}




std::string haystack[] = { "Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty", "Charlie", "Bush", "Bozo" };


template<typename T, std::size_t sz> T* begin(T (&array)[sz]) { return array; }
template<typename T, std::size_t sz> T* end(T (&array)[sz]) { return array + sz; }
template<typename T, std::size_t sz> std::size_t size(T (&array)[sz]) { return sz; }


void test(std::string const& needle)
{
  std::cout << "-- C style interface --\n";
  try
  {
    std::size_t index = get_index(haystack, size(haystack), needle);
    std::cout << needle << " found at index " << index << "\n";
  }
  catch(std::exception& exc) 
  {
    std::cout << exc.what() << "\n";
  }

  std::cout << "-- generic interface, first version --\n";
  try
  {
    std::size_t index = fwd_get_index(begin(haystack), end(haystack), needle);
    std::cout << needle << " found at index " << index << "\n";
  }
  catch(std::exception& exc) 
  {
    std::cout << exc.what() << "\n";
  }

  std::cout << "-- generic interface, second version --\n";
  try
  {
    std::size_t index = generic_get_index(begin(haystack), end(haystack), needle);
    std::cout << needle << " found at index " << index << "\n";
  }
  catch(std::exception& exc) 
  {
    std::cout << exc.what() << "\n";
  }
}

int main()
{
  std::cout << "\n=== Word which only occurs once ===\n";
  test("Wally");
  std::cout << "\n=== Word occuring multiple times ===\n";
  test("Bush");
  std::cout << "\n=== Word not occuring at all ===\n";
  test("Goofy");
}





PHP: $haystack = array("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");

foreach (array("Washington","Bush") as $needle) {
  $i = array_search($needle, $haystack);
  if ($i === FALSE) // note: 0 is also considered false in PHP, so you need to specifically check for FALSE
    echo "$needle is not in haystack\n";
  else
    echo "$i $needle\n";
}
Task: Search a list




Go: package main

var haystack = []string{"Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty",
    "Charlie", "Bush", "Bozo", "Zag", "mouse", "hat", "cup", "deodorant",
    "television", "soap", "methamphetamine", "severed cat heads", "foo",
    "bar", "baz", "quux", "quuux", "quuuux", "bazola", "ztesch", "foo",
    "bar", "thud", "grunt", "foo", "bar", "bletch", "foo", "bar", "fum",
    "fred", "jim", "sheila", "barney", "flarp", "zxc", "spqr", ";wombat",
    "shme", "foo", "bar", "baz", "bongo", "spam", "eggs", "snork", "foo",
    "bar", "zot", "blarg", "wibble", "toto", "titi", "tata", "tutu", "pippo",
    "pluto", "paperino", "aap", "noot", "mies", "oogle", "foogle", "boogle",
    "zork", "gork", "bork", "sodium", "phosphorous", "californium",
    "copernicium", "gold", "thallium", "carbon", "silver", "gold", "copper",
    "helium", "sulfur"}



PHP: $haystack = array("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");

foreach (array("Washington","Bush") as $needle) {
  $i = array_search($needle, $haystack);
  if ($i === FALSE) // note: 0 is also considered false in PHP, so you need to specifically check for FALSE
    echo "$needle is not in haystack\n";
  else
    echo "$i $needle\n";
}
Task: Search a list





Java: import java.util.List;
import java.util.Arrays;

List<String> haystack = Arrays.asList("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");

for (String needle : new String[]{"Washington","Bush"}) {
    int index = haystack.indexOf(needle);
    if (index < 0)
        System.out.println(needle + " is not in haystack");
    else
        System.out.println(index + " " + needle);
}


PHP: $haystack = array("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");

foreach (array("Washington","Bush") as $needle) {
  $i = array_search($needle, $haystack);
  if ($i === FALSE) // note: 0 is also considered false in PHP, so you need to specifically check for FALSE
    echo "$needle is not in haystack\n";
  else
    echo "$i $needle\n";
}
Task: Search a list






PHP: $haystack = array("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");

foreach (array("Washington","Bush") as $needle) {
  $i = array_search($needle, $haystack);
  if ($i === FALSE) // note: 0 is also considered false in PHP, so you need to specifically check for FALSE
    echo "$needle is not in haystack\n";
  else
    echo "$i $needle\n";
}


Python: haystack=["Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo"]

for needle in ("Washington","Bush"):
  try:
    print haystack.index(needle), needle
  except ValueError, value_error:
    print needle,"is not in haystack"
Task: Search a list






PHP: $haystack = array("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");

foreach (array("Washington","Bush") as $needle) {
  $i = array_search($needle, $haystack);
  if ($i === FALSE) // note: 0 is also considered false in PHP, so you need to specifically check for FALSE
    echo "$needle is not in haystack\n";
  else
    echo "$i $needle\n";
}



VB: Function IsInArray(stringToBeFound As Variant, arr As Variant, _
    Optional start As Integer = 1, Optional reverse As Boolean = False) As Long

    Dim i As Long, lo As Long, hi As Long, stp As Long
    
    IsInArray = -1
    If reverse Then
        lo = UBound(arr): hi = start: stp = -1
    Else
        lo = start: hi = UBound(arr): stp = 1
    End If
    For i = lo To hi Step stp 
        If StrComp(stringToBeFound, arr(i), vbTextCompare) = 0 Then
            IsInArray = i
            Exit For
        End If
    Next i
End Function
Public Sub search_a_list()
    Dim haystack() As Variant, needles() As Variant
    haystack = [{"Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo"}]
    needles = [{"Washington","Bush"}]
    For i = 1 To 2
        If IsInArray(needles(i), haystack) = -1 Then
            Debug.Print needles(i); " not found in haystack."
        Else
            Debug.Print needles(i); " is at position "; CStr(IsInArray(needles(i), haystack)); ".";
            Debug.Print " And last position is ";
            Debug.Print CStr(IsInArray(needles(i), haystack, 1, True)); "."
        End If
    Next i
End Sub
Task: HTTPS

C: #include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
CURL *curl;
char buffer[CURL_ERROR_SIZE];
int main(void) {
    if ((curl = curl_easy_init()) != NULL) {
        curl_easy_setopt(curl, CURLOPT_URL, "https:
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, buffer);
        if (curl_easy_perform(curl) != CURLE_OK) {
            fprintf(stderr, "%s\n", buffer);
            return EXIT_FAILURE;
        }
        curl_easy_cleanup(curl);
    }
    return EXIT_SUCCESS;
}



C#: using System;
using System.Net;

class Program
{
    static void Main(string[] args)
    {
        var client = new WebClient();
        var data = client.DownloadString("https:

        Console.WriteLine(data);
    }
}
Task: HTTPS

C: #include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
CURL *curl;
char buffer[CURL_ERROR_SIZE];
int main(void) {
    if ((curl = curl_easy_init()) != NULL) {
        curl_easy_setopt(curl, CURLOPT_URL, "https:
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, buffer);
        if (curl_easy_perform(curl) != CURLE_OK) {
            fprintf(stderr, "%s\n", buffer);
            return EXIT_FAILURE;
        }
        curl_easy_cleanup(curl);
    }
    return EXIT_SUCCESS;
}




Go: package main

import (
    "io"
    "log"
    "net/http"
    "os"
)

func main() {
    r, err := http.Get("https:
    if err != nil {
        log.Fatalln(err)
    }
    io.Copy(os.Stdout, r.Body)
}
Task: HTTPS

C: #include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
CURL *curl;
char buffer[CURL_ERROR_SIZE];
int main(void) {
    if ((curl = curl_easy_init()) != NULL) {
        curl_easy_setopt(curl, CURLOPT_URL, "https:
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, buffer);
        if (curl_easy_perform(curl) != CURLE_OK) {
            fprintf(stderr, "%s\n", buffer);
            return EXIT_FAILURE;
        }
        curl_easy_cleanup(curl);
    }
    return EXIT_SUCCESS;
}







Python: import urllib.request
print(urllib.request.urlopen("https://sourceforge.net/").read())
Task: HTTPS

C: #include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
CURL *curl;
char buffer[CURL_ERROR_SIZE];
int main(void) {
    if ((curl = curl_easy_init()) != NULL) {
        curl_easy_setopt(curl, CURLOPT_URL, "https:
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, buffer);
        if (curl_easy_perform(curl) != CURLE_OK) {
            fprintf(stderr, "%s\n", buffer);
            return EXIT_FAILURE;
        }
        curl_easy_cleanup(curl);
    }
    return EXIT_SUCCESS;
}








VB: Option Explicit

Const sURL="https://sourceforge.net/"

Dim oHTTP
Set oHTTP = CreateObject("Microsoft.XmlHTTP")

On Error Resume Next
oHTTP.Open "GET", sURL, False
oHTTP.Send ""
If Err.Number = 0 Then
     WScript.Echo oHTTP.responseText
Else
     Wscript.Echo "error " & Err.Number & ": " & Err.Description
End If

Set oHTTP = Nothing
Task: HTTPS



C#: using System;
using System.Net;

class Program
{
    static void Main(string[] args)
    {
        var client = new WebClient();
        var data = client.DownloadString("https:

        Console.WriteLine(data);
    }
}



Java: URL url = new URL("https:
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
Scanner scanner = new Scanner(connection.getInputStream());

while (scanner.hasNext()) {
    System.out.println(scanner.next());
}
Task: HTTPS




Go: package main

import (
    "io"
    "log"
    "net/http"
    "os"
)

func main() {
    r, err := http.Get("https:
    if err != nil {
        log.Fatalln(err)
    }
    io.Copy(os.Stdout, r.Body)
}


Java: URL url = new URL("https:
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
Scanner scanner = new Scanner(connection.getInputStream());

while (scanner.hasNext()) {
    System.out.println(scanner.next());
}
Task: HTTPS





Java: URL url = new URL("https:
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
Scanner scanner = new Scanner(connection.getInputStream());

while (scanner.hasNext()) {
    System.out.println(scanner.next());
}



Python: import urllib.request
print(urllib.request.urlopen("https://sourceforge.net/").read())
Task: HTTPS





Java: URL url = new URL("https:
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
Scanner scanner = new Scanner(connection.getInputStream());

while (scanner.hasNext()) {
    System.out.println(scanner.next());
}




VB: Option Explicit

Const sURL="https://sourceforge.net/"

Dim oHTTP
Set oHTTP = CreateObject("Microsoft.XmlHTTP")

On Error Resume Next
oHTTP.Open "GET", sURL, False
oHTTP.Send ""
If Err.Number = 0 Then
     WScript.Echo oHTTP.responseText
Else
     Wscript.Echo "error " & Err.Number & ": " & Err.Description
End If

Set oHTTP = Nothing
Task: HTTPS




Go: package main

import (
    "io"
    "log"
    "net/http"
    "os"
)

func main() {
    r, err := http.Get("https:
    if err != nil {
        log.Fatalln(err)
    }
    io.Copy(os.Stdout, r.Body)
}




Python: import urllib.request
print(urllib.request.urlopen("https://sourceforge.net/").read())
Task: HTTPS




Go: package main

import (
    "io"
    "log"
    "net/http"
    "os"
)

func main() {
    r, err := http.Get("https:
    if err != nil {
        log.Fatalln(err)
    }
    io.Copy(os.Stdout, r.Body)
}





VB: Option Explicit

Const sURL="https://sourceforge.net/"

Dim oHTTP
Set oHTTP = CreateObject("Microsoft.XmlHTTP")

On Error Resume Next
oHTTP.Open "GET", sURL, False
oHTTP.Send ""
If Err.Number = 0 Then
     WScript.Echo oHTTP.responseText
Else
     Wscript.Echo "error " & Err.Number & ": " & Err.Description
End If

Set oHTTP = Nothing
Task: HTTPS

C: #include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
CURL *curl;
char buffer[CURL_ERROR_SIZE];
int main(void) {
    if ((curl = curl_easy_init()) != NULL) {
        curl_easy_setopt(curl, CURLOPT_URL, "https:
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, buffer);
        if (curl_easy_perform(curl) != CURLE_OK) {
            fprintf(stderr, "%s\n", buffer);
            return EXIT_FAILURE;
        }
        curl_easy_cleanup(curl);
    }
    return EXIT_SUCCESS;
}





Java: URL url = new URL("https:
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
Scanner scanner = new Scanner(connection.getInputStream());

while (scanner.hasNext()) {
    System.out.println(scanner.next());
}
Task: HTTPS



C#: using System;
using System.Net;

class Program
{
    static void Main(string[] args)
    {
        var client = new WebClient();
        var data = client.DownloadString("https:

        Console.WriteLine(data);
    }
}


Go: package main

import (
    "io"
    "log"
    "net/http"
    "os"
)

func main() {
    r, err := http.Get("https:
    if err != nil {
        log.Fatalln(err)
    }
    io.Copy(os.Stdout, r.Body)
}
Task: HTTPS



C#: using System;
using System.Net;

class Program
{
    static void Main(string[] args)
    {
        var client = new WebClient();
        var data = client.DownloadString("https:

        Console.WriteLine(data);
    }
}






VB: Option Explicit

Const sURL="https://sourceforge.net/"

Dim oHTTP
Set oHTTP = CreateObject("Microsoft.XmlHTTP")

On Error Resume Next
oHTTP.Open "GET", sURL, False
oHTTP.Send ""
If Err.Number = 0 Then
     WScript.Echo oHTTP.responseText
Else
     Wscript.Echo "error " & Err.Number & ": " & Err.Description
End If

Set oHTTP = Nothing
Task: HTTPS



C#: using System;
using System.Net;

class Program
{
    static void Main(string[] args)
    {
        var client = new WebClient();
        var data = client.DownloadString("https:

        Console.WriteLine(data);
    }
}





Python: import urllib.request
print(urllib.request.urlopen("https://sourceforge.net/").read())
Task: HTTPS







Python: import urllib.request
print(urllib.request.urlopen("https://sourceforge.net/").read())


VB: Option Explicit

Const sURL="https://sourceforge.net/"

Dim oHTTP
Set oHTTP = CreateObject("Microsoft.XmlHTTP")

On Error Resume Next
oHTTP.Open "GET", sURL, False
oHTTP.Send ""
If Err.Number = 0 Then
     WScript.Echo oHTTP.responseText
Else
     Wscript.Echo "error " & Err.Number & ": " & Err.Description
End If

Set oHTTP = Nothing