« first day (3112 days earlier)      last day (1839 days later) » 
00:00 - 11:0011:00 - 22:00

11:00 AM
sadly, cleaning, compiling, packaging, validating, deploying and swapping takes about 5 seconds in total
(testing left out for obvious reasons)
 
@Wietlol you need to add a "coffee" phase to your compilation
 
but if you have a production-line, which you can't afford to stop, because (e.g. a metal melting furnace) it costs $$$ to stop and start again
 
@Neil I cant drink coffee in 5 seconds... oh... I C
 
@SebastianL In those cases, I assume they would necessarily have to hire more people yeah
if they want to make the same output
Though interestingly, companies who would like to let people go (in Italy, very difficult to find justification to fire someone), this would be a perfect solution
 
anyone knows of a nice way how to deal with this?
without doing either of these
Func<String, String> foo = bar.Foo;
var foo = (Func<String, String>) bar.Foo;
 
11:04 AM
cough dynamic
 
ew
double ew
 
can't foo be a delegate?
 
nope
the delegate would be Func<String, String>
but the method group conversion to that delegate wont work without explicitly specifying that it should be that delegate
 
i can only come up with even more ugly solutions
 
like... I know what it is, and the compiler knows what it is, why do I have to specify it???
 
11:07 AM
why do you even need a reference to a method from another class without the reference of the class itself?
 
because I need a reference to a method
 
but why not passing bar
 
because I need a function for String -> String
passing bar makes the dependency explicit
im trying to get function based dependency injection working
but C# is just so much behind in technology :p
 
then there is no way around Func<String, String> i think
 
I guess so
 
11:10 AM
sounds interesting :) (function based di)
 
its what I used quite a lot actually
mostly because I didnt do di for a long time
so I didnt really do it based on interfaces
 
@Wietlol so if I have a string that I need to change, and I know I won't be needing it later on, is it still a standard to create a new variable for that purpose?
 
if you have a string you need to change, you need to change the thing that refers to that string
for example, the property
 
@Wietlol You're going functional here. C# is object-oriented. You want F#.
 
Text = Text.Replace("old", "new");
for example
@Squirrelkiller I want a compiler that works for me, not a compiler I have to work for
that should be working independent of which language you use
 
11:13 AM
@Wietlol I want freedom everywhere
 
freedom is an illusion
 
time is an illusion, therefore freedom is time
 
-_- method group isnt even convertable to System.Object
WHUHAIIII!?
 
@Wietlol what if I just wanna change some characters in the string?
string x = "foo bar bar foo";
StringBuilder y = new StringBuilder(x.Substring(0, 1) + x + x.Substring(0, 1), (x.Length + 2));
Console.WriteLine(y);
 
Time is just related to change position in dimension
 
11:18 AM
method group is nothing you can ever use
 
except when you need to pass a lambda function, the compiler will make an exception here and automatically convert a method group to an action
Only an Action is capable of being written as a method group
@J.Doe Define freedom, and tell me how far you can go without impacting my freedom.
Anyone here who made a table in gitlab markdown? I can't get a fucking table to render.
 
11:32 AM
@Squirrelkiller Pure anarchy and that all
 
And you dont think somebody would pretty quickly kill or seriously hurt you?
 
@PawelFlajszer then you should keep string as char array
 
@pwrigshihanomoronimo makes sense. thanks.
 
