« first day (2733 days earlier)      last day (2216 days later) » 

3:10 AM
posted on April 05, 2018 by Scott Hanselman

I'm continuing to update my podcast site. I've upgraded it from ASP.NET "Web Pages" (10 year old code written in WebMatrix) to ASP.NET Core 2.1 developed with VS Code. Here's some recent posts: Upgrading my podcast site to ASP.NET Core 2.1 in Azure plus some Best Practices Easier functional and integration testing of ASP.NET Core applications Automatic Unit Testing in .NET Core plus Code Co

 
guy does any one know here how to connect a asp.net app(not asp.net core) in visual studio 2017 to mysql database
?
I have been trying but with not success, and feel frustrated. I though it was easy as simply as adding a new item on the project, picking adonet... and from database, but the provider doesn't appear there and I need help with the steps
 
 
3 hours later…
6:11 AM
ohayou
 
I have a BaseClass and a DerivedClass: BaseClass, my base class has constructor with parameter but my derived class has no constructor. why compiler error occurs here?
 
@yekanchi Because your base class with its constructor with parameter means you can't instantiate the base class without that parameter
 
Hewwow
 
The derived class must call the base class constructor with the parameter in some fashion
It doesn't necessarily have to be passed to the derived class's constructor
 
why can't it passed to the base class while it is it is a class witch is derived from
of course i know that the constructors does not inherit but my derived class actually does not need any constructor at all
actually i dont want to pass something the base class. my base class has constructor for itself and my derived class does not need
A more comprehensive question? when we instantiate a derived class do we recursively instantiate some objects for higher classes(base classes)?
 
6:29 AM
@yekanchi If you want to be able to instantiate without passing anything, create a constructor with no parmameters in the base class
When a derived class's constructor is called, its base class's constructor is called first
and this happens recursively
Even if you don't explicitly call the constructor, it's actually calling the base class's constructor with no parameters passed
 
oh thanks neil
 
when you specify a constructor with a parameter, you're saying "This is the only way you can create an instance of this class"
no problem
 
so you mean when we create a class without any constructor and it is not derived from any class, when we instantiate it, it actually calls the constructor of the object class witch all classes are inherited from it. is it right?,
 
@yekanchi Well if you don't create a constructor for a class, one is created just the same without parameters and does nothing
So just the same, the default constructors of all classes are called, even if they do nothing, but yeah
 
yes
one more question, let's assume the same problem, i mean the BaseClass has only one constructor like BaseConstructor(string BaseString). Now i have a DerivedClass : BaseClass witch needs to pass the BaseString to BaseClass. is creating a DerivedConstructor(string DerivedString) : Base(DerivedString) the only way to pass it to BaseClass? Or can i solve this Problem with other solution rather than creating a DerivedConstructor?
 
7:16 AM
Morning
 
ohaios amigos
 
You can copy-paste the base class constructor into the derived class, but what's the point for it? If you want to extend the funtionality of the base class constructor, you extend the base constructor and it's all magically working.
You can still add code after the base constructor anyway.
 
7:59 AM
Hi, I have a strange problem. I'm trying to learn C# and my book tells me to open a new project in Visual Studio Code
It says it's in File menu, but I just can't find it!
 
Visual studio code or visual studio?
 
Visual studio code
This is the SS
Forgive the Javascript in the background
That's another program
 
dotnet core or .net 4
?
 
I'm sorry?
I dont understand
I have dotnet sdk installed
 
