« first day (2658 days earlier)      last day (2305 days later) » 
00:00 - 15:0015:00 - 00:00

3:00 PM
Combine or Zip will not fit this usage
To achieve this, we need to have access to the graph of dependency and order it to perform the evaluation in topological order.
In fact, I already developed such a library. But it's a lot of work to maintain it.
 
Does it really matter if d emits twice?
 
@Squiggle I feel sorry for your wife.
 
@mikeTheLiar for very large values of d
 
It leads to intermediate state that are mostly invalid and for witch any computation result will be throw anyway
 
3:03 PM
but surely composition must be the answer here?
 
"composition" ?
 
D is the result of f(C)+f(B), C is the result of f(A) etc
 
like I suggested before
ewww no don't use ref
@HéctorÁlvarez we're talking about mutating the original value. ref won't work at all here.
Excel data cells are a good analogy
 
Yep, I was almost not joking when I say to my collegue we should code it against excel
About the "composition", yes we define observable as composition of multiple observable.
I searched for anything that look like that. but Rx always come out. and it doesn't match our needs (mostly because of the intermediate states)
We have 100k observable node in our application rigth now, if we put Rx in it the performance will just crash down
 
3:11 PM
lol
 
I hate the message Could not load foo or one of it's required assemblies. The CLR is just like "I can't even"
 
@Squiggle I don't understand that, if you pass an object by reference any operations performed on it will affect the original value.
I'm probably missing something here
 
@Orace there is also github.com/reactive-streams
but i would stick with Oracle. Why zip is not an option?
 
@HéctorÁlvarez I need 'event' and 'updates'
 
it would onnext only when both b, c ready
 
3:13 PM
In out current implem, every lambda will be called at most ones O(n).
With intermediate states it's O(n²) (at least)
@ntohl Zip will not rise in case of no modification.

var a = new Observable<int>(0);
var b = ObservableFunc(a, va => va);
var c = ObservableFunc(a, va => va%5);
var d = ObservableFunc(b, c, (vb, vc) => vb+vc);

d.Subscrive(vd => Console.WriteLine(vd));
a.SetValue(5); /// Ouput : 5 (with zip no output)
 
            Func<int> a = () => 2;
            Func<int> b = () => a() * 2;
            Func<int> c = () => a() * 3;
            Func<int> d = () => b() + c();

            Console.WriteLine(d()); // > 10
that's not feasible?
 
@Orace I think You need BehaviourSubject for a
 
because it doesn't 'push'?
 
Now I wan't to put 3 in a and have the corresponding 'valueChanged' event at d
 
yeah
you could use a digest here
but again, for it to be performant you'd need to know the graph
 
3:17 PM
@ntohl Yeah, BehaviourSubject almost do the trick but it rise on intermediate state
@Squiggle sorry what's a digest ?
 
Hi guys
Can anybody please tell help me understand the answer fiven for Question:3
on this website
How answer C will come
 
has anyone here used ApexSQL refactor?
or any ApexSQL utilities from the command line?
 
@Orace for each end node, resolve the value.
 
But I need to know the graph
 
exactly :/
 
3:22 PM
@Learning-Overthinker-Confused Do you have any resources file? Any file with .resx extension
you can open that as code and see it's actually an XML
 
sorry, I don't know the solution to your 'diamond' graph situation
 
Resources is an object to all effects
 
            var a = new BehaviorSubject<int>(0);
            var b = Observable.Create<int>(obs => a.Subscribe(x => obs.OnNext(x * 2)));
            var c = Observable.Create<int>(obs => a.Subscribe(x => obs.OnNext(x * 3)));
            var d = Observable.When(b.And(c).Then((x, y) => x + y));

            d.Subscribe(Console.WriteLine);
            a.OnNext(5); // Ouput : 0, than 25
so what is wrong with that?
 
unless you treat the entire 'cascade' as a single transaction, then emit changes only after that transaction has completed.
which is entirely possible with Rx
 
@ntohl if you define c as a%5 will it work ?
 
3:26 PM
it's 0 than 10
 
sure that'd work
 
