« first day (3165 days earlier)      last day (1996 days later) » 

3:41 AM
+		Entities	{{
  "$instance": {
    "To": [
      {
        "startIndex": 10,
        "endIndex": 15,
        "text": "paris",
        "type": "To",
        "score": 0.987954
      }
    ]
  },
  "To": [
    {
      "$instance": {
        "Airport": [
          {
            "startIndex": 10,
            "endIndex": 15,
            "text": "paris",
            "type": "Airport"
          }
        ]
      },
      "Airport": [
        [
          "Paris"
        ]
      ]
    }
  ]
}}	Newtonsoft.Json.Linq.JObject
anyone on tonight
 
2 hours later…
5:25 AM
questions how would this get done?
Coffee cup = PourCoffee();
mr5
mr5
5:52 AM
var cup = CoffeeFactory.Pour()?
Should be .Create() .NewInstance() if we follow convention
6:21 AM
Container<Beverage> cup = new Cup();
Beverage coffee = CoffeeMachine.MakeCoffee().Also { cup.Fill(it) }
(CoffeeMachine : Factory<Coffee>)
mr5
mr5
yagni
but what if you now want a cappuccino?
you'd need class Cappuccino : Coffee, Milk
also, according to DM, your cup of coffee is two separate things
a cup and the coffee
yagni is fine, but you are going to need a design that can be used in the upcoming few years
also, all other principles rule out yagni
if you have a choice between following yagni and following any other principle, you shouldnt favor yagni
mr5
mr5
"upcoming few years"
not happened to me once
6:36 AM
that a design was good enough for a few years?
7:04 AM
@ChristianMatthew that syntax implies that pouring coffee into a cup creates the cup
8:02 AM
g'morning.
Every time a discussion like the one up there comes up, I become more convinced that OO tutorials and classes that try to present OO as a way to model real-life entities do more harm than good.
mr5
mr5
8:21 AM
@Wietlol I mean, the software is "good" enough and "no more updates" are necessary or at least no demands from client.
@AvnerShahar-Kashtan same. I think that kind of question about a fictional model is evidence that the model is too abstract, because ways of factoring that do or do not make sense in context would be clearer if the idea being modelled was specific enough to be a real problem
8:46 AM
@TomW Especially with languages that don't support multiple inheritance. It's a legitimate limitation for OO modeling, but when your examples are all taken from real life objects, not from software architecture models, things can be two things.
People say "OO is modeling real-life entities and relationships!", but then you try, and realize it doesn't work for real-life entities and relationships, but only for a model, which abstracts them to a small subset which makes sense for the application.
No-one (except for that Owl guy that used to come over in the room, what was his name?) wants to do an OO model for every atom in the universe. It doesn't make sense. It's just that the rhetoric of OO design makes newcomers believe that it's an infinitely extensible idea that can model both "a FileProcessor class that calls a FileStorage class" and "Every animal and plant known to man".
Good morning
I've been playing with my linux server since yesterday evening - any idea why I can't get a simple init script to run on boot?
With Linux I always seem to get stuck on the simplest things
9:13 AM
Fuck it I need too eat. Have a nice first workday Aver!
 
2 hours later…
@nyconing You can find the thread on github about this feature, with people - including James Newton-King - saying it's a good addition to the framework and can help Json.NET focus on more advanced features.
It's not as if JNK makes money off of Json.NET. At least not a lot.
I thought the .net foundation wanted to absorb Json.net
Lots of conspiracy-theorists replying on that post saying how MS wants to kill Json.NET because it's "too useful", which seems... needlessly paranoid? MS adopted Json.NET with MVC 4 because it was the best tool out there. And they adopted JNK as well, at some point.
Saying that it's here to replace System.Text.Json is here to replace Json.NET is like saying Memory<T>/Span<T> are here to replace List<T>. Yes, it's here to replace it, in the use-cases where it's not the best fit.
11:15 AM
Ughhhhhhh. Our Azure subscription and resources are in the West-US2 zone, which is A) slow, and B) far away. Working with e.g. the databases there is a pain.
Working with the databases anywhere would be a pain for me because remote
I need stand up from my desk, walk around it and a few feet to the right and I can see the physical servers running my databases
On that note, I've rearranged my office and therefore my desk. However I still have 4 screens in a 3v1h config, just the 1h is now on the left instead of the right
Perhaps you should replace the dial-up modem for a more modern solution? Then working remotely is feasible. :-P
It's fine, the cost for us to work with azure/any cloud provider is insane and in some instances literally impossible
My latency requirements aren't that high. I just need it to not be horrible.
We abuse our database servers
11:49 AM
@CaptainObvious that doesn't seem likely. What was the calculation that led you to that conclusion?
Although for one I'm sure you get a very different answer whether or not you include buying the servers in the first place
12:19 PM
I'm not sure what it was because it doesn't seem too unreasonable now. (although $10k/mo is still way too much)
Well, that depends on the income generated by that 10k/mo.
mr5
mr5
1:05 PM
Your database infra cost about $10k monthly?
1:28 PM
Depends whether you include employing him, too
Azure SQL or full SQL Server on VMs?
That was Azure SQL
And it doesn't directly generate any income at all
@Mr5 it would do if we used azure
damn son
mr5
mr5
Storage and processing cost about that?
One of the problems being that DTUs have, I think, a fairly precise definition, but there is no formula for determining how many your workload will use
Exactly
But when we tried to work it out it came out stupid
mr5
mr5
1:36 PM
what's DTU?
Database Throughput Unit
I thought it was Database Transfer Unit, but I suppose they mean the same thing
It's an amortised measure of resource usage comprising disk space, network I/O and CPU IIRC. It's an abstraction of how much of a SQL instance's resources you use
I guess partly intended to avoid quibbling over optimisations for each particular metric. Nobody wants to have to e.g. amend their code to use temp tables everywhere just because it's on Azure
 
