« first day (3512 days earlier)      last day (1419 days later) » 

mr5
4:31 AM
o/
 
5:13 AM
Buenos dias
 
6:03 AM
morning
 
6:44 AM
@Squirrelkiller Hola
 
7:16 AM
So, I got a class design question
My coworker keeps creating classes for lists of objects
like Orders for example
and he defines them like public Orders : List<Order>
and then calls the Add() method in the constructor to fill it
it seems kinda wrong to me but I can't exactly explain why
 
mr5
yes. it's wrong
 
Because in general, if you need a list of orders called Orders, you make a variable List<Orders> Orders = new List<Orders>(). There are valid use cases for its own class though.
 
mr5
semantically wrong
 
posted on May 19, 2020 by Scott Hanselman

I've been spending a lot of time with Docker lately. Docker Desktop on Windows is great and getting better every day. Now that WSL2 (Windows Subsystem for Linux) is rolling out stable over the coming weeks and Docker Desktop supports WSL to host Linux containers directly, I'm finding myself using Visual Studio to develop my sites under Docker. Visual Studio Container Tools are actively improv

 
mr5
1561
A: Why not inherit from List<T>?

Eric LippertThere are some good answers here. I would add to them the following points. What is the correct C# way of representing a data structure, which, "logically" (that is to say, "to the human mind") is just a list of things with a few bells and whistles? Ask any ten non-computer-programmer peopl...

The answer is from the C# co-author himself
 
7:28 AM
"Orders" seems like a class which should be a model mostly
the model doesn't contain logic on how to add data to itself
the logic it should contain concerns questions on the orders that it currently holds, like "give me the largest order" or "give me all orders for user x"
 
yeah
 
I don't know if there's a term for this though
 
mr5
I think List<T> should have been mark as sealed as to not used it incorrectly.
 
what does that mean?
you can't modify the list after it has been sealed?
 
iirc it means that the class is "done" and can't be inherited
 
mr5
7:37 AM
^
 
i think it's bad cause in this case its not a object that was made, but rather a new type of list
i also think its bad that it carries all the list<t> stuff with it too
 
ah ok, so like final in java
honestly I wouldn't bother making an "Orders" class unless it offered something beyond being a simple list of Order instances
even then, I'd be tempted to create a wrapper class with List<Order> member
I don't like extending List
 
7:57 AM
good morning
 
looking fairly good thus far
 
mr5
I rarely use inheritance these days. I would not be surprised if it be replaced by extension like in Swift
 
8:21 AM
inheritance is so 1990's
joking aside, I find it increasingly troublesome and not worth doing
Interfaces and implementations are clean and already take care of 90% of cases
if I really want inheritance, I'll write an abstract base class that can't be instantiated
 
For bigger constructs I usually have interface->abstract class (probably with template method) -> implementations
 
even then, I'll use the abstract class for holding common utility methods
I won't depend heavily on the class for anything other than providing useful internal logic methods
I used to think creating this whole mini framework using an abstract class was a good idea
like wrapping a call with another abstract method that gets implemented in the concrete classes
but that's ultimately confusing imho
I like to keep the macro "do it" method have full control over what happens and what gets called, and leave the abstract class to perform the details should the implementations share those same details
 
@mr5 Too radical. You may want to extend the mechanism of List<T>. A good example is OrderedList<T>
 
Depends on the use case. We have a feature where there will always be two calls: 1) Add masterdata entry, 2) add specific entry. So the abstract base class has the DoIt() method implemented like SendMasterData(); SendSpecificData(); with some data gathering and mapping around it. The SendMasterData() actually needs one bit of information from the implementation, so that is an abstract method the implementation has to deliver. Then SendSpecificData() is abstract too.
 
What is important is not thinking inheritance as a shortcut to avoid typing more. When extending classes, you must ask yourself: "Does what I am gonna create contribute anything to the base class?"
 
8:32 AM
Or SendSpecificData() gathers specific data via an abstract method from the implementation, and then calls an abstract endpoint that's set by the implementation.
 
mr5
@bradbury9 there's an IList<T> for that.
 
