« first day (2325 days earlier)      last day (2606 days later) » 

2:16 AM
anyone available?
need some advice
 
 
1 hour later…
3:32 AM
@peterpep Don't ask to ask - Just ask. :)
 
Anyone here familiar with NLog?
 
3:48 AM
is it possible to have an attribute that does validation based off another attribute?
for example i am working on validating two datetime props
received time and expired time
so i got the validation for the date itself
but my problem is im not sure how to validate that expired time is AFTER received time
this is in aspnet mvc if that matters
 
Ah, well I'm afraid I can't help you there.
 
 
3 hours later…
7:04 AM
Hello,
is it possible to hide the default methods from my class?
I want to hide Equals() etc.
[EditorBrowsable(EditorBrowsableState.Never)] not work...
 
7:27 AM
Hi,

anyone from windows 8 or windows 10 Mobile app devlpmnt
 
7:48 AM
Good morning.
@Mr.Noob Hide from where? From intellisense? Calling code?
 
guten morgen
 
morgen, misha.
 
8:36 AM
so general question
whats more important in recruiting a developer
his personality
or his code
assuming he was brought by some friend of someone working here
hypothetical question and I dont really have anyone in line
 
Important for what?
 
well hiring
 
Because one person can say "I don't care if the developers are having fun, I need results, fast", so code is more important.
For another, a good working environment is more important, whether as a goal in itself or as a way to ensure long-term productivity of the team, so personality is important.
 
a golden developer
both wizard of code & jesus incarnate
 
9:02 AM
@AvnerShahar-Kashtan intellisense would be enough
 
Hi, I am looking for a help with .NET Core 1.1 differences between Windows and Ubuntu behavior of TcpClient. I am unable to figure out what is going on as Windows version works as expected, but server listener on Ubuntu is going weird. Anyone able to help please?
 
@Mr.Noob Are four extra methods really that bad?
 
I have settings in sqlite db and I created class which should work as properties.settings work, so it will have method for each var name to get or set it, I was hoping there is a simple way to hide those 2 methods that I don't need (equals and refequals)...
 
@Wapac not a clue but...thanks for asking an interesting question!
 
write your code in qt rather than core :^)
 
9:15 AM
I had to look into Qt once
 
