« first day (3100 days earlier)      last day (1845 days later) » 

6:03 AM
Mornin' o/
@mr5 define "large" in this case
 
H.N
6:28 AM
Morning o/ (overslept today) >.<
 
6:38 AM
ohayou
 
7:06 AM
Google has an interesting art today
 
7:27 AM
 
Did you *play
I now have 3 people I interact with, that need correcting. 1) My girlfriend is colombian, earning german, wants me to correct her so she gets her C1. 2) colleague, came here from portugal 6 years ago, basically same story and 3) nyconing
 
@Squirrelkiller oh you teach german? Can you take me under your wing? ;)
 
I just corect people on their wrong grammar ;P
And I'm also current in the process of writing down and integrating our coding standards into the repo
These two things slowly make me a grmmar nazi. I can feel the urge to correct everyone these last two weeks.
It's getting stronger.
Look at this shit, I'm even using periods in chat.
 
7:52 AM
@Squirrelkiller correct* ;P
 
Oh my
Guess I gotta delete my account now
 
So Hitler is in his office with a fellow officer. "Sir, we are mining too many iron ores." Hitler thinks on it a moment and says, "Well mine less!" The grammar nazi, upon hearing this, barges into Hitler's office and shouts, "MINE FEWER!" To which Hitler turns to him and says, "Yes?"
 
8:07 AM
 
8:33 AM
Nah, some people only speak English and still suck at it
 
proxy
 
Stannis Baratheon: "Fewer."
^ basically that
 
Can confirm that many germans don't speak proper german.
 
immigrants?
 
8:45 AM
Nah, native speakers also suck at speaking their own language, many people start taking grammar for granted, I was in Canada and this girl came and said "Can I sit here", I mean I don't know can you, do your legs bend enough to let you sit on a chair, how am I supposed to know that.
Ask many people how they decide sentence structure and they say what feels right, thus if in a community grammar is broken, the hope is lost for the entire community.
 
Do you think I am fat or not?
> Yes, I think you are fat or not.
Could you pass the salt?
> Probably, I mean, I succeeded last time as well.
 
I could, but don't feel like it
Like if everyone starts referring to you as Wietol rather than Weitlol in the chats, people unless they use the @ are unlikely to use the correct spelling
 
UPDATE [SomeTable]
SET [RefId] = (
	INSERT INTO [Ref]
	OUTPUT [INSERTED].[Id]
	VALUES (...)
)
WHERE ...
why does this not wörk?
 
does the insert work in itself?
 
ye
I have used it many times like that
 
9:01 AM
ok. So all columns present, since there is no INSERT INTO [Ref] ColumnA, ColumnB, ... VALUES (...)
 
depends on the database
but yeah, that is a nice feature
also insert into sometable (col1, col2, col3) select col1, col2, col3 from othertable has become so useful
 
never used that :D
 
9:55 AM
hiya, i've created a class which functions as string enums, however, i can't figure out how to stop it from converting objects to int before doing a comparison between two objects.
when i do ShapesEnum.Line == WeekDaysEnum.Monday it should return false because different types. but instead it converts to int then does comp so it returns true.
anyone know why? or more importantly how to stop that from happening.
 
check your public override bool Equals(object obj) methods
 
it does take type into account:
public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            var other = (TEnum) obj;
            if (other.CachedType != CachedType) return false;
            return Equals(other);
        }
it never calls that method. it casts to int then does int compare
is it bcz I have set that cast to be implicit?
 
maybe, I refuse to use implicit casts tho
they are nasty
if you comment that one out, does it work?
 
that is it. it won't compile if i make it explicit. who knew
is there a format for writing unit tests in a class?
 
10:11 AM
you could override the == operator I think
for unit tests, iDunno
 
format for writing unit tests for a class? You mean moving unit tests from test classes into the tested classes? Or I would just write a lot of Debug.Asserts around
 
i've overridden ==
for unit test for a class. ie. do i just write a static Test function in class?
 
@user14492 You create a test which compares instances of your class
AssertTrue cases but also AssertFalse cases
 
i have the tests. they're just console writeline which is not good enough.
 
I forgot how to create a unit test project
those projects are automatically added on new solutions for us
 
10:25 AM
@user14492 use asserts
you want to automate that baby
 
