« first day (2113 days earlier)      last day (2821 days later) » 
01:00 - 14:0014:00 - 23:00

1:27 AM
Panic wildly, I'm here for a bit
 
 
1 hour later…
user47589
2:52 AM
panics calmly
 
NUUUUUU
But code is borken. pls send codes
4F 07 19 pings people with ASCII 7 beep sound
 
 
2 hours later…
4:55 AM
 
Good morning all
 
good morning
 
5:44 AM
GM
what does interpolationmode do for GDI+ Graphics
if its not set i guess the default interpolation mode will be used
 
 
2 hours later…
7:53 AM
good morning all
 
morning
 
morning
 
morning
 
morning
 
room topic changed to C#: morning | Not the JavaScript room | Also not the Android room | A Safe Space to 🗣 your 🍞. Home of JicamaJS and the Fields of Justice! Confused? Good! 🐎 csharpchat.com 💃 gist.github.com - For Easy Code Pasting [.net] [asp.net] [asp.net-mvc] [c#] [coreclr] [entity-framework] [java-hate] [jicama] [linq] [panini] [php-hate] [visual-studio] [wcf] [wpf]
 
7:54 AM
woah guys. You took "all" seriously
 
to all put all 'morning' in your chat box
 
חופרים
 
that's how I'll tell everyone I quit
 
lol
 
8:05 AM
@Slashy Is it "dig"?
 
morning
 
These are the voyages of the USS Enterprisey: Its continuing mission to encourage synergy through collaborative innovation; to explore new avenues of fiscal interoperability; to seek out new paradigms and new motivational initiatives. To boldy go in the direction presented at our previous stakeholder symposium.
2
 
original theme played as Nokia ringtone
 
"I cannae do it, captain! I cannae defy the rules clearly outlined in the employee handbook!"
 
Computer says no, Captain
viewscreen bluescreens
 
8:19 AM
You may reverse the pixel polarity to cause a synaptic collapse which could swap no to yes!
 
I'm trying to integrate with an api and it says: the username and password must be sent in the header as "Authorization: Basic base64encode(username:password)". What are they expecting?
I can add headers, but what is the Basic base64encode mean?
*what does
 
Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding. == Design == The particular set of 64 characters chosen to represent the 64 place-values for the base varies between implementations. The general strategy is to choose 64 characters that are both members of a subset common to most encodings, and also printable. This combination leaves the data unlikely to be modified in transit through information systems, such...
Let us be absolutely clear, this is not encryption. The result is illegible but it's easy to convert it back
They're saying concatenate the username and password with ':' as delimiter, and base64 encode the result
 
So they want me to sent the username and password after it has been encoded? or literally write "Basic base64encode(username:password)" as the header?
Oh ok
 
lol obviously not the latter
 
@ntohl hahahaha. it is kind of expression to somone who never stop talking haha
 
8:27 AM
I assume. I'm only reading what the message says - I just happen to know what 'base64encode' means
 
Yeah, ok. Do you know of a c# library for encoding?
 
guys is it posibble to increase a bounty on a question?
i mean if i offered 100 and i want to add some more
 
@captainjamie I do not. It's a common enough task that there must be one, though
 
thanks
 
8:30 AM
Hm, yes that looks right. What is slightly odd though is that surely the bytes you pass in are dependent on the character encoding you use for the username and password. How are you supposed to know which encoding is expected?
 
Hmm, yes it doesn't say
Although it looks like it doesn't matter...
Put things in here and change the encoding, result is the same base64encode.org
 
Then again an API shouldn't have any comprehension of the text representation of your password anyway
 
Well, they send me the username and password in the first place.
So they know what it is.
 
Yes in latin characters it shouldn't do. Unless you use UTF-32 I think
 
It's quite literally 'username + ':' + password as base64. You can use whatever the server expects, which is 99/100 times UTF-8.
But hey, why not just tack it into the URI and call it a day? ;)
 
8:34 AM
I can make use of some C# 6.0 features...
private string base64encode(string s) => System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(s));
 
http://roel:l34w3somep4ssw0rd@stackoverflow.com/
 
8:45 AM
I'd be glad for help :)
0
Q: C# Draw on image using unsafe pointers