@mr5 But if you implement OrderedList using IList and composition with a List, then you'll have to route all calls you don't wanna change to the List
 
The Orders : List<Order> is a good example of my argument "it is useless". It has no aditional properties, functions whatsoever
 
it actually does have additional things
but nothing list related
mostly about loading n saving to database
 
mr5
@Squirrelkiller you can't change the behavior of List<T> by extending it anyway. You can only add features to it.
 
8:44 AM
I can totally override Add
Or make a SometimesReadonlyList and override the Add and Remove methods
 
mr5
hmm
 
Damn. Gotta make it new then.
 
 
2 hours later…
10:24 AM
hi, leopard
 
11:47 AM
What do you guys know about replacing the outdated WebMethod() static method with an ApiController?
the JavaScript canvas I made for my workplace a few months ago largely works as intended, but it's using deprecated code that I heard would be handled by an API these days
 
11:59 AM
upgrade the ApiController?
not a whole lot you can do otherwise I suppose
 
mr5
12:18 PM
when the Math says f(x) = x ^ 3 + 2sin90, does this translates in code below?
function(x) => {
    var rad = toRadian(90)
    return Math.pow(x, 3) + 2 * Math.sin(rad)
}
 
I think so
 
mr5
so all those F of X are just basically an anonymous functions with a single parameter?
 
The "f" usually stands for "function" so yeah, "f(x)" is a function with one parameter
Sin of 90º isn't equal to 1?
 
Kiss principle: f(x) = x ^ 3 + 2
My previous job, talikng with human resources about payrolls and some data they wanted calculated.
HR Boss: So the calculation is `days = (12*30) + 30`
Me: OK, so `days = 13*30`
Him: No no no... It _must_ be `(12*30) + 30`
....
He had to use the calculator
 
1/n * (sin x) = six = 6
 
Facing to the wall! now! until we decide what to do with you!
:-P
 
can I come out now?
 
Okis, fine
I am amazed, I have been just reported that in TSQL select DATEDIFF(YEAR, '20191231', '20200101') returns 1 year
 
12:59 PM
Fucking Nomad. It just took me like 5 hours to deploy my service to Nomad.
And this is the end of my nomad json file:
                            }
                        ]
                    }
                ]
            }
          }
        ]
      }
    ]
  }
}
 
nomad recurve bow
 
pew pew
i want to shoot a traditional bow like that
 
@Neil there's the thing: we don't have an apicontroller
I need to ask someone at work about this
 
@Freerey Well make a new one then go on
 
mr5
@ntohl sounds like a D3 item
 
1:08 PM
yay good news...we actually are planning on using a RESTful API soon hooray
 
@Hozuki I have pew pew day.
 
@ntohl That's a neat pew pew. Mine is very different.
 
Why do you have two half pew pews
 
Took a saw and cut it up.
It's a modern takedown recurve.
 
wow. You can't complain neither.
 
1:24 PM
to pew pew is nice
 
🏹👍
 
1:48 PM
i barely draws the bow
maybe first and second try
later I cant have enough strength
playing with bow requires excellent stamina
paid 10dollars for 20 shoots, just played 4/5
 
It depends on the draw weight. I have a very light bow, any adult will be able to shoot it continuously for at least 20-30 minutes.
 
hmm.. maybe its too heavy for me.. but at that playground, they only have standard range
which is fxxking 27m, if i remember corectly
 
wow. We have max ~20 m
nomad can be heavy and light too
I have a decent 42 lbs bow on my draw length. I draw short
 
2:06 PM
It's not the range, it's the draw weight. You can still shoot 27m or more with a much lower draw weight, you just aim more up...
FWIW I shoot at 25m with 22 lbs bow. It's very light.
(That's almost half! ntohl's draw weight)
 
!~convert 22 lbs to kg
@nyconing 9.979 kg
wtf, its heavy
 
Draw weight is not the weight of the bow :P
draw weight is the amount of tension you'll apply on your whole skeleton when drawing the bow
22lbs is nothing for a grown adult.
 
