« first day (3142 days earlier)      last day (2025 days later) » 
00:00 - 11:0011:00 - 00:00

00:05
I know ur there
@Arphile :)
mr5
mr5
morning
@Arphile you're too early
00:36
:)
 
1 hour later…
 
3 hours later…
04:35
So this question is just because I was learning and wanted to see if what I am trying is possible or not, and if it is how will I do it
class DictionaryCollection<T, TKey, TValue> : IEnumerable<T>
{
    Dictionary<TKey, TValue> newDict = new Dictionary<TKey, TValue>();
    public fillDict(params T[][] items)
    {
        foreach (T []item in items)
        {
            newDict.Add((TKey)item[0], (TValue)item[1]);
        }
    }
}
How can I write an explicit parser that converts T to TKey or TValue so that the newDict.Add() here works
Rob
Rob
@anand_v.singh You can't do it with type safety. You can't define a type of array where [0] has a different type to [1]
To make it 'work', you need to write (TKey)(object)item[0] and (TValue)(object)item[1]
But it'd be a better idea to re-work the function definition so you're taking a collection of items - which can be typed, rather than an array of arrays
class DictionaryCollection<TKey, TValue> : IEnumerable<T>
            {
                Dictionary<TKey, TValue> newDict = new Dictionary<TKey, TValue>();
                public void fillDict(Dictionary<TKey,TValue> items)
                {
                    foreach (TKey key in items.Keys)
                    {
                        newDict.Add(key, items[key]);
                    }
                }
            }