SlashyI'm trying to set few pixels in a bitmap using unsafe pointer access(for performance boost)-this is my code: private unsafe void DrawImage(Bitmap bmp1) { BitmapData bmData = bmp1.LockBits(new Rectangle(0, 0, bmp1.Width, bmp1.Height), System.Drawing.Imaging.ImageLockMode.ReadWrite, bmp1.Pixe...

 
9:14 AM
I have a small doubt. Is the difference between async await and running a function in a newly created thread just thread reusability?
 
Could you share a few? I am bit confused.
 
9:36 AM
I like these videos on YouTube youtube.com/…
He explains threading well
 
Thanks a lot. I will check them. It will be good if you could point out some major differences.
 
It's quite a long topic and I probably don't understand it well enough without looking it up. I'm also at work.
 
Async/await is merely a mechanism to put work onto a scheduler and await result from said scheduler. It is entirely possible that the scheduler does not use threads at all, but it could also spin up new threads for every piece of work it needs to do. Therefore, it depends.
 
9:56 AM
If i use response.redirect("url"), and i need to return an action result, how do i do that?
Knowing that response.redirect returns void
 
return Redirect("ladieladiela")
 
Why do you need to return an ActionResult?
 
public IHttpActionResult GetThing() { }
 
Oh yeah that
 
i am in an if statement, the true returns a view with an error, false returns the return url which i am doing in a method.
@Squiggle i shall try it
 
10:05 AM
MVC?
 
huh
n/m
what should I lunch today?
 
@Squiggle panino
 
Shawarma with lots of garlic
Just to be pleasant to your colleagues.
 
KFC double down dog
 
You speak the language of shawarma ... WITH GARLIC
Where have you been all this time roel?
 
10:10 AM
You can eat an Onion salad with garlic sauce ! Perfect to have a good day!
tested and approved!
 
Tested to live a lonely day
 
You did not have to remind me that I'm alone :'(
 
Should have provided me with the error.
I shall invite you to some garlic drink to ease off, worry not.
 
@ElieSaad I've been.. here?
 
10:28 AM
@RoelvanUden shall we lunch together then? Since you are here that is.
 
I'm going for lunch now. So, feel free to join me.
 
This is scaring me, i am going to lunch as well.
On me this time.
 
10:43 AM
What happens when I do fruits.Where(f => f.rarity == rarity) as Fruit[] vs fruits.Where(f => f.rarity == rarity).ToArray(); ?
The former gives null
fruits is Fruit[]
 
But the result isn't
as (type) gives you a variable of that type, or null if the argument isn't of that type
 
@catgocat the first is literally a cast
 
the result of a LINQ method like Where() is an IEnumerable<T>
 
@milleniumbug but why null
 
because that's what x as type means
 
10:44 AM
that's not an array. You can convert it to an array using ToArray(), but that's not the same as a cast
 
@catgocat "hey, cast it to type, but don't throw an exception if this isn't the type, just give me null instead if this happens"
 
There are two different kinds of cast syntax in C#. (type)x throws InvalidCastException if the cast isn't valid. x as type gives you a value or null
 
so what you mean is it returns null because arrays are not derived from inenumerable?
 
Arrays are IEnumerable
 
so why cant I do the conversion
 
10:46 AM
@catgocat no this means that whatever was returned wasn't an array in the first place
 
Because it's not an array
 
ah so I can cast an array to a inenumerable
 
You can cast array to IEnumerable. You can't cast an IEnumerable that isn't an array to array
 
but not the opposite?
 
You can cast it if you know that it is, but the cast will fail in either of those two ways if it isn't
 
10:47 AM
how does it know that it's an array?
 
You usually don't. But you might write code in some scenarios where you know that's the case
 
it does it by checking the dynamic type
 
x is type returns bool
 
can you link me to an article or something explaining this further?
 
true if it is, false if it isn't
 
10:48 AM
@catgocat this should be described by pretty much any C# book
 
thanks
@milleniumbug yes I've read the C# player book a couple weeks ago
but what sticks is the general idea of casting not the specific details
 
the casts are explicit type conversions. for classes being part of an inheritance hierarchy, the casts can be classified into downcasts, sidecasts and upcasts
upcasts (Derived -> Base) always succeed so it makes no sense to use cast for them - just use assignment operator
downcasts (Base -> Derived) may succeed if the object was originally Derived, but it was upcasted before to Base
otherwise they're incorrect and must fail
your usual cast ((type)x) fails by throwing an exception
as-cast (x as type) fails by returning null
In C# all reference types are polymorphic, so the type information is stored at runtime inside the object
 
that's a very good explanation
just saved me from a ton of reading
thanks
 
this information is used to determine if the cast succeeds or not
in your case (fruits.Where(f => f.rarity == rarity) as Fruit[]) you tried to use a downcast, but the type wasn't correct so the cast failed
fruits.Where(f => f.rarity == rarity).ToArray() works completely different because it creates a new Fruit[] and fills it with the elements
 
11:06 AM
Wonder how ToArray works internally
It would have to know how many elements there are in the sequence to allocate the array, which means it'd have to enumerate it. So it either enumerates it again to fill the array or stashes them somewhere
OR it does what List<T> does and resizes as the collection grows
 
@TomW such questions can be answered with ReferenceSource
 
yup I was about to
 
it's pretty cool
 
if i have an empty string, is it defined as "", or as " ", or as null?
 
string.Empty == ""
@ElieSaad the second one is a string with one space, so it's not empty
 
11:14 AM
and if i define it as string? , the null is the same as ""?
 
no, that would be insane
also you can't do that
string is a reference type
T? (i.e. Nullable<T>) only works when T is a value type
@ElieSaad null is a special thingy
 
I see, i will research that in more details, thank you :)
 
