« first day (2673 days earlier)      last day (2292 days later) » 
02:00 - 14:0014:00 - 22:00

mr5
2:32 AM
o/
\o
\o/
@KendallFrey why would you even need RegEx for this?
 
easier
 
mr5
aside from being not-so readable, I also find those kind of code unmaintainable
 
How would you parse "rgb(123,12,1)"?
 
mr5
hol up
"rgb(100,  200,    50)"
.Replace("rgb", "")
.Trim('(', ')')
.Split(',').Select(e => e.Trim());
"rgb        (100,  200,    50)"
.Replace("rgb", "")
.Trim()
.Trim('(', ')')
.Split(',').Select(e => e.Trim());
 
@mr5 eh wtf
 
mr5
what's wrong with that?
 
It's a very verbose way of doing what a regex does with one line
 
@KendallFrey Start learning Haskell, Lisp and ML, and also learn Prolog. I like to view these languages in terms of families. The more different a language, the more you need to learn it
 
Have you learned any really off-the-wall paradigms, like Befunge or REBEL?
 
3:12 AM
What is REBEL in a nutshell
 
A list of regexes and replacements, that gets iterated on forever
it's like a string rewriting system
It has no concept of control flow, which makes it pretty different
 
I hate regex
 
I love it
Did I mention I'm writing a regex engine
 
Is it PCRE?
As in does it support it?
 
No, it's NCRE
.NET compatible
 
3:20 AM
I hate PCRE notaton. It burns my eyes
 
which part?
 
Any lengthy expression in PCRE causes me to focus my eyes for too long
Like validation of email for example
On paper, the notation looks unwiedly
 
email validation is misuse of regex basically
also it's too complicated anyway and not useful
 
Why do you say so
 
you validate emails by sending one to that address
 
3:25 AM
What if you want to save bandwidth
 
it won't help you anyway
 
You still send an email
 
if your "email validation" is not "check if the string has at least one @", you're overcomplicating it
 
What if you want to check for other things as well
 
oh look "very.(),:;<>[]\".VERY.\"very@\\ \"very\".unusual"@strange.example.com, is a valid email address
 
mr5
3:32 AM
@KendallFrey at least it is readable and easy to understand
 
How about validating parts of programming language notations
Like validating numerical types' values' literals
 
what about them
 
Surely, you can use REGEX for that
By the way, millenialbug what's your opinion on the expectation of familiarity
 
on what
 
Wietlol saying that OCaml is like Perl because he can't understand a single thing that's happening. He argues this is a weakness of OCaml and that since he has experience with 19 languages, he should be able to tell right off the bat what is happening
I objected to that because those 19 languages might be in a conceptual territory that is exclusive of ML's
 
3:47 AM
Just because I know Haskell, don't expect me to be able to understand Idris
 
Elaborate
 
Similarly looking languages may not work the same. You know, false friends and all
 
That's one other thing I forgot to raise. The syntax of a language is no reliable indicator of the functioning of a languag
Another question: Do you believe context free grammars necessarily make the programmer's life easier
 
that is, when a programming language has a context free grammar? A language which is easy to parse is making life easier for the programmer, although "context free grammar" is not the necessary nor sufficient condition for that
 
Well, I mean the programmer of the translator of the language produced by that grammar
If not, any leads to the conditions necessary and sufficient for that
I'd like to start work on a typed Lisp
Or a minimal ML
I might change the syntax radically for ease of understanding for those unfamiliar with the languages
I also think there are some things we need to be let go of
 
4:04 AM
It's good if you can diagnose issues by analyzing the syntax alone. Also don't have language constructs that meaning depends on what the identifier is referring to
Like, in C, A * B; has different meaning depending on whether A is a type or a variable
 
However, when I get a new keyboard, I won't use *
I will use ×
And +
It's an inconsistency to use * for product types and | for sum types
I hate infix notation so there won't be any
 
4:24 AM
There are important features to support
And investigate
 
5:01 AM
Ignoring performance
With algebraic data types you can describe anything
A list can be defined inductively as a sum type
Once you have a list you can define other types
 
 
2 hours later…
7:17 AM
Goood morning sharperinos!
 
7:46 AM
Hey ho
 
Good morning
Is there a feature in C# to check if an object has another object, e.g. Class.Has(Chair)
 
Uh..
That made little sense
 
mr5
!!wat
 
It's called class diagram and is language agnostic
 
mr5
7:56 AM
why is it not kendall anymore
 
Also, VS can build a class diagram for you. Somehow.
 
morning
 
!!kendallfrey
 
