Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View run-dlang's full-sized avatar

Eleanor Cross run-dlang

View GitHub Profile
@run-dlang
run-dlang / main.d
Created November 3, 2023 04:03
Code shared from run.dlang.io.
import std;
void main()
{
   writeln("Hello D");
}
@run-dlang
run-dlang / main.d
Created November 2, 2023 07:21
Code shared from run.dlang.io.
import std;
void main()
{
  long  z = 0b101010;
  string zStr = format("%b",z);
  int  t = 1100;
  string tStr = format("%b",t);
   writeln("z = :",zStr);
@run-dlang
run-dlang / main.d
Created November 1, 2023 22:18
Code shared from run.dlang.io.
import std.stdio;
void main()
{
string[string] aa;
string x = "xxx";
aa["name"] = "Arthur";
aa["quest"] = "seek the Holy Grail";
aa["favoriteColor"] = "blue";
@run-dlang
run-dlang / main.d
Created November 1, 2023 12:13
Code shared from run.dlang.io. Run with '-i -run test.d'
--- test.d
module test;
import libweb;
import std;
void main()
{
writeln("test");
runClient();
runServer();
@run-dlang
run-dlang / main.d
Created November 1, 2023 12:11
Code shared from run.dlang.io. Run with '-i -run test.d'
--- test.d
module test;
import libweb;
import std;
void main()
{
writeln("test");
runClient();
runServer();
@run-dlang
run-dlang / main.d
Created November 1, 2023 12:07
Code shared from run.dlang.io. Run with '-i -run test.d'
--- test.d
module test;
import libweb;
void main()
{
runClient();
runServer();
runConv();
runText();
@run-dlang
run-dlang / main.d
Created October 31, 2023 15:15
Code shared from run.dlang.io.
import std;
void main()
{
foreach (n; 1 .. 101)
{
string rules = (
(n % 3 == 0 ? "Fizz" : "") ~
(n % 5 == 0 ? "Buzz" : "")
);
@run-dlang
run-dlang / main.d
Created October 31, 2023 15:14
Code shared from run.dlang.io.
import std;
void main()
{
foreach (n; 1..101) {
string rules = (
(n % 3 == 0 ? "Fizz" : "") ~
(n % 5 == 0 ? "Buzz" : "")
);
@run-dlang
run-dlang / main.d
Created October 30, 2023 21:16
Code shared from run.dlang.io.
import std.stdio;
import sqlite;
void main()
{
SQLite db = new SQLite(); // Crea una instancia de la base de datos
if (db.open("mi_basededatos.db") == SqlResult.SQL_OK)
{
// Realiza una consulta simple
string query = "SELECT * FROM tabla";
@run-dlang
run-dlang / main.d
Created October 30, 2023 08:46
Code shared from run.dlang.io.
import std.stdio;
import std.datetime;
import std.stdint;
import std.conv;
class Writer
{
this(void delegate() del)
{
_del = del;