also no one likes it but you can't remove it from the language now
 
but is it not useful in some cases?
 
if I was designing C# from scratch, I'd allow Nullable to work both on value and reference types, and reference types would be non-nullable by default
that would violate the assumption that every type has a default value, but in my opinion, it would be worth it
this assumption is btw the reason you can't retroactively introduce such change now
it would break so much code
 
11:20 AM
Hi
 
well then can't "" be the default for example for the string if you happened to design c#?
 
possibly
in some languages empty string is default value for a string type
 
@milleniumbug Amen.
 
then worry not, your design is wonderful.
@SunilPaul yo
 
I'm still waiting for C# to get its own strictNotNullChecks
Because right now, TypeScript has C# defeated there.
 
11:29 AM
@ElieSaad some say it might be reasonable for interoperability. For example When You pass an object from an alien space ship to a PC, where there is no data, You can't pass something Nullable<⤫⥖⍲⎑>, because the compiler can't parse ⤫⥖⍲⎑. Tho it can parse just simple null instance
 
@ntohl wat
 
@ntohl are you an interstellar species?
 
@ntohl you lost me there
 
61
Q: If null is bad, why do modern languages implement it?

mrpyoI'm sure designers of languages like Java or C# knew issues related to existence of null references (see Are null references really a bad thing?). Also implementing an option type isn't really much more complex than null references. Why did they decide to include it anyway? I'm sure lack of null...

the 111 upvote answer
"Easy interoperability with COM is important"
 
I call it my billion-dollar mistake. It was the invention of the null reference in 1965.
This is so beautiful.
 
11:33 AM
@ElieSaad and now I'm talking about (X)COM :D
 
Guys
How to open VS 2012 project in VS 2013?
 
just open it
 
search for the file, right click on it, open with VS2013 i suppose :p
 
you'll be presented a migration creator
@ntohl which is a problem that can potentially be solved in another universe
 
@milleniumbug if it was set to default, then i don't think so. (well in my case)
 
11:37 AM
That one is right up there with "What did [author] mean by..." and the guy referenced in the question posting a comment "Actually what I meant was..."
I can't remember who that was, but I think it was to do with Smalltalk
68
Q: So what *did* Alan Kay really mean by the term "object-oriented"?

Charlie FlowersReportedly, Alan Kay is the inventor of the term "object oriented". And he is often quoted as having said that what we call OO today is not what he meant. For example, I just found this on Google: I made up the term 'object-oriented', and I can tell you I didn't have C++ in mind -- Alan...

I was too blythe about the term back in the 60s and should have chosen something like "message oriented" — Alan Kay Jun 8 '11 at 16:27
buried most of the way down the page
It's really cool that people can ask questions about topics that are now historical and get actual answers from the authors
I hope it also pleases them to see that new people are still learning about the thing they wrote fifty years ago
 
Does OData saves from SQL Injection/ cross browser scripting
&
Does EF saves from sql injection
 
@Mathematics They don't make data magically secure, but attack vectors will probably be by something other than SQL.
 
I implemented WCF Data Services with EF provider, I don't have troubles with authentication as my web services will sit in sharepoint so that's done.

However I am looking into authentication angle of these OData services, I am using Query Interceptors to make sure tenants only get what they have for there tenancy.
 