>Overloading the assembly resolver as a debugging tool
:[
 
zip also works
            var a = new BehaviorSubject<int>(0);
            var b = Observable.Create<int>(obs => a.Subscribe(x => obs.OnNext(x * 2)));
            var c = Observable.Create<int>(obs => a.Subscribe(x => obs.OnNext(x % 5)));
            var d = b.Zip(c, (x, y) => x + y);

            d.Subscribe(Console.WriteLine);
            a.OnNext(5); // Ouput : 0, than 10
 
I was abble to write this
var a = new BehaviorSubject<int>(0);
var b = Observable.When(a.Then(x => x * 3));
var c = Observable.When(a.Then(x => x * 2));
var d = Observable.When(b.And(c).Then((x, y) => x + y));
 
neat Rx functions are in System.Reactive.Linq in nuget
 
user5500750
3:36 PM
Don't you get those when you download System.Reactive?
 
user5500750
Okay, It is just a namespace
 
user5500750
If I update an item outside a List it affects the item in the list?
 
user5500750
For example;
 
user5500750
SQLiteDb.ScrapeProxy scrapeProxyToUse = ProxyCollection.Proxies.Where(x => x.InUse == false).FirstOrDefault();
scrapeProxyToUse.InUse = true;
 
Many thanks @ntohl and @Squiggle I will dive in it.
 
3:40 PM
#Rx #magic
 
it really is magic
 
I still have doubts about the performances ;)
 
Is this going to be a realtime system?
 
We use this at 'the model' in our MVVM application.
We have some "editor" objects that discribe a field in out application.
It has with a lot of observable parameters:
IsEnabled, IsReadOnly (value not editable), DefaultValue, ErrorMessage, AvailableValues.
 
if You use WPF, than I highly recommend github.com/runceel/ReactiveProperty
You can instantly bind to a wrapped reactive property
no need to fight with the ScubscribeOn(...)
 
3:56 PM
You can read such code in our Editor
IsEnabled.Set(standardId, propagationModel, GetIsEnabled);

Where standardId and propagationModel are observable and GetIsEnabled is

static bool GetIsEnabled(StandardId standardId, PropagationModel propagationModel)
 
that's bad
I think the whole logic is upside down
You want something depending on standardId, and propagationModel. So the observable's inner function should do GetIsEnabled's job
public ReactiveProperty<bool> IsEnabled { get; } = standardId.Zip(propagationModel, ...).ToReactiveProperty();
... is the body of GetIsEnabled
binding is like <TextBlock IsEnabled="{x:Bind ViewModel.IsEnabled.Value, Mode=OneWay}" />
 
The Set is an helper function.
Our editors are interdependent (standardId come from StandarIdEditor.Value).
So we have two options:
create the editors in the right order (with dependence injected in the constructor).
create all the editors then bind them (with a 'context' passed to a 'SetContext' method)
We choose the second option.
That's why IsEnabled already exist and then is configured with the "Set" helper
It's look like this in Rx
var a = new BehaviorSubject<int>(0);
var c = new BehaviorSubject<int>(0); // create C
var b = Observable.When(a.Then(x => x * 3));
Observable.When(a.Then(x => x % 5)).Subscribe(c.OnNext); // define C behavior
var d = Observable.When(b.And(c).Then((x, y) => x + y));
 
4:17 PM
Observable.When(a.Then(x => x % 5)).Subscribe(c.OnNext);

can be
a.Subscribe(x => c.OnNext(x % 5));
that would save creation of an observable I think
 
Cya nudger tommorow
 
How answer C is coming in question 7 given here :i.stack.imgur.com/VCxxT.jpg
 
@Learning-Overthinker-Confused omg. Really? Do You need the answer in 20 mins?
and keep it quiet. Instructors walking around
 
.... I can't even read this
 
me neither
 
4:22 PM
You can zoom in
You would be able to see the questions
 
Yeah, the text is still shit
 
@Learning-Overthinker-Confused have You tried?
it's a jpg. lossful.
 
btw.. Make it copiable source code
 
4:27 PM
@Learning-Overthinker-Confused, I don't think you should get that job.
 
what do you mean?
 
Thanks again @ntohl and @Squiggle
bye
 
bye
I'm not gona download it
 
user5500750
To understand what I asked earlier. Whenever I use the equal sign in C# I am copying the item into a variable by reference?

So if I do;
List<Object> list = new List<object>();
Object item = list.Where(x=>x.property==false).FirstOrDefault();
 
user5500750
I am taking the reference of the item in the list and giving it to the variable item?
 
user5500750
4:31 PM
Therefore changing the Object item property will affect the item in the List?
 
user5500750
Is that right?
 
I believe so, why not try it in dotnetfiddle?
 
