Instruction stringlengths 45 106 | input_code stringlengths 1 13.7k | output_code stringlengths 1 13.7k |
|---|---|---|
Maintain the same structure and functionality when rewriting this code in C. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Port the following code from AWK to C# with equivalent syntax and logic. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Produce a functionally identical C# code for the snippet given in AWK. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Write the same code in C++ as shown below in AWK. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Keep all operations the same but rewrite the snippet in C++. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Transform the following AWK implementation into Java, maintaining the same output and logic. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Generate a Java translation of this AWK snippet without changing its computational steps. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Write the same code in Python as shown below in AWK. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Change the following AWK code into Python without altering its purpose. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Produce a language-to-language conversion: from AWK to VB, same semantics. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Change the programming language of this snippet from AWK to VB without modifying what it does. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Produce a functionally identical Go code for the snippet given in AWK. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Generate an equivalent Go version of this AWK code. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Rewrite the snippet below in C so it works the same as the original BBC_Basic code. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Preserve the algorithm and functionality while converting the code from BBC_Basic to C. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Can you help me rewrite this code in C# instead of BBC_Basic, keeping it the same logically? | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Translate the given BBC_Basic code snippet into C# without altering its behavior. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Maintain the same structure and functionality when rewriting this code in C++. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Rewrite this program in C++ while keeping its functionality equivalent to the BBC_Basic version. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Write the same algorithm in Java as shown in this BBC_Basic implementation. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Ensure the translated Java code behaves exactly like the original BBC_Basic snippet. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Convert this BBC_Basic snippet to Python and keep its semantics consistent. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Rewrite this program in Python while keeping its functionality equivalent to the BBC_Basic version. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Rewrite the snippet below in VB so it works the same as the original BBC_Basic code. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Port the following code from BBC_Basic to VB with equivalent syntax and logic. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Convert this BBC_Basic block to Go, preserving its control flow and logic. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Transform the following BBC_Basic implementation into Go, maintaining the same output and logic. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Please provide an equivalent version of this Clojure code in C. | (println (java.util.Date. 0))
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Generate a C translation of this Clojure snippet without changing its computational steps. | (println (java.util.Date. 0))
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Port the provided Clojure code into C# while preserving the original functionality. | (println (java.util.Date. 0))
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Translate the given Clojure code snippet into C# without altering its behavior. | (println (java.util.Date. 0))
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Transform the following Clojure implementation into C++, maintaining the same output and logic. | (println (java.util.Date. 0))
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Generate an equivalent C++ version of this Clojure code. | (println (java.util.Date. 0))
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Change the programming language of this snippet from Clojure to Java without modifying what it does. | (println (java.util.Date. 0))
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Produce a language-to-language conversion: from Clojure to Java, same semantics. | (println (java.util.Date. 0))
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Convert this Clojure block to Python, preserving its control flow and logic. | (println (java.util.Date. 0))
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Convert this Clojure block to Python, preserving its control flow and logic. | (println (java.util.Date. 0))
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Ensure the translated Go code behaves exactly like the original Clojure snippet. | (println (java.util.Date. 0))
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Keep all operations the same but rewrite the snippet in Go. | (println (java.util.Date. 0))
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Produce a language-to-language conversion: from Common_Lisp to C, same semantics. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Convert the following code from Common_Lisp to C, ensuring the logic remains intact. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Keep all operations the same but rewrite the snippet in C#. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Transform the following Common_Lisp implementation into C#, maintaining the same output and logic. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Convert the following code from Common_Lisp to C++, ensuring the logic remains intact. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Maintain the same structure and functionality when rewriting this code in C++. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Maintain the same structure and functionality when rewriting this code in Java. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Keep all operations the same but rewrite the snippet in Java. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Port the following code from Common_Lisp to Python with equivalent syntax and logic. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Preserve the algorithm and functionality while converting the code from Common_Lisp to Python. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Write the same code in VB as shown below in Common_Lisp. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Produce a functionally identical VB code for the snippet given in Common_Lisp. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Please provide an equivalent version of this Common_Lisp code in Go. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Write a version of this Common_Lisp function in Go with identical behavior. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Write the same code in C as shown below in Delphi. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Produce a functionally identical C code for the snippet given in Delphi. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Convert this Delphi block to C#, preserving its control flow and logic. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Translate this program into C# but keep the logic exactly as in Delphi. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Translate this program into C++ but keep the logic exactly as in Delphi. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Write the same code in C++ as shown below in Delphi. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Write a version of this Delphi function in Java with identical behavior. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Write a version of this Delphi function in Java with identical behavior. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Write a version of this Delphi function in Python with identical behavior. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Write the same code in Python as shown below in Delphi. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Change the programming language of this snippet from Delphi to VB without modifying what it does. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Transform the following Delphi implementation into VB, maintaining the same output and logic. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Maintain the same structure and functionality when rewriting this code in Go. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Write a version of this Delphi function in Go with identical behavior. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Translate the given F# code snippet into C without altering its behavior. | printfn "%s" ((new System.DateTime()).ToString("u"))
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Translate the given F# code snippet into C without altering its behavior. | printfn "%s" ((new System.DateTime()).ToString("u"))
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Generate an equivalent C# version of this F# code. | printfn "%s" ((new System.DateTime()).ToString("u"))
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Port the following code from F# to C# with equivalent syntax and logic. | printfn "%s" ((new System.DateTime()).ToString("u"))
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Keep all operations the same but rewrite the snippet in C++. | printfn "%s" ((new System.DateTime()).ToString("u"))
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Convert this F# snippet to C++ and keep its semantics consistent. | printfn "%s" ((new System.DateTime()).ToString("u"))
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Write the same code in Java as shown below in F#. | printfn "%s" ((new System.DateTime()).ToString("u"))
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Write a version of this F# function in Java with identical behavior. | printfn "%s" ((new System.DateTime()).ToString("u"))
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Change the programming language of this snippet from F# to Python without modifying what it does. | printfn "%s" ((new System.DateTime()).ToString("u"))
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Ensure the translated Python code behaves exactly like the original F# snippet. | printfn "%s" ((new System.DateTime()).ToString("u"))
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Port the following code from F# to VB with equivalent syntax and logic. | printfn "%s" ((new System.DateTime()).ToString("u"))
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Convert the following code from F# to VB, ensuring the logic remains intact. | printfn "%s" ((new System.DateTime()).ToString("u"))
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Generate a Go translation of this F# snippet without changing its computational steps. | printfn "%s" ((new System.DateTime()).ToString("u"))
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Translate the given F# code snippet into Go without altering its behavior. | printfn "%s" ((new System.DateTime()).ToString("u"))
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Can you help me rewrite this code in C instead of Factor, keeping it the same logically? | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Change the following Factor code into C without altering its purpose. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Translate the given Factor code snippet into C# without altering its behavior. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Can you help me rewrite this code in C# instead of Factor, keeping it the same logically? | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Write the same code in C++ as shown below in Factor. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Ensure the translated C++ code behaves exactly like the original Factor snippet. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Convert the following code from Factor to Java, ensuring the logic remains intact. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Generate a Java translation of this Factor snippet without changing its computational steps. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Produce a functionally identical Python code for the snippet given in Factor. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Produce a functionally identical Python code for the snippet given in Factor. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Convert the following code from Factor to VB, ensuring the logic remains intact. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Translate the given Factor code snippet into VB without altering its behavior. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Change the following Factor code into Go without altering its purpose. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Can you help me rewrite this code in Go instead of Factor, keeping it the same logically? | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Convert this Forth block to C, preserving its control flow and logic. | include lib/longjday.4th
0 posix>jday .longjday cr
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Change the programming language of this snippet from Forth to C without modifying what it does. | include lib/longjday.4th
0 posix>jday .longjday cr
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Generate an equivalent C# version of this Forth code. | include lib/longjday.4th
0 posix>jday .longjday cr
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Write the same algorithm in C# as shown in this Forth implementation. | include lib/longjday.4th
0 posix>jday .longjday cr
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Translate the given Forth code snippet into C++ without altering its behavior. | include lib/longjday.4th
0 posix>jday .longjday cr
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.