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

2:00 PM
idk. didn't know if that was a best practice
 
i think it's the only way for surviving a process termination isn't it?
 
I think it will use the PersistenceId for find again the event stream where to recover from
 
War
How do i determine ifa type has a default constructor ?
 
@War Via reflection?
 
War
yeh
 
2:02 PM
lol
 
Also, heya, long time no see.
 
War
I can call type.GetConstructors()
 
wow look it's wad
 
War
hey @AvnerShahar-Kashtan :)
 
o/
 
2:02 PM
wadry pls
 
War
hi @Squiggle :)
 
typeof(MyType).GetConstructors().Where(ctor => ctor.GetParameters().Length == 0)
 
War
ah ok
 
y u abandon us
 
War
that seems legit
 
2:03 PM
apparently you gotta use binding flags if you want to access private default constructors as well var constructor = theType.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null);
 
"Think for yourself and question authority"
 
Yeah, I was going to suggest @Squiggle's way too. Didn't know about the Type.EmptyTypes though.
I was just going to pass in a new Type[0].
 
War
Type[] types = new[] { ... }
             .SelectMany(a => a.GetExportedTypes().Where(t => t.Name.EndsWith("Activity")))
             .Where(t => !t.IsAbstract)
             .Where(t => t.GetConstructors().Any(c => c.GetParameters().Length == 0))
             .ToArray();
trying to construct them i get an exception
System.MissingMethodException: 'No parameterless constructor defined for this object.'
what did i miss ?
 
Which expression throws?
 
War
2:05 PM
none of that
 
Later on? Maybe there's a private parameterless constructor your activator fails to reach?
 
> .GetConstructors()
 
War
hmmm, good oint i'll use flags too
 
prolly
 
Maybe you should define a parameterless constructor on whatever access level si required
 
2:08 PM
@War debugging
 
this is fun
 
@MikeTheLiar Probably a squirrel allergy.
 
War
i'm trying to get a complete list of activity types from .Net assemblies
I didn't write the types
nor do I have the source
 
the json serialization library that we use creates the properties of objects in "random" order
each build, it has a different order
 
@War And ending with "Activity" is the only filter you have? Don't they all extend some base class or interface?
 
War
2:10 PM
i tried getting all types that inherit from Activity
that results in a bunch of abstract base types
I just wanted to get a small subset working
then refine
kinda annoying there isn't a helper function that I can find for this
 
is there a function in VS to look at two classes and how they are related?
 
