--- ct_beer.d
static foreach_reverse(beer; 1..100)
{
pragma(msg, beer, " bottles of beer on the wall, ", beer, "
bottles of beer. Take one down, pass it around, ", beer-1, "
bottles of beer on the wall.");
}
void main(){}
---
import std.format;
template Bootle(alias Beer = 0)
{
static if(Beer < 99)
enum Bootle = Bootle!(Beer + 1);
else
enum Bootle = Beer;
pragma(msg,
format!"%d bottles of beer on the wall, %d bottles of beer.
Take one down, pass it around, %d bottles of beer on the
import std.stdio;
import std.conv;
void main() {
const string drink = "beer";
int bottles = 99;
while (bottles > 0) {
string amt = to!string(bottles);
writeln(amt ~ " bottles of " ~ drink ~ " on the wall, " ~ amt ~
" bottles of " ~ drink ~ ". Take one
On Friday, 6 April 2018 at 14:03:18 UTC, Abdulhaq wrote:
On Friday, 6 April 2018 at 13:10:07 UTC, jason wrote:
what is this?
It's a perl program that converts D code into APL
Here is a more readable version:
(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t]
On Friday, 6 April 2018 at 14:03:18 UTC, Abdulhaq wrote:
On Friday, 6 April 2018 at 13:10:07 UTC, jason wrote:
what is this?
It's a perl program that converts D code into APL
+1
On 04/06/2018 10:03 AM, Abdulhaq wrote:
On Friday, 6 April 2018 at 13:10:07 UTC, jason wrote:
what is this?
It's a perl program that converts D code into APL
Genius.
I want to know whose bright idea it was to turn l33tspeak into a
programming language.
On Friday, 6 April 2018 at 14:03:18 UTC, Abdulhaq wrote:
On Friday, 6 April 2018 at 13:10:07 UTC, jason wrote:
what is this?
It's a perl program that converts D code into APL
I didn't know perl syntax got such improvment for readability.
On Friday, 6 April 2018 at 14:03:18 UTC, Abdulhaq wrote:
On Friday, 6 April 2018 at 13:10:07 UTC, jason wrote:
what is this?
It's a perl program that converts D code into APL
I laughed way too hard at this
On Fri, Apr 06, 2018 at 01:10:07PM +, jason via Digitalmars-d wrote:
> what is this?
It's a poor man's URL matcher.
(Yeah, hard to believe, but most of the unreadability is caused by the
Leaning Toothpick Syndrome caused by the poor choice of using / as regex
delimiter when literal '/'s
On Friday, 6 April 2018 at 13:10:07 UTC, jason wrote:
what is this?
It's a perl program that converts D code into APL
On Friday, 6 April 2018 at 13:10:07 UTC, jason wrote:
what is this?
Line noise.
what is this?
credi
ts 9;999
On Thursday, 4 January 2018 at 00:54:12 UTC, Seb wrote:
On Thursday, 4 January 2018 at 00:35:56 UTC, H. S. Teoh wrote:
On Thu, Jan 04, 2018 at 12:25:59AM +, Justin Whear via
Digitalmars-d wrote:
// Reads bytes from stdin and writes a hexadecimal view like
a no-frills
xxd.
// All the
On Thursday, 4 January 2018 at 00:35:56 UTC, H. S. Teoh wrote:
On Thu, Jan 04, 2018 at 12:25:59AM +, Justin Whear via
Digitalmars-d wrote:
// Reads bytes from stdin and writes a hexadecimal view like a
no-frills
xxd.
// All the actual formatting work is done by format's sweet
range syntax
On Thu, Jan 04, 2018 at 12:25:59AM +, Justin Whear via Digitalmars-d wrote:
> // Reads bytes from stdin and writes a hexadecimal view like a no-frills
> xxd.
> // All the actual formatting work is done by format's sweet range syntax
Mmm, I like this! Care to submit a PR for this in the
// Reads bytes from stdin and writes a hexadecimal view like a
no-frills xxd.
// All the actual formatting work is done by format's sweet range
syntax
void main(string[] args)
{
import std.getopt;
uint bytesPerLine = 8;
args.getopt(
"cols|c",
);
namespace Ethplorer \ UnitTest ;
ใช้ ข้อยกเว้น ;
ใช้ PHPUnit_Framework_TestCase ;
/ **
* ทดสอบ Ethplorer API
* /
class Api_Test ขยาย PHPUnit_Framework_TestCase {
protected $ url = ' https://api.ethplorer.io/ ' ;
/ **
* @return void
* /
การ ตั้งค่าฟังก์ชัน สาธารณะ ()
Hi,
I just tried the print hex dump example.
The output is:
Application output (1: )
Compilation output:
Program's output exceeds limit of 4096 bytes.
Program's output exceeds limit of 4096 bytes.
Maybe a smaller file could be used (currently the exe file itself
is used).
Or the limit could
On Thursday, 7 September 2017 at 04:01:21 UTC, Lionello Lunesu
wrote:
Thought this code ended up really concise and readable:
https://gist.github.com/lionello/60cd2f1524c664d4d8454c01a05ac2c8
Suitable for dlang.org?
L.
The best way to find out it to make a pull request [1]
[1]
Thought this code ended up really concise and readable:
https://gist.github.com/lionello/60cd2f1524c664d4d8454c01a05ac2c8
Suitable for dlang.org?
L.
On Wednesday, 6 September 2017 at 11:43:55 UTC, Aljeb wrote:
Hi bro can you teach me now bro about hacking
To enable hacking, you must delete system32 in Windows. Then get
a chat application from the late nineties.
Hi bro can you teach me now bro about hacking
On Thursday, 3 August 2017 at 08:47:12 UTC, Martin Tschierschke
wrote:
Can you point me to the explanation of this: %(%02X %)%*s %s ?
https://dlang.org/phobos/std_format.html
Under "Example using array and nested array formatting:"
writefln("My items are %(%s %).", [1,2,3]);
So "%( %)" is
On Thursday, 3 August 2017 at 08:47:12 UTC, Martin Tschierschke
wrote:
On Wednesday, 2 August 2017 at 22:02:49 UTC, Vladimir Panteleev
wrote:
On Wednesday, 2 August 2017 at 21:59:23 UTC, Vladimir
Panteleev wrote:
Good idea! But I think it needs more ranges:
The format call can be substituted
On Wednesday, 2 August 2017 at 22:02:49 UTC, Vladimir Panteleev
wrote:
On Wednesday, 2 August 2017 at 21:59:23 UTC, Vladimir Panteleev
wrote:
Good idea! But I think it needs more ranges:
The format call can be substituted with writefln directly:
void main(string[] args)
{
import
On Wednesday, 2 August 2017 at 22:02:49 UTC, Vladimir Panteleev
wrote:
On Wednesday, 2 August 2017 at 21:59:23 UTC, Vladimir Panteleev
wrote:
Good idea! But I think it needs more ranges:
The format call can be substituted with writefln directly:
void main(string[] args)
{
import
On Wednesday, 2 August 2017 at 22:02:49 UTC, Vladimir Panteleev
wrote:
On Wednesday, 2 August 2017 at 21:59:23 UTC, Vladimir Panteleev
wrote:
Good idea!
https://github.com/dlang/dlang.org/pull/1854
On Wednesday, 2 August 2017 at 21:58:18 UTC, H. S. Teoh wrote:
Whoa. This is cool and everything, but it also looks pretty
intimidating for a newcomer to D. I'm not sure if we should
put this on the front page!
Perhaps we should make some examples only available if the user
selects them
On Wed, Aug 02, 2017 at 09:59:23PM +, Vladimir Panteleev via Digitalmars-d
wrote:
> On Wednesday, 2 August 2017 at 19:39:18 UTC, Andre Pany wrote:
> > This application opens the file passed as argument and display the
> > content in hex and text format:
>
> Good idea! But I think it needs
On Wednesday, 2 August 2017 at 21:59:23 UTC, Vladimir Panteleev
wrote:
Good idea! But I think it needs more ranges:
The format call can be substituted with writefln directly:
void main(string[] args)
{
import std.algorithm, std.format, std.stdio;
enum cols = 16;
On Wednesday, 2 August 2017 at 19:39:18 UTC, Andre Pany wrote:
This application opens the file passed as argument and display
the content in hex and text format:
Good idea! But I think it needs more ranges:
void main(string[] args)
{
import std.algorithm, std.format, std.stdio;
enum
On 8/2/17 3:39 PM, Andre Pany wrote:
This application opens the file passed as argument and display the
content in hex and text format:
00 00 03 00 00 00 64 00 00 00 FF 56 01 00 00 70 ......d... V..p
02 00 FF A6 00 00 00 20 02 00 00 00 00 00 00 00. ª... ...
00 00 00 00 00 00 00 00
On 8/2/17 5:27 PM, Nick B wrote:
On Wednesday, 2 August 2017 at 19:39:18 UTC, Andre Pany wrote:
This application opens the file passed as argument and display the
content in hex and text format:
Is this code in GitHub or DUB ?
Is there a link ?
Here is a link:
On Wed, Aug 02, 2017 at 09:27:07PM +, Nick B via Digitalmars-d wrote:
> On Wednesday, 2 August 2017 at 19:39:18 UTC, Andre Pany wrote:
> > This application opens the file passed as argument and display the
> > content in hex and text format:
> >
>
> Is this code in GitHub or DUB ?
> Is there
On Wednesday, 2 August 2017 at 19:39:18 UTC, Andre Pany wrote:
This application opens the file passed as argument and display
the content in hex and text format:
Is this code in GitHub or DUB ?
Is there a link ?
Nick
This application opens the file passed as argument and display
the content in hex and text format:
00 00 03 00 00 00 64 00 00 00 FF 56 01 00 00 70
.....d... V..p
02 00 FF A6 00 00 00 20 02 00 00 00 00 00 00 00. ª...
...
00 00 00 00 00 00 00 00 00 00 00 00
On Wednesday, 26 July 2017 at 09:45:07 UTC, Timon Gehr wrote:
import std.stdio,std.string,std.algorithm,std.conv;
void main(){
readln.split.fold!((stack,op){
switch(op){
static foreach(c;"+-*/") case [c]:
return stack[0..$-2]~mixin("stack[$-2] "~c~"
On Wednesday, 26 July 2017 at 17:12:00 UTC, Mike Wey wrote:
On 26-07-17 16:40, Iakh wrote:
On Wednesday, 26 July 2017 at 09:46:45 UTC, Timon Gehr wrote:
readln.split.fold!((stack,op){
switch(op){
static foreach(c;"+-*/") case [c]:
return
On 26-07-17 16:40, Iakh wrote:
On Wednesday, 26 July 2017 at 09:46:45 UTC, Timon Gehr wrote:
readln.split.fold!((stack,op){
switch(op){
static foreach(c;"+-*/") case [c]:
return stack[0..$-2]~mixin("stack[$-2] "~c~"
stack[$-1]");
On Wednesday, 26 July 2017 at 09:46:45 UTC, Timon Gehr wrote:
readln.split.fold!((stack,op){
switch(op){
static foreach(c;"+-*/") case [c]:
return stack[0..$-2]~mixin("stack[$-2] "~c~"
stack[$-1]");
default: return stack~op.to!real;
On 26.07.2017 11:45, Timon Gehr wrote:
On 26.07.2017 04:37, Seb wrote:
On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
Semi-Functional/pure RPN calculator: https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler enforced
safety and purity
On 26.07.2017 04:37, Seb wrote:
On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
Semi-Functional/pure RPN calculator: https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler enforced
safety and purity (State is passed through the fold), while
On 26.07.2017 04:37, Seb wrote:
On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
Semi-Functional/pure RPN calculator: https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler enforced
safety and purity (State is passed through the fold), while
On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
Semi-Functional/pure RPN calculator:
https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler
enforced safety and purity (State is passed through the fold),
while also showing off the higher level
On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
Semi-Functional/pure RPN calculator:
https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler
enforced safety and purity (State is passed through the fold),
while also showing off the higher level
Semi-Functional/pure RPN calculator:
https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler
enforced safety and purity (State is passed through the fold),
while also showing off the higher level parts of Phobos (Use of
fold).
To me it seems like the website damplips
Please send a code
On Friday, 9 June 2017 at 18:09:50 UTC, bethany wrote:
hello erin i am sorry you got bullied friend i am hacking
jgsgjb vsnbwhtbknhghtdgh
hello erin i am sorry you got bullied friend i am hacking
fh
dsfdsfsdfb cxvxcvxcv
On Friday, 31 March 2017 at 02:22:14 UTC, April Dale wrote:
I need some informations on what this is
Hovering your mouse over it should cause the following message to
appear:
Got a brief example illustrating D?
Submit your code to the digitalmars.D forum specifying "[your
code
I need some informations on what this is
8
4
djdjdjbfdlkjsa ncxmjadks,fdmxc nxkjas,md cZXsdknxcl
medsjakcxjfncx, zmekm, zxcfjdlkx,m czwjkldf xm,zcadf kjadfbjskfn
jesakfbaksdjfkasjnflkwnsafewckewanrfknesrkanrwaknerdAwknrkwenrkewanrrawkRnDAQwnlsadk.,qwd;lasm,.x
On Friday, 13 January 2017 at 20:40:32 UTC, mustafa wrote:
dfdsfsd
afdsaaf?
dfdsfsd
On Friday, 30 December 2016 at 08:17:54 UTC, Joseph Agiri wrote:
Why is the compiler for the D language not downloading from
your site. It has not enabled me to be entirely fascinated with
the language with confidence. Please correct the challenge.
Does it have issues with Windows 7?
The
Why is the compiler for the D language not downloading from your
site. It has not enabled me to be entirely fascinated with the
language with confidence. Please correct the challenge. Does it
have issues with Windows 7?
to be
widely circulated—enough to attract spammers!
And for a few moments I thought this was just literally a [post
your code here] thread which sounds like fun, and I could post
something useful. I have a chess-knight puzzle solver code I
could put in... Although maybe if it was more limiting
On Thursday, 1 December 2016 at 14:26:11 UTC, ringo starr wrote:
swello.edu
This post screams Captcha!
Just to make sure it was not a false positive, I went to the
(non-existent) URL. On the bright side, the forum seems to be
widely circulated—enough to attract spammers!
As far as I can
swello.edu
judr jpg
Send pictures
On Friday, 16 September 2016 at 08:40:08 UTC, alam wrote:
give me code
void main()
{
foreach(ref const shared shared(immutable(int)) i;
[shared const shared(immutable(int))(0),
shared const shared(immutable(int))(1)]){}
}
On Friday, 16 September 2016 at 08:40:08 UTC, alam wrote:
give me code
if (2b || !2b) { //to be or not to be? It's funny becasue its true
}
On Friday, 16 September 2016 at 08:40:08 UTC, alam wrote:
give me code
pou];,wl
give me code
Hi how are you
i dont know
The D code part on the front page has only 2 examples currently.
I thought we should add to that. As per the instructions, I'm
posting one sample here for approval:
// Find anagrams of words
void main()
{
import std.stdio, std.algorithm;
string[][string] anagram_info;
https://issues.dlang.org/show_bug.cgi?id=7505
Andrei Alexandrescu and...@erdani.com changed:
What|Removed |Added
Version|unspecified |D2
--
Arrrg, formatting got torn up. Here's a Dpaste:
http://dpaste.dzfl.pl/ca190950f199
On Sunday, 3 May 2015 at 04:14:40 UTC, Andrei Alexandrescu wrote:
On 5/2/15 7:48 PM, Vladimir Panteleev wrote:
On Saturday, 2 May 2015 at 22:23:01 UTC, Andrei Alexandrescu
wrote:
On Friday, 1 May 2015 at 17:17:09 UTC, Justin Whear wrote:
A process for rounding numbers.
Thanks Justin. Could
On Friday, 1 May 2015 at 17:17:09 UTC, Justin Whear wrote:
A process for rounding numbers.
Thanks Justin. Could someone take this? We don't have PHP code
for rotating examples randomly yet. -- Andrei
On Saturday, 2 May 2015 at 22:23:01 UTC, Andrei Alexandrescu
wrote:
On Friday, 1 May 2015 at 17:17:09 UTC, Justin Whear wrote:
A process for rounding numbers.
Thanks Justin. Could someone take this? We don't have PHP code
for rotating examples randomly yet. -- Andrei
Doesn't need to be
On Sunday, 3 May 2015 at 02:48:32 UTC, Vladimir Panteleev wrote:
Doesn't need to be PHP
could also be D
On 5/2/15 7:48 PM, Vladimir Panteleev wrote:
On Saturday, 2 May 2015 at 22:23:01 UTC, Andrei Alexandrescu wrote:
On Friday, 1 May 2015 at 17:17:09 UTC, Justin Whear wrote:
A process for rounding numbers.
Thanks Justin. Could someone take this? We don't have PHP code for
rotating examples
On 5/2/15 7:51 PM, Adam D. Ruppe wrote:
On Sunday, 3 May 2015 at 02:48:32 UTC, Vladimir Panteleev wrote:
Doesn't need to be PHP
could also be D
code or it didn't happen -- Andrei
A process for rounding numbers. This incarnation can be run like
round 1.23 3.4 4
or by reading lines from stdin. It could be simplified as an example by
getting rid of the argument-processing form. It shows off templated
function composition using std.functional.pipe, ct-regexes, and
On Thursday, 2 January 2014 at 14:49:50 UTC, Ola Fosheim Grøstad
wrote:
I like the nice little compiler app on the frontpage, but it
gets killed most of the time leaving an error. Which is kind of
unfortunate.
Thank you for reporting this!
Looks like something got borked on dlang.org side.
On Thursday, 2 January 2014 at 14:49:50 UTC, Ola Fosheim Grøstad
wrote:
I like the nice little compiler app on the frontpage, but it
gets killed most of the time leaving an error. Which is kind of
unfortunate.
Try http://dpaste.dzfl.pl/ instead.
I like the nice little compiler app on the frontpage, but it gets
killed most of the time leaving an error. Which is kind of
unfortunate.
On Thursday, 2 January 2014 at 14:54:14 UTC, Dejan Lekic wrote:
On Thursday, 2 January 2014 at 14:49:50 UTC, Ola Fosheim
Grøstad wrote:
I like the nice little compiler app on the frontpage, but it
gets killed most of the time leaving an error. Which is kind
of unfortunate.
Try
On 01/02/2014 03:54 PM, Dejan Lekic wrote:
Try http://dpaste.dzfl.pl/ instead.
That's actually the backend used on the dlang.org page.
On Thursday, 2 January 2014 at 19:38:25 UTC, Martin Nowak wrote:
That's actually the backend used on the dlang.org page.
Oh well, maybe it should run on a server closer to the web-host.
It is kinda discouraging for newbies coming to dlang.org for the
first time that the demo doesn't respond.
// Checks if two files have equal content using memory mapped
files
import std.file;
import std.mmfile;
import std.stdio;
// Compares the content of two files
private bool equals(in string f1, in string f2)
{
if (getSize(f1) != getSize(f2))
return false; // different
Roumen Roupski:
private bool equals(in string f1, in string f2)
{
if (getSize(f1) != getSize(f2))
return false; // different file sizes
if (getSize(f1) == 0)
return true;// zero-length files are equal
Making equals() private is not
On Thursday, 31 January 2013 at 08:42:48 UTC, Roumen Roupski
wrote:
finally
{
delete m1;
delete m2;
}
D has a GC. No need for manual deletion.
(In fact, I think this is deprecated? Or scheduled for removal?
Or maybe neither. Who knows).
On Thursday, 31 January 2013 at 10:58:48 UTC, Peter Alexander
wrote:
On Thursday, 31 January 2013 at 08:42:48 UTC, Roumen Roupski
wrote:
finally
{
delete m1;
delete m2;
}
D has a GC. No need for manual deletion.
(In fact, I think this
On 2013-01-31 12:38, Namespace wrote:
If you want to do something, then take destroy.
AFAIK delete destroy _and_ release the memory immediately. 'destroy' doesn't.
And that's why delete is valuable (at least on 32-bit windows).
Especially when you are comparing 500 MB files in a loop. :)
On Thursday, 31 January 2013 at 12:28:43 UTC, FG wrote:
On 2013-01-31 12:38, Namespace wrote:
If you want to do something, then take destroy.
AFAIK delete destroy _and_ release the memory immediately.
'destroy' doesn't.
And that's why delete is valuable (at least on 32-bit windows).
On Thursday, 31 January 2013 at 12:28:43 UTC, FG wrote:
On 2013-01-31 12:38, Namespace wrote:
If you want to do something, then take destroy.
AFAIK delete destroy _and_ release the memory immediately.
'destroy' doesn't.
And that's why delete is valuable (at least on 32-bit windows).
On Thursday, 31 January 2013 at 12:28:43 UTC, FG wrote:
On 2013-01-31 12:38, Namespace wrote:
If you want to do something, then take destroy.
AFAIK delete destroy _and_ release the memory immediately.
'destroy' doesn't.
And that's why delete is valuable (at least on 32-bit windows).
FG:
Especially when you are comparing 500 MB files in a loop. :)
I have had problems comparing with this program a single pair of
files that large...
Bye,
bearophile
On 2013-01-31 14:21, bearophile wrote:
Especially when you are comparing 500 MB files in a loop. :)
I have had problems comparing with this program a single pair of files that
large...
Strange. No problems here. Only had to switch from dmd32 to gdc64 with 1GB or
bigger files. Tested on
FG:
Strange. No problems here. Only had to switch from dmd32 to
gdc64 with 1GB or bigger files. Tested on win7-64.
How much memory is it using? What's the performance compared to
the diff tool?
Bye,
bearophile
1 - 100 of 182 matches
Mail list logo