3 hours later…
5:02 PM
happy fathers day
anyone here
5:24 PM
Hi, is somebody here doing CodeWars?
 
3 hours later…
8:28 PM
what's code wars
9:01 PM
hi @Wietlol
i read what you sent yesterday
I am using linqPad
in general is this possible
Coffee cup = PourCoffee();
ii am not really seeing how taking a Coffee type and extracting magically another method out of Coffee
and I am not seeing how to do it without instatiating the class with the new keyword
9:27 PM
anyone here
lol or is everyone a father
Something, somewhere must call new to create an object, no exceptions. Or actually, one exception, Activator.CreateInstance(Type)
That probably just calls new internally but may also do some framework level trickery
static void Main(string[] args)
{
    Coffee cup = PourCoffee();
    Console.WriteLine("coffee is ready");
    Egg eggs = FryEggs(2);
    Console.WriteLine("eggs are ready");
    Bacon bacon = FryBacon(3);
    Console.WriteLine("bacon is ready");
    Toast toast = ToastBread(2);
    ApplyButter(toast);
    ApplyJam(toast);
    Console.WriteLine("toast is ready");
    Juice oj = PourOJ();
    Console.WriteLine("oj is ready");

    Console.WriteLine("Breakfast is ready!");
}
they just list this out like this... i am trying to actually recreate it
Sorry, I don't understand what the question is
9:33 PM
Coffee cup = PourCoffee();
what are they talking about
how do you do such a thing
However you like
the syntax is confusing i don't get it
where are they getting a random method from?
It's a method call that returns a Coffee, what's confusing about it?
a method call?
cup that returns Coffee is set to a method PourCoffee
yes?
No, the cup doesn't return anything
cup is a variable, its type is Coffee
9:41 PM
can you give me an example there is something i am missing
i get that
How much C# do you know? I'm guessing you're a beginner
yes I am coming from javascript
You say you get that but you just said something completely different
i get the types of the variable is Coffee yes I misspoke
and you said it's a method call that returns a Coffee
so that's not completely different than what I just said
You said the variable is set to the method. It isn't, it's set to the result of the method call. Those are two completely different ideas, even though C# has first class functions so you could have a function variable if you wanted
9:45 PM
you're right
i do understand that. what I am saying or asking is how can you set something to a method like that
I am not seeing how to do that
Anyway I think the problem is that this is an illustrative example you're taking too literally
lol that's what I want to know
i want to know that that is literally wrong
if that's the case i am ok with that
and if that's the case what would be correct.
would it be a contructor for the class
a delegate
Would what be?
i am asking to make the example real... with real methods and classes and types and functionality
let me show you this
static async Task Main(string[] args)
{
	// Egg test = FryEggsAsync(2000);
	Console.Write(FryEggsAsync(2000));


}

delegate string Something (string x);
	static string Thing(string x) => x;