Yesterday I revealed that you have to close the socket (on Ubuntu) if your first attempt to ConnectAsync() fails for the first time and you want to try again. But that was just one difference and now the Ubuntu listener is refusing to accept second connection :(
 
I couldn't get anything to compile and gave up
 
yea I had that too
you get stuck often on compile errors there
but the framework(library?) is really comfty for cross platform
@Wapac are you implementing the threading properly?
 
misha130: i think so, Windows version works just fine. Currently it seems that I am able to connect to the listener using Ubuntu "nc" command, but not using TcpClient
but I have to try netcat with TLS to be sure
What I currently receive on the client side in C# is System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer.
But the server side does not even accept the connection.
 
for the sake of fun can you look up what is happening on the network level?
and compare it to the nc testing
 
9:24 AM
my Linux kungfu is weak, but I'll try
OK, getting more information, seems promising
Now I know that await TcpClient.ConnectAsync succeeds, stream = TcpClient.GetStream(); succeeds as well, but

SslStream sslStream = new SslStream(stream, false, PeerCertificateValidationCallback);
await sslStream.AuthenticateAsClientAsync("", null, SslProtocols.Tls12, false);

one of these two lines causes the server side to disconnect
While "ncat --ssl" is able to connect without problems
 
Maybe it doesn't support Tls 1.2?
 
The server side is TLS 1.2 only and ncat connects well. So it does support TLS 1.2
So confused right now
 
I've never actually used SslStream, so I don't know - could it be the parameters you pass are the problem? A null credential collection and empty server name, are these supposed to be working?
 
All work on Windows just fine
but will try to tweak something there
The thing I am finding weird is that ncat does connect no problem.
 
9:53 AM
OK the issue is not on SSL layer, even non-SSL connections are like that. It seems like a race condition or something like that. The client thinks the connection was established, the server does not.
 
10:07 AM
OK, I've got it working, just not sure how :)
 
Spun in a circle three times?
Sacrificed a goat?
Goats are the real victims of the industry-wide switch to SSL.
 
not related to SSL at all, it is all related to how I handle Accept on the server
but still not sure what is happening, but it looks good
 
@Wapac So the goat was sacrificed for nothing?!
 
no, it looks really promising!
I use Task<TcpClient> task = listener.AcceptTcpClientAsync();
followed by task..ContinueWith(t => taskEvent.Set());
which then goes as one of several handles to WaitHandle[] handles
which then follows with int index = WaitHandle.WaitAny(handles);
now let's see what is happening ther
now i have this:
if (handles[index] == taskEvent) {do something}
the log tells me now that index = 1
which is correct because my taskEvent is second in the handles array
what fails, however, is this if (handles[index] == taskEvent)
so nothing happens
that is beyond my understanding how this if can eventually fail
when ncat connects just a bit later, it works ...
OK the if does not fail apparently
TcpClient client = task.Result does
which follows the if
 
10:54 AM
So what really happens is that ContinueWith was triggered but the task was not finished, I have no idea how this is possible
 
@Wapac ContinueWith can trigger if the task failed, as well.
Can you check the parameter passed to ContinueWith to see if IsFaulted is set?
 
11:11 AM
Say I used the wrong type through parts of my code, is there a way to rename those usages to another type, without renaming the type I used?
i.e. I'm looking for "Replace" instead of "Rename"
Wait, that doesn't make sense. nvm. Manual it is.
 
11:56 AM
Avner Shahar: I've checked that it is actually waiting for activation, it is not faulted, not cancelled, not completed and no exception
my best guess at the moment is that there is a bug on Linux that disallows you to use AcceptTcpClientAsync for more than one port on the same thread; I do think so because if I create two threads and each only waits for one accept task to complete, it works well
 
Waiting for activation means the task wasn't even started.
 
yet its ContinueWith action was triggered ...
i was also able to reproduce the problem with ncat, so it is not specific to my client
the problem is in the TcpListener and the way I accept the new clients - I have 3 listeners and 3 tasks and I wait for any of them in a single thread
this works well on Windows, it does not on Ubuntu
if I make 1 listener/task per thread it works
and i still use WaitAny as i do have additional event not related to any TCP task
so the code is exactly the same, just number of accept client tasks per thread differs
 
Ugh. It's a wrapper around the original BeginAsync/EndAsync code:
return Task<TcpClient>.Factory.FromAsync(
                (callback, state) => ((TcpListener)state).BeginAcceptTcpClient(callback, state),
                asyncResult => ((TcpListener)asyncResult.AsyncState).EndAcceptTcpClient(asyncResult),
                state: this);
 
on Ubuntu, ContinueWith is triggered, but then task.Result blocks
 
That makes sense, if the task isn't started.
 
12:04 PM
i don't really understand it why it makes sense - on Windows, ContinueWith triggers when the client is accepted
 
Here's a hack to try: check the task status in ContinueWith, and if it's AwaitActivation, do nothing.
 
then task is in RanToCompletion state
Avner Sharar: if i do nothing, i would lose the information that the client connected
client connects -> ContinueWith is triggered, but the task is not completed, i.e. does not give me TcpClient
task.Result blocks and both sides are blocked
but i think i am starting to understand where i made a mistake
so i will try it
actually, i don't now understand how it is possible that it works on windows :)
but mystery should be solved at least
 
@AvnerShahar-Kashtan I have the unenviable task (har) of trying to mush that pattern together with TPL to make some code I'm working on...work
I never really used it
weirdly the Service Bus SDK still uses it, or at least, the published version does. There's a github repo for vNext that uses tasks and looks a lot more sane, but sadly not the version on nuget
 
user6023611
Hi,
Tell me please: If someone manage to invoke from SSIS package webservice exosed by WCF ?
 
12:20 PM
@Wapac The question is whether this bug will cause ContinueWith to be called twice - once before activation, and one after it really completes.
 
Avner Sharar: the final resolution - the bug was on my side and from unknown reasons, it never expressed itself on windows; it seems that on windows, if you start new accept on the same listener, it cancels the old one; on ubuntu, if you start new accept on the same listeners, both instances are active and if someone connects, it is the first listener to get the client
there just tiny differences in how sockets work on windows and linux and .net core does not really mitigate all diferences
 
Well that sounds...sane, at least
be nice if it was documented hey?
 
:)
similarly if you try to connect with a socket to a port on linux and it fails because no one is listening there and you try again, you can't connect even if the server started there
so you have to close the socket and create a new one to connect
now that i actually replace only the one task that finished i can use one thread and accept connections to those 3 listeners
pfuf, that was a tough one
 