user5500750
I have a project with a lot of code. So I am not sure whether it will always work.
 
user5500750
So I just want to know the facts.
 
user5500750
For example something like this;
 
user5500750
4:34 PM
SQLiteDb.ScrapeProxy scrapeProxyToUse = ProxyCollection.Proxies.Where(x => x.InUse == false).FirstOrDefault();
if (scrapeProxyToUse!=null)
{
    scrapeProxyToUse.InUse = true;
}
new Thread(async () =>
{
    //Some code here.
    scrapeProxyToUse.InUse = false;
}).Start();
 
user5500750
I want later to update the item with; scrapeProxyToUse.InUse = false;
 
user5500750
...but I want to make sure it is referring to the item in the List
 
Here, check this out
Whoops, try the editted link
This shows that by grabbing something from a list and changing the value of the thing you grabbed you change the value of the original item.
That said, if you're using a boolean variable called "InUse" there are almost certainly better ways to do what you're accomplishing.
 
user5500750
Yes, it works. And it works in my current code.
 
user5500750
I have read an answer on stackoverflow.com, something about "an item being detached from the List" I wonder that might happen.
 
user5500750
4:39 PM
When the item is no longer attached to the List
 
I mean, if you have a reference to an item you have the reference to the item, not a reference to the list to the item
 
user5500750
So the only it will become detached is if the reference changes.
 
user5500750
..put into another reference.
 
user5500750
The List just has references to the items
 
Yes, the list is just a reference to items. I'm not sure what you mean detached -- You have to explicitely remove an item from a list
 
4:52 PM
i'm out
 
Hey there all. I'm hoping I can get someone to give me a recommendation on my code and see if there's a better way of going about what I'm trying to do.

Basically, I want to create a dictionary with string keys whose values are delegates to a method on my factory class. The issue I'm facing is that the method has a type parameter which is used as a type parameter of the return type of that method (so I can't just pass the type in as a normal parameter).

So far, the only way I've been able to make the compiler happy is to have the delegate return type set to 'object' in my dictionary decla
 
Can you have the return type inherit from an interface of some sort?
 
Yeah I was tinkering with that. But some of the methods on IObjectRepository use T as either a return type or a parameter, so I can't move the methods up to the parent interface, so to use the methods I'd have to cast anyway
I guess what I could do is move the dictionary implementation into the RepositoryFactory and have a method that handles the cast based on a passed in string. At least then the cast is consolidated to one place
 
Hello
Say I have an ASP.NET server running which receives and processes HTTP requests as usual. But it also has a background service which makes requests to other services. Does the traffic that comes from making those external request block the traffic that comes in?
 
user5500750
5:33 PM
@Shoe I don't think you have to worry about that since a request does not last very long. If there is any kind of blocking which I don't will be the problem in your case it will depend on the technology.
 
user5500750
5
A: How many socket connections can a web server handle?