wait what
 
7:56 AM
:)))))
 
mr5
!!watkendall
 
@mr5 That didn't make much sense. Maybe you meant: hahkendall, kendall
 
!!hahkendall
 
7:58 AM
I think it's a desirable feature, to check in runtime if an object has another object
 
@MohamedAhmed Please specify. Do you mean whether or not a specific class has a reference to another, of if an object of a class holding a reference has an object referenced with that object?
 
Terminology issues. An object does not have another object. What is the question?
Is an object of type n in an array?
Is type n implemented by type of class?
Is an object of type n useable as object of class?
Whaat
 
Because whether or not a class references another class should be clear at design time
A streamreader has a stream. We know this at design time. At compile time, it may have a stream, and you can check that with sr.stream != null
 
Correction: A StreamReader is a Stream that decorates another stream.
 
Fortunately I never use streamreaders so I can't fuck that up
(Whatever there is to fuck up)
@MohamedAhmed Are you talking about something like dynamic objects?
Because that's just...dirty.
 
mr5
8:09 AM
@MohamedAhmed in JavaScript, you could check if a "property" exist in an object but I'm not sure how you would check its type
 
I think I missed up things
 
@mr5 instanceof in JS, is in C#
 
mr5
!!> undefined instanceof undefined
 
@mr5 "SyntaxError: expected expression, got keyword 'instanceof'"
@mr5 "SyntaxError: expected expression, got keyword 'instanceof'"
 
I was thinking to gift my lead a cup printed on it this line of code : if(!project.Has(Yousef as Lead)) throw new Exception();
 
8:16 AM
@mr5 "TypeError: invalid 'instanceof' operand undefined"
 
And I wondered if this thing already exists :/
 
mr5
if (!project.Contains(Yousef as Lead)) throw new Exception(); // this should work
 
if(!project.Lead == Yousef) throw new LeadershipException();
 
mr5
are you asking if an object exist in an array? therefore, you need to override Equals and use Contains in your IEnumerable<T>
 
!!> function Test() {}; let test = new Test(); test instanceof Test;
 
8:22 AM
@RoelvanUden true
 
!!>while(true) ;
 
@Metallkiller "SyntaxError: expected expression, got end of script"
@Metallkiller Maximum execution time exceeded
 
ohayou
 
good morning
 
mr5
!!> await fetch('https://chat.stackoverflow.com/rooms/7/c');
 
8:27 AM
@mr5 "SyntaxError: await is only valid in async functions and async generators"
 
!!sandbox
 
@Metallkiller Please go and play in the Sandbox
 
mr5
!!> fetch('https://chat.stackoverflow.com/rooms/7/c');
 
Thx Cap
 
@mr5 "ReferenceError: fetch is not defined"
 
mr5
8:28 AM
!!no
 
9:05 AM
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
Morning Nerd
I'm having Apfelstrudel right now :D
 
And i forgot my franzbrötchen in the kindergarden
 
9:22 AM
THat's gonna make one happy kid :D
 
Its unreachable for him in the pram
 
Poor Franzbrötchen :(
 
9:35 AM
that's gonna make one kindergarten teacher happy.
 
They probably won't go through the parents' prams
(hopefully)
 
@KamilSolecki hi. When You came to Budapest. Were any of Your luggages opened at the airport? I'm reading about raising frequent burglary at there.
 
ahoy o/
 
9:58 AM
\o
 
@ntohl wat, are you planning to smuggle watches?
 
@Nerdintraining'questionmark' my plan is to raise awareness
 
ohh. Most likely...
 
Anyone been keeping up with sea of thieves?
 
10:09 AM
I don't watch documentaries aobut you Mister!
 
Can someone please warn me against F#. I'm extremely attracted to it at the moment.
 
0
Q: how to make pagination size of record limit to 10 while return JSON using mvc?

Ivin Rajwhile returning JSON value we are having more than 50 records. I need only 10 record per page after clicking on next button only i need to view next 10 record. <table id="example" class="display table table-striped table-bordered" cellspacing="0" width="100%;"> <thead>

 
@Shoe Warning F# is extremely attractive, aproach at own risk! Warning
 
I don't know. Tell me that tooling is awful and that I can't do the things I can do in C# with F#
 
TBH I don't know a rats fart about F#
 
10:16 AM
good morning :)
 
@ntohl absolutely not
Because we went by car :P
 
@KamilSolecki sneaky sneaky
 
@Nerdintraining'questionmark' its a game you silly
have a look if you want - youtube.com/watch?v=kfVsfOSbJY0
 