Nicely investigated.
 
user6023611
12:39 PM
@AvnerShahar-Kashtan Have you ever managed to invoke from SSIS package webservice exosed by WCF ?
 
Never did anything with SSIS more complex than running a data export from SQL Management Studio.
 
@AvnerShahar-Kashtan additional question, if you don't mind - when is Task object disposed? i suppose the original code i've had there was leaking Task objects as each time a client connected to one listener, i've created 3 new tasks, while the 2 other tasks were never finished; do you actually have to care about cancelling/disposing tasks that you have installed there (potentially with ContinueWith handlers)?
 
Ugh. I've started switching out WCF service contract to be Task-based. So now the client proxy is async, which is nice. I hope.
Previously, before teh async proxies, I had code to warn if a service call was made on the UI thread, since it's almost always a mistake. Now, I'm not so sure - an async service call should be fine on the UI thread because it releases the thread immediately, shouldn't it?
Maybe I should ensure I have ConfigureAwait(false) on all await calls.
@Wapac There was a much-quoted blog post by the CLR team a few years ago about that.
I'm not sure if it's still up to date.
 
tx will read
 
What UI?
:P
 
12:47 PM
Oh, right. WPF.
Classic Windows main, blocking one-per-process dispatcher UI thread.
 
That sounds reasonable but I can't be confident. I'm sure Stephen Cleary knows all.
 
Dammit:
2
A: Async WCF service call blocking UI thread

Stephen ClearyThere is a known problem with Microsoft's implementation of client-side HTTP connections (HttpWebRequest and friends): they do some work synchronously, including DNS resolution and (I believe) proxy detection. This work is always done synchronously even for an asynchronous request, and it may tak...

Stephen Cleary says: "wrap it with Task.Run anyway".
But the whole point of doing async service operations is to avoid that.
Though I'm willing to live with sync DNS resolution, especially since most of the time our clients connect to the server by IP.
Ooh, I see Cleary has a good post of whether you should do async Task Blah() { await return OtherAsync(); }, or just return the internal Task directly. I never did figure out which was better.
 
bah
HttpClient seems to have a whole world of issues
I also found an absolutely horrendous blog article on all the pitfalls you can get into with WCF services in not handling faults properly
where 'properly' means 'knowing all the undocumented state machine weirdness you have to just do to stop the channel model from going screwy and leaking objects all over the place'
the try-catch-try-again code apparently required is horrible
 
Now I'm scared for my WCF calls.
 
anyone knows a good online scheduling component?
most of them use iframes to integrate into the page :/
 
 
3 hours later…
4:02 PM
Hey in wpf is there a way I can accept an object that both has IAddChild AND Visibility?
So I can accept Panel as well as UserControl?
 
4:37 PM
Wow I actually miss python's super()for dependency injection now.
 
5:26 PM
17
Q: Abstract UserControl inheritance in Visual Studio designer