I'm trying to solve a real conundrum with database rows sometimes disappearing when they shouldn't - they certainly have been there, aren't, and my coworker says that we never delete database rows. How do I debug?
 
There are next to no Good articles on that @Google
@JanDvorak you mean figure out ?
remove any permissions from the table/SP then if it's being done automatically then code should through an error ? pretty sure there would be other ways too to find out..
 
11:48 AM
@JanDvorak log all db traffic. put hooks in SQL to catch deletes.
 
Can this be done in an Azure database?
 
@JanDvorak why not
 
Thanks for your advice, great idea. I'll voice myself if this fails to find the issue.
grepping the project for DeleteObject yields zero requests except in jsPlumb
 
my query runs slow in dapper but almost instantaneous in SSMS
what the hell :(
 
12:03 PM
@StevenLiekens can you profile?
 
No one here either knows in & outs of oData
 
I wouldn't know how to
 
we had a query running 40 min called from IIS service, and 10 sec in SSMS
 
@Mathematics some people here do
It's not really clear what you're asking though
@War?
 
Dapper gets stuck for about 5 minutes on this line
return connection.Query<double?>(cmd).SingleOrDefault().GetValueOrDefault();
maybe I'm doing something funny there
but I don't see it
 
12:08 PM
Update: the team leader said the rows don't disappear frequently enough to count as enough risk and I'll be responsible for any side effects of the delete permissions being revoked. Hence, I'm not fixing anything before the product is presented to our client.
 
eh
I changed my code to ExecuteScalar and now it runs fast
return connection.ExecuteScalar<double?>(cmd).GetValueOrDefault();
 
Best look at the dapper source then
 
Hi guys
i have variant and its subvariants
variants have 2 types:Add,Multiply
I have total 18 variants : 9 variants of type Add and 9 variants of type Multiply
and each of this 9 variants will have number of subvariants
now if i know that from this 9 variants of type Add have problem in 5 variants
and from 9 variants of type multiply have problems in 4 varaints
so total variants in which i have problem = 9 variants
so i have 50% problem in this 18 variants
my question is how do i calculate this 50%
What could be the formula for this???
 
12:28 PM
F = M(A)
 
@Learning
%problem = ((totalAddVarientProblems + totalMultiplyVarientProblems) / totalVarients ) *100
 
@Michael:Thanks and what data type would be better for storing %problem??
 
@Learning decimal I guess. I'm not terribly familar with the pros and cons of certain types. someone else here would probably be able to provide a better explanation of which type to use and why
 
what the fuck is this
you took like 10 messages to say "how do i calculate a percentage"
 
lol
@Failsafe be nice.
 
12:34 PM
@Michael Thanks
@Failsafe I was little confuse for this
 
@Failsafe savage af.
 
@Learning you solved the equation yourself. so you basically wrote the formula yourself. all I did was remove some of the extra text you wrote and added some operators.
 
Lol failsafe :D
 
C# has no protected and internal, correct?
 
How about "protected internal" ?
 
12:37 PM
@KendallFrey did you try typing protected and internal next to each other?
 
Of course not, as that wouldn't do what I want
 
Eh?
 
that first answer actually does it pretty well
 
guys, when i open IIS manager, i receive it as blank, and the internet fixes are shit. (so far) Anyone got an idea?
 
12:39 PM
@ElieSaad the program loads up blank?
 
what does blank mean?
 
@Failsafe Except I want it to not be visible at all
 
Then delete it, that makes it invisible to everything :D
 
@KendallFrey Hmm
 
You mean invisible outside the assembly?
 
12:41 PM
@Michael Yeah, it just opens, and i can do nothing in it, and if i press the Home button, it closes
 
@ElieSaad what shows up in both the sidebar and the main window
 
@borrrden yes
 
can you take a screenshot
 
Nothing
 
@ElieSaad reinstall it?
 
12:42 PM
this IIS or the IIS for smtp?
 
That sounds like just "internal" to me, I think I'm missing something
You mean only for derived classes inside the assembly?
 
wow that looks fooooooked
 
That sounds like an internal class with a protected property
 
Run as admin?
 
12:44 PM
@KendallFrey internal var {get; protected set; }
?
idk
 
@TomW same thing
 
@ElieSaad maybe try disabling IIS as a windows feature and re-enabling
 
@Failsafe Did you read the question?
That doesn't compile
I'll just go with internal
 
if that doesnt work try downloading it again
 
@ElieSaad File Connect to server?
 
12:45 PM
@KendallFrey Not really, and i hope not cuz i just wrote some bs
 
there is nothing in file, 2 options:
save all connections (which is grey because no connection is there)
Exit
 
i don't feel like you can do both
 
@Failsafe after rebooting, i will tell you the result :p
 
What roles do you have installed?
 
@juanvan what do you mean?
 
12:47 PM
IIS is a role installed on the server?
 
I have IIS on my pc, never touched, It only runs when i run a web app, nothing more
 
@KendallFrey I don't think you can do it in a single line
 
And IIS manager has worked before?
And you haven't changed anything?
 
@TomW i honestly never opened the manager ...
 
did you install the manager?
 
12:48 PM
Right. You know that IIS and IIS Express are different products, right
Visual Studio hosts applications for debugging in IIS Express
 
"private protected" may or may not be in C# 7
 
@TomW not by a single chance.
 
Which does what @KendallFrey wants
The CLR already supports it, it's just not mapped in C#
 
I was searching for a mean to remove default.aspx, and so they just would say open iis manager and ...
 
Ah, that's what I remembered
I knew I'd seen something like that
 
12:50 PM
I should read the c# 7 docs
i have no idea what any of the new features are
 
It was originally scheduled for C# 6
There was backlash against it
C# 7 has a lot of functional style new features
Incidentally, this modifier exists in C++/CLI
 
Whats a good approach for how to set up an AdvancedSearch with Asp.Net MVC?
I've already (miraculously) implemented a semi-working advanced search using classes and views that were not setup properly to be used with Advanced search.

But now i will need to look into refactoring everything and start from scratch.
 
Does private protected == internal protected?
 
The main issue I see is AdvancedSearch's have lots of fields, which means lots of properties, which means, lots of method parameters.
Which mean the Controller action is going to need to take A LOT of parameters (some of complex type). This means big headache for Model Binding
 
private protected would not be available to the same assembly
 
12:57 PM
@Failsafe internal protected isn't defined, so no
 
also isn't private protected kind of redundant?
 
no
It adds something that wasn't possible in the language
 
what does it add?
 
@Michael you could implement a custom model binder
 
an accessibility level that exposes members to any derived types within the same assembly
 
1:01 PM
@TomW that sounds daunting
 
user47589
@Michael nah, its actually not that bad.
 
Ahh ok im on board now
 
Is that the actual answer to implementing an AdvancedSearch in MVC? custom Model binding?
It seems weird that I cant find any good examples :/
@Amy btw did you see the answer I found for that datetime issue yesterday?
 
user47589
yeah
 
user47589
really bizarre
 
1:05 PM
Crazy. I could have been tracing that down for days. How are people supposed to know that stuff. lol.
 
by running into that problem and trying to fix it
 
Yeah, well thanks to google, and SO. I now have it in my knowledge arsenal.
 
that's a good thing
 
The thing about Arsenal is they always try to walk it in.
2
 
wow
haven't heard that one in a while
 
1:08 PM
Did you see that ludicrous display last night?
 
user47589
nicely done kendall
 
What was Wenger thinking, sending Walcott on that early?
 
i miss that show. I thought they were supposed to do one more season
 
user47589
nope
 
user47589
i wish they had tho
 
1:34 PM
well balls
my queries are timing out again after I changed everything to ExecuteScalar
 
user47589
check the execution plan.
 
SHOWPLAN permission denied in database 'AIRCONNECT'.
:(
I can only imagine the evil DBA laughter
echoing through the dark chambers of his sql server castle
 
user47589
i just discovered by accident that CTRL-D in visual studio duplicates the current line.
 
you didn't know..?
I use that all the time :p
 
user47589
obviously i didn't.
 
1:38 PM
but don't try to use it in other editors where it means delete the current line
 
@StevenLiekens Don't you know that duplicate code is bad?
 
Am I going mad? I thought Newtonsoft.JsonConvert.DeserializeObject<Type>(object) used throw a JsonReaderException exception if it couldn't deserialize. Now it just fills it all in with null.
 
it's a setting
 
Can I get it to throw an exception?
 
1:48 PM
Ah thank you!
 
1:58 PM
Its #467269646179 !
 
what is
 
today is
 
01:00 - 14:0014:00 - 23:00

« first day (2113 days earlier)      last day (2821 days later) »