« first day (1375 days earlier)      last day (3564 days later) » 

12:23 AM
Upcoming features in C#: roslyn.codeplex.com/discussions/552378
I'm really sad I don't agree with half of the decisions they made about new C# features :(
 
12:34 AM
whcih ones don't you like?
 
The general idea of primary constructors
I think it just adds complexity
 
I'm used to it, since that's how F# works
but at least in F#, you must use them - so it's not more complicated
it's just the way it works in general
 
I really like it in F#
I just don't think the value we get in C# is worth the complexity
especially around the constructor parameter scope
having constructor parameter, property/field and constructor body variable with the same name seems to be totally OK
but it just seems wrong
(OK from the language perspective, wrong for me)
I also don't like the idea of writing to getter-only properties from the constructor body (I'm totally ok with getter-only properties with initialization syntax)
 
why would they have the same name?
(I agree with that one ;) Writing to getter properties seems wrong )
 
why? I can image some people doing it, just because they can
without considering how hard it will be to maintain that kind of code
and I think language should prevent stupid code
 
12:40 AM
yeah, well, C# has never been good about that
this is a step forward - object initialzers are my pet peeve
anyways- need to run - but would be happy to chat more about it tomorrow ;)
 
cool!
I have more to complain about :P
have a good one!
 
 
4 hours later…
4:36 AM
any ideas about this anyone?
1
Q: MySql.Data.MySqlClient.MySqlConnection.Open() taking a long time

jaminatorI have a mvc .net4 website, connecting to mysql, on page load i run a query (which cannot be avoided) for which MySql.Data.MySqlClient.MySqlConnection.Open() is very slow in worst case taking 15 seconds to open. This page is only slow if i use the website after long periods of time. Once I use t...

 
Hi
how can I override an event ?
 
5:39 AM
@Pheonixblade9 ? do you have time?
 
 
7 hours later…
12:09 PM
Holy crap, this room is super empty today.
 
Everyone is just hiding.
 
yea
come back people
@RoelvanUden do you do mvc 4?
 
I think I use MVC5 but whatever, mostly the same.
 
mind helping a newbie ->me<- with this tutorial codeproject.com/Tips/597253/Using-the-Grid-MVC-in-ASP-NET-MVC
I want to use that grid with a database connection
 
Helping someone with a tutorial? That's a new level of noobiness. Or the tutorial sucks.
 
12:19 PM
They dont use a database there @KendallFrey
actually scratch that I downloaded the code and have realised why its having errors for me.thanks
 
hey, that grid looks nice
I might use that
 