^ true
 
idk,that bow have how much weight seted on. i feels very stressful after 3 shoots
and then i cant having a fully drawed position
:(
 
Then it was way, wayyy too heavy.
If you go to a shooting club they'll set you off with a lightweight bow
 
2:12 PM
that was a themed playground, archery is one of them
i play guns after that, choosen sniper
 
"play"
 
Airsoft guns? Also a lot of fun.
 
shooting with a sniper rifle might have much bigger force on your shoulder than shooting with a 22 lbs bow on your fingers
 
nah, its a fake gun with bb bullets
 
airsoft was fun.
 
2:15 PM
real gun i might cant have enough weight to handle the.. reaction force
 
I shot with a real pistol, and my fear of the reaction force was higher than really how big it was
 
2:33 PM
@ntohl .22 lr?
 
I don't know the diameter, but it was a SIG Sauer
 
3:00 PM
Afternoon lads
I'm coming to you live from yet another novelty platform
 
FORTRAN?
 
Can you guess it before I post a photo
 
I can
Ruby
 
I did guess before the photo
 
3:04 PM
But its wrong
 
but still. I was able to "Can you guess it before I post a photo"
 
Also holy shit imgur mobile is aids
Here we go
 
Please tell me you type using the car's controls
 
Sadly just an old version of the android soft keyboard
 
lol nice
 
3:12 PM
But it turns out the head unit is just a bunch of android aoos
 
nice
 
The android auto display thing is an android app...
But more surprising
They bothered to put the icon on the carplay one, so maybe Apple developed an Android app
 
3.0 honeycomb?
 
||hmmmm
 
3:18 PM
Nah its ICS
 
Hey All, Isn't C# TransactionScope API Ineffective and pointless when you have a C# TransactionScope wrapped around C# code that invokes numerous SQL DML statements (i.e, inserts, updates, deletes,etc. )?
 
Oh wait
It's actually jellybean
4.2.2
Must have been updated since last time
 
Been working too long, cya tomorrow o/
 
Also ew my screen is filthy
 
install a samsung tab s6 into it
 
3:24 PM
do they install camera on car? What happens when you open the app?
 
take a selfie
set 10s timer, trigger, run to car back
 
Hey All, Isn't C# TransactionScope API Ineffective and pointless when you have a C# TransactionScope wrapped around C# code that invokes numerous SQL DML statements (i.e, inserts, updates, deletes,etc. )?
 
my refrigerator has a camera installed inside so I can use an app on my phone to see what's inside
my colleagues thought it would be funny if I checked what was in my fridge only to see some guy I don't know in the house with my wife :P
 
yeah, smart refrigerator, it can also post a tweet
 
@Neil whaaa.
 
3:30 PM
that's not possible though of course
it takes a picture only after fridge closes
 
The camera is the reversing camera
 
any modem and gps? so you can track your car by google
 
This car doesn't have its own internet connection
It doesn't have the Google apps either. Apparently somebody tried it and it brickedbtheirbhead unit
 
mr5
3:46 PM
@CaptainObvious what happens if you press the button that says "passenger air bag"?
@Hozuki cool. archer/dev
a lot of rich people here
 
when we bought our car, we had the option of getting that
we settled for the sensors
 
mr5
that parking sensor seems easy to do using a phone and a camera.
having a built-in and dedicated system is decent though
 
Hello, somebody with good knowledge of Telerik components?
 
@Neil me too. Monochrome display
 
mr5
help
which one would produce more multishot damage?
 
4:04 PM
@ntohl no just the sensors which beep for me :)
 
@Neil I mean I have the beeper too, because the display is not compatible with the camera (monochrome). It would be very expensive to change the display, so we settled the sensor (beeper)
 
after some getting used to, it works just fine
almost second nature
 
yeah. Tho I would like to see, what's behind me. Especially buying a new 7 seater. I will have to relearn driving
 
it works well, even with say, gates with holes in them
 
Hey, somebody Telerik?
 
4:12 PM
is any bot capable of don't ask, if you can ask?
 
don't ask?
 
