« first day (2557 days earlier)      last day (2390 days later) » 
01:00 - 13:0013:00 - 21:00

mr5
1:28 AM
o/
 
mr5
1:57 AM
My senior made a "dirty fix" to cope with the deadlines of the project. However, he doesn't seem to have any plan to change it again. What would I do? Should I fix it myself?
 
do you have a task backlog or something?
we use jira to track issues
if it were me I would create a clear ticket to say "Quick & dirty fix implemented for deadline in X.cs, fix asap"
 
mr5
We are using Bitrix (project management software) and made a custom module to track all the issues, feature request, etc. But we're only using it to communicate with the QA
and the only way we could do that similar approach is to mark that section of code with TODO
and there's none in this case
 
how do you keep track of bug reports?
 
mr5
in our custom module called "Scrumboard" but it isn't a suitable place to add a particular line of code there
 
dunno what to say. if I find a bug I create an item in jira to address it. In our sprint planning/backlog grooming sessions we prioritise bugs/features.
 
mr5
2:12 AM
do you include the related files and loc in your report?
 
if appropriate. eg if I did the dirty fix I would raise the item saying where the code is, why I did it and an idea (if any) how to fix it
 
 
3 hours later…
mr5
4:49 AM
does the OS put the function calls into a queue first before firing it?
what happens when you call a function multiple times, disregarding if it's async or not, from the same instance and that function can be accessed by a single thread at a time only?
 
5:49 AM
@mr5 That's when concurrency and reentrancy errors occur.
When you call a method in C#, that method is called directly on your thread. No queue involved.
 
mr5
@AvnerShahar-Kashtan is it true for all languages?
 
mr5
oh
 
Some languages will wrap function calls in messages and put them in a queue. I think Erlang is heavily message-based. Haven't used it.
 
mr5
and objective-C right?
 
5:51 AM
No clue.
But for simple method calls - say, .ToString or .Equals, the performance hit will likely be enormous. Depending on the use case.
Although I heard a very good talk about this evolution a few years ago.
 
6:05 AM
good morning :)
 
@mr5 Objective-C doesn't use queues for locking/concurrency either.
 
6:20 AM
Good day everyone. I'm trying to host my asp.net core simple website in ubuntu. I have an access using sftp but I don't know where to put it?
I've also installed nginx
 
6:33 AM
Hellow, C-sharpo
 
mr5
@mark333...333...333 is your server running already?
 
yes @mr5 with nginx
Hello @KamilSolecki :D
 
Servus sharperinos!
 
mr5
@mark333...333...333 have you registered a domain name already?
 
6:49 AM
@mr5 not yet. but I'm only working on-premises
 
7:13 AM
I have an interface that has only int property, I want to implement it on classes that may have that int member or int?.. is there a workaround for this?
 
Nope. An interface has to define one thing, and that has to be implemented. int nd int? are different types, no chance to use one thing for both.
You can however make and int property and return 0 if the underlying int? field is null.
 
@MohamedAhmed If I had an instance of IIntHolder, and I accessed the int member and it was actually null, what would you expect to happen?
 
Hey, anyone in here done any neural network development using C#/.NET in here?
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
The interface is a contract - I, the implementor of this interface, am contractually obligated to have an int member.
 
7:20 AM
@Metallkiller you shouldn't have time to chat
it's time to do your projecto
 
@Corona No, but please visit us more often, since I wanna learn about neural networks.
 
I am in the learning process also.
 
@Nerdintraining The friggin project isn't confirmed yet -.-
 
If you have an existing class that has an int? member and you want it to implement the interface, you could add a new member, of type int, which simply returns the value of the int?, or throws an exception if the value doesn't exist.
 
Considering my first project to be playing a video game.
 
7:21 AM
Make a dota2 bot :D
 
@Metallkiller mine isn't either, i don't care and will start working on it now
 
Been recommended Tensor Flow
I'm not OpenAI with team of 20-30+ people haha
just individual hobbyist
 
@Nerdintraining I'll talk to my boss, then probably talk to Mrs Blumberg (the IHK women who is responsible for everything). Then I'll start.
 
@Metallkiller Tell me what she says
 