10:41 AM
@Neil but what if I lose my job to these machines?
 
if you write good code, job security because they want good programmers. If you write bad code, job security because someone's got to be able to read it :)
 
is it better to hard code values for these tests? or make it so that if the input changes the test still works.
 
no, hardcode it
randomness isn't doing you favors in tests
 
only reason I don't want to make it flexible is bcz then i'm kinda using code from the class e.g. instance.ToInt() == (int) instance
 
the point isn't supposed to test robustness, it's supposed to ensure certain specific behaviors remain consistent after changes to your code
 
10:43 AM
so kinda makes it fall back on it self.
rather than: 1 == (int) instance
 
magic numbers are bad in code, but not in tests
for testing it's fine
 
(await stuff.FindAll()).SelectMany(moreStuff)
is there a better way how to do this?
 
@user14492 You will lose your joob anyway. Machines will cut off 50% programmers in ~20 years. Just look what we've done on ML/AI ground from 2013
 
not if we all become ML engineers....
if you can't beat 'em, join 'em.
 
10:59 AM
nah, programmers will be the very last job replaced by machines
if we get that, then we've essentially got the singularity
 
The current machine learning approach even when perfected at best would be able to overtake minor front end tasks
 
big step b/w what you do and what singularity can do.
it just has to beat your mundane coding tasks.
translate from psuedo-code to machine code. but i imagine, it'll require some human guidance at least.
 
Pseudo-Code to machine code might be reachable, but that will have it's limits as well
 
pseudo-code to actual code is the easiest part of software development though
when you got pseudo-code you're practically 90% done
 
i meant, not actual pseudo-code but more like natural language description. but yeah, it's a rigid transformation, easy for machines.
thinking is still for us humans. no computer is going to come up with the idea of string theory.
 
11:05 AM
even natural language description. You gotta find out what you actually have to do first. And how to do it.
And in what order
and what if things happen while you do it
 
pretty much what computers are good for. imo.
 
...once you tell them what to do
But you gotta figure out what to actually do
Log an error? Log where? What data? To what server? Or ring an alarm bell? What bell? Does it have a password? Or do I send a mail?
 
i mean yeah. it won't think of solutions to problme which we haven't presented. that prob would be a bad thing, bcz what if it thinks something as an issue which do not want it to solve e.g. global warming by mass genocide.
 
It's always easy to go "If an error happens show it on my monitoring display on the wall" but how is it connected to wherever my applciation runs? How to hsow it, as text? FLash the display red?
 
it'll be have to sandboxed and monitored by humans. more to enhance what we're doing by making it easier for us, than completely replace us.
idk. those things are easy. they're part of the setup of the environment of AI.
just like DL right now, you set it the CNN and let it solve. except not like it :D
 
11:39 AM
has anyone seen error when using Asserts.Greater when Asserts.IsTrue( a > b) works.
 
Anyone used or tried Orleans? from reading documentation - Orleans tries to evenly balance work between all servers. What if I have two servers for my Orleans project and one is twice as fast as another - Orleans will still divide work equally and slower one will get bogged down?..
 
