The distance function is implementation dependend and can only be
computed between two objects of the same class (in this example
the class is Item).
My goal is to write a module for a k-medoids clustering
algorithm. The class MedoidClassification shall be able to
partition a list of objects
On Monday, 4 December 2017 at 20:14:15 UTC, Ali Çehreli wrote:
6) 'git push -force' so that your GitHub repo is up-to-date
right? (There, I mentioned "force". :) )
The right option name is --force-with-lease ).
On Monday, December 04, 2017 12:02:37 Ali Çehreli via Digitalmars-d-learn
wrote:
> On 12/04/2017 09:38 AM, Patrick Schluter wrote:
> > So, avoid pull, look first what fetch does and if that is what you
> > thought it would do, do the merge and be happy.
>
> +1
>
> Paraphrasing someone I trust ve
On Monday, December 04, 2017 20:02:30 kdevel via Digitalmars-d-learn wrote:
> On Monday, 4 December 2017 at 11:05:22 UTC, Vino wrote:
> > On Monday, 4 December 2017 at 10:46:03 UTC, rikki cattermole
> > wrote:
> >
> > FunTest.d(52): Error: template FunTest.ptProcessFiles cannot
> > deduce function
On Monday, 4 December 2017 at 22:34:41 UTC, helxi wrote:
Why can't enums be used as types in this (simplified) example?
enum Positivity
{
Positive,
Negative
}
struct Wave
{
public:
Positivity slope;
}
enum Waves
{
Sin = Wave(Positivity.Positive),
Cos = W
void main()
{
import std.algorithm.iteration, std.typecons, std.stdio;
[tuple(dchar(0), uint(0))].reduce!((a,b) =>
a[1]+b[1])(tuple(dchar(0), uint(0))).writeln;
}
On Monday, 4 December 2017 at 22:34:41 UTC, helxi wrote:
enum Waves
{
Sin = Wave(Positivity.Positive),
Cos = Wave(Positivity.Negative)
}
writeln(nth_value!(Waves.Sin)(1));
}
Sin and Cos there are actually values, not types...
Why can't enums be used as types in this (simplified) example?
enum Positivity
{
Positive,
Negative
}
struct Wave
{
public:
Positivity slope;
}
enum Waves
{
Sin = Wave(Positivity.Positive),
Cos = Wave(Positivity.Negative)
}
int nth_value(T : Waves)(int n
On Monday, 4 December 2017 at 20:43:27 UTC, Dirk wrote:
Hi!
float distance( Medoid other );
float distance( Item i ) {...}
The two signatures need to be the same. I think this is true of
most OOP languages. Have them both be:
float distance( Medoid other );
On 2017-12-04 21:43, Dirk wrote:
Hi!
I defined an interface:
interface Medoid {
float distance( Medoid other );
uint id() const @property;
}
and a class implementing that interface:
class Item : Medoid {
float distance( Item i ) {...}
uint id() const @property {...}
}
The
On Monday, 4 December 2017 at 20:43:27 UTC, Dirk wrote:
Hi!
I defined an interface:
interface Medoid {
float distance( Medoid other );
uint id() const @property;
}
and a class implementing that interface:
class Item : Medoid {
float distance( Item i ) {...}
uint id() const @pr
On Monday, 4 December 2017 at 20:43:27 UTC, Dirk wrote:
interface Medoid {
float distance( Medoid other );
uint id() const @property;
}
and a class implementing that interface:
class Item : Medoid {
float distance( Item i ) {...}
uint id() const @property {...}
}
The compiler s
Hi!
I defined an interface:
interface Medoid {
float distance( Medoid other );
uint id() const @property;
}
and a class implementing that interface:
class Item : Medoid {
float distance( Item i ) {...}
uint id() const @property {...}
}
The compiler says:
Error: class Item inte
On 12/04/2017 12:14 PM, Ali Çehreli wrote:
2) Rebase origin/master (on upstream, right?)
2.5) Create a branch and do all work on that branch
3) Make changes
Ali
On 12/03/2017 12:05 PM, bitwise wrote:
> I've finally started learning git
git is one of those things where as soon as you understand how it works,
you lose the ability to teach. :) I'm watching this thread with
amusement because like most online tutorials, nobody is mentioning the
relationshi
On Monday, 4 December 2017 at 11:05:22 UTC, Vino wrote:
On Monday, 4 December 2017 at 10:46:03 UTC, rikki cattermole
wrote:
FunTest.d(52): Error: template FunTest.ptProcessFiles cannot
deduce function from argument types !()(string,
Array!(Tuple!(string, string)) function(string FFs,
string
On 12/04/2017 09:38 AM, Patrick Schluter wrote:
> So, avoid pull, look first what fetch does and if that is what you
> thought it would do, do the merge and be happy.
+1
Paraphrasing someone I trust very much, "Never 'pull', always 'fetch -p'
and then rebase."
Ali
On 12/04/2017 04:52 AM, Vino wrote:
> if the Variable CleanDirlst is defined as "auto"
Every expression has a type. 'auto' in that context (or 'const', etc.)
just helps with not spelling-out that type. You can see the type with
pragma(msg) and typeof:
auto someExpression = [ "one" : 1,
On Sunday, 3 December 2017 at 23:29:01 UTC, Basile B. wrote:
On Sunday, 3 December 2017 at 22:33:40 UTC, kdevel wrote:
On Sunday, 3 December 2017 at 14:58:03 UTC, Basile B. wrote:
In this case i'd go for a typed pointer, e.g
---
immutable struct Configuration
{
this(string){/*load some fil
On Monday, 4 December 2017 at 11:51:42 UTC, Nick Sabalausky
(Abscissa) wrote:
On 12/03/2017 03:05 PM, bitwise wrote:
One thing to keep in mind: Any time you're talking about moving
anything from one repo to another, there's exactly two basic
primitives there: push and pull. Both of them are ba
A lock on stdout works as a barrier: threads may hit it
simultaneously, but pass it one by one in a queue with a time gap
between them.
On Monday, 4 December 2017 at 16:26:02 UTC, A Guy With a Question
wrote:
Reading this, the interface seems very similar, but I'm not
sure. There's only like a two sentence general description,
then it goes on to talk about a boolean specialization...
https://dlang.org/phobos/std_container_arra
Uh, a bottleneck, not a barrier.
On 12/4/17 11:26 AM, A Guy With a Question wrote:
Reading this, the interface seems very similar, but I'm not sure.
There's only like a two sentence general description, then it goes on to
talk about a boolean specialization...
https://dlang.org/phobos/std_container_array.html
I'm looking for
On Monday, 4 December 2017 at 14:01:08 UTC, Steven Schveighoffer
wrote:
On 12/3/17 2:38 AM, Jonathan M Davis wrote:
On Sunday, December 03, 2017 01:05:00 Nick Sabalausky via
Digitalmars-d-
learn wrote:
Is this even possible? My attempts:
class Outer {
struct Inner {
void foo() {
Reading this, the interface seems very similar, but I'm not sure.
There's only like a two sentence general description, then it
goes on to talk about a boolean specialization...
https://dlang.org/phobos/std_container_array.html
I'm looking for something that doesn't have to resize every
inser
On Monday, 4 December 2017 at 16:26:02 UTC, A Guy With a Question
wrote:
Reading this, the interface seems very similar, but I'm not
sure. There's only like a two sentence general description,
then it goes on to talk about a boolean specialization...
https://dlang.org/phobos/std_container_arra
On Tuesday, 21 November 2017 at 13:45:31 UTC, Dukc wrote:
My question is, does anybody know a way to draw that image
backwards without making another PNG file to do so?
After a lot of code research, I believe the best way for me is to
use DlangUI helpers in same way as in the new api of the op
On Sunday, 3 December 2017 at 20:05:47 UTC, bitwise wrote:
I've finally started learning git, due to our team expanding
beyond one person - awesome, right? Anyways, I've got things
more or less figured out, which is nice, because being clueless
about git is a big blocker for me trying to do any
On 12/3/17 3:48 PM, Basile B. wrote:
On Sunday, 3 December 2017 at 20:05:47 UTC, bitwise wrote:
or just some specific files? and do I need a separate branch for each
pull request,
Yes, yes yes, again. ~master is sacrosanct.
For good reason. If you commit things to your master, and they don
On 12/4/17 4:09 AM, Kagamin wrote:
On Wednesday, 29 November 2017 at 16:13:13 UTC, Wanderer wrote:
static void getId(shared IdGen!(MyId)* g)
{
writeln("next: ", g.next());
writeln("next: ", g.next());
}
writeln synchronizes on stdout, so your code is mostly serialized, good
example of
On 12/3/17 2:38 AM, Jonathan M Davis wrote:
On Sunday, December 03, 2017 01:05:00 Nick Sabalausky via Digitalmars-d-
learn wrote:
Is this even possible? My attempts:
class Outer {
struct Inner {
void foo() {
// Error: no property 'outer' for type 'Inner'
Outer o
On 12/3/17 12:42 AM, Johan Engelen wrote:
On Friday, 1 December 2017 at 18:33:09 UTC, Ali Çehreli wrote:
On 12/01/2017 07:21 AM, Steven Schveighoffer wrote:
> On 12/1/17 4:29 AM, Johan Engelen wrote:
>> (Also, I would expect "popFront" to return the element
popped, but it
>> doesn't, OK...
>
>
On Monday, 4 December 2017 at 11:41:06 UTC, codephantom wrote:
On Monday, 4 December 2017 at 11:30:02 UTC, codephantom wrote:
On Monday, 4 December 2017 at 11:05:22 UTC, Vino wrote:
The original program is as below
Error:
FunTest.d(52): Error: template FunTest.ptProcessFiles cannot
deduce f
On Sunday, 3 December 2017 at 20:05:47 UTC, bitwise wrote:
How does one keep their fork up to date? For example, if I fork
https://help.github.com/articles/syncing-a-fork/
On Monday, 4 December 2017 at 04:45:01 UTC, Patrick Schluter
wrote:
On Monday, 4 December 2017 at 01:54:57 UTC, ketmar wrote:
Basile B. wrote:
On Sunday, 3 December 2017 at 22:22:47 UTC, Arun
Chandrasekaran wrote:
Git CLI is arcane and esoteric. I've lost my commits before
(yeah, my mistake).
On 12/03/2017 03:05 PM, bitwise wrote:
I've finally started learning git, due to our team expanding beyond one
person - awesome, right?
PROTIP: Version control systems (no matter whether you use git,
subversion, or whatever), are VERY helpful on single-person projects,
too! Highly recommende
On Monday, 4 December 2017 at 11:30:02 UTC, codephantom wrote:
On Monday, 4 December 2017 at 11:05:22 UTC, Vino wrote:
The original program is as below
Error:
FunTest.d(52): Error: template FunTest.ptProcessFiles cannot
deduce function from argument types !()(string,
Array!(Tuple!(string, s
On Monday, 4 December 2017 at 11:05:22 UTC, Vino wrote:
The original program is as below
Error:
FunTest.d(52): Error: template FunTest.ptProcessFiles cannot
deduce function from argument types !()(string,
Array!(Tuple!(string, string)) function(string FFs,
string Step, int DirAged), File,
On Monday, 4 December 2017 at 10:46:03 UTC, rikki cattermole
wrote:
On 04/12/2017 10:36 AM, Vino wrote:
Hi Rikki,
Thank you very much, I tired the above code and it is
working, so another help on the same topic.
IF my function (First) of below type when who do we define the
Mid function
On 04/12/2017 10:36 AM, Vino wrote:
Hi Rikki,
Thank you very much, I tired the above code and it is working, so
another help on the same topic.
IF my function (First) of below type when who do we define the Mid function
Array!(Tuple!(string, string)) First(string Ftext)
Tried the below
On Monday, 4 December 2017 at 08:27:10 UTC, rikki cattermole
wrote:
On 04/12/2017 8:22 AM, Vino wrote:
Hi All,
Request your help on the below code, I want to send the
name of the function ( First and Second) from main as an
argument to another function(Mid) and the function "Mid" has
to e
On Monday, 4 December 2017 at 08:27:10 UTC, rikki cattermole
wrote:
On 04/12/2017 8:22 AM, Vino wrote:
Hi All,
Request your help on the below code, I want to send the
name of the function ( First and Second) from main as an
argument to another function(Mid) and the function "Mid" has
to e
On Wednesday, 29 November 2017 at 16:13:13 UTC, Wanderer wrote:
static void getId(shared IdGen!(MyId)* g)
{
writeln("next: ", g.next());
writeln("next: ", g.next());
}
writeln synchronizes on stdout, so your code is mostly
serialized, good example of a very subtle race condition.
On 04/12/2017 8:22 AM, Vino wrote:
Hi All,
Request your help on the below code, I want to send the name of the
function ( First and Second) from main as an argument to another
function(Mid) and the function "Mid" has to execute the function(First
and Second).
Program:
import std.stdio;
Hi All,
Request your help on the below code, I want to send the name of
the function ( First and Second) from main as an argument to
another function(Mid) and the function "Mid" has to execute the
function(First and Second).
Program:
import std.stdio;
void First (string Ftext) {
writeln("
46 matches
Mail list logo