On Friday, 13 May 2022 at 05:41:33 UTC, rikki cattermole wrote:
On 13/05/2022 5:18 PM, MichaelBi wrote:
i have code here:
auto uri = environment.get("MONGODB_URI");
MongoClient conn = connectMongoDB(uri);
MongoDatabase eqpdb = conn.getDatabase("MbEqpHeroku");
On 13/05/2022 5:18 PM, MichaelBi wrote:
i have code here:
auto uri = environment.get("MONGODB_URI");
MongoClient conn = connectMongoDB(uri);
MongoDatabase eqpdb = conn.getDatabase("MbEqpHeroku");
the "MONGODB_URI" showed above already put into heroku's app config
there are online documents of heroku on how to access config var
value from code, and several code samples without D. link here:
https://devcenter.heroku.com/articles/config-vars#accessing-config-var-values-from-code.
i have code here:
auto uri = environment.get("MONGODB_URI");
On Friday, 13 May 2022 at 04:39:46 UTC, Tejas wrote:
On Friday, 13 May 2022 at 04:19:26 UTC, Ola Fosheim Grøstad
wrote:
On Friday, 13 May 2022 at 03:31:53 UTC, Ali Çehreli wrote:
On 5/12/22 18:56, forkit wrote:
> So...you want to do a talk that challenges D's complexity,
> by
getting
> back
On 5/12/22 21:41, Tejas wrote:
> Or a presentation on ranges can also be good, considering how the de
> facto best online article on it(by HS Teoh) is from 2013
I think the best person to give that presentation would be its awesome
author. ;)
Ali
On Friday, 13 May 2022 at 03:31:53 UTC, Ali Çehreli wrote:
On 5/12/22 18:56, forkit wrote:
> So...you want to do a talk that challenges D's complexity, by
getting
> back to basics?
I wasn't thinking about challenging complexity but it gives me
ideas.
I am looking for concrete topics like
On Friday, 13 May 2022 at 04:19:26 UTC, Ola Fosheim Grøstad wrote:
On Friday, 13 May 2022 at 03:31:53 UTC, Ali Çehreli wrote:
On 5/12/22 18:56, forkit wrote:
> So...you want to do a talk that challenges D's complexity, by
getting
> back to basics?
I wasn't thinking about challenging
On Friday, 13 May 2022 at 03:31:53 UTC, Ali Çehreli wrote:
On 5/12/22 18:56, forkit wrote:
> So...you want to do a talk that challenges D's complexity, by
getting
> back to basics?
I wasn't thinking about challenging complexity but it gives me
ideas.
I am looking for concrete topics like
On Thursday, 12 May 2022 at 20:49:08 UTC, Chris Katko wrote:
In D, I can do the module based method, but nothing short of
renaming variables gives me a list of violations and, that also
makes all the correct internal accesses wrong. Because private
doesn't work.
Call it whatever keyword you
On 5/12/22 18:56, forkit wrote:
> So...you want to do a talk that challenges D's complexity, by getting
> back to basics?
I wasn't thinking about challenging complexity but it gives me ideas.
I am looking for concrete topics like templates, classes, ranges,
rvalues, etc. Are those
On Thursday, 12 May 2022 at 21:58:33 UTC, Ali Çehreli wrote:
I am considering proposing a presentation for DConf 2022.
Would a "Back to Basics" style presentation be interesting? If,
so what exact topic would you like to see?
There was a book from my childhood. Its name is "Temel Basic",
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote:
What are you stuck at? What was the most difficult features to
understand? etc.
The concept of traits (std.traits) confuses me enough. Actually
the problem is that the interface is disorderly (disorganizedly).
As if it was very
On Thursday, 12 May 2022 at 21:58:33 UTC, Ali Çehreli wrote:
I am considering proposing a presentation for DConf 2022.
Would a "Back to Basics" style presentation be interesting? If,
so what exact topic would you like to see?
For ideas, here is what CppCon 2021 had on their track:
On Thursday, 12 May 2022 at 17:34:30 UTC, H. S. Teoh wrote:
Why is TLS by default a problem?
It's not really for optimization, AIUI, it's more for thread
safety: module-global state is TLS by default, so you don't
accidentally introduce race conditions.
What you accidentally have instead
I am considering proposing a presentation for DConf 2022.
Would a "Back to Basics" style presentation be interesting? If, so what
exact topic would you like to see?
For ideas, here is what CppCon 2021 had on their track:
https://cppcon2021.sched.com/?searchstring=Back+to+Basics
Ali
On Thursday, 12 May 2022 at 20:12:19 UTC, Ali Çehreli wrote:
And I've been thinking 'iota' may not be as suitable as I
thought at first. I like the following even more:
auto r0 = st
.by(Duration(2))
.take(5);
So I wrote this by() for my DateTime and then:
On Thursday, 12 May 2022 at 17:06:39 UTC, Ali Çehreli wrote:
I don't care whether it is good practice or not. :) The
following is what you meant anyway and seems to work.
I restricted the parameter types to the ones I wanted to use.
And for the standard iota behavior I used a public import.
On Thursday, 12 May 2022 at 16:04:09 UTC, Ali Çehreli wrote:
My view on private has changed over the years. I need to be
convinced that there is usage that needs to be protected. :) I
don't see people using types freely especially the ones that
are in the same module. The only argument for
On 5/12/22 12:51, ag0aep6g wrote:
>> auto iota(B, E, S)(B begin, E end, S step)
> [...]
>> {
>> static struct Result
>> {
>> B current;
> [...]
>> void popFront()
>> {
> [...]
>> current += step;
>> }
>> }
> [...]
>> }
>
> Mark iota's
On Thursday, 12 May 2022 at 16:57:35 UTC, H. S. Teoh wrote:
Does your DateTime type support the `++` operator?
It can't because I only want to use the quantities.si.Time type
to do arithmetic with my DateTime. In my previous DateTime, it
was a lot of problem that I was doing math on it's
On 5/12/22 12:00, Paul Backus wrote:
> Good news: starting from DMD 2.099, this error message has been
> reworded. Instead of "cannot deduce function...". it now says:
>
> Error: none of the overloads of template `std.algorithm.iteration.sum`
> are callable using argument types `!()(int[3])`
On Thursday, 12 May 2022 at 17:06:39 UTC, Ali Çehreli wrote:
void main() {
const st = DateTime(Duration(0));
[...]
// (0) I think D should not insist on 'const'
// when copying types that have no indirections.
// We shouldn't need the cast() below in this case.
[...]
On Thursday, 12 May 2022 at 15:17:10 UTC, Adam D Ruppe wrote:
It is simpler than it looks, I wrote about it in my book and in
a post here:
https://forum.dlang.org/post/xklcgjaqggihvhctc...@forum.dlang.org
"Then commas separate the definitions of each placeholder
variable, just as if they
On Thursday, 12 May 2022 at 16:48:05 UTC, H. S. Teoh wrote:
static foreach isn't meant to handle large loops. Writing
`static foreach (i; 0 .. 6)` is generally a bad idea; my
suspicion is that the compiler ran out of stack space). It's
more for unfolding groups of statements or
On Thursday, 12 May 2022 at 18:07:05 UTC, H. S. Teoh wrote:
On Thu, May 12, 2022 at 09:04:09AM -0700, Ali Çehreli via
Digitalmars-d-learn wrote:
Error: template `std.algorithm.iteration.sum` cannot deduce
function from
argument types `!()(int[3])`
On Thu, May 12, 2022 at 09:04:09AM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 5/11/22 18:06, Christopher Katko wrote:
>
> > Cool useful library functions like sumElement that magically don't
> > work on static arrays.
>
> Yeah, that sometimes gets me as well. Although it is trivial
On Thu, May 12, 2022 at 01:06:02AM +, Christopher Katko via
Digitalmars-d-learn wrote:
[...]
> Cool useful library functions like sumElement that magically don't
> work on static arrays.
Just slice it with []:
int[5] data = [ 1, 2, 3, 4, 5 ];
auto sum = data[].sumElement;
On Wed, May 11, 2022 at 06:43:39PM +, Guillaume Piolat via
Digitalmars-d-learn wrote:
> On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote:
> > What are you stuck at? What was the most difficult features to
> > understand? etc.
>
> - How to do deterministic destruction with
On Thursday, 12 May 2022 at 16:24:26 UTC, Ali Çehreli wrote:
Cool trick but "parent" confused me there. I think you mean
"base". :)
https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming
mentions "base class" as much as "parent class"
On 5/12/22 04:57, realhet wrote:
> //this would be nicer, but not works
> iota(st, en, day).each!writeln;
For others, the problem is, iota does have a version that works with
user types but not one that parameterizes 'step'. An oversight?
> My question is, is there a way to 'extend'
On Thu, May 12, 2022 at 11:57:54AM +, realhet via Digitalmars-d-learn wrote:
[...]
> I have my own DateTime struct.
> It has opCmp() and opBinary(), I can do arithmetic with this custom
> DateTime and the amazing time units of the **quantities** package.
>
> Now I'm about mo make iterations
On Thu, May 12, 2022 at 02:42:43PM +, Anonymouse via Digitalmars-d-learn
wrote:
[...]
> The one thing that has caused me most anguish and woe is hands-down
> https://issues.dlang.org/show_bug.cgi?id=18026 though. It hasn't bit
> me for a while now, but the feeling of uncertainty, that the
On Thu, May 12, 2022 at 12:13:32PM +, Basile B. via Digitalmars-d-learn
wrote:
[...]
> Problem is more (from https://dlang.org/spec/expression.html#is_expression)
>
> ```
> is ( Type : TypeSpecialization , TemplateParameterList )
> is ( Type == TypeSpecialization , TemplateParameterList )
>
On 5/12/22 07:28, Guillaume Piolat wrote:
> On Thursday, 12 May 2022 at 11:05:08 UTC, Basile B. wrote:
>> - Certain variant forms of the `is` Expression are not obvious (not
>> intuitive), I'm pretty sure I still cant use them without a quick look
>> to the specs.
>
> That one was a trouble to
On 5/11/22 19:35, zjh wrote:
> On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote:
>> What are you stuck at? What was the most difficult features to
>> understand? etc.
>>
>
> I don't know the progress of `interface to C++`.
> I want to use my C++ functions in `d`.
That direction is
On 5/11/22 18:06, Christopher Katko wrote:
> Cool useful library functions like sumElement that magically don't work
> on static arrays.
Yeah, that sometimes gets me as well. Although it is trivial to deal
with, the programmer may be surprised by the strange error messages:
int[3] arr = [
On Thursday, 12 May 2022 at 15:32:24 UTC, Adam D Ruppe wrote:
On Thursday, 12 May 2022 at 15:18:34 UTC, jmh530 wrote:
What's the difference between a Type and Type Identifier?
The is expression roughly follows variable declaration style.
You write
int a;
to declare a new symbol named `a`
On Thursday, 12 May 2022 at 15:31:03 UTC, Steven Schveighoffer
wrote:
On 5/12/22 11:18 AM, jmh530 wrote:
On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote:
[snip]
```
is ( Type : TypeSpecialization , TemplateParameterList )
is ( Type == TypeSpecialization , TemplateParameterList )
is (
On Thursday, 12 May 2022 at 15:18:34 UTC, jmh530 wrote:
What's the difference between a Type and Type Identifier?
The is expression roughly follows variable declaration style.
You write
int a;
to declare a new symbol named `a` of type `int`.
Similarly,
static if(is(T a))
declares a new
On 5/12/22 11:18 AM, jmh530 wrote:
On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote:
[snip]
```
is ( Type : TypeSpecialization , TemplateParameterList )
is ( Type == TypeSpecialization , TemplateParameterList )
is ( Type Identifier : TypeSpecialization , TemplateParameterList )
is (
On Thursday, 12 May 2022 at 15:18:34 UTC, jmh530 wrote:
On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote:
[snip]
```
is ( Type : TypeSpecialization , TemplateParameterList )
is ( Type == TypeSpecialization , TemplateParameterList )
is ( Type Identifier : TypeSpecialization ,
On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote:
[snip]
```
is ( Type : TypeSpecialization , TemplateParameterList )
is ( Type == TypeSpecialization , TemplateParameterList )
is ( Type Identifier : TypeSpecialization ,
TemplateParameterList )
is ( Type Identifier == TypeSpecialization
On Thursday, 12 May 2022 at 14:42:43 UTC, Anonymouse wrote:
That said, one thing I cannot seem to firmly wrap my head
around is `is` expressions. `is` does so many things.
It is simpler than it looks, I wrote about it in my book and in a
post here:
On Thursday, 12 May 2022 at 14:06:13 UTC, Arjan wrote:
On Thursday, 12 May 2022 at 11:05:08 UTC, Basile B. wrote:
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote:
- Operator overloading in certain cases was confusing, I
remember that for one particular form once I had to use your
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote:
What are you stuck at? What was the most difficult features to
understand? etc.
I came from shell scripts. They grew too large and overly complex
when I wanted to do non-trivial things in a neat way, so I looked
to proper
On Thursday, 12 May 2022 at 11:05:08 UTC, Basile B. wrote:
- Certain variant forms of the `is` Expression are not obvious
(not intuitive), I'm pretty sure I still cant use them without
a quick look to the specs.
That one was a trouble to hear about =>
On Thursday, 12 May 2022 at 11:05:08 UTC, Basile B. wrote:
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote:
What are you stuck at? What was the most difficult features to
understand? etc.
To make it more meaningful, what is your experience with other
languages?
Ali
Overhall
On Thursday, 12 May 2022 at 13:04:51 UTC, Alain De Vos wrote:
Is there a link to a webpage with some dlang exercises in order
to see if i master the language, from simple to diffucult ?
[Rosetta Code](https://www.rosettacode.org) has a bunch, with
On Thursday, 12 May 2022 at 13:04:51 UTC, Alain De Vos wrote:
Is there a link to a webpage with some dlang exercises in order
to see if i master the language, from simple to diffucult ?
[dtour](https://tour.dlang.org/).
On Wednesday, 11 May 2022 at 10:01:18 UTC, Johan wrote:
Any function call (inside the loop) for which it cannot be
proven that it never modifies your memory variable will work.
That's why I'm pretty sure that mutex lock/unlock will work.
I think the common semantics ought to be that
Is there a link to a webpage with some dlang exercises in order
to see if i master the language, from simple to diffucult ?
On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote:
On Thursday, 12 May 2022 at 11:50:59 UTC, Alain De Vos wrote:
Some keywords are overloaded and have different meaning when
used in a different place.
Also some syntactic-sugar is way to much meaning too many
different ways to do the
On Thursday, 12 May 2022 at 11:50:59 UTC, Alain De Vos wrote:
Some keywords are overloaded and have different meaning when
used in a different place.
Also some syntactic-sugar is way to much meaning too many
different ways to do the same thing. I would prefer one way
which is advised.
`ptr1
Hello,
I have my own DateTime struct.
It has opCmp() and opBinary(), I can do arithmetic with this
custom DateTime and the amazing time units of the **quantities**
package.
Now I'm about mo make iterations in a DateTime range:
const
st = DateTime(UTC, "22.1.1 8:30").utcDayStart,
Some keywords are overloaded and have different meaning when used
in a different place.
Also some syntactic-sugar is way to much meaning too many
different ways to do the same thing. I would prefer one way which
is advised.
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote:
What are you stuck at? What was the most difficult features to
understand? etc.
To make it more meaningful, what is your experience with other
languages?
Ali
Overhall I think that D was not hard to learn because well
designed
On Wednesday, 11 May 2022 at 20:53:21 UTC, Marvin Hannott wrote:
On Wednesday, 11 May 2022 at 20:23:07 UTC, Ali Çehreli wrote:
On 5/11/22 13:06, Marvin Hannott wrote:
> I appreciate the answer, don't much like the "solutions".
Me neither. :)
> It's not so much about copying
Great!
> scoped
57 matches
Mail list logo