11:52 AM
Can I somehow, in the constructor of an IDisposable, queue a particular object to be disposed at the time this gets disposed? Or do I have to keep a member reference and dispose it Dispose() (which I'll have to override)?
@user14492 That sounds illogical
 
tell me about it. no idea why it won't work.
 
12:07 PM
@user14492 did you override the comparison operators?
@Squirrelkiller events?
 
Then I have to add an event. Hoped there's a possibility to put it in an existing queue.
 
12:26 PM
@Default yes i did.
that is what i'm testing.
 
then maybe Asserts.Greater uses !(a < b)
but it's of course very hard to say what's incorrect without seeing your code. especially since we have no idea how you implemented your comparators
 
12:59 PM
Can you use nunit in a fiddle?
or mstest or any other test framework?
Both work for me
 
1:55 PM
Hey there!
long time no see
 
Why are you trying to look like the best person in this room?
 
Buenos dias Hector!
Where've you been? New job?
 
Yes, I got a new job finally
It's been hectic
Several interviews, I ended up getting 2 offers and got to choose
I've been 2 days in, it's wonderful
I feel like I had a leash in my previous job, this one's so permissive
I'll wait for a whole month to give my impression, but thus far it's great
I also got to do some oracle stuff
 
Nice, congratulations!
> I also got to do oracle stuff
And my condolences
 
2:07 PM
what
it's gorgeous
it's intricate
and the database is both normalized and well-designed.
 
Did... Did oracle pay you to say that?
 
G K
Hi all,
I wanted to validate the input string for an IP Address format on PreviewTextInput event so that it does not allow the user to enter anything else apart from numbers and ".". I tried with many examples but they have a problem like since they try to check for the IP format, the moment I start typing my input is not valid and it returns false.

I am thinking that this makes a lot big validation. Wanted to check if there are any other solutions to achieve this.

I have seen Masked TextBox but the problem is I am using a Combobox and the textbox is PART_EditableTextBox which I am trying
 
unlike previous mysql bullshit like "company.id_c" ---> city id
 
Ok but a normalized and we'll designed database is independent of the rdbms running it.
 
You're correct, but in my case I still haven't seen the ugly side of Oracle
well i've seen the PL/SQL developer part, and it's pretty ugly, but it works
Also I can nest cursors and access data lightning-fast, work in batches, etc.
I still have much to learn but it looks awesome thus far
@GK Use regex, a very simple check for ranges with 3 dots between ranges, and also no leading zeroes in each field.
I don't see Avner's logo here, has he left this place for good?
alright now I need a desktop
and next week I'll move my PC here
any ideas or recommendations?
 
G K
2:20 PM
Yep but RegEx will try to check for complete IP Address format. But on PreviewTextInput event, the whole string is not formed completely. So my regex match will always return false until I type it completely.
So is there any other way to validate this?
 
^\d+(?:\.\d+){0,2}(?:(?<=[^.])\.|\.\d+|)$
^(?:(?:[0-9])|(?:[1-9][0-9])|(?:1[0-9]{2})|(?:2[0-4][0-9])|(?:25[0-5])(?:\.(?:[0-9])|(?:[1-9][0-9])|(?:1[0-9]{2})|(?:2[0-4][0-9])|(?:25[0-5])){0,2}(?:(?<=[^.])\.|\.(?:[0-9])|(?:[1-9][0-9])|(?:1[0-9]{2})|(?:2[0-4][0-9])|(?:25[0-5])|))$
might work more accurately
 
2:44 PM
always keep in mind, validations of an actual value are entirely different things than validations of input
 
when setting up fields for a type, say a class, should you always give each field setters and getters for each type?
 
I would
even for private properties
treating everything as properties is not a bad thing imho
I consider it the compiler's job to optimize if applicable
 
lol oh wait yea, then they are just properties right
so why make them also fields?
i see this pattern in java
 
in Java, you make a field and a getter/setter method
in C#, you make a property with a get/set functionality
so: public String Text { get; set; }
 
You should definitely only validate when that box loses focus @GK
 
2:55 PM
the property is basically a getter and a setter method, but if you use the default implementations (like above) then you simply get a backing field with a getter/setter
 
G K
But the thing is this textbox is part of the Combobox, I am going to validate this on the previewtextinput for the Editable_TextBox. I tried with the above regex. But it looks like I am still having some problem. It does not allow me to type "."
 
3:10 PM
@Wietlol ahhhh thank you. now it makes sense
 
@GK woops, made an oopsie
^(?:|(?:0|[1-9][0-9]{0,1}|1[0-9]{2}|2[0-4][0-9]|25[0-5])(?:(?:\.(?:0|[1-9][0-9]{0,1}|1[0-9]{2}|2[0-4][0-9]|25[0-5])){0,2}\.?|(?:\.(?:0|[1-9][0-9]{0,1}|1[0-9]{2}|2[0-4][0-9]|25[0-5])){0,3}))$
 
G K
3:23 PM
@Wietlol perfect. God is great and you are great. It works awesome. I have tested with all possibilities. Now I need to put up this for my combobox...
 
3:35 PM
it might also halp to know what it actually is doing
> When I wrote this code, only God and I knew how it worked.
... Now, only God knows.
 
G K
haha
 
 
1 hour later…
5:00 PM
Visual Studio 2015 keeps crashing and I don't know why. I've cleared out a bunch of space on my hard drive in case that was the issue, I removed every extension VS would let me uninstall, I fucking uninstalled it and reinstalled it and it keeps fucking crashing!
 
5:13 PM
try safe mode? or reset settings?
 
I already reset the settings. I'll try safe mode.
I occasionally get error messages saying the packages didn't load correctly. It's always different packages
Right now it's CommonAzureToolsPackage
This was after restarting in safe mode.
At least it should be safe mode. It doesn't look any different.
 
5:59 PM
 
Wes
hello people, is there a way...at all... to implement Equals in a polymorphic way? i am trying to write Point3D : Point2D and I couldn't write an Equals() that is symmetric and transitive while being polymorphic... (yes i know about composition over inheritance... still, i'm curious to know if that's possible at all) pastebin.com/TCzRGMtm
 
posted on April 12, 2019 by ericlippert

I’m continuing my efforts to port over and update my old blog content. The previous episode is here. We’re still in the first few weeks of me blogging; I was pumping out articles at a rate I now consider to … Continue reading →

 
7:05 PM
@Squirrelkiller nice. Tho you won't get the nice testrunner
 
7:42 PM
@Wes i suggest you to make 3d not inherit from 2d
give 3d a function that maps it to a 2d variant
 
Wes
which is precisely what i said i know already :P
 
inheritance hierarchy is not a simple thing
for example, a square and a rectangle
which would be the parent and which would be the child?
 
it's writing true
 
user10864482
@Wietlol imo the square is a child of rectangle as square is just a rectangle with equal side
 
but now the square has a separate width and height property
@ntohl only in some cases
 
8:01 PM
square and rectangle is a completely different story. You try to model - not the world - but a model of the world. Like bringing to book the representative of someone
that was a code written in an online compiler. Bring me another personal computer or laptop, which will write out false
square and rectangle is the school example of Liskov failure
 
object v2 = new Point3D();
 
Wes
i didn't use the square and rectangle example
@ntohl yes, i am aiming at having it to be false
 
you could make another function, say ValueEquals, and make Equals do this.ValueEquals(other) && other.ValueEquals(this)
@Wes why do you want it to be false?
 
Wes
because the type of the references is not equal
 
it is
both are Point3D
 
Wes
8:09 PM
> type of the reference
 
> both are Point3D
 
Wes
v1 is point3d, v2 is a point2d
 
the type of the variables is different
but I think I know what you want
 
Wes
aka references
maybe they mean a different thing in c#
 
now I see what you mean
 
Wes
8:11 PM
if my understanding is correct, it's impossible to have symmetry in this case
it's going to be true, and with the operands inverted false
 
class Point2D
{
	public override bool Equals(object other)
	{
		return this.GetType() == other.GetType()
			&& ValueEquals((Point2D) other);
	}

	private bool ValueEquals(Point2D other)
	{
		return this.X == other.X
			&& this.Y == other.Y;
	}
}
 
class Point3D : Point2D, IEquatable<Point3D>, IEquatable<Point2D>
{
    private int z = 789;

    public bool Equals(Point3D other){
        return this.z == other.z && base.Equals(other);
    }

	public new bool Equals(Point2D other){
		return false;
	}
}
 
@Wes references are highly ambiguous
everything are references
@ntohl that wont work
you need GetType equality
not an overload
 
Wes
@ntohl ah, good idea. hold on let me play with it.
 
on the online compiler it worked
 
8:14 PM
at least...
no, nvm, the overload is actually the solution
my bad
 
Wes
@ntohl very nice, looks like it's working. thank you very much :D
 
I would still highly recommend against it
even more now that I understand what you want
 
Wes
obviously
 
why do you want it?
 
Wes
because knowing stuff is fun
 
8:17 PM
so you will not actually use this code?
 
@Wes I was lucky to come up with this
 
in fact, interfaces would have solved this easier tho
but you need default methods in interfaces
this is exactly the reason why the preview version was so horrible
im not sure if they changed the design
 
Wes
@Wietlol nope, i am going to use it to illustrate how messy inheritance is compared to composition/aggregation ... pretty much :P so no need to lecture me on the thing :D
 
you... sigh
"lets create the most stupid thing ever to illustrate that a perfectly fine programming construct is silly"
inheritance is useful, just not when it is not
the same with method overloading
and for operator overloading
and for dsls
and for lambda expressions
and for functional programming
and for pretty much everything else
and... for composition
 
Wes
i didn't say i hate inheritance
 
8:28 PM
but you say "i am going to use it to illustrate how messy inheritance is compared to composition/aggregation"
I accept people that hate inheritance
but I have some kind of problem with people that say that "C#is bad because your computer can crash from programs written in C#"
which is sort of what you are doing right now
 
Wes
you are missing quite a lot of my context which you are probably not interested knowing but still you started lecturing again
 
Im sorry if I misinterpreted your earlier message, I could be blind to some key part of it
but feel free to elaborate (or not, whatever you like)
 
user10864482
As many of you already figured out I'm not English native speaker. I'm refactoring some piece of code and I'm looking for the proper term to give to a class that fetch and assemble data required for the main program. The word that come to my mind is a bootloader but I'm not sure its appropriate. Would it be?
 
Wes
nothing is black or white in programming
@user23333 a factory? a repository? btw that's actual pattern names
if the class fetches from storage, like a database, repository or data mapper would be the name
 
user10864482
mapper?
 
8:34 PM
mapper would have input -> output , no?
@user23333 care to share some code?
 
Wes
mapper is in the sense "find me this content from the data store"... so like it "maps an id to the entry"
at least that's how i understand it... :B
 
user10864482
Yes, there is input that provide output . I cannot provide actual code because I'm not allowed to but it something like a static class providing public field filled with formatted data coming from files
 
Wes
@ntohl adding : IEquatable<Point2D> again does even do anything?
 
you mean a store pattern?
 
Wes
class Point2D : IEquatable<Point2D>{}
class Point3D : Point2D, IEquatable<Point3D>, IEquatable<Point2D>{}
 
8:38 PM
@user23333 example code then ;)
@Wes there are subtle differences
such as, Point3D cannot explicitly implement methods from interface X if it does not directly implement it
 