@ntohl theft as in airport workers stealing from people?
I always lock up my bags before flight
Just in case
 
@CaptainSquirrel i clicked that link, had a glance in the chat at the actual link, then quickly hit ctrl+w before it loaded
 
10:24 AM
I read about they just crack up locks
 
and yes, airport workers
 
Whoa what
 
10:25 AM
#didn'tfallforit
 
you clicked it
that counts
 
It didn't load yet^^
But if you want that win, it can count poor little squirrel :P
 
I can Crack older locks like this, but modern suitcases are hardly Crackable by just feel
 
it couuuuuuuunts
 
@KamilSolecki typical polish man :P
 
10:26 AM
they crack
 
IRL skeleton key
 
@Nerdintraining'questionmark' Kek :D I like to learn as many things as possible, even at the basic level
 
@KamilSolecki like loosing in chess :D
 
And it's useful. I've cracked at least a few of my friends/family suitcases because they forgot the code
@Nerdintraining'questionmark' kys :P
I take my time mkay
 
Fun fact:
We visited my wifes brother (they are polnish) ond day and he proufly presented a lock-picking kit that he bought + some locks to pick "Just for fun".
So it's undeniably in your blood to do that kind of stuff :P
 
10:30 AM
These ones are easy
You press/pull the button that opens it
And simultaneously rotate the dials
The one that turns the hardest (or clicks/snaps)
Is the first one
After you do the first one, repeat the process
 
It's in your blood QED. Thank you Kamil for proving that ☻
 
@Nerdintraining'questionmark' if you Win In chess against me again, I'm taking your car
 
But I have his car
 
Dont worry I'm Polish
 
10:43 AM
@KamilSolecki kek :D
@KamilSolecki My father in law will steal it back, he is true polski!
Every 2nd word out of his mouth is "kurwa" and when any1 else uses it, he scolds them "Don't say that word! It's bad!"
 
It is!
 
@Nerd you have to have him teach you so you can actually have a car
 
@Metallkiller Who says i don't own a car secretly?
 
Pretty sure Obama said that
And Merkel agreed
I went to ask Putin, but he was busy with his ice cream
 
11:03 AM
0
Q: condition based column's value in kendo grid