iheggieIt looks like the answer is at least 12 million if you have a beefy server, your server software is optimized for it, you have enough clients. If you test from one client to one server, the number of port numbers on the client will be one of the obvious resource limits (Each TCP connection is def...

 
user5500750
That's not related to HTTP but it should give you some idea.
 
user5500750
Probably
 
user5500750
 
6:30 PM
Josh, You have different types in your dictionary, so you have no choice but to use a common abstraction. object works but is the degenerate case because everything inherits from that. You could create a common interface like IObjectRepository (not generic) and have your generic versions inherit form there. Of course, if you want the T in your return type, you're back to needing a cast. There's no way around it.
Based on what you've pasted though, it looks like you've built a service locator. Have you considered using dependency injection instead? That should help you bypass the problem completely.
 
@user5500750 Thanks
 
Does anyone know, if I add an event hander to appdomain.AssemblyResolve, does that run first, or does the default assembly resolver run first?
Looks like the custom code only runs if the runtime fails default behavior
 
7:06 PM
Thanks eisenpony, I'm quicky coming to that same conclusion as I tinker with this more. The generic types as arguments to my interface kind of kill the goal I'm trying to achieve.

And you're right, it is something of a service locator. The reason I didn't go for DI is because this is a small administrative console app to act as an interface for a script to seed our database at deployment time, so I don't have the full built-in DI framework handed to me out of the box and didn't want to dive into how to get it configured by hand. On top of that, I don't think it would fully solve the proble
 
7:18 PM
Category theory for all its noise is actually quite enjoyable
 
7:42 PM
Wish I could say the same about you.
 
oof
 
@mikeTheLiar That's not very nice of you, Mike
 
I kid, I kid.
Only take about 1/10th of the things I say seriously.
 
Gotya!!!!!!!!!!!!!!
A question regarding architecture
Is it normal to develop a module the domain that you then use in infrastructural modules like the client, server, etc
Because I have been getting into the habit of encoding the domain I am working on into a module of its own
And find it a bit messy to have business rules spread across multiple modules
 
user7480455
8:23 PM
1/10th... that's alot when you type alot
 
Mike has only the best keystrokes
 
@007 did you do something different with your hair?
 
8:41 PM
@007 are you squiggul
 
Squirrel what?
Squirrel please
Squirrel you trippin'
 
Squiggle me timbers!
 
@~
 
use the tilde!
 
To what extent do you use your programming language to document the design?
 
8:52 PM
as in, XML docs?
 
9:02 PM
Why does Console.WriteLine(new string('s', 't'); prints "s" 116 times?
 
user7480455
Why yes... yes I did mike
 
@MohamedAhmed Hint: 116 is the ASCII code for 't'
 
user7480455
It was too cute to pass up... so I had my assistant modify it a tad
 
@KendallFrey so when I provide a character instead of int, it gets the opposite ASCII code to runt the (char, int) constructor version?
 
Yes (char is implicitly convertible to int)
 
9:10 PM
@007 what's her name?
 
@KamilSolecki Dmitri
 
user7480455
I can;t tell you that Kamil
 
user7480455
also why does she have to be a she lol
 
Is she not a she?
 
user7480455
that patriarchate is alive and well
 
9:18 PM
@KamilSolecki you done been told
 
user7480455
I never said the gender of my assistant
 
user7480455
now my night nurse is a she back at the home
 
@007 I bet the night nurse is a hottie isnt she
 
user7480455
what is a hottie? She is a women
 
user7480455
9:22 PM
she does not have a fever
 
user7480455
I am the old and sick one
 
@007 See, this is what happens when you have me ignored. You make the same joke after I do, only I make two jokes and only use one word.
 
user7480455
most of the nurses at the compound are young
 
@007 you kinky old man
 
user7480455
lol
 
9:33 PM
Is there a special way to do a recursive extension method? It doesn't recognize its own name when it's called. Do I have to declare it somewhere before defining it?
 
A recursive....extension method?
I mean, I don't see why it wouldn't work
I've just never heard of anyone doing that before
Try writing it as plain static method and then refactor the signature to be an extension method, that's all I've got.
 
@Hypersapien Just call it like a regular static method, if the instance syntax doesn't work.
 
There's no instances anyway.
Console program
Well, instance of the object I'm adding it too
 
Works fine for me
 
9:39 PM
Works for me
 
pls hold
 
elevator music
 
This is better:
    class Program
    {
        public static void Main()
        {
            int x = 10;
            x.Foo();
            Console.Read();
        }
    }

    public static class Bar
    {   public static void Foo(this int n)
        {
            if (n <= 0) return;
            Console.WriteLine(String.Format("n: {0}", n));
            Foo(n - 1);
        }
    }
I forgot to actually call it as an extension method the first time. 😒 Whoopsies.
 
10:07 PM
Fuck it. It doesn't need to be an extension method. I got it to work the regular way.
 
That's probably a good way to avoid evil code.
Proceeds to code evilly
 
 
1 hour later…
tin
11:22 PM
Hi everyone. I have a string with many {N} placeholders and I'm using String.Format(templateString, values) to fulfill them. "values" is an array of strings. The templateString has the placeholders unordered, like "..... {5} .... {0} {1
sorry, pressed Enter before finishing. But I guess you'll get the idea. Some of the placeholders are repeated also
And I'm getting this Exception: "Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
"
the template is like ".... {5} .... {6} ... {0} . {1} ... {2} {3} {4} {2} {1} {2} --- {5} " and so on . lets say 7 elements total (from 0 to 6) and the array has 7 elements . But I don't know if this is accepted by String.Format
Thank you all , hope anyone knows
 
@tin You must not be passing enough arguments
 
tin
11:46 PM
@KendallFrey thank you. Will check that tomorrow
 
00:00 - 15:0015:00 - 00:00

« first day (2658 days earlier)      last day (2305 days later) »