Also 72h = 2w-1d
Will report in
 
7:23 AM
no 70h
 
There is very good YouTube series, he also writes many articles on the topic also on guy teaching training computer to drive in GTA5
 
@AvnerShahar-Kashtan these classes are auto-generated by EF db-first
 
@MohamedAhmed That means they're nullable in the DB.
 
If they don't need to be nullable, they shouldn't be in the DB either.
 
7:24 AM
There guide is in python however
 
If you have a value that can be null in the DB but not in code, you're asking for trouble.
 
some columns are nullable and some not
 
but it's using TensorFlow libraries which is very good :D
 
What happens if someone updates the entity without the value?
It looks like your interface should expose an int? too.
 
good morning
 
7:25 AM
@AvnerShahar-Kashtan two properties?!
 
@MohamedAhmed If those values are null in the DB, there should be a corresponding state/process for that in your code.
If my Debitcard has money on it, I can pay. If it hasn't got money on it, I can't pay or have to recharge it. If my card doesn't exist, I need to get a card first.
Find out what would happen if your value doesn't exist (=null).
 
@Metallkiller The property (column) is not that significant, it is just a Serial for ordering rows
 
Then why do you need it in an interface?
And if it's for ordering, why can it be null?
 
@Metallkiller there has been a reply on your issue
 
Does null equal "order doesnt matter"?
@Nerdintraining I know, a few actually, still waiting for someone who knows his stuff to propose how to actually add the different invocation command t chat.
 
7:34 AM
@Metallkiller I didn't design it :(
 
"fwiw the invocation pattern is already a runtime variable.

adding in functionality to respond to users who @ her has been proposed as well #65

I just don't see much work needing to be done here unless you want a listener that tries to parse messages with Cap in them."
hmm how does that work again? xd
 
@MohamedAhmed Those weren't meant to be rethoric questions, they were meant to help you build your interface/process ;)
 
@CapricaSix listofcommands
 
thanks any way
 
You know there's a problem with your architecture when you find yourself writing a method called GetAlternateSpellings that gets a field name that can be pascalCased or snake_cased and returns a list containing that name as well as the other-case.
pass it "baseName", it will return ["baseName", "base_name"]
 
7:40 AM
...parsin email adresses so you can send a spam mail that looks real because you adress your receipients with their name?
Totally valid architecture
 
@Metallkiller I retrieve a list of objects from a web service. Depending on how I get the objects (via API call or via Export to XML), the field names are rendered differently (XML comes in as camelCase, web-service call as snake_case), for the exact same objects.
 
Guy at a previous company didn't know how to serialize a model to JSON so that public fields are camelCase and not CapCase, so his solution was, for each model, to write an interface, implement a second model class with all the field names in lowerCase, and write a mapper between the actual model and the class.
He did that for over 60 classes
 
Can't you query whether or not its xml, and then adjust you casing?
 
@Metallkiller I have both as part of the same flow. :-/
I think I'm ready to leave this project now.
 
Also, morning o/
 
7:44 AM
\o
 
Uh crud madara is here I mean, hurray madara is here
 
o/
Unfortunately I was unable to teach Cap to say crud me in ascii
@Nerdintraining You know which one
 
Also @Nerdintraining..why do you have time to chat when you should be doing your project?
 
@Metallkiller got 2 hours to spare i am burning thme right now ;D
Aswell did you fix your computor?
 
8:30 AM
API or Api?
 
8:44 AM
ahoy o/
 
@SebastianL Microsoft's C# naming guidelines say Api.
It's a good enough style to follow, assuming you don't have an existing style.
 
Microsoft's C#'s naming guidelines say Api
Microsoft uses API
 
Anyone knows, why am I getting, that my long value on XML/XSD is not valid Int64 ?
<DataStorage>3124557217859193281751840123</DataStorage>
 
That doesn't look like a valid Int64.
 
Severity	Code	Description	Project	File	Line	Suppression State
Warning		The 'DataStorage' element is invalid - The value '3124557217859193281751840123' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:long' - The string '3124557217859193281751840123' is not a valid Int64 value.
how should it be then?
<xs:element name="DataStorage" type="xs:long" />
 