public static async Task<string> FryEggsAsync(int x)
{
	string cookingAction = "Frying Eggs";
	var delay = Task.Run( async () => { Stopwatch sw = Stopwatch.StartNew();
                                    await Task.Delay(x);
                                    sw.Stop();
                                    return sw.ElapsedMilliseconds; });
i created that
other than creating a class name Egg and putting this method inside of it I am totally confused by what they're doing setting something to a class and then calling said method
forget that delegate stuff
It's just normal C#, I don't see what's unusual or difficult to understand about it. They just haven't included all the methods they're calling because it's meant to be obvious that they're just examples
9:53 PM
it's ok nm you're not helping
You're not explaining properly what you don't understand
how is what asking confusing?
are you able to replicate Egg eggs = FryEggs(2);
could you do that?
Define a method named FryEggs(int minutes) that returns an Egg
And presumably a class named Egg
i think the part I don't understand is the method returning a class of Egg
Ok, tell me what you think a method looks like
And a class definition
10:07 PM
void Foo(string x) {...}
public class Food {...}
lol sorry foo
Yep looks fine but returning void isn't the right thing here. Method Foo and class Foo have no relationship to one another just because of their name
true
i get that
Foo Foo(string X) {}
So what's the problem?
ok this is what i picture when you say "Define a method named FryEggs(int minutes that returns an Egg
Going to bed
10:16 PM
public static Egg FryEggsAsync(int x)
{
	string cookingAction = "Frying Eggs";
	var delay = Task.Run( async () => { Stopwatch sw = Stopwatch.StartNew();
                                    await Task.Delay(x);
                                    sw.Stop();
                                    return sw.ElapsedMilliseconds; });

	Console.WriteLine("{0} took {1} minutes to make:", cookingAction, delay.Result/1000);
	return new Egg(32);
	//return await Task.FromResult("Eggs are ready");
}

public class Egg {
is that what You mean?
Yes other than the task stuff which is jumping forward somewhat that looks fine
ok so my question then becomes I understand that
one second
static async Task Main(string[] args)
{
	// Egg test = FryEggsAsync(2000);
	Egg eggs = FryEggsAsync(2000);
	Console.Write("Eggs done");


}

delegate string Something (string x);
	static string Thing(string x) => x;


public static Egg FryEggsAsync(int x)
{
	string cookingAction = "Frying Eggs";
	var delay = Task.Run( async () => { Stopwatch sw = Stopwatch.StartNew();
                                    await Task.Delay(x);
                                    sw.Stop();
                                    return sw.ElapsedMilliseconds; });
oh it works
i get it.. that was confusing though. javascript don't get down like that
Oh well that was a waste of my time then. Thanks for nothing
i guess my last question would be. What is the point of that... returning a class
no you were actually super helpful.
in a way lol
i unserstand returning a method but returning a whole class
seems odd
return new Egg(x); and is that really how one would do that
mr5
mr5
11:08 PM
are you new to programming?
you said you come from JS, it's the same there.
@mr5 not it's not it may be possible that is not normal coding convention
mr5
mr5
it is
1. main reason that is not normal coding convention is because I can set a var to anything i want
no it's not
show me examples of that
javascript is not a typed language so no you're wrong
now in typescript with class prototypes ok.
but that's not vanilla javascript
mr5
mr5
wat
what are you saying is the same?
mr5
mr5
11:14 PM
I don't understand why you said it's different from JS
ok. I think you mean in JS, there's no keyword new right?
setting a variable to anything other than var is different
in javascript there is no typing
there are no types
mr5
mr5
it's called type inference.
I'm sure there is
no trust me I have worked in it for years
mr5
mr5
!!> Int32 x = 0;console.log(x)
@mr5 "SyntaxError: unexpected token: identifier"
11:15 PM
typescript which is awesome makes javascript strongly typed
lol
see
mr5
mr5
eh. you can define type in JS
no
no you cannot
mr5
mr5
class there is called function
it is literally for better or worse the heart of js
mr5
mr5
!!> new Int32Array(32);
11:16 PM
everything is an object
@mr5 "ReferenceError: length is not defined"
yes you can call a class
@mr5 {"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0}
mr5
mr5
there's even built-in types
ohhh
but that not a typed language
mr5
mr5
11:18 PM
everything is an object doesn't validate there is no type.
not typed language?
javascript isn't a typed language
there are no types
mr5
mr5
what's your definition of not typed language?
mr5
mr5
> The Int32Array typed array represents an array of twos-complement 32-bit signed integers...
how is that not a type?
what's your definition of type?
JS is not type safe that's it.
because you're just calling a class
var int32 = new Int32Array(2);
that's not a type
mr5
mr5
11:20 PM
omg
javascript is not compiled
mr5
mr5
why do you said it's not a type?
and if it's not compiled, there's no type?
because you're just calling a class
that has nothing to do with being strongly typed
mr5
mr5
calling a class?
var int32 can be a string the next go round
mr5
mr5
11:22 PM
It's not called like that. Class is just a representation. You don't call a class, you instantiate a class.
right?
yes in Java and C# you instantiate
in javascript... you call the class i.e. new SomeClass();
mr5
mr5
and why would you call something completely irrelevant to what it's supposed to be?
what does that have to do with being typed?
if say this.
string someThinig = "some string here";
i can't go next go round and set someThing = 32;
that's the entire point of a typed language
and it is compiled first
javascript is not compiled
it just runs on the runtime
mr5
mr5
When you declared something as `var` and you assign it to some value, the type is inferred at compile time. It's called type inference.
In JS, if you put the `new` keyword, there is a TYPE defined.
Now, you just directly assigned it without a NEW, it's type-less.
javascript does not compile
so it can't infer anything
javascript is 1000000000% not a strongly typed language
mr5
mr5
11:27 PM
where do you get that JS is not a typed language?
*strongly typed
mr5
mr5
AFAIK, JS is a dynamic, multi-paradigm language
@ChristianMatthew and what does this tells you?
JS has types. Right?
you're confusing strongly typed with any types
mr5
mr5
It's not just STRONG
strongly typed is what C# is
correct?
mr5
mr5
11:29 PM
yes.
but you said, JS has no type at all
javascript is not strongly typed?
i keep saying strongly
mr5
mr5
you're not making a point
and my point that is what your point even was is about strong types
mr5
mr5
I think I'm just wasting my time with oyu
i am totally am.
you can think what you want the first thing you put in here was code that failed
my entire point is that assigning a variable to a class is 1000000% not a thing
in javascript
furthermore, the original point you where trying to make is that it's the same in javascript of what I was confused on. It is in fact not that same.
lastly, like Einstein said so adeptly "if you can't explain something simply then it means you don't really understand the material you're trying to explain yourself."
A Weakly Typed Language Means That JavaScript Is Smart
One last characteristic of JavaScript needs to be discussed before going on to the next chapter. JavaScript is considered a "weakly typed" or "untyped" language. The type in question here are the data types—nothing to do with typing from your keyboard. For programmers coming from C++ or Java, two strongly typed languages, this means that JavaScript will figure out what type of data you have and make the necessary adjustments so that you don't have to redefine your different types of data.
it is literally the fundamental difference of the 2 languages of where I was having confusion. but thanks for your help
mr5
mr5
11:42 PM
23 mins ago, by Christian Matthew
there are no types
I am making a point what you said is wrong.
because there really isn't not in the way Java and C# is
mr5
mr5
Then you jump to another topic discussing strongly-typed and weakly-typed language, compiled, interpreted, so-on so forth
you have understand that. when i write JS I don't think about types
because fundamentally that is literally the most important distinctions of the languages
to be fair... typescript adds in typing. and then I have to think about types
and I should say generics too
mr5
mr5
you clearly didn't grasp the concept of OO in JS despite coding on it for years.
like delegates for example. javascript doesn't have delegates. you want to write a function have at it.
mr5
mr5
11:45 PM
^ there you go, jump again.
because there what I notice as being different in the languages
i think C# is a very good language 100%
but there are some hardcore differences between the 2
mr5
mr5
bullshit
where are you getting your numbers?
my numbers?
mr5
mr5
17 mins ago, by Christian Matthew
my entire point is that assigning a variable to a class is 1000000% not a thing
1 min ago, by Christian Matthew
i think C# is a very good language 100%
In computer programming, the term magic number has multiple meanings. It could refer to one or more of the following: Unique values with unexplained meaning or multiple occurrences which could (preferably) be replaced with named constants A constant numerical or text value used to identify a file format or protocol; for files, see List of file signatures Distinctive unique values that are unlikely to be mistaken for other meanings (e.g., Globally Unique Identifiers) Variable values used to accumulate values of register (e.g. variable). It can be changed at any point in time. == Unnamed ...
what do you find wrong with those statements?
mr5
mr5
11:48 PM
Nothing. I just woke up and feel like everything you've said are exaggerated.
how about this. can you help with the question I do have
mr5
mr5
I'm off. Cya
no you dont' know it's ok
do you play overwatch?
I know, this topic has been discussed so many times, too many times. However it is always a current topic. Every time a Java or C# or any other OOP language developer get in touch with JavaScript, he complains of it. He says that working with it is a mess, that it has no types, it is not well-structured, it has several oddities, its object support is trivial and definitively it is not an OOP language.

Some of these complaints may be acceptable, but some others are prejudices, such as the claim that JavaScript has no types and that it is not an OOP language. Regarding the latter point, befo
very good article. you should read it. then you may understand the difficulties that exist for developers going to C# from JS and JS to C#
i approve of the article 10000000.0999%

« first day (3165 days earlier)      last day (1996 days later) »