« first day (3931 days earlier)      last day (1012 days later) » 

4:45 AM
Hey I'm trying to use covariant types in C# but I'm getting an error.
This is the example from c# in a nutshell 6.\
My code :
namespace MyTDDExampleTests.Types
{
public interface IPoppable<out T>
{
T Pop();
}

public class TestCovariance
{
[Test]
public void testCovar()
{
Stack<Bear> bears = new Stack<Bear>();
bears.Push(new Bear());
IPoppable<Animal> animals = bears;
Animal a = animals.Pop();
Assert.NotNull(a);
}
}

public class Animal
{
}

public class Bear:Animal
{
}
}
Project is using C# 7.3.
Using Rider windows btw.
 
5:26 AM
Anyone interested I just wrapped Stack.
 
 
4 hours later…
9:48 AM
/cat
oak :(
!~shiba
ny :(
 
10:11 AM
this is madness
every single bot is revolting against its master
 
 
2 hours later…
11:48 AM
We've got so many positive tests at work
 
Hey
long time no see
There are still some squirrels around
 
Probably thought I was someone else? :D
The other squirrel
 
There used to be about...
5-10 squirrels
Lots of oldies around as well
 
12:16 PM
Why aren't you part of us? :D
 
I didn't want to follow trend
I'm more of a cat person
 
mr5
hey look, the cartel guy
 
12:45 PM
silence! I kill you
!!kill mr5
 
This conflicts with the First Law.
 
#bringCapricaBack
I am going to try the arcane incantation known as regex
can someone lend me a hand? This has always been one of my weaknesses
believe it or not I'm trying to provide a sample text that doesn't get me fired tomorrow
 
Hello,

Looking to see if anyone else is getting the same experience in Visual Studio 2019 and using Gitlab.

If I make a code change in the Dev branch, the little icon in the corner shows the number of changes.

If I then switch to UAT, it still has the same change from Dev listed in the changes window. Even though in in UAT now.

Is this happening to anyone else?
 
1:02 PM
so here's the play
most likely everyone here isn't familiar with traps
I need to be able to select one chunk of info at a time
Description, condition ID, and condition with all the guts
in this small example I have only a few conditions
in the real scenario, the file is about 70k lines
so I have to select all the text that is relevant for a condition where the value of $e is specified by me
 
Looks like you're getting fired :D
 
been trying to regex this myself but even dots are hard to do, escaping them doesn't work, tried to select the text as a single capturing group but also doesn't help
@mr5 yooooo
sorry to ping
but I see you
 
mr5
 
1:17 PM
@Squirrel.98 worst case scenario we will just copy/paste whatever we see fit
someone had the brilliant idea of loading 4GB worth of raw data to load from a browser
therefore, Chrome goes omnomnom RAM yummy
 
mr5
looks like a custom parser would do
 
custom parser?
 
mr5
<key><space><value>
is this the pattern?
 
nope, it would be more like
DESCRIPTION "TBD (SNMPv1)"
CONDITION_ID "321B34D6-0D02-E2AA-B712-133531E3D389"
CONDITION
            $e ".1.3.6.1.4.1.11.2.17.19.2"
            $G 6
            $S 1
            $2 "^<@.nnmiprotocol>://<@.nnmiserver>:<@.nnmiport>/nnm$" SEPARATORS " 	"
            $21 "192.168.78.61|192.168.78.60|172.24.216.188" SEPARATORS " 	"
it can have any amount of $ stuff
next one starts on DESCRIPTION again
 
mr5
yeah but the pattern I said still applies, you only need to do it recursively
 
1:20 PM
if there's $e "1234" I need the whole chunk
but don't worry
we will just go the lame way in
just it would be nice to get all the stuff in 1 go, but that's only efficient if you know regex in the first place.
 
mr5
so a group can be identified by the number of whitespace on its start.
line contains a pattern of <key><whitespace><value>
if key == CONDITION, next line is expected to be a group
 
I can't build a program, just saying
not even scripting
 
mr5
but why
 
because that defeats the purpose of saving time
the point is as follows
we were handed a massive text file
we have to split it and remove everything that's unnecessary
my first idea to approach it was to select all the conditions that were correlated to a certain trap
so we could just change the $e value and roughly extract, copy, and paste
 
mr5
eh good luck writing the regex for that.
do you need to group the values as well?
 
1:26 PM
no, just extract as-is
I know how to do it from a script
but since I'm not familiar with regex, I think we just need a different approach
 
mr5
you're only interested on keys that starts with $?
 
everything
from one DESCRIPTION to the next
take it as a block
I need it verbatim
 
mr5
but you said you don't need to group the values
 
group how
do you mean if I need all the $e together?
then no, I don't
let me put it in other words
 
mr5
2 mins ago, by Héctor Álvarez
take it as a block
 
1:31 PM
I need to splice the file and cut away the blocks that don't contain what I need
 
mr5
wdym by that then
 
This is a block
12 mins ago, by Héctor Álvarez
DESCRIPTION "TBD (SNMPv1)"
CONDITION_ID "321B34D6-0D02-E2AA-B712-133531E3D389"
CONDITION
            $e ".1.3.6.1.4.1.11.2.17.19.2"
            $G 6
            $S 1
            $2 "^<@.nnmiprotocol>://<@.nnmiserver>:<@.nnmiport>/nnm$" SEPARATORS " 	"
            $21 "192.168.78.61|192.168.78.60|172.24.216.188" SEPARATORS " 	"
condition may contain an arbitrary amount of conditions
the next block will start with DESCRIPTION
so if $e == ".1.3.6.1.4.1.11.2.17.19.2" then we need the whole block
 
mr5
1:43 PM
that shit is too complicated for me to do in regex
I'd rather write a simple script in JS
 
1:56 PM
I have this class that receives an object and processes it into one of a given number of classes (all based on the same parent class). I'm trying to figure out if there's some way to simplify the case statement since each block does the same thing, just with a different class.
 
@mr5 this might actually be what I should do
but I'm def not gonna waste time scripting a parser again
IDK
Will give it a thought
anyway, cheerios
 
mr5
2:29 PM
@Hypersapien using reflection? Make an overload of value.GetData(Type)?
@HéctorÁlvarez at this point, I think you should. You have already wasted a lot of time lol.
 
Is it possible to create a dictionary where the Value type is a Generic Interface?
 
mr5
object?
 
I want to actually use the methods declared in the interface
 
mr5
does it have a common interface?
 
I want to use a specific Interface that is generic.
This is what I want the definition to be - Dictionary<Type, ISender<T>>
ISender has a 'where T' in its declaration as well.
for a common base class
 
mr5
2:45 PM
does T have a common base class as well?
 
Yes
They're the same set of classes
 
mr5
Ah wait. I'm not sure if that is possible with C#
I haven't fully understood the rule of covariance.
Try if you can:
dictionary[type] = new Sender<A>();
dictionary[type] = new Sender<B>();
dictionary[type] = new Sender<C>();
 
3:07 PM
@Hypersapien You want a builder pattern?
I think that's what you're going for, it's going to be a Repo Interface style
 
 
3 hours later…
5:47 PM
Hi all
Got weird situation in an MVC app: in Visual Studio, it has a reference in References to System.Net.Http ver. 4.2.0.0 and it also has a Nuget Mgr reference to ver. 4.3.4. If I uncheck the box for that in References > Assemblies, the app won't compile with lots of errors, such as:
The type name 'HttpClient' could not be found in the namespace 'System.Net.Http'. This type has been forwarded to assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.
What am I doing wrong? I know the Nuget pkg is the way to go as it's the latest but VS isn't cooperating
 
 
1 hour later…
6:55 PM
@Alex any refs in the csproj
 
 
2 hours later…
8:59 PM
Max Horstmann on July 21, 2021
If you’re building a new app today, it might be worth taking a closer look at making it cloud-native and using Kubernetes from the jump. The effort to set up Kubernetes is less than you think. Certainly, it’s less than the effort it would take to refactor your app later on to support containerization. 
 

« first day (3931 days earlier)      last day (1012 days later) »