« first day (3260 days earlier)      last day (1687 days later) » 

1:01 PM
the plot thickens
 
oh man
that was tasty
essentially i've just had a blt with extra steps
 
Every now and again I'll make myself a BELT, which is just a BLT with egg :)
 
ooo
that's a belter
.....geddit?
 
Would have to loosen me belt after one of those...
 
ba dum tss
 
1:04 PM
I need to burp after that, let me just belt it out
 
He had a taste of the belt there.
I am idle because my remote VM just disappeared into another dimension... again, so I can't work. Such a shame.
 
@Neil I'm partial to the bloated goat. BLT with onion, avocado, and goat cheese.
 
BLOAT ah, I get it
that's a dagwood right there
sounds great
I think onions would be kickass on a BLT and I love avocado
I'll have to try that out
 
There's lamb bacon, so there's probably goat bacon as well.
 
1:10 PM
Forget the cheese just gimme the goat :)
 
mr5
 
"I like to think of computers as really smart idiots." is on the sidebar. It reminds me of something someone said. "A computer is an idiot, it just happens to be a high speed idiot."
 
@mr5 Y U NO ASK QUSTON
 
LGBTQA+, Lettuce, Guacamole, Bacon, Tomatoes, over easy Quail egg, Aged cheddar + a side
 
@Hypersapien it also is a rock that was tricked into thinking
 
1:13 PM
Computers give you super-human stupid powers, instead of normal stupid.
 
Well, you have to flatten the rock and put lightning inside it first.
 
is it safe to use a singleton in a web api (asp.net)? assuming I used a thread safe singleton
 
mr5
class DelegateAsyncCommand : DelegateCommand
{
    public DelegateAsyncCommand(Func<Task> task, Action<Exception> exceptionHandler) : base(() => { task().FireAndForget(exceptionHandler); /* how can I capture "this" here ? */ } ) { }
}
 