11:48 AM
@PawelFlajszer if you want to change some characters in the string, you get a new string
iirc, you can use concatenation
aka, x + y + z
compiler should optimize it for you
(ofc, I often hold the C# compiler in higher respect than it deserves)
 
well... I'm used to concatinations. I find it hard to believe that you'd safe much GPU using StringBuilder instead, unless maybe you're dealing with millions of strings. correct me if I'm wrong
 
if you use a loop for example:
 
also GPU nowadays
windows takes full advantage of the GPU as an additional CPU core
 
while (condition)
    str += stuff;
then you really want a stringbuilder
@Neil ty
especially if the string gets longer, this operation (using concatenation) would take longer and longer every iteration
 
12:11 PM
you could write some container like StringWrapper, which will have Queue<string> internally, and override + operator as well, so when you do concatenation, no new strings are created so it will look convenient like stringWrapper = "test" + stringWrapper, but underneath it will invoke Queue<string>.Add.
it will work well for large amount of string if you don't care about iteration time ;P
looks like a mad approach a bit
 
you mean a StringBuilder?
 
no, I mean custom class
do not know how StringBuilder is implemented
yea, something like it, I guess
 
hmm... C# stringbuilder works slightly different
a bit weird even
 
2k lines of code for text concatenation :D
 
meh
hmm... Java's StringBuilder is only 489 lines
the first 84 are dedicated to documentation even
(3 blank lines, 1 package declaration and 1 import statement, 79 comment lines)
 
12:18 PM
out of 2k ~400 are comments
 
mm unsafe code as well :d
 
ah, I see why
Java cheats
class StringBuilder extends AbstractStringBuilder
 
lol Comment of line 347:
// Copy these into local variables so that they are stable even in the presence of ----s (hackers might do this)
does ----s stands for some sort of insult?
 
@Wietlol why? it always operates on 2 variables( string str and var stuff)
it should take the same amount of time
every time
 
not really
a string is basically a char[]
if you concatenate two arrays, you need to make a new array with the combined size
then you need to copy all the elements from both sources to the target
 
12:22 PM
so it has to iterate to find the NULL char? \0
every time?
 
@Wietlol depending on the implementation of [] you can reroute the pointers :D
 
concatenating two 1.000.000 element arrays is slower than concatenating two 1 element arrays
@SebastianL [] = array
 
yep
 
@PawelFlajszer no
it has to iterate to load all elements
the char[] doesnt have a null character
 
@Wietlol also arrays with that big of a size should be avoided to avoid memory fragmentation
 
12:30 PM
that too
but if you need that much data, you need that much data
 
you would tend to favor linkedlists with smaller more manageable arrays
 
@Wietlol ah, because we know the size of an array as we have to declare it, right?
 
no
 
the array has a length property
arrays are length + data
@Neil even more data?
 
12:32 PM
@Wietlol even more data what?
 
linked lists
or wait
you mean LinkedList<Array<T>>
 
when you require arrays of a certain size, it becomes increasingly less likely you will find a contiguous space in memory to hold it
a linkedlist of arrays lets you break it up into bite-sized pieces
but you'd only do this for massive arrays
 
@PawelFlajszer arrays are a type which uses the most simple strategy of storing stuff: consecutive memory allocation. so you declare an array[n] and it will allocate x * n bytes in consecutive memory to make it as easy as possible to get access
 
@SebastianL yes, yes. char* do have a NULL character at the end though, right?
 
im wondering if there is a collection type that uses a similar approach as a List<T>
but on removing, it would replace the removed element with the tail
I have used collections like these quite a lot, but I never used them in C#
 
12:35 PM
string manipulation doesn't seem so bad as I thought in c# anyways
 
@PawelFlajszer that is C
this is C#
 
but c# uses pointers as well
 
Java as well
JavaScript too
as almost every other language does
I dont know any language that doesnt use pointers
 
this is the implementation of the String class
 
if you mean references, then sure
 
12:38 PM
well yeah, but isn't that the standard way of determining end of the string? finding a \0? I'd assume languages that are not really asking you to deal with it, do it under the hood themselves
 
it implements IEnumerable<char>
so no null character
 
every underlying framework ultimately pushes around memory addresses in the end
so they're all "pointers"
 
@PawelFlajszer only silly languages do this
most, more mature, languages, use a length property
 
@Wietlol and by silly you mean low-level?
 
by silly, I mean, languages that make a list of assumptions you dont want to make as a language
such as "the null character will never be used in a string"
"strings will always be in ASCII encoding"
etc
 
12:40 PM
aren't most of those mature languages built on the silly ones in the first place? ;>
 
not really
they are often based on them
not built on top of them
 
!!meow
 
disgusting
 
OakBot is better
 
12:41 PM
!!meow
he is
 
lol
 
fact: a human being's mouth has far more bacterial diversity than the mouth of a dog or a cat
 
Does anyone have any recommendations for open source projects that they feel is high quality in terms of code and design?
 
1:03 PM
Do u mean license?
 
@EnterTheCode I assume you are looking for C# projects...
 
@Wietlol - Yes
 
im sorry, I have yet to find a well designed and clean C# project :D
 
1:20 PM
@Wietlol - Thanks for the reference, I'll take a look. I was hoping for a C# project too. Not a single clean one? :)
 
im picky :)
I do recall me being quite surprised by how well designed something was recently... but I forgot what it was
(no guarantees it is C# tho)
I cant remember what I used it for
 
1:39 PM
Checking my flagging history, I see 1,257 total flags, but 111 disputed & 434 aged away.
Should I worry? 434 seems a lot, looks like I were flagging irrelevant content
 
@bradbury9 flags "aged away" - what's that?
 
The description says something like "you flagged but nobody could review it on a proper time" so I wonder if I flag irrelevant content or if is normal (too many flags to review)
 
oh. never seen it.I don't have any of those and I've flagged 4,414 currently
 
I've never flagged anything
 
And IMO I flag very irrelevant stuff, like outdated / even hidden comments
 
1:48 PM
Exact description: "aged away" flags are those no one was able to handle within the time allowed by the system.
 
@bradbury9 I guess you can ask on meta if you're curious
27
Q: When are flags marked "aged away"?

Jesse de BruijnePlease note that I'm fully aware why flags age away and I know what alternate actions I can take. I was looking through my flags, and I noticed something odd. A rather recent flag (flagged one week ago) was already marked as "Aged Away". Meanwhile, older flags (two to three weeks ago) are still ...

 
Interesting, looks like I flag content that does not receive visits, AKA irrelevant content ^-^
The funny thing is most of my flags are for closing because of duplicated/lack of mcve, things like that... And that content is subject to not recieve many visits
receive*
 
2:34 PM
In the editorconfig, do I put the more general rules (with [*]) at the top or the bottom? which way does it get parsed/used?
 
2:46 PM
Who is behind editorconfig? A group? Company? Who?
Anyway bye
 
mr5
me
nooo
 
TIL Groovy has extension lambdas
in a way that looks way more interesting than the way kotlin does it
 
mr5
wiet, what language were you using earlier?
 
my own :p
 
mr5
is that jaba?
oh
looks like jaba and c#
is it working already?
 
2:51 PM
mostly based on Java, Kotlin and Haskell
@mr5 not as far as I want it, sadly :(
 
mr5
do you open source your compiler?
 
I could
I have everything in bitbucket, which defaults to private repos tho
if I make something public, that is a decision to make it public
 
mr5
what's stopping you from making it OS?
 
im lazy
 
mr5
I've made a simple 8051 MCU simulator before. Maybe I can help?
 
2:54 PM
sure... except I would have to write down the specs...
 
maybe not a bad idea anyway
 
mr5
I did not publish mine cuz it was paid thesis from my batch
 
@Wietlol Put it on gitlab. FUck bitbuckets, it's ugly.
 
it wörks
 
mr5
2:55 PM
what if someone fork your code and did not credit you @Wietlol ?
 
Also make it OS obviously
 
mr5
Just so you know, GitHub already have a free private repos
 
@Squirrelkiller as long as I dont need to make it Mac OS
@mr5 I dont think I care
its not something I earn money with
and his fork is preventing me from gaining money
if it would... I am not sure I would make it open source in the first place
 
mr5
what if he takes all credits if someday it becomes big?
 
I would laugh
 
mr5
2:58 PM
ohoho
the horror of open source
 
I love horror fantasy movies :D
 
mr5
what do you call to your comp. prog again?
Wiet#?
 
comp?
prog?
 
mr5
computer language
 
prolly Wietlang :p
 
mr5
3:00 PM
I mean to say, computer language lol
 
someone suggested hyperscript...
it appears that it already exists
 
mr5
you know, the word "lang" in our language means somewhere between just, only. So if you say wietlang, it sounds like you're telling them, "just wait"
 
Hello
 
mr5
y not wiet charp
 
wiet-harp ?
Jawa
im still open for suggestions
but for the time being, it is called Wietlang just so I know where to find my project
 
3:04 PM
I'm using MVC and trying to submit a form to a controller. The view has a few partials, and so I want to create different methods to handle the post-backs. But I don't know how to get it working. If I use a method in the controller that matches the name of the parent page, it works, if I try to use a form helper, and direct the postback to a differnt method name, it fails.
I'm new to MVC so go easy on me.
 
I could also call it Ben
 
My form helper looks like this:
@using (Html.BeginForm("NewMethod", "MainView", FormMethod.Post))
 
mr5
@Wietlol green lion programming language
 
My class "MainViewController" contains a method "NewMethod"
 
Majesticlang
 
mr5
3:07 PM
Use place name?
 
Dutch
good one
 
C'mon kids, help a dinosaur out.
 
mr5
deuthschlang
 
I just assumed your generation : P
 
mr5
btw, I'm 72
 
3:08 PM
I'm just trying some controversy to get attention.
 
mr5
One more cough and my ribs are out
 
Can you cough up an answer to my Q?
 
mr5
That'd be my last cough of tea
 
"One more cough of coffee before I go..."
I'm using MVC and trying to submit a form to a controller. The view has a few partials, and so I want to create different methods to handle the post-backs. But I don't know how to get it working. If I use a method in the controller that matches the name of the parent page, it works, if I try to use a form helper, and direct the postback to a different method name, it fails. BAD REQUEST
 
mr5
I'm not reading anything kiddo
I have astigmatism and 1/1 vision
@SeaCharp it's very simple when I do that in PHP
 
3:13 PM
It's very simple when I do it in webforms, too. But this ain't that.
 
mr5
Back in my days, I only need XAMPP bundle > Configure database in PHPMYADMIN > type some simple scripts in PHP then host it on any free hosting
 
I read MVC
I am out
 
mr5
I'm sorry. I have not yet tried MVC but I saw some of them codes with my colleague.
 
anyway, im off as well
 
mr5
dotatu as well
 
3:16 PM
guess ill make a public repo and start writing dem specks
 
mr5
yeah
don't forget to post the link here
 
sure
 
@SeaCharp Bad Request is a strange one in that scenario
 
Yeah
I'm sure it's something dumb.
 
no wait, ignore me, that's what it tends to give you when the ModelState is invalid in some way
what's the action method look like?
 
3:27 PM
public async Task<ActionResult> NewMethod(int? id, int? groupId)
This is on a "Detail" page. If I name the method "Detail" it works fine.
 
And that's the only difference?
Hmm
 
OK, I just had a breakthrough, kinda
I don't understand the way that views pass models back to the controller / method, so I'm just stabbing at the wind, but...
 
hmmm got an @Html.AntiForgeryToken() in there?
 
I added this on a hunch.
FormMethod.Post, new { id=1, groupId=1 }

Now the method runs (WOW!) but it only passes in the groupId not the id. weird. And besides, I want the original ID that is posted to the details page, and I want the groupId to come from the dropdown in the form.
 
well you have the values available in the markup though right?
so that's not a problem
 
3:33 PM
So that's the question now. When using a form helper in a partial (relevant?) how do I pass the parameters passed to the parent page into the form method? And the control values?
 
I haven't done MVC in a while. It should just be sticking those values in the body, form encoded though, I think
and the variable names come from the names of the input controls, I think. Same as regular old HTML forms, because there's no Razor in the browser
 
Am I the only one who has never gotten LINQ's .Cast<T>() to work? Always "uncastable".
 
In other words I'm on the detail page for a record. The ID is passed into the original Index method of the Detail page controller/method. Now I have a form helper and need to get that value and pass it through to the form, as well as the value from a dropdown in the form.
 
So the form helper should render controls for each property in the model, but I assume you don't want the user to be able to amend the id
 
Trying something...
 
3:39 PM
Try stripping out the form helper completely and writing the form markup by hand with values you know are right, and see if that will submit
then work backwards to what you need to pass to the form helper to get it to generate that
 
3:53 PM
@MikaelDĂșiBolinder I think so? Never had a problem
I guess you're trying to use it to do something that doesn't make sense
What would you expect it to do when the sequence contains elements that don't cast to the specified type?
 
OK, so the following helper works, the form is submitted, and the value of the dropdown (groupId) is passed into the method in the second param. How do I pass the id (first method param) which originates in the page url?

@using (Html.BeginForm("NewMethod", "MainView", FormMethod.Post, new { } ))

public async Task<ActionResult> Permit(int? id, int? groupId)
 
4:20 PM
OK, just passed the original ID in through a hidden field. Never liked to do that in webforms, feel like an old-school Access/VB6 hack.
 
 
1 hour later…
5:38 PM
@SeaCharp the MVC examples have it as part of the path
the helper gets it from the route table AFAIK
hidden fields are used for the antiforgery token as well, so it's not exactly a big smell
p.s. there was a lot that was hacky in webforms and you complain about that? ;)
 
6:08 PM
@MikaelDĂșiBolinder Box casts don't work, fwiw
@SeaCharp Nothing wrong with that as long as you validate it somehow, if necessary.
 
6:36 PM
Hey Sea Charp, check this out >> stackoverflow.com/questions/2246481/…
In short, you would want to create a new custom route to allow the multiple paramater
 
 
7:14 PM
Folks, can I do this to an event?
Validation.Error = ValidationErrorHandler <!-- in XAML -->
public EventHandler<ValidationErrorEventArgs> ValidationErrorHandler; // in codebehind
Then my ViewModel could provide handlers which would be hooked-up to the public event exposed by the View .
 
8:02 PM
I think you can
<YourTag Error="ValidationErrorHandler" />
If the control exposes the binding property
@NickAlexeev I guess you're long gone so I'm pinging you so you find this later.
 
8:35 PM
Took me 3 hours to figure out ef core does result caching. Is there a way to ensure noting in a context gets cached
 
what in c# acts like a for...of loop via javascript
 
foreach(var element in elements)
{
}
 
can it evaluate an array of objects?
var test2 = [{id: 1, prop: 'casey'},{id: 11, prop: 'candle'}];
var second = new Map();
for (const value of test2) {
    second.set(value.prop, value);
}
 
Hi, is there a library in .NET similar to Guava's EventBus (github.com/google/guava/wiki/EventBusExplained)? (To clarify it a bit: the EventBus library allows you to subscribe to messages and publish messages in a way that you don't need to specify a custom interface... you basically just use annotations to mark methods that will receive a certain message type.) I like it because it allows me to decouple code quite nicely.
 
like that
 
8:55 PM
@ChristianMatthew foreach (var value in test2) second.Set(value.prop, value);
in c# the type always goes in front of the variable:
public const string Name = "Chris";
C# is a strongly-typed language - each variable has to have a definite type at compile time. (Except for dynamic. We don't talk about dynamic. Except when we do. But we're usually joking then.)
And you cant jsut go all JSON in here
You have to put newin front so the compiler knows you wanna build a new object
@Martin Annotations are called Attributes here and I have no idea.
 
9:11 PM
@MartinVseticka not aware of an attribute-based subscription mechanism in .NET but I'd imagine someone must have made one
 
00:00 - 11:0011:00 - 22:00

« first day (3112 days earlier)      last day (1839 days later) »