Something like this?
Rob
Rob
Yep.. that'd work, but not sure how useful it'd be :)
As it's already a dictionary
You could change the function definition to be IEnumerable<KeyValuePair<TKey, TValue>> to be a bit more flexible with the input
Or IEnumerable<Tuple<TKey, TValue>>, though I hate tuples in c#
Not making it useful as of now, just learning, how would you make a custom collection similar to a dictionary?
Rob
Rob
Or... IEnumerable<MyClass<TKey, TValue>>. But yeah, what you have would work
04:50
Suppose I want to make a collection like dictionary with few additional services
Should I extend IDictionary<>
?
Rob
Rob
Your best bet would probably look at how the actual implementation is written: github.com/dotnet/coreclr/blob/master/src/…
If it's a dictionary, then yes, implementing IDictionary<> would make sense
Thanks :)
Rob
Rob
No problem
05:21
morning
@anand_v.singh you might also like tuples
IEnumerable<(TKey, TValue)>
@Wietlol Will try to code that up as well
(assuming you use C#7)
if not, you could get away with an IEnumerable<Tuple<TKey, TValue>> or even an IEnumerable<KeyValuePair<TKey, TValue>>
wherever your array comes from, should then return such an enumerable (or list)
then you can guarantee type safety
it becomes difficult when you want to do something like IDictionary<MyClass<T>, T>
where String myStr = dict[(MyClass<String>) something]; would be valid
I found this quite a few times in Java, where I wanted a Map<Class<T>, T>
05:56
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' squirrelerinos!
@SebastianHofmann bloody germans
@SebastianHofmann Arn't you Sebastian L.?
No, I'm Sebastian H.
I haven't seen Sebastian L. in a while
You kiddin' me?
We had 2 Sebos?
@Squirrelintraining nah
I mean yah
06:07
yah
I mean nah
06:18
@SebastianHofmann mind :: blown
Gooooood moorniiiing CeeeeeShaaaaaarp! Have you played any previously unknown games lately?
'previously unknown'
While we born in this world with new memory?
Ones you didn't know before
@Squirrelkiller Does PokemonGo count?
No, Pokemon Go has been known both by you and the world for years.
Also you haven't been playing Pokemon Go lately.
06:27
@Squirrelkiller I have to!
Since the last 2 weeks I've been tidying upmy pokemons
We're best friends already, time to become lucky friends!
got room for 225 new pokemons now and still got some to send away
and lots to exchange for candies
06:29
Nicoe
Nyoooce
::see what i did there? ::
Ok, this is epic
I used to be into pokemon go
@SebastianHofmann No this is the C# room!
then I quickly realized that I wouldn't have a lot to show for dedicating a lot of time
06:30
Ok, this is the C# room
@Neil I don't really care to much where you had your willy in, good sir.
2
free willy!
@Wietlol Using C# 7
@anand_v.singh The doubble ping :gasp:
Omg Iran is publically denouncing the US. The've must gone hopping mad, they even claim they will fight even if they get bombed!
3
06:48
@Squirrelintraining I think the firing of the missiles was entirely unnecessary to make their point though..
@Neil Well.. I mean they need to demonstrate strength, right?
yeah but that seems a bit excessive. ground to air missiles no less
07:02
Whats the biggest threat of the US?
Land invasion first or airstrikes first?
I guess the latter, so it does makes sense from that perspektive.
@RoelvanUden also good mornin' sama senpai sensai o7
The morning greetings are more elaborate by the day o_o
@nyconing Who's that?
@Roel Hey I try
Have you though?
And I'm not trying to be elaborate, just to throw a topic into the room
topic thrown
joking aside, I'm afraid that the events of the world recently would imply that war is in the works
there's already tension between the states and russia.. now throw China into the mix and you're looking at what would probably be a very bad result
I hope china and USA have a small trade war, and soon realize they have to get heir shit together.
ANyone remember C&C:Generals?
One of the best C&Cs in my opinion, so yes :p
07:11
@RoelvanUden I used to greet you in even bigger manner over a year ago :<
I don't think there's ever been a trade war where both sides had a lot to lose
it's always been one-sided
I don't want to know what a true trade war could be
I also feel in this case USA would shit their pants if it actually happened
And china would be like "yeah well now you got it"
@Squirrelkiller The GLA remembers.
china maybe has the upper hand in this, but I still think it's mostly a bluff
china and america are both trying to intimidate the other
07:22
I still play Kane's wrath, but only because Generals looks aged AF
@Neil The cold war wasn't all too one-sided TBH
@HéctorÁlvarez the cold war wasn't a trade war
@Neil Oh we're stating facts now
@HéctorÁlvarez do you have reason to assume the cold war was a trade war?
No seriously, what's a trade war, I assumed it was something about mutual economic barriers
Opponent is stronger.

A. To grow up and enhance
B. Attacking the opponent
C. Both
D. Whatever

USA: B
China: C
Japan: D
Under developing countries: A
07:25
E.g. I'll block Huawei - Oh right so I'll block Apple - Ok so I'll block chinese stores - So I'll block Burguer kings
@nyconing Japan has mechs and FromSoftware, they can't lose
There's no version of a Leopard Main battle tank that stands a chance vs a full-fledged squad of Ravens
@HéctorÁlvarez well, lets just say they weren't doing this during the cold war
whatever you want to call this
Nah it was more about both sides saying "If you attack we retaliate" and sweating it through.
yep
I'll agree with that
Coca couldnt import Cola ingredients into Germany during the 2nd world war, this left the german facilities of Coca with a problem, which they solved by inventing a new drink.
Up to this date, we thank Hitler for making Fanta possible.
Sony might back to the list if they start to reform, open and share the technology each other from the all departments especially Medical and Digital-optic.
07:29
M&M's were invented because they needed to be able to give troops chocolate without having it melt in their pocket
This conflict looks the same to me, except all major parties are ruled by eccentrics.
Also apparently Hershey chocolate bars were requested to "taste a little better than a boiled potato" to keep soldiers from eating their emergency rations in non-emergency situations
@Wietlol Fantastic.
no u
The trade war disrupt the unity of humankind. The AI will start to plan their takeover on earth.
On a diffrent note: LINQ
LINK
Query syntax vs. Method Syntax.
Is there any diffrence in speed that you guys know about?
07:42
afaik, they produce the same bytecode
And no I havn't asked google yet :D
at least... they should
Method syntax is more readable IMO, but also requires you to write it better (which is a skill not everyone has)
LINQ just gets converted to a method doing the equivalent, doesn't it?
not really
that is kotlin, niel
not c-harp
07:43
Thats what i thought, and maybe they do.
I just ran a test and the query syntax seemd to be faster
then why would you assume it's the same bytecode?
they're clearly different
~0.1ms faster on the query i wrote
Im not sure where I read from. The article claim: Want performance, avoid Linq.
i thought the query syntax was just syntax sugar for the method approach
@nyconing Ji ofc,
@Wietlol Me thought so to, I am confused why its so
07:44
also, 0.1ms faster says nothing
syntactic sugar means from the point of view of assembly, the code is equivalent to another
unless you have a specific reason to think it is a considerable difference, I think they are equal
@Neil yes
if one is faster than the other, then you can't really say one is syntactic sugar for the other
for all practical purposes, it doesn't really matter, but if we're being pedantic, they're not the same
@Wietlol 0.1ms faster on average over 5.000 runs with an average runtime of ~27 ms
I believe both are equal, just query syntax is more... low level
it's like SQL, you can read the sentence and it makes sense
Hey nice article, and it suggests Avner's company's tool
2 genitives in a row really loow awkward.
.method assembly hidebysig instance int32
		'<Foo>b__1_0'(string s) cil managed
{
  //
  .maxstack  8
  .language '{3F5162F8-07C6-11D3-9053-00C04FA302A1}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
  .line 15,15 : 10,18 ''
  IL_0000:  ldarg.1
  IL_0001:  callvirt   instance int32 [mscorlib]System.String::get_Length()
  IL_0006:  ret
} // end of method '<>c'::'<Foo>b__1_0'

.method assembly hidebysig instance int32
		'<Foo2>b__2_0'(string s) cil managed
{
public static IEnumerable<int> Foo(IEnumerable<String> strings)
{
	return from s in strings
		select s.Length;
}

public static IEnumerable<int> Foo2(IEnumerable<String> strings)
{
	return strings.Select(s => s.Length);
}
it appears to be almost identical
apart from ".language '{3F5162F8-07C6-11D3-9053-00C04FA302A1}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'"
Thats allot of spam wietlol :D
Seems like query syntax has more stuff.
I dont know much about CIL, but it looks like metadata
07:52
Yup but still that instruction means cycles put to waste
depends
then again, such a minor impact.
if its metadata, they arent instructions, no?
so calling the function should result in the same
in any case, the query syntax is definitely syntactic sugar
it still has to parse that and set the parameters, doesn't it?
it depends on available methods named "Select", "Where", etc
@HéctorÁlvarez at loading, not running
07:53
Right, but still cycles
BTW -1 point for Foo2 instead of Bar
Foo2!
> But I don’t want to think when I’m looking at code, I want to read it like a book. A children’s book if possible.
ah yes..
sadly, this is C#
@Wietlol also its .1ms faster with an && chain, once chaneing with wheres it's 0.25ms faster
@Squirrelintraining 'tis like reading match books, you either understand it or don't. You get to read faster when it's a method and not a long chunk of text. Also easier to maintain.
07:57
@Squirrelintraining this contradicts hector's point
adding more metadata should make it slower, not faster
now you two fight!
pokemon battle 8-bit theme
also... how do you know it is 0.1ms faster?
how do you know your machine didnt just have something else to do?
He probably ran statistics 1 success / 1 try
That's what squirrels do
@Wietlol Eliminating those variances by large amounts of run
@HéctorÁlvarez thats how i find my nuts
Actually...What if Apple phone cant assemble in China anymore?
Apple phone might become more expensive
@nyconing aaand unavaidable even :D
Im born in Malaysia and Im Malaysian which mean Malaysia citizen
I even need VISA to go China.
Yeah I also need a credit card when I go there.
Apple will just look for the next cheapest country to flog for 50€/phone
08:16
Maybe India?
Maybe
Or some African country
Or Venezuela
No wait, those are already sided with the chinese.
Venezuela is #1 choice now, for sure
morning o/
is there a c# for nebwies chat room?
or this is the only one?
this is the only one that I'm aware of
but that doesn't mean we're all experts either
08:30
@xavier Why would it be?
Just like africa, to instable
@Squirrelintraining what is the average run time?
and the number of runs
@Squirrelintraining I saw an Angular for newbies room and I thought perchance there is also a c# for newbies room...
@HéctorÁlvarez oh you
I dont think there is a need for a C# for newbies room
if you have a question, you can ask it here
10.000 runs, min rutime: 24/25ms, max runtime ~70/160/190ms Average runtime: ~27.0 - 27.5ms atm
I would have to study statistiks to write an algorithm which kicks out the ones that are ridicusly out of scope
ok
just wondering
I have a question, indeed...
08:33
my answer was to a diffrent question :D
You can ask your question here anytime :)
(hover over message to see where i replied to)
The idea of this chatroom from a newbie standpoint is actually being able to ask other people who are more veteran, actually.
@Squirrelintraining did you set up a testing run, or are you just using the normal (Debug/Release) configuration?
@Squirrelintraining true! I didn't realize :D
@Wietlol testing run
How to download Visual Studio
08:34
dont
@Squirrelintraining Just average them I guess, with enough data the ration between both operations should be similar
use rider
well that sucked to look at
if you have 1 instance of 190ms in 1000 runs, but 900 instances of 65-75 ms you should be golden
ok, my question: I want to upload a picture in a webpage. In the frontend I have the File class (typescript, angular). Which class should I use with c# to load it in the DB?
Today is my last day at work
ALSO
MY BOSS JUST DECIDED THAT THE COMPANY IS NO LONGER SUPPORTING IE
08:35
I'm using entity framework
SOMETHING I'VE BEEN VERY VOCAL ABOUT FOR THE PAST YEAR
Oh god, cheers!
@CaptainSquirrel congratz
We should celebrate
(╯°□°)╯︵ ┻━┻
08:36
!!hardbass
@HéctorÁlvarez That didn't make much sense. Use the !!/help command to learn more.
hands the captain rum
Oh no, Cap is lacking major knowledge
21 hours ago, by Squirrel in training
@HéctorÁlvarez If UserAgent.Contains("IE") Redirect("https://mashable.com/article/microsoft-stop-using-internet-explorer-browser/?europe=true");
you shoved him that right?^^
08:37
@xavier I think it depends on the databse.
sql server
Also @Squirrelintraining I have a bottle JD Tennessee fire next to me
I think storing on filesystem > Database i read somewhere but dunno
@CaptainSquirrel Picture or thou shall not earn any trust!
@CaptainSquirrel does that mean it's
!!funfriday
08:38
Yeah there's a Filestream data type IIRC on SQL Server that stores your image on the disk and then saves a route in your DB, which is also backup-ready.
@Squirrelintraining 2 seconds
@xavier do you want to store your image in your database?
oh, I was thinking on storing the whole picture, using a blob file or similar
if so, you might want to use a blob type in sql and byte[] in C#
but if you tell me Filestream is better, I can try it too
08:39
but I would recommend not storing files in your database
why?
but instead using a file store
databases dont like files
this is what i am doing basically
08:40
I asked in my company and they told me it's easier to store it in the DB
I absolutely recommend storing files in your database.
for backups and so on
@Squirrelintraining here ya go
@CaptainSquirrel enjoy! :cheers:
I shall
Its not what i'd normally drink but im not complaining
08:44
databases dont like files + I absolutely recommend storing files in your database. = I'm quite confused
Different developers, different opinions.
Congratz Captain o7
@CaptainSquirrel You might suffer from astigmatism what your your monitor ye
:D
Best thing is, write both, speedtest (if it's speed what you are after) what is faster, then decide what to use
And blame sama senpai roel for confusing you
@xavier people have different opinions
08:48
I like files to be stored in the database due to the fact that you don't need another storage container, and databases should be already in a backup plan. You also don't need to write error-prone code to delete file references in a database and the actual file from somewhere else. That's my opinion. You can definitely argue that databases aren't designed to store files, and a dedicated file storage is much much faster. Speed = follow Wietlol's recommendation, simplicity = follow mine.
in our case, we can specify a "column" in our db schema that it is a "file" and it would save an identifier which it uses to load the file from a file store
@Squirrelkiller cheers :D
@nyconing wot do you mean
Your choice should mainly depend on your situation ;-)
the issue files in (mostly relational) databases have, is that files have a very large range of size and dont contain much information that your database cares about
Your screen reflects light, harm to your eyes
08:50
so it generates unnecessary overhead to everything
especially on the cache of the database server (i assume)
but for simplicity, you could just store it there just like any other thing
if you dont have a database that can handle file redirection by itself, then it might introduce a lot of complexity to your applications
@nyconing I have bad eyes anyway so
@Wietlol Incase you are interested, my results as a imgur post: imgur.com/a/Ly4hpUw
it's just to store some logos that will be retrieved once, so speed seems not a crucial issue
08:53
Normally i'll pull the blinds down behind me but don't see the point now
@xavier Just remember, what you do now, you should always do in order to keep thins the same.
@Squirrelintraining I see
I'll think about it carefully
thanks you all!
@Wietlol what confuses me is, that function and runs faster than query and, but function chained runs slower than query chained
@xavier Thank you, come again!
because of reasons
vOv
@Wietlol You recommend not to store files in the database. Do you consider Filestream as stored in the database or not?
@HéctorÁlvarez "stores your image on the disk and then saves a route in your DB, which is also backup-ready"
09:05
FileStream ?
you mean System.IO.FileStream?
yes
that is a class
that means nothing to how you store it
HéctorÁlvarez said ""stores your image on the disk and then saves a route in your DB, which is also backup-ready""
perhaps I didn't understand it
ah, tsql-filestream
in that case, that might be pretty much an equivalent of what we use
1) Save file on disk
2) Backup disk
3) save link in DB
4) backup DB
that is not exactly the same link he just posted :D
hahaha
Sorry I only noticed the (63*) mark on the browser and the confusion over .NET Filestream.
too busy checking how exactly astigmatism affects my worthless eyeballs
you need some sleep
you cant go on like this
try counting sheep
and make sure there's none you miss
Oh but I do, today I woke up at 4am and suffered the consequences of eating food remains from yesterday that were visually in arguable condition.
I needn't sheep, I can instantly drop dead by looking at my table names
AOHSORGA
Or this table that's duplicated in the database for a reason I cannot comprehend
09:18
today I got a message from our support team that some of our client partners cannot log in
it appears they arent even partners
weird database assumptions
Oh that's interesting.
@Squirrelkiller 5) Synchronize db with another server
6) Save DB backup link in text file
if (long.Parse(user.Uid)% 2 == 0) throw new Exception("Cats inside the DB");
09:35
7) create new database from scratch
8) Use scratch to recreate db containing link backup
heard mongodb?
9) install wietlangcompiler
Hello, is it possible to perform a foreach loop in email html body?
in C#
ok... what?
09:38
10) etch binary in rock on office lawn
"<table border=\"0\">" +
$"<thead>" +
$"<tr>" +
$"<th>Header 1</th>" +
$"<th>Haader 2</th>" +
$"<th>Header 3</th>" +
$"<th>Header 4</th>" +
$"</tr>" +
$"</thead>" +
$"<tbody>"
> Hello, I am sending you this mail because of foreach (var item in list) { Body.Append(item.Text) }
yep, it works
(might not work the way you want it to)
that is my string
@AppleCiderYummy you might want to take a few fewer steps
do you have sample?
09:40
you want to produce a string from a list?
I mean, I need to put the list inside the string
you might want to try the function Aggregate
myStrings.Aggregate((l, r) => l + ", " + r)
Can we open a private room?
Why I can only select on "public chat"
i think not
@mr5 just checked, it happens to be that CreateCommand is already an existing function of SqlConnection, which is why we needed a different name
00:00 - 11:0011:00 - 00:00

« first day (3142 days earlier)      last day (2025 days later) »