asmoabstract class CustomControl : UserControl { protected abstract int DoStuff(); } class DetailControl : CustomControl { protected override int DoStuff() { // do stuff return result; } } I dropped a DetailControl in a form. It renders correctly at runtime, but t...

That looks so ugly, where simple dependency injection could do the job. I'm actually wondering why there aren't more questions like that...
 
 
1 hour later…
6:38 PM
hello darkness my old friend
just kidding, testers cant write code
 
6:56 PM
@paul23 been there, done that. it sucks like hell.
 
@scheien Well in my case "that" didn't even work :(
 
Didn't for me either. The designer crashed all the time.
 
Wait what? How come there is no more outcry then? Isn't one of the features of C# visual studio and its integrated tools? - Yet if I can't use custom stuff in my designer it makes no sense for real applications? At least this was for me the reason to stop using pyqt and start learning C#...
 
It's winforms dude. I switched jobs, and didn't have to touch it again.
 
Oh not you personally, I just can't believe there's an answer on google for this (using wpf).
0
Q: Inject middle class in custom C# `UserControl` while working with visual studio designer

paul23Well the title should actually explain the problem quite well. Consider I create a new UserControl, however in my application many of those elements share a common code, and they are part of a "subgroup" of user controls. The logical thing is to "inject" a class between the generated CustomUserC...

 
7:04 PM
Visual Studio is pretty great. That is just one of the many quirks with winforms.
Not sure how it is in newer versions (2012 and newer) though
 
@misha130 this is wrong data because java run inside vm
Hello, anyone know how to change controls order inside wrapPanel at run time? (WPF)
 
??
C# aswell runs on a VM
at some point
 
I was reading about all this stuff and as far as I understand this is wrong to compare this languages like this...
 
of course it is
 
@scheien Guess I'm spoiled by python nowadays. Learning new languages I have to come to actually appreciate that the python committee decided not have backwards compatibility between version 3.x and lower. Prevented so many quirks - and allowed them to remove many more.
 
7:10 PM
I wish the C# team(s) with friends had big balls like that.
 
C# soon will drawn in all its libs...
so many features but when I need something its not there :D
 
;)
 
anyone know how to change controls order inside wrapPanel at run time? (WPF)
 
.net with core is sort of like that
 
Like what?
Preventing backwards compatibility?
To some degree yes. e.g. they don't have an implementation for pbkdf1.
 
7:16 PM
well whats the point of core if not refractoring
not that i used it yet
 
cross platform?
 
I mean there is mono....
 
We're going all in dotnet core with latest and greatest on the current project. Feels like we're using more time resolving annoying issues and reading roadmaps than doing actual coding.
 
yea I feel yea
Its been a year now(?) but it still feels too early to use
 
can someone answer my question please?
 
7:20 PM
We're getting into the grove now, so we're getting past the barriers (EFCore), and I'm starting to like it. Still feels a bit unpolished.
Issues with tooling (again, efcore) when upgrading to vs2017
 
@Mr.Noob You're better of formalizing it at stackoverflow I think.
 
you mean I should ask there?
 
5
Q: Re arranging controls in WrapPanel at runtime

Abdullah ZaidI have a WPF WrapPanel, it contains some of Buttons, I want to re arrange them at runtime. The XAML code at design time like: <Grid x:Name="LayoutRoot"> <WrapPanel Margin="133,127,216,189" Background="#FF979797"> <Button Content="Button" Width="75"/> <Button Content="Button" ...

 
I saw this question but its not what I need, I don't have bindings
why I cant just somehow change items order and "bring it to front" and that it?
 
If you do it manually isn't ZIndex helping there?
 
7:32 PM
Anyone into IoT here? Researching components for low power consumption wifi capable sensors. I've seen esp8266 with deepsleep (and wake up at given intervals, thus giving away two-way comm), talk2 whisper node (requires a separate receiver node since it's RF comm). Are there any alternatives to these? If so, which one(s)?
 