@Wes not really
 
Wes
it can override tho?
 
so, if you did class Point3D : Point2D, IEquatable<Point3D>, then it cannot explicitly implement Equals(Point2D)
 
Wes
i can override it tho
 
it can override yes
assuming that the implementation of Point2D was virtual
 
Wes
8:41 PM
non virtual
 
if it was non-virtual, it could not override
but it could explicitly implement the method itself
which then gets messy
 
Wes
ugh, let me check
 
user10864482
static class Example
{
	public static string PROP = "...";
	public static readonly string[] screens = {"screen91", "screen12", "screen001"};

	public static readonly string[] PROP_A = Example.generate_stuff(ConfigurationManager.AppSettings["PROP_A"]);
	public static readonly KeyValuePair<ObjA, ObjB>[] PROP_B = Example.get_abc(ConfigurationManager.AppSettings["PROP_B"]);

	...
}
 
We don't happen to have a Xamarin chat room, do we?
 
user10864482
basically all the code refer to that. The value in it are generated dynamically but are never modified once filled
 
8:46 PM
and you want to rename "Example"?
 
user10864482
Yes.
 
considering these are just globals... Globals?
I think that is quite common
I avoid all forms of globals, but since you already have it
 
user10864482
I thought of "Provider" but not sure
 
what you basically have is a collection of providers
 
user10864482
Ok
 
8:48 PM
a provider or supplier is basically a Func<T>
each of those fields is a supplier
and the function to load their value would be by loading the value from that field
but the field is somewhere in a Globals class
one of our projects has a Supporter class, which contains a shit ton of functions that are useful
and an Extender class which contains a lot of extension methods
and a Globals class, which contains a lot of fields
 
user10864482
thank you for every words :)
 
I assume you dont have a Dependency Injection framework, right?
 
user10864482
no I don't
 
because, what you essentially have is a set of singletons
if you find that some fields are related to each other and some are not, you could separate them into different classes
but the use of those classes remain the same, define global constants
 
user10864482
That's what I'm at now. Basically I have a prototype, like a working-ish version of a program but now I need to separate stuff because it's a bit messy.
 

« first day (3100 days earlier)      last day (1845 days later) »