8:50 AM
That number is several orders of magnitude larger than what Int64 can hold.
 
wait, what
 
Int64.MaxValue is
9223372036854775807
vs.
3124557217859193281751840123
 
ahh
okey
 
anyone good with multithreaded stuff?
I want to collect a list of stuff from several sources
 
@Wietlol I know all / multithreaded stuff / about
 
8:52 AM
but as each source takes quite some time, and they are completely unrelated to each other, I can call them using different threads
IList<Stuff> allStuff = new List<Stuff>();

Parralel.ForEach(sources, source =>
{
    IList<Stuff> someStuff = source.GetStuff();
});
in simple terms, this code gets all the stuff from each source, and creates a list to hold everything
but how would I add all the items to allStuff?
or what other method/approach should I use
 
Does the order matter?
 
the parralel foreach is what I used to use
but i never had to return one big collection
the order doesnt really matter no
 
You can have each function in the Parallel.ForEach add its contents into a shared collection, like a ConcurrentBag.
 
but that is mostly because I will sort them later
and then at the end, I loop through the bag and add everything to a list?
 
AsyncSubject<Stuff> subject = new AsyncSubject<Stuff>();
...
foreach(Stuff stuff in source.GetStuff())
subject.OnNext(stuff);
...
subject.Subscribe(<what You want to do with collective stuff>);
 