That is Diablo 3?
 
Aug 28 '17 at 15:53, by mikeTheLiar
Don't ask if you can ask, it creates an infinite recursive loop. Just ask your question. If someone is around who can help, they will.
Apr 25 '19 at 19:49, by Caprica Six
Aug 28 '17 at 15:53, by mikeTheLiar
Don't ask if you can ask, it creates an infinite recursive loop. Just ask your question. If someone is around who can help, they will.
!!justask
 
Aug 28 '17 at 15:53, by mikeTheLiar
Don't ask if you can ask, it creates an infinite recursive loop. Just ask your question. If someone is around who can help, they will.
 
yaaay. JamesBot is capable
so don't ask if you can ask a Telerik question
gtg
bye
 
4:41 PM
If i add a ControlTemplate to a button, I must style the mouse over/out/click states right?
Is it possible to inherit those states form, say a Telerik theme button?
and add a picture inside of it?
So picture and text in the button, but keep the button shape like the rectangle and mouse over/out/click states
That possible?
 
5:23 PM
9 hours ago, by Neil
inheritance is so 1990's
is inheritance really considered outdated?
granted I almost never do it, but still
 
posted on May 21, 2020 by Scott Hanselman

During the Microsoft Build keynote last week - that you can watch free online here - we snuck in a LOT of detail and easter eggs. We planned the whole thing out like a live stage play (I have a background in theatre) and one of the things that mattered to me was lighting. If you're going to watch something you for an extended time you'll need a little visual interest. Ya gotta mix it up! So I

posted on May 28, 2020 by ericlippert

Source code for this episode is here. Just as a reminder: I am developing my C# version of Stafford’s “QLIFE” algorithm by taking Abrash’s “keep the neighbour counts around” algorithm and gradually adding optimizations. That’s much easier to understand than … Continue reading →

 
5:38 PM
@Freerey lets just say it was supposed to revolutionize everything, and then we just kind of realized that no, it's just a popular programming paradygm
people think functional programming is going to revolutionize everything now, and I just think it has its advantages and disadvantages, like OOP and everything else
I mean it's still technically OOP, but emphasis isn't about inheritance
 
I'm surprised my profs never told me about functional...but that also sounds like it encompasses almost all programming now
lately I've been using more objects anyway
 
Lisp :)
 
I have Opinions About Inheritance (which is that it's almost never the right tool for the job, you almost always just want an interface), but I guess it's... fine.
Those design pattern weenies are always talking about ways you can use inheritance to pretend you have features that other, typically functional, languages have, like mix-ins and typeclasses, but I always get the feeling that those people are more into selling you books than actually making you a better programmer.
There's some situations that seem tailor-made for it, like "I have a UI toolkit full of widgets, and some widgets are subclasses of other widgets, so you can use a DialogWindow or a FooWindow or a WhateverWindow for anything that expects a window, but I tend to find UI programming unweildy, so I'm the wrong person to ask.
 
5:57 PM
Are you pointing towards JavaScript?
 
I don't point towards Javascript if I can help it, no.
HTML/JS/CSS is the only thing I do anything resembling UI programming in, and I can do that all right, but I wouldn't want to do it for a living or anything.
 
Hmm, people said VB6 will die, well, you can still code VB6 or VBA which is subset of VB6 in Excel :)
Same with inheritance, you may think it will die, but there is a purpose why it exists so :)
I don't think it will die, large ERP systems need to be tested thoroughly
So strongly typed languages will still exist
And among the books Gang Of Four - Elements of Reusable Software Design Patterns is all you need. other books perhaps just modify the way you learn patterns :)
And I also keep forgetting the patterns. :) I guess you remember them if you have built a software using them.
The main point of patterns is, when you do things twice or pile a lot of code in small space, its time for restructuring code.
And you can build the whole software properly by just following the patterns.
Usually should use composition instead of inheritance, but I think, best is around 50 / 50
Inheritance triggers explosion of classes, composition makes you dependent on that certain data structure. A compromise between the two.
 

« first day (3512 days earlier)      last day (1419 days later) »