Yes it does
@TomW
@all I still dont know how to do it with a db :-(
h
how am I supposed to sub the private readonly List clients = new List() with db code?
Below is how I would access my db in controller but in the tutorial not sure how
  public class MoviesController : Controller
    {
        MoviesEntities db = new MoviesEntities();
        public ActionResult Index()
        {
            var movies = from m in db.movietbs
                         select m;
            return View(movies.ToList());
        }
 
12:50 PM
so I have managed somehow but am stuck at how to get the grid displaying my data
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1660: Cannot convert lambda expression to type 'GridMvc.Columns.IGridColumn<TimeAttendance.Models.CRsiUser2>' because it is not a delegate type

Source Error:


Line 23:         @Html.Grid(Model).Columns(columns =>
Line 24:                     {
Line 25:                         columns.Add(c => c.Id).Titled("Client ID");
 
You're trying to pass a lambda to something that doesn't expect a delegate
 
@KendallFrey I want it to generate my columns rather than add it
coz am using a table with different column names
 
Not sure what that means
 
@KendallFrey if I was creating a list it would have sth lyk this:
<div class="editor-field">
@Html.EditorFor(model => model.Title)
@Html.ValidationMessageFor(model => model.Title)
</div>
 
sth lyk?
use English please
 
12:57 PM
something
seriously?
hehehe
okay
 
yes, seriously. This is a very serious internet
 
hahahahaha
you win
I should have started typing some poor english from thwe start to get away with it
sorry *the
anyway what I did is I simply changed the code to look like the default list scaffold
This may be wrong but I can't figure out how to do it using a database by changing the private readonly List clients = new List() code in that tutorial
Here is the view and controller code pastie.org/9412138
wrong column name issue
solved
 
KTF
1:13 PM
Hey gents, my first time in this chat room- is it anything goes as long as it's C# related?
ish
 
It's anything goes.
 
Seriously, the nonsense that comes out here. Anything goes. More or less.
 
KTF
lol... I actually wanted to get some direction regarding TDD.
I've been reading up on TDD and trying to make an honest assessment- but I always seem to end up with tutorials on example of how to test a function, that I just don't see how I would fit in a real world application. It's like all the tutorials are showing you how to write a test, but not what you should test.
And it doesn't seem like you realistically test everything... even if you did, it seems like you'd get a false sense of security in your tests
Am I completely missing the point?
 
The whole point of TDD is to get that false sense of security.
 
KTF
lol
 
1:19 PM
In my experience, it doesn't work. It just forces you to work in a certain way that makes your entire system overly complex just to satisfy your tests
I'm not the only one that stopped doing it. Instead, I like Contracts :)
 
KTF
Honestly, Roel- that's exactly what I'm trying to figure out, but for myself.
Basically, have an experience to make a judgement
It's like people either swear by it or hate it
It just dawned on me: maybe I can look at an open source project that embraces TDD, or at least includes unit testing- and in that way get a real idea of what makes sense to cover with the test.
Also, what's Contracts?
 
It's best to make that judgement for yourself, I agree. I haven't seen many TDD open source projects though.
Jup, that's the one. Code Contracts.
 
KTF
Interesting. Totally new concept to me
 
It does 95% of the things I used TDD for, without all the hassle.
I have just some Unit Tests for integration purposes now.
 
KTF
I see
Thanks for the input, I'll definitely have to read up on Contracts.
 
1:23 PM
That one is basically what you're going through right now. Read it :-)
 
KTF
Nice
 
#KSPFirstContract
 
1:53 PM
Task.WaitAll is throwing an exception if one of the tasks is faulted, but is already complete. Is there a way to avoid this?
The reason is that we call WaitAll multiple times, and we want each exception to only be reported once.
 
@KendallFrey I can suggest a hack, although I haven't tried it, so no idea whether it would actually work
 
That's kind of what I'm going on now
 
I suck at explainations
i hate having to explain anything
 
@KendallFrey follow every task you're waiting on with a continuation that's OnlyOnFaulted, and wait on those
 
hopefully they wont can my ass
 
2:00 PM
theOnlyOnFaulted tasks would do nothing but pass the result of the continued task so they take negligible time
 
That's a thought
 
If they will throw vexatious exceptions, we can;'t be blamed for writing code that effectively swallows them
 
@Skullomania Depends on whom you're explaining to, and what it is you're explaining, doesn't it? What happened?
 
we had a workplace survey that I created and at the end I created a tool that let them split up the data by department roles and such
...but 4 of the averages turned out to be similar
all 3.58
they asked me to verify that it was coincidence and not a glitch
so I pasted sql code in an email and explained what it did and showed the results
then showed them the columns of data where the rows were different
somehow i dont think this helped
in retrospect I should have sent them an excel file and averaged it...but I already sent 3 emails
of code
How do I walk my ass out of this mess?
 
@Skullomania Do what you just said, send an excel file with the results averaged.
 
2:10 PM
what gave you the impression that wasn't the right thing to do?
 
They are not technical people...and there has been no reply...from anyone
so im probly just freaking out
but their all VPs people who make my salary or more for their christmas bonus
@KoBE i would but i already sent 3...wont sending another piss them off
 
no reply normally means "I am satisfied - no further action required"
 
@TomW I know that now after the 3rd email
 
@TomW It could also mean "how the heck do I read this?"
 
@KoBE well in that case they can man up and if they want more information, ask for it
 
2:20 PM
If you truly think they don't understand the data, I would send a final email with the spreadsheet that reads something like this: "Good morning, I apologize for the multiple emails. I've attached a spreadsheet that should further support the data that I previously provided. If you have any questions, please don't hesitate to ask.
@TomW If they're big wigs (VPs and such) then they would rather not deal with it. From my experience that is.
I always end my emails with "if you have any questions, please don't hesitate to ask". That way it gets me off the hook of having to send multiple emails.
@Skullomania Waiting to see if they respond is also a good option. It really just depends on the entire situation, which neither Tom W or myself can fully understand.
 
@KoBE I put that in the email....the multiple email thing happened when he asked me to explain....which as a person and a programmer I suck at!
do you guys have a hard time explaining to users what something does? or how something works?
 
I tend to walk people through the logical decisions of a program. Because it's simple for me to explain (I wrote the damn thing), and usually easy to follow when it's just 'How it works'-logic and nothing else.
 
@Skullomania Ah, well then that's not as bad. I was under the impression you sent 3 emails without receiving any response. The thing to keep in mind, when talking to people that don't know the technical side, keep things as simple as possible.
 
When it's a bit more formal, flow charts help a ton for users to understand how an application conceives the result it gives you.
 
@RoelvanUden i will try flow charts next time. @KoBE I sent the first email explaing what the program did....then the VP sent an email asking why the numbers were similar and to verify...this caused me to send 3 trying(and failing) to explain
 
2:41 PM
Hi all
can anyone help me with this fiddle
the layout is wromg the rows are not lining up
any ideas why?
 
Is there a better way to take all the "Customer Data" in a table column to another column within the same table? Or am I forced to use an UPDATE query with a sub-query to SELECT the data?
 
INSERT INTO SELECT
Oh, within the same table. UPDATE n SET v = c?
 
Yeah, within the same table.
 
@Greg UPDATE Subscriptions SET ModifyDate = CreationDate :P
 
@Corbo152 Line 5986 of your CSS has the display:none css applied
 
2:52 PM
As an example.
 
@Corbo152 that's hiding the first column of your first table
 
@RoelvanUden I'd need a loop though, correct?
 
@Greg No.
That query just set all ModifyDate to the CreationDate of the same row.
 
@KoBE columns are not the issue, rows are
 
Then, just put a WHERE clause to ensure the right data is migrated.
 
2:56 PM
The rows look aligned to me: pngb.in/twyzz.png
@Greg indeed
Your WHERE clause will limit the rows affected.
 
sorry @RoelvanUden for stepping on your toes. :O
 
You didn't step on my toes o_o what are you on about?
 
@RoelvanUden Nothing. You had been answering about SQL stuff then I kind of butted in. I was half-joking about stepping on your toes.
 
@RoelvanUden's toes look positively flattened. You brute, @KoBE!
 
3:09 PM
@Corbo152 Your rows have different heights. I'm not sure what CSS is causing this. To fix it, you could set the height of each TR in the right table to 37px.
Or find out where the CSS is not matching up.
You can see here after I manually adjusted the first three: pngb.in/wBTHc.png
 
Yeah the only to accomplish that is fixed-height rows.
 
@RoelvanUden @KoBE Look right?
UPDATE [dbTwo]
SET	[CourseDescription] = [ShortDescription]
FROM
	[dbOne] AS category INNER JOIN [dbTwo] AS course
	ON category.SubCatID = course.SubCatID AND CatID = 1;
CatID has an integer value for type of person in database (one is customer).
 
Achievement Get!
Unit Test: Passed
 
\o/
 
3:26 PM
@Greg is dbTwo your database name or table name?
(same question for dbOne)
 
@KoBE The database table name.
 
ok, and which table does CatID belong to?
 
@KoBE I ran it, I had it reversed it should be:
I ran it the other way, which copied null. Sigh- Luckily the production db should have the records.
 
@Greg you have DbOne in as both tables in your FROM clause..
Also, I like to explicitly tell what table to pull from, even though it should figure it out. I would have CatID be: category.CatID = 1 maybe a little over the top, but to be safe that's what I normally would do.
 
3:35 PM
Yeah.
 
UPDATE course
SET	course.ShortDescription = course.CourseDescription
FROM [dbOne] AS category INNER JOIN [dbTwo] AS course
	ON category.SubCatID = course.SubCatID AND category.CatID = 1;
that's how I'd write it.
 
Yeah, I know for future. Short hand isn't always ideal.
 
o/
Can you guys help me, what is the key.xxxx value here?

CmdUpdateSortOrderValueRow1.Parameters.Add(New SqlParameter("@this", key.Substring(0, 1)))

Can you point me to the right link?
 
@KoBE ty
hmm neither ".Add" or "key." are on that page
 
3:46 PM
@JoJo What are you attempting to do?
 
@JoJo Parameters is a collection of SqlParameters. Add is simply adding a new SqlParameter.
 
What are you attempting to do as your key or this add?
 
reverse engineer this code.. the stored procedure does not have a single value result in the db Table.. so not sure why the substring(0,1).. debugging it I see .. C1254460 .. hmm
@KoBE okay, ty
 
@ton.yeung :( If it is damaged where it needs to be replaced, let me know and I'll give you the information for Fed Ex so you can get reimbursed. Totally glad I paid the insurance.
@ton.yeung You sure?
 
.. if key is a variable and ='s C1254460 then how can this work? ...("@SortOrderID", Convert.ToInt32(key.Substring(1))))
 
3:52 PM
@ton.yeung What?
@ton.yeung It should.
 
Why are we talking about the same thing in JS and C#?
 
still facing this issue
so annoying
1
Q: MySql.Data.MySqlClient.MySqlConnection.Open() taking a long time

jaminatorI have a mvc .net4 website, connecting to mysql, on page load i run a query (which cannot be avoided) for which MySql.Data.MySqlClient.MySqlConnection.Open() is very slow in worst case taking 15 seconds to open. This page is only slow if i use the website after long periods of time. Once I use t...

 
@JoJo Who knows? We don't have access to your code.
 
@ton.yeung I'll get it later when I get home.
 
@ton.yeung We're talking computers. The Razer was mentioned as well
 
3:54 PM
Your right, ty
 
Anyone know of clean expression that will find a particular word, then grab all the text after to the first period?
Including that word.
 
word[^.]*\.
 
@KendallFrey Thank you.
@KendallFrey Word is my word I'm searching for right?
 
yeah
 
Wanted to clarify.
 
4:18 PM
I know there isn't a built in operator for LINQ to call ForEach but I thought there was a way to write LINQ as if it were a ForEach loop?
 
There is a ForEach extension for List<T>
if that helps
337
Q: LINQ equivalent of foreach for IEnumerable<T>

tags2kI'd like to do the equivalent of the following in LINQ, but I can't figure out how: IEnumerable<Item> items = GetItems(); items.ForEach(i => i.DoStuff()); What is the real syntax?

 
posted on July 22, 2014 by ericlippert

Finishing off my series of questions people asked during my recent webcast that I didn’t have time to answer, some short Q&A: Does the analyzer require that we share our code assets with you? No; the analyzer and defect database … Continue reading →

 
@KoBE I've got a MatchCollection which I run a RegEx.Matches in. You think I could do like find.Cast<Match>() to get access to some of those Linq Queries?
@ton.yeung What should I do instead then, it is a word search for a Search Page?
I can't unfortunately.
As it is through the database trying to pull data back.
 
@Greg would this not suffice?
foreach (Match m in find)
    DoStuff(m);
 
@KoBE It would, just wanted it to look nicer.
Well, cooler.
 
4:29 PM
@Greg Lol, I'd prefer functional over cooler. :P
Let me play with it and see.
 
@KoBE This is where it is at the moment.
@KoBE Basically, I need to return value with all the matches.
 
As a list?
find.Cast<Match>().ToList();
You are returning a string. So how would you want all the matches formated?
* formatted
 
What you mean?
 
You said you want to reaturn value with all the matches. Yet your function returns a string
 
@Greg please escape the string before you inject it
 
4:35 PM
I could return a List.
 
@Greg What about a MatchCollection?
 
Anyone know why my winforms application will not sure Chinese characters in a textbox
 
@KendallFrey Where does the escape go when it is formatted in the manner I have it.
 
@Greg This would return a list of Match values as the string
return find.Cast<Match>().Select(m => m.Value).ToList();
* as a string. So it'd be returning a List<string>
 
@Greg What do you mean? It goes in the pattern.
 
4:39 PM
@KoBE nvm
 
You know what, that code doesn't make sense, it can't match anything.
 
@KendallFrey ?
 
content will never contain content + other stuff
 
@KendallFrey How should it be, content is the word?
 
Probably
Side note: I think it might be slower to compile a regex if you're only using it once.
 
4:41 PM
What would be faster, but still grab the entire word to the first .?
 
?
What do you mean faster?
You want a different regex?
 
Nothing like starting off the week with a 6.5 month estimate for a project that's supposedly due in October. :D
 
I think he means, what would be faster, rather than using Regex
 
Given the situation I have, nothing, except maybe Travis's favourite sliding window.
 
@Greg here's a way to do it without RegEx
    string word = "test";
    string sentance = "This is a test that went well.";

    int startIndex = sentance.IndexOf(word);
    int endIndex = sentance.IndexOf(".",startIndex);

    string result = sentance.Substring(startIndex,endIndex - startIndex);
You'd then have to loop through the content.. while startIndex and endIndex != -1
Depending on how large your content is, it could be faster or slower.
@SpencerRuport Which side of the project are you on? The side that will be 3 months late, or the side that will be waiting an extra 3 months.
 
4:52 PM
The 3 months late side of course.
I'm a developer. I don't make unrealistic timelines. They pay other people to do that. ;)
 
That's what project managers get paid to do. :D
 
And sales reps
 
@KoBE Wouldn't that only find one occurrence?
@KoBE You thinking like this:
 
5:15 PM
1 message moved to Trash
1 message moved to Trash
1 message moved to Trash
 
you know you can move more than one message at once
 
@KendallFrey Yeah.
 
@Greg Don't do it :) Just use foreach and loop
 
lol
 
@ReedCopsey What?
 
5:19 PM
was replying to something back up a ways ;)
make a ForEach method
 
@ReedCopsey You talking about the LINQ Extension method?
@ReedCopsey What would be the fastest way to loop this?
 
with foreach
 
foreach is probably the fastest
 
    protected string FilterSummary(string content)
    {
        string value = string.Empty;
        if (content.Length >= 3)
            value = content;

        int initial = value.IndexOf(txtSearchPlattU.Text);
        int end = value.IndexOf(".", initial);

        string result = value.Substring(initial, end - initial);

        return value;
    }
 
A Linq method should be Pure, indeed. Mutating the state is totally MEH.
 
5:21 PM
@RoelvanUden Yeah, I hear you.
Sadly, my earlier approach as @ton.yeung pointed out really hit our server speed with the search. So now I'm trying to do something faster.
 
@Greg start the second iteration at the last index of the first match
 
@Greg What exactly are you trying to do here?
just find all of the matching words?
 
@ReedCopsey Basically content is data that is pulling out of the database the whole field. I'm trying to match the word from the txt to the content, then grab that sentence. Also grab any and all occurrences there after.
 
you have it returning string, not IEnumerable<string>, though
do you want to join the results?
 
@ReedCopsey Yeah, into one single string.
 
5:24 PM
any separators?
 
Yeah ...* and bold the matched txt word in the match.
 
strings do not support rich text formatting
Remember, solve one problem at a time. Don't worry about bold until you have the rest of it working
 
if you need to do something like that
you'll be better off using regex
because you'll have the match info - and you can get all of the positions, convert the string to rtf, and walk backwards bolding
 
Then forget the bold, I need speed.
@ReedCopsey It had a huge performance hit.
@ReedCopsey A hit I can't afford currently.
 
    protected string FilterSummary(string content)
    {
        if (content.Length < 3)
            return content;

        string search = txtSearchPlattU.Text;
        var values = new List<string>();

        int index = 0;

        while((index = value.IndexOf(search, index)) != -1)
        {
            int end = value.IndexOf(".", index+1);
            // Error check for no "." required?

            values.Add(value.Substring(initial, end - initial));
        }

        return string.Join("*", values);
 
5:27 PM
Regex shouldn't be much slower
 
it'd typically only be slow the first run
then Regex should be similar speed if it's written well
 
first run?
 
this would definitely be quicker - but it's not like it's a ton quicker
@KendallFrey compiling the regex is a bit slow - but once it's done once, it'll be cached
 
Yeah, but if it's only run once...
 
It will usually be once.
 
5:29 PM
Or doesn't Matches count as once?
 
is content huge?
 
@ReedCopsey Well, it will vary. I built a backend system that allows it to be fed. So the description can be several pages (per field).
 
you running this once per field?
or just once overall?
 
@ReedCopsey Once per field.
 
how many fields?
 
5:31 PM
2,300
 
The stored procedure should eliminate the ones without a match though.
?
Is that bad?
 
well, it's going to be slow, pretty much no matter what you do
why are you trying to do this on that many items?
you can't present that much data anyways...
 
@ReedCopsey I'm not just the way they have it structured, the code you posted, was that supposed to incorporate my earlier code cause value and initial don't exist in your example.
@ton.yeung Yeah.
 
@Greg yes - that fixes it
@ton.yeung thousands of pages of scrolling :p
 
5:46 PM
@ton.yeung Because the data is pushed through a SP that I have no control over.
@ton.yeung It comes through an ASP.NET Control.
That is coupled to a data source.
 
Note to self; check LinkedIn once in a while. That thing is spammed :o
Yoga?
 
@ton.yeung Yeah.
 
@ton.yeung Dafuq o_o
 
@ReedCopsey You doing code camp in September?
 
not sure
I may be able to, but may not
@Greg I think I"ll be there
 
5:53 PM
@ton.yeung "Have to do yoga".. why?
 
going to try to see if I can get an F# talk or two in
 
@RoelvanUden Rage issues :P
 
@RodrigoSilva Isn't @ton.yeung one big bundle of rage, and wasn't that unanimously agreed to be OK?
 
@ReedCopsey I'm going to drive up I believe.
 
@RoelvanUden I must have missed that secret meeting
 
5:58 PM
You were hating MVVM at the time :P
 
nice
 
No... I never hated it!
 

« first day (1375 days earlier)      last day (3564 days later) »