.NET Framework (pronounced dot net) is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large class library named Framework Class Library (FCL) and provides language interoperability (each language can use code written in other languages) across several programming languages. Programs written for .NET Framework execute in a software environment (in contrast to a hardware environment) named Common Language Runtime (CLR), an application virtual machine that provides services such as security, memory management, and exception handling. (As suc...
.NET Framework (pronounced dot net) is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large class library named Framework Class Library (FCL) and provides language interoperability (each language can use code written in other languages) across several programming languages. Programs written for .NET Framework execute in a software environment (in contrast to a hardware environment) named Common Language Runtime (CLR), an application virtual machine that provides services such as security, memory management, and exception handling. (As suc...
sorry german
 
8:02 AM
microsoft.com/net/learn/get-started/windows I am using the official guide
 
Hello, people and peoplettes.
 
Hi Avner
 
Have you all managed to not burn down the place while I was away?
 
Oh dear. The official guide. HowNotToDoThings (tm) by Microsoft.
 
@PrittBalagopal but this tells you to download visual studio (community edtion) not visual studio code
 
8:03 AM
Oh shit
What is the difference between Visual Studio and VS Code?
They sounded so similar
 
@AvnerShahar-Kashtan Long time no see!
 
visual studio code is a lightweight editor with plugin capabilities and works on linux
visual studio is a full fledged IDE with lots of features specifically for microsoft products already builtin
 
Oh I see.
 
@SebastianL "lightweight"..
 
but you can work with vs code
@Neil more lightweigth than any version of VS
 
8:05 AM
But it doesnt have the Create Project option
That's what's bothering me
 
It's hardly notepad
 
yeah you have to use the command line for this
 
@Neil It is lightweight, it just features a ludicrous amount of add-ons.
 
Im new to C#, so I have to follow my book's instructions
 
@HéctorÁlvarez Then so is eclipse
 
8:05 AM
Nontheless I'll install Visual Studio
 
@Neil VS Code is nowhere close to Eclipse.
 
I think on the lightweight spectrum, serious editors like visual studio and eclipse are on the far end of "lightweight"
 
VS code is intuitive and has a modern UI.
 
I guess it depends on your definition of lightweight
 
I LIKE VS CODE, duh!
:P
 
8:06 AM
I know bits of Javascript, and Visual Studio code isn't too bad, as far as I have used hehe
 
But any editor which allows plugins is automatically no longer "lightweight" for me
I don't mean slow, I just mean complex, sophisticated, airplane cabin controls, and most importantly not "lightweight"
 
@Neil except its name is "lightweight"
 
Right, hence the quotation marks
 
@PrittBalagopal I think what you need is the full Visual Studio (the free Community edition), which is probably what your book assumes, and which has a lot more features already setup out of the box (creating projects, project items, debugging, intellisense, etc)
 
Wow great then
I'm doing just that
 
8:09 AM
If I ever create a multi-threaded multi-platform program meant to work with cloud clusters and an as400 and Docker, I'll call it "Lightweight 2.0"
 
As far as Workloads, I went for the universal one
Hope I made the right choice
 
@Neil Lightweight as in few MBs as opposed to the 30+GB Visual Studio installs on the initial setup.
Whatever you add on top of it is completely up to you, but the base product is as lightweight as Notepad++.
 
@HéctorÁlvarez well I think that's a bit like putting lipstick on a pig and calling it beautiful
 
to some it is.
 
@Neil nah more like adding a new UI to windows 7 and calling it windows 8
 
8:11 AM
@Neil will it have plugins?
 
That's like saying a vehicle chassis is a very complex system because it can become a truck one day.
 
@Default of course not, since it can handle everything out of the box
 
@Default Well of course. It'll also be under 100 MB
 
What VS codes by default is read text files and provide syntax highlighting for a bunch of languages.
 
So you know it's lightweight
 
8:12 AM
a mazing!
 
hi
I am getting "Exception thrown: 'System.IO.DirectoryNotFoundException' in mscorlib.dll"
But I can clearly see the file
being there
 
File != Directory
 
even directory
 
You are checking the wrong directory.
 
@Breathing have you escaped the path properly?
 
8:17 AM
I.e. the path you are checking for in your program and the one you are looking for manually aren't the same.
 
I am looking at the call stack
 
yooo
 
8:35 AM
@AvnerShahar-Kashtan how are you doing? I bet you have at least one story to tell from your travellings.
 
i got it thanks
 
@HéctorÁlvarez Well, one story I can tell is that travelling with a 5 year-old can be exhausting. Fun, but exhausting. :)
 
Oh well, that's not a story really. I'm expecting a street-automatic-pizza-vending-machine-level story.
 
I just posted a new entry in my (Hebrew only, sorry) blog about how I couldn't indulge in my usual outlandish snack fetish, because I didn't want the kid's diet to consist entirely of junkfood.
Though I did sneak in a couple of more unusual soft drinks, like a Jamaican watermelon-guava soda.
 
8:48 AM
I needed this earlier in my life
Injectable auto deserializing config files
 
@AvnerShahar-Kashtan that is some cool soda indeed,
 
Also an apple-rhubarb soda. And a Coke Zero with Peach, which was nice because it's not a flavor we get here.
 
@KamilSolecki config files are so 2010. It's all about environmental variables these days.
 
@Squiggle Like in 1994.
I hear the Registry is set to making a comeback.
 
8:55 AM
@AvnerShahar-Kashtan :/
at least it's abstracted now
 
Store your configuration in a cloud key/value store
 
@Squiggle Pfff please, conditional compilation symbols. #ifdef Foo FTW.
 
Apple-rhubarb, but does it work with vodka or is it more of a gin mixer?
 
@AvnerShahar-Kashtan ...and who decided using a hierarchical database would be a good thing in 2018?
 
You know what should be making a comeback in 2018?
Naps.
Naps are good.
(Haven't quite recovered from Sunday evening's sleepless night flight)
 
8:58 AM
i dont even nap the day after a night out
sleep is for the weak
 
sleep is for the week*
 
@AvnerShahar-Kashtan I'm spanish, I know that arcane art pretty well.
 
24/7 party for the weekend
 
@HéctorÁlvarez Ahh, yes, the home of the siesta.
 
8:59 AM
too lazy to work through the day
go home at lunch and sleep
 
Just sleep at your desk
 
boss'll kick fuck out me
 
hammock.
 
We have beanbags and a sofa for lunchtime sleepage
 
do you also have table football?
 
9:11 AM
No. Pool table, PS4, Star Wars AR headset
 
I had never seen the term "table football" before. Part of me wished it was called Lil' football in English.
 
and a home made drone that tries to kill us
 
@RudiVisser That's because it has a lot of dynamics.
He can't tell the difference between Kill(person) and Help(person) because both are accepted.
 
It's more that in our initial flight tests we coded 10 second based power cycles and it tried to take off in to our faces and cut us to death
Lots of frantic commands from the Win10 IoT console did not save us
But hey ho
 
@RudiVisser where the fuck do you work
if my work had a pool table theyd never get me off it
 
9:14 AM
It's a problem I used to have with my staff, yes
But the introduction of a whisky cabinet helped with that cos they ended up beating each other up with the pool cues after a while
 
professional
 
Always
 
In my last workplace we used to have a pool table, but we could never use it because it was too noisy. Thus, it was useless.
 
Yea I can see that
 
can the each() method of jquery take only one parameter ie the call back function only?
 
9:26 AM
Is your google broked
 
@RudiVisser their google won't be borked, some people are just lazy
Occasionally, i too fall under that category
 
But Breathing has been here for ages don't us regular chatterererers generally scare away the lazies
 
the amount of shit i've got from people in the chat lmao
 
            join = new SQLJoin();
            join.Table = "someTable";
            join.JoinType = SQLJoinType.JOIN;
            join.conditions = new List<string>() { "someTable.stb_idtbs = emps.per_idemps AND foo.foo_idfoo = emps.idfoo" };
That's some actual code in production.
I replaced the table names only.
And that object will be used in a similar-shaped SQLSelect to output an actual sql sentence that selects whatever.
Uh? I have 10 extra points, I believe I haven't answered anything in SO for like 6 months.
 
@HéctorÁlvarez what am i looking at?
 
9:33 AM
@Wietlol Some bullshit I have to debug.
That's meant to be a "Custom internal ORM" that simply makes it exhausting to work with queries.
I love databases, like oh god, I could work 24/7 on them. It takes this much to bore me while working with them.
 
The fuck is a SQLJoin
 
An enum type.
 
then new SQLJoin is a compiler error
 
@RudiVisser I need you drone.
 
^^ (to Wiet's comment)
 
9:37 AM
wut
Oh to kill people
 
I don't know what I hate more, the custom bullshit, or the random database field names. I swear there are no tables with actual valid names.
 
I thought my old database connection logic was bad. There was a function called SelectData(string Query) which you fed a select query and it would return and arraylist of arraylists, where you chose the column you needed by it's index because column names didn't exist
 
@Butler1233 A query enters a bar and approaches two tables and says, "May I SQLJoin you?"
 
cries in the corner
 
geez, tough crowd
 
9:49 AM
It was so bad that I actually laughed.
It's a solid 5/7
 
Get some rice from the bar and that score might improve
 
I want to Create A function under a WCF Service Application to witch will input an Excel file and then parse it to datatable in the serivce. my problem is how to input the excel file and then how to parse it
 
@HéctorÁlvarez depends on what you consider a valid name
i can assure you that I have worse databases
 
most of the librarries how do parsing actually recieve the directory address of the file but here the consumer application and the wcf serivce are seperate
 
@Wietlol stb_idtbs is not a valid name.
 
9:55 AM
dont talk to me about bullshit names
std_idtbs is perfectly fine
(not to mention that I have tables with 382 columns)
 
It could be worse - I have a table that tracks signups of users to products. It has a UserId, DateCreated, DateProcessed, DateCancelled. To sign up, you get a DateCreated inserted, it gets processed, DateProcessed gets set. What happens when you cancel? Inserts a new row with DateCreated and DateCancelled
 
i like the consistency
 
@Wietlol my eyes are bleeding
 
both approaches are nice, but not together
 
Wietlol wtf
 
9:57 AM
the first one is the basic way of doing it
the second one is immutable database stuff
 
Not my shit, your paste
My shit is just stupid bad design
 
ow, bad design, i know lemme search
 
I am having the following problem
0
Q: how to decrease modal header default height in bootstrap 4

Icche GuriI want to decrease bootstrap 4 modal default height and width . For this purpose , I have written the following code : <div class="modal-header" style="background-color: darkblue;color:#fff;height:5%;!important"> <p class="mx-auto d-block">Please Give Your Finger</p> </div> I have set the ...

please someone help me
 
What's that got to do with C#?
 
!!giphy jump down the window
 
I am doing the project in asp.net
 
shit, i cant find them any more
 
lol, and?
height:5%;!important is not valid CSS
 
style="background-color: darkblue;color:#fff;height:5%;!important" is not valid bootstrap.
 
ok .
Then how can I decrease bootstrap 4 modal header default height ?
 
10:01 AM
Have you tried height:5%!important
Wait, the header height? wtf
Have you actually looked at how it is the current height?
 
There you go, I posted an answer for you
 
@RudiVisser
this is amazing
 
🤮
 
not working
 
10:05 AM
 
I guarantee you it works fine
 
this is what it is now
also, css height in percentages must have its parent also have a defined height right?
 
1 rem is bootstrap default height
 
1rem is the default padding. Removing 1rem padding from the top/bottom gives this result
This is the default
Also, use the appropriate element in your modal-header. That's not a paragraph
 
@Wietlol You can build one hell of a D&D dungeon based on that class diagram.
 
10:08 AM
Thank you
@RudiVisser
 
@AvnerShahar-Kashtan sorry, not much for D&D
 
@Wietlol Please tell me you did that to avoid that someone, for some reason, wants to steal it, so you added some random lines.
 
also, its a database diagram
 
@IccheGuri You're welcome
 
@HéctorÁlvarez nope, that was generated by EF
 
10:10 AM
Databases are simply ORM-realized classes.
 
i find classes a bit nicer to work with
more... explicit
and... natural
 
Here's an interesting one I'm going to have to work out at some point in the next few months. I'm gonna need to do some kind of pathfinding between multiple destinations in a space which doesn't have and explicitly defined edges but has obstacles in a 2d space. I'm not looking forward to it
 
More compliant with Object-Oriented Programming, you mean?
 
compliant?
 
@Butler1233 Copy Starcraft 2's pathfinding.
 
10:13 AM
I've never played it, what's it like?
 
What is this, pathfinding for ants?! :D
 
It seems easy from point a to b with no defined edges, or multiple destinations with defined edges, but I can't find anything about multi destination with no edges
 
Just draw a massive arc around the outside of the obstacle infested area
 
edges shouldnt matter
 
@Butler1233 It probably has the best pathfinding system so far, at least since DeepMind developed their enhanced AI.
 
10:16 AM
you dont want to walk around the edge to find a path
 
I'm gonna have loads of obstacles though
 
for a 2d space, you want to have a straight line and split up when you hit an obstacle
 
I mean yeah why do edges matter
 
They shouldn't matter, because I'm not drawing the edges between all of the possible destinations
I can easily forsee an example where I'd need to plot a path between 50 destinations, with 20 obstacles, for example. Some destinations might be right next to each other, while some might be quite far apart
 
I'm not sure of the exact logic as I've never done it before, but surely you just create a map to/from all destinations and then go over them all finding the smallest connection points from each?
For 50 dests it's only 2500 plots in memory
 
10:22 AM
what is the issue with 50 destinations?
you need to find 50 paths (from x to any destination)?
 
The issue that I have is there often won't be direct paths from 1 point to another. LIke 1 point may be on one side of an obstacle, where the other point would be on the other side
 
Right but in all cases there's a way around
So as a first version like I say, I'd plot all dests -> all dests to get the whole picture, then use the shortest paths to/from one another to create the most efficient
 
I assume true pathfinding stuff goes through a similar process, but probably iteratively from one destination to the next (thus making it slightly less efficient on a path, potentially, but more in code)
 
There's always a way. This is a super simplified example but it'll do
Obviously the red circles/dots are destinations, the rectangles are obstacles. I don't have an explictly defined routes between destinations
 
10:27 AM
The calculations should be lightning-fast. It's almost instant when playing any sort of game.
I've never done anything like that myself, but I assume the idea is drawing a straight line and bending it until you have a non-blocked connection, then get the shortest total distance.
 
Yeah
 
I don't really know however if that's directly related to a smaller number of vertices.
 
My concern is that I'd have to do that N^2-n times and it would get excessively long under larger amounts of destinations
 
Well, if you have to calculate 50 destinations at once, it might need to be complex
 
50 is a low estimate too. I've seen instances where I would need to run >600 destinations
 
10:32 AM
But it's just loopy loops
 
The distribution would lean heavily toward the 50 or so amount though
 
It's easy stuff
I mean, for a cpu
 
Are you trying to build a autonomous swarm ballistic warhead for Lil' Kim?
 
No, worse
I'm trying to control warehouse staff
 
Oh crap.
 
10:33 AM
Ask Argos how they do it
 
Argos only pick like 3 things at a time
 
Ask Amazon how their robots do it
 
10:57 AM
@Butler1233 isn't that traveling salesman problem?
The travelling salesman problem (TSP) asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?" It is an NP-hard problem in combinatorial optimization, important in operations research and theoretical computer science. The travelling purchaser problem and the vehicle routing problem are both generalizations of TSP. In the theory of computational complexity, the decision version of the TSP (where, given a length L, the task is to decide whether the graph has any tour...
 
Not quite
Mainly because I don't know the distances between the cities
 
Sure you do
 
Returning to origin is not required
 
then how would you determine the order of your destinations?
 
I mean sure i can calculate the distances between them all and then use TSP
It just seems super inefficient and there must be a better way
 
10:59 AM
It's simple mathz
 
if you have distances i'd try a modified version of A*
 

« first day (2733 days earlier)      last day (2216 days later) »