Ram SinghI am using below code to bind a kendo grid. $("#dvToInvoice").kendoGrid({ dataSource: { autoBind: false, transport: { read: url }, schema: { data: "Data", tot...

 
That looks like you should ask in the javascript room first
 
@RamSingh please don't cross post questions in unrelated rooms. This is a JS question only.
 
Ban him, ban him! :D
1 hour ago, by Ivin Raj
0
Q: how to make pagination size of record limit to 10 while return JSON using mvc?

Ivin Rajwhile returning JSON value we are having more than 50 records. I need only 10 record per page after clicking on next button only i need to view next 10 record. <table id="example" class="display table table-striped table-bordered" cellspacing="0" width="100%;"> <thead>

11 mins ago, by Ram Singh
0
Q: condition based column's value in kendo grid

Ram SinghI am using below code to bind a kendo grid. $("#dvToInvoice").kendoGrid({ dataSource: { autoBind: false, transport: { read: url }, schema: { data: "Data", tot...

 
Lololololol
> bad human
 
See, kendo is good and all
but when you start messing with the templates and shit, everything becomes confusing
that's why i do it the cheats way :)
make yer <table></table>
Then render it on top
simples
 
 
2 hours later…
12:51 PM
anyone is used to async processing?
 
Just super that is
 
I have this tool that loads all orders from the database and processes them
but this tool first loaded the first 500 items from it, then processed them, then did the next 500 items, etc etc etc
I changed it so that the "GetOrders" didnt return a list of 500 entries, but instead an IEnumerable with all of them
using yield return
(im not sure that is entirely async, but the issue is the same)
 
Definitely not async
 
at first, I got the error that the connection was already closed when it tried to read it
 
You need Rx for that
 
12:55 PM
^
 
Have a feed that loads items and then process them as they come in
Feed? That's the wrong word
 
currently, I just removed the using (var connection = ...) part so it wouldnt autoclose
 
I just wanted to say You need IObservable
 
I don't remember
That's the one
 
but this is only good because this tool will be closed after it is done processing
@ntohl what advantage does an IObservable have?
 
12:57 PM
@Wietlol streamable bufferable async supported flow control with possible extension to control the scheduler also
for exchange it's not simple
Rx is create + combine + listen
 
I thought a simple function like this would be helpful
public IEnumerable<IDictionary<String, Object> GetAllItems(SqlCommand command, string connectionString)
{
    using (var connection = new SqlConnection(connectionString))
    {
        command.Connection = connection;
        return command.ExecuteAndGetAllItems();
    }
}
where ExecuteAndGetAllItems() returns the records using yield return
but this fails because of the connection which gets closed
 
You want to create command maybe inside the loop. Not connections
create 1 connection
 
I now use one connection
 
and create possible multiple commands from that connection
Your logic is backwards
connection spawns the commands
 
@Wietlol this must be an iterator too
 
1:01 PM
so it can do like not closing the connection whenever the command is disposed
 
change from return command.ExecuteAndGetAllItems(); to
foreach(var item in command.ExecuteAndGetAllItems()) yield return item;
 
@ntohl in my logic, I have a command and run that on a particular server/connection
@milleniumbug i'd rather pass the connection in instead of the connectionstring though
but I hoped there was a nice way to actually make it autoclose after an iterator ended
 
@Wietlol check this>
 
also, I only have 1 command and 1 connection
 
6
Q: "using" keyword doesn't close an open SQL connection

JaquesI'm referring to a post that was put on Stack Overflow a long, long time ago. Does End Using close an open SQL Connection I have a problem however. I found that using does not close the connection at all on SQL 2012 Express edition as well as SQL 2008 Developer Edition. Here is the code that I'...

 
1:12 PM
it does autoclose after the iterator ends. The problem is that GetAllItems is not an iterator
 
GetAllItems provides an object that spawns an iterator, sure
 
BTW, "iterator" in C# terminology means the function which contains a yield return or yield break. Yeah, it's a dumb terminology, but if I say "coroutine" like it is, people won't understand me
 
as You can see SqlCommand is bound to the connection. Even the creation of the SqlCommand have the parameter of the connection
 
sure, i could do that too, but it wont fix my issue @ntohl
 
backward logic generates issues. A lot.
 
1:16 PM
i now fixed it by putting the connection in a using statement inside the ExecuteAndGetAllItems
 
SqlCommand is still a property of the GetAllItems?
 
^ with this, GetAllItems() is now an iterator
 
@ntohl property?
 
argument
 
closing the parameters might be a bit of a bummer, but for now, I am happy with the result
afaik, this will close the command and connection only after the iterator ended
or enumerator
 
1:20 PM
I don't think the if (!reader.HasRows) yield break; part is needed for anything
 
im not sure what reader.Read() does if there arent any rows at all
if it reached the end, it returns false and does practically nothing
but as it is like that everywhere in our code base, I'd just as well do it too
 
yes, it works without it
 
You are using command's connection from it's connection pool in the 3rd line. Than using another connection from the connection pool in the 4th line.
does it work without the 4th line?
 
@ntohl im not sure i understand
 
//using (connection)
will work
because command have a connection
in itself
not around
not connection have command in itself
 
1:24 PM
so
using (connection)
using (command)
==
using (command)
?
 
try to understand the logic of creating SqlCommand
 
ussually, we even have connection.CreateCommand()
 
it's on top of a connection. It cannot be instantiated to be an Oracle command or MSSql command, and poof, give it a context and work
first connection established
than sqlcommands spawned, and done
after disposing the command, the connection does not stop
 
HAMMERTIME!
 
1:27 PM
it will, but it wont close the connection
if the application isnt a run-once application but for example a web server, then it will keep creating new connections
which I assume is not going to be good
 
but it won't open and close an unused connection, as Your code does
 
using (connection) doesnt open it
afaik
 
ok. But connection isn't used in the reading process
 
this is the current setup
but connection is required
otherwise, the SqlDataReader will throw exceptions
if the connection is closed or w/e
(untested as the tool is still running :D with the older version of the code)
 
it's probably easier to pass in Func<SqlConnection> and Func<SqlConnection, SqlCommand> as the parameters to the function and that one will create them inside the iterator
 
1:37 PM
I'll build a test project quickly
 
@milleniumbug it is probably easier to not return an IEnumerable<T> but just an IList<T>
but it definately takes longer
and will require.... a few bytes of ram
 
not sure how one is supposed to compare to another, but whatever floats your boat
 
my boat doesnt float so...
 
I have just checked. Commenting out the using (command) does not affect the running
using (connection)
using (command)
is same as
using (command.Connection)
using (command)
no parameter needed
You should see that using using is superfluous because using(command) already does use the connection
this is the closest to what You would like to do
it works with multiple read using same class1
 
02:00 - 14:0014:00 - 22:00

« first day (2673 days earlier)      last day (2292 days later) »