zindex will make it above all controls no? I need it to be first inside wrappanel only
there is Arduino mod to make it consume very low power.
some people even remove leds from it
 
8:15 PM
I'm finding myself prefixing all my Database classes with Db to be able to differentiate them and avoid name collisions. Are there any strategies to avoid this?
In my case I have DbTradeItem and TradeItem. DbTradeItem is the database class I use with Entity Framework, and TradeItem is the class I use in my web service to send information back and forth.
Database classes may have information that shouldn't be available in the web service.
 
8:49 PM
How would you envision this "avoidance"?
 
a namespace
 
Other than a namespace it seems to me that adding the "type" is the clearest way to go: TradeItem clearly means different things, so you describe them also as a different name.
Whether that's a prefix, a suffix or a full word somewhere doesn't really matter.
 
9:14 PM
@paul23 One thing I could imagine was maybe decorating the class with attributes, so the same class could be used but it would serialize differently. But I think that would just lead to confusing/messy code.
 
@WilliamMariager Well that is called a namespace.
Or actually: if you extrapolate and formalize that you get namespaces.
 
Huh?
Attributes are additional information you add to fields/classes. Using those, I could instruct my Json serializer to ignore some fields, allowing me to use the same class for two tasks. That has nothing to do with namespaces.
 
Wait you just wish to "protect" certain functions from being accessed by parts of your code?
 
Could someone give me some information on what would be best to use if I wanted to update my title every 10 seconds with the Uptime of the Console Application?
 
Timer?
6
A: How do you add a timer to a C# console application

Real CazLets Have A little Fun using System; using System.Timers; namespace TimerExample { class Program { static Timer timer = new Timer(1000); static int i = 10; static void Main(string[] args) { timer.Elapsed+=timer_Elapsed; ...

 
9:30 PM
@WilliamMariager like [DataContract] & [DataMember] or [IgnoreScript] etc
 
But do I go for a System.Timers.Timer or System.Threading.Timer
 
in this example he used System.Timers
 
@Ashkru Depends which behaviour you want
Threading.Timer is multithreaded
 
288
A: System.Timers.Timer vs System.Threading.Timer

David AndresThis article offers a fairly comprehensive explanation: "Comparing the Timer Classes in the .NET Framework Class Library" - also available as a .chm file The specific difference appears to be that System.Timers.Timer is geared towards multithreaded applications and is therefore thread-safe via ...

you can use system.timers for console app I think...
 
I just want it to update the console every 10 seconds with new information, which one would be best @KendallFrey
 
9:38 PM
You don't need multithreading for that unless you need to interrupt running code.
 
is system.timers deprecated in .net v5.0?
:D github also changed top menu style
 
I wonder how a language that is designed from the ground up to be used for parallel/threaded execution would look like.
 
@paul23 Probably like HLSL, GLSL, or some other shader language
 
is there anyone who works on something by himself? or you work at companies etc?
 
Both
 
9:46 PM
I know a "visual" language that does this: labview
 
Or are you looking for a single-person startup?
 
no just asking...
this project you work on is "hobby" or also work related?
 
Which is a simple counting loop, line representing data passing to different functions.
I also know VHDL which seems to model concurrency. - But I don't see any general purpose language with this.
 
@Mr.Noob hobby
@paul23 Read up on SIMD
 
9:51 PM
Whitepad?
I pressed on link here and it took me to Rebecca Black - Friday
and I must say it was refreshing :\
3
 
@Mr.Noob I haven't updated kendallfrey.com in way too long, look at my github instead
 
10:23 PM
github is easier to update?
 
Is it still necessary to dispose a System.Timers.Timer if you're always going to be using it until your application is closed?
 
it's best to do a using statement
it's not like a sql connection where the connection is open till you dispose of it
or the time out
 
10:41 PM
I see.
 

« first day (2325 days earlier)      last day (2606 days later) »