var baseActivity = typeof(Activity);
var types = GetAssemblies().SelectMany(a => a.ExportedTypes).Where(type => baseActivity.IsAssignableFrom(type).Where(type => !type.IsAbstract);
 
War
yeh this is where i started ...
static Type activityBase = typeof(Activity);

Type[] activityTypes = new[] { Assembly.Load("System.Activities"), Assembly.Load("System.Workflow.Activities") }
        .SelectMany(a => a.GetExportedTypes().Where(t => t.IsAssignableFrom(activityBase) && !t.IsAbstract))
        .ToArray();
finds 0 types
 
@War No, no, your IsAssignableFrom is reversed.
 
War
so i was like ... hmmm ... must have gotten something wrong
 
2:14 PM
does anyone know in winforms what event the 'X' on a window or dialog fires?
 
It's a terrible API that's always confusing.
 
War
DOH!
ah ok
 
72
A: How to prevent or block closing a WinForms window?

Victorprivate void Form1_FormClosing(object sender, FormClosingEventArgs e) { var window = MessageBox.Show( "Close the window?", "Are you sure?", MessageBoxButtons.YesNo); e.Cancel = (window == DialogResult.No); }

 
War
so that now gives me 123 types
then i get this ...
System.NotSupportedException: 'Type 'EnvironmentLocationValue`1' is not a valid toolbox type. Reason: Default parameterless constructor not found.'
 
It's a generic type.
Doesn't make sense to instantiate it without a generic type parameter.
 
War
2:16 PM
hmmm so i can't have generic workflow steps ?
oh i can but i need to define a type
hmmm
that could get complex
trying to build a toolbox
for generic steps I could potentially have a lot of valid types
 
myType.MakeGenericType(typeof(string))
Yeah, potentially infinite, depending on your business logic.
Anyway, I'm off home.
 
War
thx man
 
Bye Avner o/
 
War
i'll keep at it and see what i can come up with
 
Have fun.
 
2:17 PM
oh shit, its War
 
War
:)
 
2:42 PM
Has someone worked with MIFARE Classic chips?
 
I've not heard of that branch, are they more like Ruffles or Lays?
 
Badum tss.
 
any SSRS ninjas/gurus in here on this beautiful morning?
 
It's 16:55 here... Anyway, enlighten us.
 
where are you Hector?
 
2:56 PM
In Spain.
 
cool I bet it's warming than in US
warmer
I have a report with a whole bunch of textbox where the WritingMode is Rotate270, basically the width of the textbox is small, and the text Vertical
It works okay in VS2010, but when I upload to the reporting Server, it does not render any of the textboxes with Rotate270 as writing mode
but when I export it to PDF, it looks correct
 
What version of SSRS are you using?
It's usually tied to your SQL Server version.
You might be using an older version, or a newer one, that has too much padding, or whatever on those textboxes.
 
4.5
 
I don't know the version numbers by heart. What I mean is maybe your SSRS version is too old.
 
s/your/any/
 
3:10 PM
yah could be
thanks
 
3:22 PM
I think I'm getting into a position where I really should have separate models for EF and MVC.
I was muddling through well enough with just one model, but I've discovered that I can't put arbitrary function calls in template .cshtml files, which means I can't do @Html.DisplayFor(modelItem => Utilities.makeLessUgly(item.UglyValue)), where UglyValue is some ugly raw data from the db and makeLessUgly sanitizes it for user consumption
 
They're supposed to be separate anyway so...good.
 
I could, in principle, make a LessUglyValue property in the item's class, but since it's autogenerated by EF, it's liable to disappear the next time I generate from the db
 
indeed.
 
DAL has access to EF, mvc talks to DAL if it wants anything
 
And the disclaimer at the top of the file saying "making changes to this class might ruin everything" doesn't inspire confidence even if I'm careful to not overwrite without a backup
 
3:25 PM
"DAL" is EF.
 
Yeah but EF is ugly
So y not make a nice class thas has .AddThisItem(thisItem) and .AddThatItem(thatItem) and translates it to those lists
 
EF works just fine on both POCOs, and can even work well on "heavy" domain models if you use a private parameterless constructor and private setters.
it's far less ugly than many other ORMs
caveat caveat caveat
 
Can anyone tell me if I need to use TcpListener in order to use TcpClient, or is it recommended?
I've been advised to use TcpClient instead of Socket for my client application, but have already coded the Server application using Socket, should I stick to Socket for the client or do TcpClient?
 
@seegal What makes you think you'd need both?
oh you mean on the server side?
 
3:33 PM
@Kevin just because they're both called "models" doesn't mean they do the same thing
 
@KendallFrey yes, I just thought with them both starting with Tcp that they should or are meant to go together.
 
I mean... They both hold data about the thing I'm trying to represent.
 
I imagine you'll be fine with anything that implements the bare TCP protocol (and I'm guessing Socket does)
 
@Kevin just don't use database-first EF :P
just... don't
 
Like, I have model figurines and Gisele Bündchen is a model.
 
3:34 PM
and Mike is the very model of a modern Major General
 
But one I'd rub my junk on, and the other is married to Tom Brady.
 
@KendallFrey Thanks! TcpClient it is then.
 
I take it back. He's a horrible person and not to be used as a role model for anything.
 
@Squiggle Major Ennui and General Malaise.
 
So right now I have just the one Widget class. What should I name the classes I'm about to split it into? WidgetEntity and WidgetDAO? Or something?
 
3:36 PM
They can both be Widget but in different namespaces.
 
@Squiggle This. The uruk-hai among orcs.
LOTR fans will understand.
 
I keep forgetting that namespaces exist.
 
Uruk O Hai there.
> Namespaces are one honking great idea -- let's do more of those!
 
uhm how do I sort test results by failure/success
I updated VS and now they're all mixed together
 
If Python really wanted to do more with namespaces, they would let you embed arbitrary statements at the class scope
 
3:38 PM
Which framework @KendallFrey?
 
ah yes, good analogy. Born of mud, ugly as sin, but absurdly powerful.
 
well, in one of the test categories but not all wtf
@MikeTheLiar mstest
 
And you can't filter by test result?
Just asking the obvious questions here.
 
user5500750
Is there a way to get a sleeping Thread to wake up on command. For example if I use; Thread.Sleep(TimeSpan.FromHours(1)); Can I force it to wake up before the 1 hour runs out?
 
@MikeTheLiar not via any button I see, and that's not what I want either
this is the test explorer not the separate test results
 
3:40 PM
@GSCM that sounds like a great way to generate migraines
 
@GSCM Don't use Sleep, use wait handles
AutoResetEvent, for example
 
I guess my first order of business is to put these EF entities in a namespace narrower than MyProject
 
That would be a good place to start.
 
I expect there will be some amount of crying as I resolve lots of "couldn't find type Widget" errors
 
We have a MyProject.DataAccess namespace
@Kevin right click -> resolve -> using MyProject.DataAccess;
 
3:45 PM
Yeah, not too hard to fix, just tedious
 
We usually go MyProject.Database
And no, not really tedious. Make a folder, move everything in there.
 
!!tell squirrelkiller zoidberg naming convention
 
Namespaces will be shifted accordingly, automatically.
 
@squirrelkiller The naming convention is bad and you should feel bad
 
Just kidding, ilu
 
3:46 PM
Hey how do I connect a razor page to a "normal" .net project?
 
@Squirrelkiller Oh, I'll try that, then.
 
Like, I wanna login. I have a project, with a class that has Login(udername, password).
How do I get my data there? Do I make a tcplistener in my normal project and have it running as console and just process requests to that?
 
can you run .NET applications on docker?
 
AFAIK you can run anything in docker
 
are you familiar with docker?
 
3:51 PM
Not really, just made a small project on it during my apprenticeship.
 
if i wanted to run a .NET application should i get docker on mac or windows?
 
But another dude from our group made most of the docker stuff :D
 
damn haha
 
Instinctively I have to say windows
Why are you trying to run .net in docker anyway?
 
i know right lol, but i believe its says that running docker on windows spins up a linux vm and then run containers inside that so what the hell
whats the alternative?
 
3:54 PM
The alternative? Dunno, just run the .net application on windows?
 
im just trying to set up some kind of containerization really
 
or if its .net core, just run it
this may be a good software engineering SE question
 
@user3743168 Windows only natively started supporting containers recently
So you have to jump through a lot of weird hoops to get VMs inside of VMs
 
what do you mean?
 
I was just remarking on your "windows spins up a linux vm and then run containers inside that so what the hell" comment
 
3:56 PM
when you say containers do you mean like for dokcer?
 
Yes.
Docker creates containers.
A Docker container, is, in fact, a container.
 
are containers a thing other than docker?
so windows now natively supports containers? what does that mean?
 
Containers are definitely a thing other than Docker
Containers have existed in Linux basically since forever AFAIK
A container is just lightweight VM
Docker just made them easier to use
 
Not sure how to specify the relation between the EF model class and the MVC model class... It might make sense to let the Model.Widget hold a reference of the Database.Widget. But I don't know if the reference can stay alive in between page loads, so it might barf when I try to handle the POST version of WidgetController.Edit
 
The problem with Windows is that until recently you couldn't arbitrarily nest VMs. So if you wanted to have a Virtual Box docker host on your windows machine, you couldn't host any containers on it.
Take what I'm saying here with a grain of salt, I'm fuzzy on the details.
 
4:03 PM
you mean like put ubuntu in virtual box and run docker on that but you cant run containers?
 
Exactly.
 
I could just hold a reference to the widget's primary key, but then the user would have to manually tell Model.Widget to propogate its changes to a Database.Widget. Or maybe I'd have to do that either way? Unfamiliar territory, here
 
Why would you want to nest VMs?
 
right now you put docker on windows and then it runs a linux vm in hyperv to be able to run containers
 
Yeah but why would you want to
 
4:05 PM
@Butler1233 take this real world example: we had a windows 2012 server. We wanted to host an Ubuntu VM, that would in turn host various Docker containers.
 
im just wondering about how i can run a .net app using docker
 
You can't have a VM within a VM except in the most recent versions of Windows. Or rather, you can, but the second layer has to be some weird, ancient, proprietary IBM VM software that's of no functional use to anyone
@user3743168 the short answer is get Docker for Ubuntu, use .NET Core
 
Why can't I jsut install virtualbox within my virtualbox vm?
Isn't it supposed to be sandboxed, so that the inner virtualbox doesn't realize its in a vm?
 
Because the host won't allow it
Why, I don't know. I remember I looked it up when I was trying to do it like a year and a half ago
 
How can it block that? You're an admin on your vm after all
 
4:08 PM
The takeaway was "you can't do that" and I immediately forgot everything else
 
...why would you try something like that anyway?
 
ALL THE REASONS I JUST EXPLAINED JESUS CHRIST
At any rate, it's more low level that "admin access"
It's a fundamental constraint of the architecture or some shit. Like I said, I immediately forgot the details because they weren't relevant, just annoying
 
"Hmm, I have all this spare compute power which I don't want, or this spare ram, or this spare storage. Lets waste it doing inception VMs"
 
3 mins ago, by MikeTheLiar
@Butler1233 take this real world example: we had a windows 2012 server. We wanted to host an Ubuntu VM, that would in turn host various Docker containers.
 
@Butler1233 That actually sounds like something I might think
 
4:10 PM
soooo
if i got ubuntu and docker on that then ran a .net core app
 
We needed local test environments. When deployed it was going to be hosted on Ubuntu. We had no local Ubuntu servers.
 
Hyper-V uses hardware features of the CPU to virtualise the VMs at decent speed instead of abstracting it all in software. But that virtualised cpu doens't have the virtual hardware

Or something like that anyway
 
docker has a way to handle translating to the linux kernel calls?
 
Wait what?
No
The container is ignorant of the host beyond mounts and exposed ports
 
@MikeTheLiar So why not just run a few Ubuntu vms in hyper-v? Instead of pissing about using ubuntu to run more ubuntus
 
4:12 PM
Thank you for solving our problem two years later, yes that's what we did
But we had to request the servers from IT instead of just using the ones they've already provisioned us
Also as you might've noticed, we're not an Ubuntu shop, so we have to maintain these servers entirely ourselves. IT does not maintain them for us, unlike our Windows servers.
 
So I made a project with asp.net web application -> razor page template. How Can I make backing mvc code for the backend? Do I have to create another project with asp.net -> asp.net mvc?
 
Riight. It just doesn't make sense to have the huge overhead of an extra layer of virtualisation. I kinda get it though having to wait for IT to allocate more, but surely they would have to allocate more resources to the Ubuntu VM so it's capable of running more ubuntu VMs
 
@Squirrelkiller O_o
 
And, can I make a the backend with normal .net?
 
Do you mean how do I make a Controller?
 
4:14 PM
...maybe?
 
Do u even ASP.NET bro?
 
not really
not yet
also I dont know
can you repeat the question?
 
@Butler1233 I'm glad we're taking this trip down memory lane because this is almost word for word the process we originally went down just accelerated
 
I still lack some deciding point of how to connect a (razor) website to a .net framework application handling DB stuff
And also handling validation and authentication
 
You can make a custom Authorization handler that calls your service
As I said before can you not just reference your library
You keep saying Application
an application (.exe) and a library (.dll) are two very different things
 
4:22 PM
So when I put all of the logic in the library, I can just reference it and use it in the functions block as if I were on the same machine?
Not on my pc right now or I would just try it
 
Yes
If you have control of the library, I'd suggest migrating it to .NET Standard if you're not doing anything too crazy
 
!!giphy the power of yes
 
I need 🥃&🍕
Long day -_-
 
Why .net standard? Why not core or daddy framework?
 
4:26 PM
So you can run on both with ease if needed?
and it's just a nice abstraction
 
You assume I know too much
 
The Squirrel Who Knew Too Little
 
I meant to ask: Why can't I make a .NET framework 4.6 library and use that from my razor page?
 
You can
and if you're running on Windows it'll work fine
 
@Mike that doesn't make a nice word, its just consonants all the way
 
4:29 PM
!!imdb the man who knew too little
 
@Squirrelkiller INTERCAL managed to make it work
 
So since its definitely gonna run on a windows server...it'll just work?
 
!!wiki the man who knew too little
 
Yes
 
!!are you there, Cap?
 
4:30 PM
@Squirrelkiller Of course not
 
Uhhh ok
 
!!bing the man who knew too little
 
...bing?
 
@Squirrelkiller Google (and all the commands that run on Google) doesn't work anymore. Hasn't for a long time at this point.
 
4:31 PM
Sounds like the story of my life
 
Case sensitive?
 
!!sandbox
 
That's why xkcd only works with direct numbers
 
@Squirrelkiller Please go and play in the Sandbox
 
does js have params params?
 
4:35 PM
Technically speaking it only has params params
!!> [10, 10, 10, 10, 10].map(parseInt)
 
@MikeTheLiar [10,"NaN",2,3,4]
 
user5500750
How is a class from another project included into the project when compiling?
 
user5500750
Does it compile the other project first before including it?
 
user5500750
Or is it used directly?
 
Compiles other project, links to dll
 
user5500750
4:38 PM
What happens if the project cannot be compiled?
 
user5500750
If I use a class in an ASP.NET Core project. It has to compile that project first?
 
!!googleme sum stuff
 
The failure cascades.
Which is a good metaphor for life, now that I think about it.
 
@Rudi How do I make the using in my razor page?
Back on pc, trying the direct referencing thing.
 
4:46 PM
I'm not sure why you're focusing so much on the fact it's a Razor Pages app - that's just your UI (and a little codebehind)
Just reference your library and write a service to use it like any other app
 
...service?
Any other app?
 
>_>
 
The only other app here is the client application using the library, and it just builds some classes from it to use.
 
You are a developer, right?
Yes
So do what you're already doing
In your web app
 
My certificate claims I am. I'm still not sure though.
Right now, I'm in a .cshtml page. Don't know how to get from here to the server. Can't go "using myLibrary;". Usually I just ad the library to project references, and the nI go "using myLibrary;" and then I use the classes there.
My web app has a program.cs, but I'm not sure how to getfrom my .cshtml to that either.
Intellisense only suggests names from within this cshtml file
Like I said, I miss some fundamental piece of the puzzle here
 
4:59 PM
Expand the .cshtml file
It has a backing .cs
Index.cshtml.cs
 
Hi! I haven't used C# in a while and had a question, how would I interact with a curl/http api that gives output in JSON? 99stack.com/api
I'm not exactly sure how I would be sending the commands?
 
Ok got something to read on the way home, see ya in 2h when I get home!
 
@Annabelle Newtonsoft.Json
 
5:15 PM
@Butler1233 Thanks, that's for output. How do I send commands using curl? or http?
 
Uh I've made a nasty function you can try if you like
 
Yes please.
 
Give that a go. Bear in mind it will only return the text, which you will then need to decode. Also by default it POSTs requests
I don't recommend using it for long though, just as a starting point to get familiar
 
user5500750
5:37 PM
 
9:01 PM
Can I see the type inferred by dynamic in debugging ?
when it's a type parameter
 
9:16 PM
GetType() ?
im not sure when you can have a dynamic type parameter though
 
Func<Foo,dynamic>
 
ow great, how is that even supposed to work?
 

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