8:58 AM
@Wietlol Just call ToList() on the bag.
Another way is to use tasks: sources.Select(source => Task.Run(source.GetStuff); You'll get an IEnumerable<Task<IList<Stuff>>> - a list of tasks whose result is of IList<Stuff>
 
but then I still have to get all the values
 
await Task.WhenAll(sourceTasks);
IEnumerable<Stuff> allStuff = sourceTasks.SelectMany(task => task.Result);
This will merge all the Results of the various tasks.
 
hI GUYS, wHEN i AM LAUNCHING THE visual studio
I am getting error saying that
Exception has been thrown by the target of invocation
in windows 10
any idea ?
 
There's an error that is thrown by the target of the invocation.
 
@RoelvanUden I think you might be a bit hasty in your judgement here.
 
9:07 AM
welcome dead pirate
 
It might be clearer to use a ConcurrentDictionary instead of a ConcurrentBag - each source adds itself to its own entry under the dictionary, so there's probably no locking.
 
what version of C#/Asp.net is required for that async call?
 
4.5
Actually 4.0 with VS15 IIRC.
 
> The 'await' operator can only be used in a method or lambda marked with the 'async' modifier
 
Or 13 even.
Your method must be async (return a Task) to use await
 
9:11 AM
@AvnerShahar-Kashtan that is my call
 
Task.WhenAll() returns a Task that wraps the inner tasks.
Are you sure you didn't call Task.WaitAll by accident?
It's a common auto-complete error.
 
copy'n'paste doesnt fail me :D
on the other hand, is it required to do that call?
and does it not create 2 different collections?
 
If you don't, calling each task's Result will hang until it's complete. The call ensures that all tasks have completed in parallel before accessing the results.
 
as it is a direct result from a Select
 
You pass it a collection of Tasks, and it creates a new Task that completes when all your tasks also complete. Then, it creates a new collection containing the Results of all the source tasks.
 
9:15 AM
but "sourceTasks.SelectMany(task => task.Result)" creates new tasks as it goes to the sources again and does the Select again, which creates the tasks
 
Hmm, yeah. So call ToArray() to get a concrete list.
 
Watch out with concrete, once it sets, it's difficult to adjust. Adjust it while it's not set yet!
 
> public static Task<TResult[]> WhenAll<TResult>(IEnumerable<Task<TResult>> tasks)
.net 4.5
 
Ah, it's complaining that your method isn't marked as async
 
C#6
"your method" is the method I want to call with await
if I mark my own method async, then I must return a task
 
9:20 AM
@Wietlol No, your method is the method where you have the await call.
 
but I dont want a task, I want a collection
 
Yes. Async has to go up all the way.
You want a Task<Collection>. And the one calling you will await it.
 
then what is the purpose of this?
 
if it has to go up all the way, you cannot call this method from a non-async method
which you cannot call from a non-async method
then there is literally no purpose of this thing whatsoever
 
9:22 AM
Read the docs. Async/await is an incredibly powerful construct.
 
Of course there is. What's your root method? For instance, in a web service, it's the controller method that's called for the request. Using an async-aware framework, like WebApi, you simply mark that method async, and everything going forward also async, and it works - the framework knows to dispatch and await the call.
 
that said you can just do the select on .result and cause your thread to block
inefficient as fuck, but works.
 
@RoelvanUden No, that would block each thread, one after the other.
If you have to block, block on the WhenAll task.
Task.WhenAll(sourceTasks).Wait()
 
Still, why even
 
@AvnerShahar-Kashtan the problem with that is that you are now required to have an async method to call my method that loads the stuff
 
9:25 AM
var tasks = sources
  .Select(x => x.GetStuff())
  .ToList();
var results = tasks
  .Select(x => x.Result);
  .ToList();
Which should work just fine. It's just inefficient.
 
@Wietlol Yes. That's a legitimate requirement. Because the moment you don't have an async method, all the benefits of async go out the window.
 
then you go all the way back in your application marking every single frigging method async, probably breaking your entire application
and also, you now change your code based on what you use
which is literally the wrong direction
 
It's not if you care for performance. Java is a terrible example when it comes to that.
 
@Wietlol That's like saying making your method return IList instead of ICollection is "changing your code based on what you use". Of course it is.
 
Incorrect approaches result in two things: refactoring or going with the not best approach. It's up to you.
 
9:27 AM
If you don't care for performance with I/O bound ops, don't look into async/await.
 
that is not the same though
 
It's changing your code to do what you want it to do, which is be asynchronous.
Being asynchronous is part of your interface. It's part of your contract.
 
changing a type from IList to ICollection is completely unrelated
I mean for example, you have to use a different framework if you want to use x method that someone wrote
 
The problem is that you're still thinking of your method as "returning a collection". No. It's returning a Task, a promise of an asynchronously generated collection.
 
but you want both method x and method y
and now you are fucked
I dont want to return a task
I want to return a collection
maybe even an enumerable just for the sake of not caring
 
9:28 AM
@Wietlol If you want to return a collection, then you're not doing asynchronous processing.
 
@Wietlol "I don't want my code to be efficient". Then don't. Use what I said and move on.
 
I dont want fancy await stuff
I just want to have several threads do something for me, let them come together and merge all their results
and I want to return that result
 
@Wietlol Why not? Because you don't want to learn what is the de-facto coding style for efficient asynchronous operations for the past 5 years at least?
 
4 mins ago, by Roel van Uden
var tasks = sources
  .Select(x => x.GetStuff())
  .ToList();
var results = tasks
  .Select(x => x.Result);
  .ToList();
 
Don't use async, then.
 
9:29 AM
^
 
@RoelvanUden efficiency vs behavior is completely unrelated
behavior = return Task vs return Collection
efficiency = use one thread vs use multiple threads
 
@Wietlol This is like saying you'd rather just return an ArrayList, instead of a generic List<Stuff>, because you don't feel like using the fancy Generic stuff.
 
@AvnerShahar-Kashtan thats not the same
you can use ArrayList just as easy as List or List just as easy as IList (to keep it C#)
but you must change your methods to handle my async method now
and you must go through all your code refactoring everything
 
@Wietlol No. You return a promise, that promises that If you get a result, it will be of given type. Refactoring to async isnt usually that great of a deal either
 
No, it's not. It's related. Just look at what the entire world is doing with asynchronous processing. Look at what is happening JS. There are promises, promises, not 'plain results'. Because they must be asynchronous, it's forced upon them. C# provides the same performance benefit using async/await. It can literally allow you to process 10x-1000x more I/O requests per second on the same hardware. That's why it exists!
If you don't want to use it, fine! But move on from this discussion.
 
9:32 AM
ConcurrentBag results = new ConcurrentBag;
int running = 0;
foreach(var source in sources)
{
  running++;
  new Thread(() => ProcessSource(source));
}

ProcessSource(Source source)
{
  ConcurrentBag.Add(Source.GetResults());
  running--;
}
@Wietlol
 
@KamilSolecki I just wanted to get a big collection and people throw await/async stuff at me
 
Now, wherever you want to wait for your results, go while(running>0)sleep(10);
 
assuming it is what I want :(
 
Yup. No point in arguing wether async is an incorrect approach, If you started off not using it (and from mine, and most likely all other peoples perspective, that was a mistake)
So, either refactor everything or go with your lesser approach
 
@Metallkiller that sounds like, 1, a bad idea, 2, has been done before and mapped into a class/function
 
9:34 AM
async/await was one of the first things people tried to teach me when working asynchronous. I still don't get it. I just use bgw or make new thread do my stuff.
@Wietlol Maybe Threadpool. Or, indeed, parallel.freach.
Also, why should that be a bad idea
 
@Wietlol I already said how you can do it the inefficient way, use that like an average copy/paste brogrammer and don't bother thinking about doing things the correct way. This is SO, after all!
 
@RoelvanUden but what do I use instead of it then?
 
10 mins ago, by Roel van Uden
var tasks = sources
  .Select(x => x.GetStuff())
  .ToList();
var results = tasks
  .Select(x => x.Result);
  .ToList();
 
that still uses parallel processing to not make each source wait for another
GetStuff() doesnt return a task
 
Then you just need to kick them off first.
 
9:37 AM
it returns a list
 
foreach(var task in tasks) Task.Run(task);
Then just use a Parallel.ForeEach
 
and then just using a concurrent bag to throw all the results in?
 
@RoelvanUden I came to ask about Task.Run and , I saw this :'D
how to pass the method name to Task.Run?
 
Task.Run(() => myMethod());*
 
The call is ambiguous between the following methods or properties: 'Task.Run(Action)' and 'Task.Run(Func<Task>)'
 
9:41 AM
Task.Run(myMethod)
Task.Run(new Action(() => MyMethod()));
 
Easy: Cast the whole Lambda to an action
 
@Metallkiller this works
 
I think .Run doesn't take a methodgroup, does it?
The thing is, I don't get the Func<Task>
Why would it make it a Func<Task> ?
 
@Metallkiller I thought of that too
 
What does your method return?
 
9:46 AM
void- parameter-less
 
10:13 AM
--> just Task
 
10:26 AM
in Asp.net, is there any way that I can do "HttpContext.Current.Server" without the Current ?
I need an HttpServerUtility
 
Wait...why shouldn't I place panini in questionable places?
 
!!panini
 
May 4 '16 at 14:23, by Caprica Six
Jan 12 at 16:55, by Markus Werner
to all stupid put all "Panini" in your asshole
 
10:53 AM
@Wietlol you may like this article
 
Is this:
subList.OfType<IListHasSerial>().ToList();
the same as this:
subList.ToList<IListHasSerial>();
 
but if I'm sure that subList is of type IListHasSerial
 
mr5
11:09 AM
@MohamedAhmed use the .Select to make the list of type List<T> without using that
!!wat
 
the latter is more like IEnumerable<IListHasSerial> e = subList; var result = e.ToList();
the former accepts a non-generic enumerable and tries to as IListHasSerial to check the type of each element and you don't need that
 
11:38 AM
@milleniumbug i like the style of writing already "Because our strawman is a modern shitty language, we also have first-class functions."
@milleniumbug also... (still reading the blog) there is another function, a blue one that resolves the value of a red one
at least... it does in Java...
which I was looking for in C# earlier today
 
> You can avoid the pain of async in C# by using threads.
Alright I'll bite. WAT?
 
11:54 AM
0.o?
 
I'm sorry this is exactly like "You can avoid the pain of strict type checking by passing everything in as object".
 
the "pain of async" seems to refer to necessity to accomodate going async all the way up
 
@KendallFrey ow, I didnt read so far yet :D
 
@milleniumbug There's a fatal flaw with that reasoning. That's not usually necessary.
 
These are language constructs that serve a purpose. Sure, they restrict you, but that's because they're trying to provide a specific set of features. Can you do everything async/await does by manually managing threads? Sure. And it will seem simpler at first. Until the first time you'll try to propagate an exception with its call-stack from within a thread.
That's what libraries do. They give you functionality at the cost of flexibility. You can have all the flexibility you want by sticking as close to the metal as you want.
 
11:56 AM
I agreed with most of what the article said until it started saying that await wasn't a good fix
 
the async parts and non-async parts are not always compatible. There are no async constructors, so you can't reliably call async functions in a constructor, for example
you have to use a factory method workaround
 
also, you should be able to call an async function from a sync function and simply making it wait for the value
 
There should be async constructors IMO
 
you can, it's just you are never sure if the async function is actually running on a separate thread
that is, there are async functions which don't
 
I refuse to think of async functions as "running" with regards to threads, because it's a nonsensical idea
 
12:04 PM
@Wietlol You can. Just call Wait on the async function.
In another topic - do any of you know of a simple util (or ideally, C# line of code) to check a remote host's SSL handshake info?
 
if you are 100% sure these are on their own separate threads, call .Wait() or .Result
 
There is the event loop style async which does make you think about sharing the thread though
 
openSSL can do it, but I don't want to drag a copy of that, along with Cygwin dependencies, onto my production server.
 
@AvnerShahar-Kashtan according to Roel, you cannot
you can never run multiple threads at all without making every function in the stack async
 
threads are threads, asynchrony is asynchrony
 
12:06 PM
tasks*
which are easy to use with await/async
 
@Wietlol Ehm no
 
@KendallFrey Indeed, you could wrap Unix-style select with C# async/await and it wouldn't be running on a thread
 
idk what that is
But it's trivial to create async functions that run on any specific number of threads, including 0.
 
12:21 PM
Asked this earlier but for new people in the room, anyone learning about neural networks? Also people who have learned AI techniques that can recommend good books or guides for C# TensorFlow.
I have read many python source codes, I get the general idea at this point but I'm not big fan of writing python, i can read it however
 
Anyone know if i use a Battery with 4500mAh instead of a 5200mAh one, it's fine or bad for my laptop ? O.o
idk where to ask this question tbh, but i don't trust this Asus Shop ... he they don't have 5200 one for my laptop but they got 45000 and its fine ! no worry O.o they say there isn't one for me in the whole city atm
 
As long as it fits, it will be fine. mAh is the capacity of the battery, so going from 5200 to 4500, you will see a drop in how long your battery lasts during use, but otherwise, it will work just fine.
You do want to make sure the voltage is within spec, too much voltage will fry components and too little will simply fail to power them.
But I've never heard of a battery being applicable to that situation; typically its the chargers you need to pay attention to regarding voltage.
 
@milleniumbug i guess that article describes how I never had this trouble before
I worked quite a lot in Java (including any other JVM language)
and I grew quite fond of it
 
Ok Thanks, I guess its fine then, tbh my own battery wont charge anymore, 5 min and it will die, if it wont make my laptop get ruined over time or something, i dont mind having a weaker battery over a dead one lol
 
in Java, I learned how to do things with Threads directly
in C#, having different Api's I was missing certain methods that I really use a lot in Java
and with missing, I dont mean that they are named differently or that they take in different parameters, but literally I cannot find any method that has similar behavior
 
12:31 PM
Can you give an example?
 
hence my question about a parallel foreach that returns the results
which in turn led to "ow you just use await and its all fine"
 
and, as I never used await, none of my functions are async
 
not related really but a great tutorial on threads in c# anycase
 
and for some reason, its stupid to do a wait in the function that you want to make simple
and you have to make your functions return a Task<T> instead of T because that is more efficient
even though, the code that would call your function now must change so it handles a Task<T> instead of a T
and that has to go back to the root of your application
(noone told me to use wait for whatever reason)
@Nerdintraining i suppose you mean the entire article
not only from that subject/chapter/w/e
 
12:39 PM
@Wietlol yeap it's super
 
12:58 PM
Ha! I'm back
Good morning
 
01:00 - 13:0013:00 - 21:00

« first day (2557 days earlier)      last day (2390 days later) »