Tsk, me VDI is back from the 5th dimension already, such a short trip :(
 
mr5
1:17 PM
y u guys stop chatting
 
@mr5 First, I would probably call it AsyncDelegateCommand, but that's just me.
 
I'm salaried, so why do I have to fill out a time sheet?
 
Secondly, what's this? The command instance?
 
mr5
@AvnerShahar-Kashtan y tho?
Semantics?
 
Because it's a DelegateCommand that's extended to be async, not an Async command that's turned into a delegate.
 
mr5
1:19 PM
yeah. the DelegateAsyncCommand instance
 
Capture and do what? Do you want it available for the exception handler? The task itself?
 
9/19 9:19
 
9/19 15:21
doesn't work for me
 
Also, 19/9, so, you know.
 
mr5
I want to insert this thing:
class DelegateAsyncCommand : DelegateCommand
{
    public DelegateAsyncCommand(Func<Task> task, Action<Exception> exceptionHandler)
    	: base(async () =>
    	{
    		try
    		{
    			this.IsActive = true;
    			await task();
    		}
    		catch (Exception ex)
    		{
    			exceptionHandler?.Invoke(ex);
    		}
    		finally
    		{
    			this.IsActive = false;
    		}
		})
	{

	}
}
the syntax is awful
but you get the idea anyway
 
1:23 PM
Is this expected to work with WPF?
 
The problem is that your constructor param exists before your object is constructed. There's no this yet.
 
mr5
I have edited the code
 
I rebuilt my EDMX file, and I have this one stored procedure that returns a table object, but EF thinks it doesn't return anything.
 
Is this an attempt to never write try/catch blocks ever again? or what?
 
mr5
@AvnerShahar-Kashtan yeah. I realize that. But is there somewhere to work it around?
 
1:25 PM
Store the task as a member, and listen on its state, maybe.
 
mr5
@AvnerShahar-Kashtan okay. I'll refactor our entire code base for this ^^
@AvnerShahar-Kashtan how would you do that?
 
Oof ouchie owie my cpu
computer just had a stroke
 
mr5
@Hypersapien is it the same as time-tracking?
 
But is it still alive
 
class AsyncDelegateCommand : DelegateCommand
{
    public AsyncDelegateCommand(Func<Task> task) : base( () => { task.FireAndForget()})
    {
          IsActive = true;
          task.ContinueWith(t => { IsActive = false});
    }
}
Something like that.
 
1:36 PM
@CaptainObvious yeah after both my screens literally blinked at me
 
The base class executes the task, but your constructor chains a continuation onto it which handles errors and completion.
 
mr5
Hey, I've missed one vital part from my code
class DelegateAsyncCommand : DelegateCommand
{
  public DelegateAsyncCommand(Func<Task> task, Action<Exception> exceptionHandler)
    : base(async () => {

        if (this.IsActive)
          return;

        try {
          this.IsActive = true;
          await task();
        }
        catch (Exception ex) {
          exceptionHandler?.Invoke(ex);
        }
        finally {
          this.IsActive = false;
        }
      })
    { /* Empty Body */ }
}
 
@AvnerShahar-Kashtan Seems strange to me. I would flag it as active and then call .FireAndForget(). Otherwise the IsActive` value may not be consistent until the base constructor is finished
 
mr5
It should also prevent the task from being fired again until the first call have finished.
 
1:42 PM
@mr5 You could also encapsulate that logic in a protected static method for shake of readability.
 
mr5
@bradbury9 but that code is not compileable yet
 
@bradbury9 Yeah, but IsActive is an instance member, but the base class's constructor gets a delegate that's defined before the instance is created.
But yeah, you're right, what you actually need to do is set IsActive when the Task switches to Running.
Or Started, or whatever it's called.
 
mr5
Can I listen to the Task's state?
 
@mr5 Just how many hours I work, holiday hours and PTO hours. Not what I'm actually working on.
 
No, it doesn't make sense, because during the command's ctor, the task hasn't been created yet.
My bad.
You don't have a Task, you have a Func<Task>.
Well, basically, you need to override DelegateCommand's Execute() method, then.
That's your starting point.
 
mr5
1:50 PM
This blogpost also produces the same "boilerplate" code from the library I am using
although it was linked on SO and have many upvotes sigh
 
Doesn't CaliburnMicro have support for async commands and also for Xamarin forms?
 
mr5
idk. I can't see any good examples the has those features I want
 
Does anyone know about default/init code forhte c# interactive window? Like a profile for powershell?
 
mr5
They have this:
await new SimpleResult().ExecuteAsync();
which I am unsure what it does
@Squirrelkiller like capturing the current context when debugging?
 
No, the C# interactive window. A REPL in its own context.
 
mr5
2:01 PM
I think this is a good start
128
A: Compiling/Executing a C# Source File in Command Prompt

AshCSC.exe is the CSharp compiler included in the .NET Framework and can be used to compile from the command prompt. The output can be an executable (.exe) if you use /target:exe, or a DLL if you use /target:library. CSC.exe is found in the .NET Framework directory, e.g. for .NET 3.5, c:\windows\...

Like, System.* namespaces are loaded by default?
 
Nope, don't have a command prompt. I jsut have the C# interactive window.
 
We were taught how to compile C++ in command line at uni once
ONCE
 
Ew
who goes to uni
 
Then we had to deal with .... visual studio 2012 and C++
And then visual studio 2013
back in the dark ages
 
mr5
2:21 PM
brings back memories
gcc main.cpp -o main
./main
 
oh yeah, I remember those days
you had to make a makefile to first compile the .o files
then create the executable from the .o files
and if you did rm * .o, you removed everything
learned that the hard way
 
G++ = g++
CXXFLAGS =	-ggdb -Wall -Wextra -pedantic -O2 -fmessage-length=0

OBJS =		main.o AbstractClass.o ConcreteClass1.o ConcreteClass2.o
COUNTER1 = $(OBJS:.o=.cpp)
COUNTER2 = $(OBJS:.o=.h)

TARGET =	TemplateMethod.exe

$(TARGET):	$(OBJS)
	$(G++) $(CXXFLAGS) -o $(TARGET) $(OBJS)

$(OBJS):
	$(G++) $(CXXFLAGS) -c $(@:.o=.cpp) -o $@

all:	$(TARGET)

.PHONY: clean TAGS

clean:
	rm -f $(OBJS) $(TARGET)

love :
	@echo "Don't war!"

clear :
	rm -f $(OBJS) $(TARGET)

count :
	wc -lm $(COUNTER1) $(COUNTER2)
 
mr5
I used to compile using notepad++ with and I just bind command lines in the F5. Manually updating it every time I include new files
 
good old days
 
mr5
up until now, I still didn't learn that makefile syntax
my favorite flag was -L"Path/to/library" or the -lRelativeFileNameOfLibrary.a
and since MSBuild, I don't know if static library is still relevant
 
that was the only way once upon a time
it was also the way my university decided to teach us
 
Sean Bave on September 19, 2019

Control the types of ads you see. We’ll categorize the different advertising offerings and you’ll be able to select the ones you want to see.

Report specific ads you don’t like and we, together with our ad partners, will make sure you don’t see them again.

 
make love, I love that
 
:)
 
mr5
We have QueryHelper.ToQueryString(object command); which basically translates any object into query string. We also use this as a key for caching in some of our GET request. Pretty much, it acts like a persistent hashing function. Do you guys know any optimal way to generate a hash without implementing it on the class level but the same helper method as we have?
 
2:48 PM
use comparer where the hash is used? Like docs.microsoft.com/en-us/dotnet/api/…
 
mr5
but then, I would need to implement EqualityComparer<T> for any object I would use
 
yes. But you can do that without modifying the original classes
 
mr5
it would render a lot of work if we have intensively used this for hashing
 
I would implement hash stuff anyway
 
mr5
not until those objects you're using is created by other developer
 
2:57 PM
git merge
 
mr5
Something something something like this:
10
Q: Calculate fingerprint for an object

t3chb0tI need to store serialized objects in a database and I want to avoid duplicates. In order to be able to tell wheter an object is already stored, I have to compare them somehow. My idea was to calculate a hash for some of its properties that I consider as equatable and store it in a separate colum...

 
is there a clever way for TeamCity to do the Implement Equality stuff whenever commit happens?
 
mr5
His code produces the following:
D46E5C869CDBA5775D7F8C9AF6BC497D5EEA76C4
D46E5C869CDBA5775D7F8C9AF6BC497D5EEA76C4
F450C1CE6B1A2041D8D7D0FEAA31AF7C5C214D81
What is TeamCity?
A git client?
 
CI CD stuff
JetBrains' Jenkins
 
mr5
oh
 
3:02 PM
and since JetBrains does R#, and R# have that Implement Equality stuff, I would suspect that might be doable.
 
mr5
ugh
I like to setup my personal CI/CD
but too lazy
 
> Static code analysis
TeamCity uses a set of several hundred IntelliJ IDEA and ReSharper inspections to analyze your code and identify potential problems.

If you prefer to use other tools, TeamCity supports FxCop out of the box. It can also import reports produced by PMD, PMD/CPD, FindBugs, Checkstyle or JSLint.
 
3:17 PM
I am coding a httpget endpoint. But I need to pass an object that contains information that will be used to filter a dataset also contain pagination information. since httpget does not allow boy to carry an object is there a better way?
 
use post
or [fromurl] kind of info
 
mr5
@YousufHossain convert the object into a query string
 
3:33 PM
user image
2
 
It is a large object
 
mr5
can't find it
 
@Hypersapien 10/10
 
oh please tell me that's not real
 
It's not.
 
3:44 PM
i wish it was
i tried to search
was disappointed
 
mr5
hello former disappointed
 
4:09 PM
ohai mr5
 
mr5
ohai
BitConverter.ToString(byte[] bytes) returns a hex string representation. What would be the optimal way to minify the result string of this function?
I'm thinking of looping the byte array for every sizeof(uint64) and convert each byte into uint64 representation.
 
4:37 PM
@mr5 You mean something like UTF8Encoding?
 
mr5
produces garbage value though
 
If that's not that you want, what do you want?
if you want plain ASCII text, base64 is probably the way to go
 
mr5
A replacement for this, but faster:
2 hours ago, by mr5
We have QueryHelper.ToQueryString(object command); which basically translates any object into query string. We also use this as a key for caching in some of our GET request. Pretty much, it acts like a persistent hashing function. Do you guys know any optimal way to generate a hash without implementing it on the class level but the same helper method as we have?
The BitConverter seems to generate value per instance based on my tests
which is no way to go
I would like something that operates on per property name/value basis
 
 
3 hours later…
7:43 PM
so you want a hash
but you don't want to use .gethashcode
 
 
1 hour later…
8:53 PM
@mr5 does this hash function operate on a specific type? or just random types?
if a subset of types will do, you could make an interface that gives you a set of the properties
 

« first day (3260 days earlier)      last day (1687 days later) »