« first day (1753 days earlier)      last day (3189 days later) » 

Rob
2:20 AM
Hello
 
 
3 hours later…
5:11 AM
@Rob Hello.
 
5:27 AM
Morning All!
 
Hi
I have problem with entity code first? help me.
 
I have Button and ItemsControl[UIIC] inside Panel, in ItemsControl's[UIIC] DataTemplate I have element that need to bind to the Button, that in the same level with ItemsCOntrol[UIIC], how can I do that? ElementName is not finding the control name, RelativeSource will find only parent, but button is in the same level with parent?
@OmidNasri ask your question if some one interested will answer
 
5:51 AM
good moooooooorning C#!
 
6:01 AM
Morning y'all
 
6:12 AM
morning @BenjaminDiele & @Loetn
 
6:30 AM
Hi
I don't understand static class or methods at all, anyone free to help ?
 
6:42 AM
@Learner Everything? Or something specific?
 
@Loetn we can start from it's definition, how it's different from normal class
 
@BenjaminDiele Yes and I am also looking at C# language specification, but I am looking for a more informal definition
 
@Learner Simple: A static class can't be instantiated (new)
 
6:48 AM
@Learner This is pretty informal: "A static member cannot be referenced through an instance. Instead, it is referenced through the type name. "
I find those articles to be pretty clear, but that might be because I already know what they're talking about. The examples are pretty helpful I find.
 
This does make sense now,

"A static class can be used as a convenient container for sets of methods that just operate on input parameters and do not have to get or set any internal instance fields."
so basically a class which doesn't has properties, should be a static class
 
@Learner Can be.
And a property can be static.
 
@Loetn true, so if a class has only static properties, it should be declared static
another thing I always get confused with,

if I have a web application with a static DataAccess class, 1000 people access a code which calls this class at same time,

how static class will server them, as it only has a single instance
 
7:09 AM
Static classes should not have a state.
 
@Learner Oh, but that's quite simple from a best practices point of view; if you're using a static class, you're most likely doing it wrong. Take that assumption and only ever use a static if you have a damn good reason to.
 
user1804599
Good morning.
 
user1804599
@RoelvanUden lol
 
Good morning :-)
 
7:30 AM
@RoelvanUden I am so confused now
so when I create a instance of a utility class, people say why is it not static
I have no answer to that
however I am still confused with my question above about 1000 people accessing a static class how it going to effect
How a web application deals with such things
 
user1804599
If 1000 people access the same object then maybe it should be immutable.
 
@elyse where in language immutable stands, does it comes after value types or before
I am trying to figure out where to start learning
 
user1804599
That makes no sense.
 
I am going through this course

http://www.pluralsight.com/training/player?author=scott-allen&name=csharp-introduction&mode=live&clip=0&course=csharp-fundamentals
 
user1804599
Immutability is not a property of the language.
 
7:34 AM
oh
where am i going to learn about such things then
fundamentals of programming ?
 
user1804599
There are facilities that provide it such as readonly, though.
 
user1804599
But in a language like C# it's up to you to not forget to make things immutable.
 
!! google immutable in programming
 
hello guys , i have 2 web application
i have link in the first application that when i click it , it redirect me to second application
how i enable user to open the second application ONLY when they are press that link in first app
i don't want that someone able to open app 2 without pressing the link in app 1
 
user1804599
Set a cookie upon clicking the link and read the cookie in the other web application.
 
7:40 AM
@elyse how is it linked to static classes,
 
@elyse , good idea
thank you ,
 
hi guys
 
@elyse , should i set time for cookie expiration ?
 
@Learner That depends. One of the reasons static is a bad idea because of parallel access from multiple threads. How is it going to handle a 1000 parallel accesses? No idea! That depends entirely on your implementation..
 
user1804599
@Bassem Maybe.
 
user1804599
7:53 AM
Depends on what you want.
 
@Learner And do people ask "Why is it not static?"? Well, "Because it's a bad idea and you're a bad programmer." might be a nice answer for those people. Really, if we're all adjusting to the bad people in our groups, we'll never get anywhere above the level of making a big spaghetti of PHP/HTML
 
user1804599
@RoelvanUden That only applies to mutable statics.
 
@elyse what is the default ?
 
@RoelvanUden so should I use sealed class then :)
or maybe I am asking a stupid question
I don't feel we follow OOP at all in our projects
 
sealed is just there to prevent anything from inheriting that class
 
user1804599
7:56 AM
You don't want to "follow OOP".
 
@Learner Let me guess, you're a student working in group projects?
(With bad students)
 
user1804599
You want to exploit OOP iff it's the right tool for the job.
 
@RoelvanUden No, I am a developer with 4 years of experience in C#, our product will be used by bill gates soon, project is 80% completed
 
Well, it sounds like you're in a bad position then..
 
nope, I am learning, nothing is impossible
 
user1804599
7:58 AM
Wrong.
 
morning, all
 
morning @Squiggle
 
user1804599
Solving the halting problem is one example of what is impossible.
 
@RoelvanUden I wasn't involved in project architecture, I am follower
but at same time, trying to learn
by understand what ex architect did wrong and why
we have a dataAccess class, which uses strongly typed dataset, this dataAccess class has no constructor for connection, instead it's calling our core project to get connectionString
so I showed this code to someone else, he said why this class isn't static
 
It's impossible to stop people from doing stupid shit :P
@Learner That someone is, quite bluntly, an idiot.
Your DataAccess should use IoC to get a connection (or context) injected, instead. Then yay, it makes sense. Why the fuck would you want to use a static there?
 
8:03 AM
@RoelvanUden it's an architectural issue, nothing I can do about, it's architects fault...
 
Then again, why do you have a DataAccess? And not, say, a uow? Or repositories if you swing that way
@Learner You said you wanted to understand what he did wrong. Well, that!.
 
user1804599
Good thing you have lots of automated tests (hahaha) so you can refactor it without fears.
 
Problem starts from layering, we don't have properly planned layering,

our business layer is mixed with everything else
 
@Learner It's PHP all over again :-\
 
@RoelvanUden Hey, bad coding is language-agnostic!
4
 
8:10 AM
True. My dislike for PHP surfaced there. My apologies.
 
That deserves a star.
:)
 
@RoelvanUden Haha, wasn't to single you out or attack you (personally). You dislike PHP, I do the same with web apps :D
 
Still, better to correct my improper statement, there is nothing inherently wrong with PHP either, so it just feels like blind hate for no reason now. I don't like that.
 
There are enough things wrong with PHP, no denying that. But it's possible (through a lot of effort) to write clean code.
 
How a layered application looks like when planning
then someone implements some great thoughts
 
8:13 AM
@BenjaminDiele Just because you don't like it, doesn't mean it's wrong :P
 
@RoelvanUden So auto converting values to strings is not "wrong"? :D
@scheien How long did you search for those images?
 
It's not. It's something pretty much every dynamic language does. You might not like it, and that's fine, but it's not wrong per-see.
 
@BenjaminDiele: probably ~10seconds
 
Everything is wrong for a given value of wrong
PHP can only be juged by its own standards and if they say string all the things then all things shal be strings
now if it auto converted the string "wrong" to a int now that would be wrong
 
Morning Guys
The app is closing before it finishes 7 seconds, any logical mistake? private System.Windows.Forms.Timer timer1;
private int counter = 7;
private void StartCloseTimer()
{
	int counter = 7;
	DispatcherTimer timer1 = new DispatcherTimer();
	timer1 = new DispatcherTimer();
	timer1.Tick += new EventHandler(timer1_Tick);
	timer1.Interval = TimeSpan.FromSeconds(1d);  // 1 second
	timer1.Start();
	tTimer.Text = counter.ToString();

}
private void timer1_Tick(object sender, EventArgs e)
{
	DispatcherTimer timer1 = (DispatcherTimer)sender;
 
8:31 AM
@linguini i expect you are missing some curly brakets after the if in the timer event, unless you intend to call Close every 1 second
also int counter = 7; does nothing as does DispatcherTimer timer1 = new DispatcherTimer();
in StartCloseTimer()
 
:24867909 Basically i want to display counter-- (7 5 5 4 3 2 1) along with the text & then close the app.  If i use this way, nothing happens :                                              if (counter == 0)
            {
                UpdateXMlClose();
                Application.Current.Shutdown();
            }
            timer1.Stop();
 
Tagged the RC \o/
 
@linguini ... timer1.Stop(); will stop the timer, you dont want that to happen every tick
 
@Alex correct.
 
8:52 AM
Does VS have shortcut to collapse currently browsed code region?
 
probably? Which version?
 
@Squiggle @ 2013
 
Ctrl+M, M
 
@Squiggle Freaking cool, thanks ! I won't have to scroll to heavens.
 
@Alex Thank you
 
9:06 AM
Goddamnit, who the fuck thinks that providing a sorting mechanism without being able to specify which direction to sort in, is a good idea?
 
I just googled the answer. I never used that before.
@BenjaminDiele .Reverse() ? :)
 
I have multiple fields to sort on. The first is ASC, the second would need to be DESC, and the third again ASC.
 
@BenjaminDiele Sorting is overrated
 
9:38 AM
@BenjaminDiele: OrderBy() OrderByDesc(), ThenBy(), ThenByDesc() ?
OrderBy().ThenByDesc().ThenBy() and it goes on and on and on
Or are you in the dynamics rant mode?
 
Hello
Can I ask a question?
 
@KevinMaxwell You already did :)
 
@Loetn I always get caught by you :)
@Loetn I tried the same thing on the other room and they kicked me out :D
They were very nice to me
 
@KevinMaxwell Hahah. The other room?
 
HTML, CSS, Web Design
 
9:52 AM
@KevinMaxwell Very nice people there :)
 
@Loetn Oh yeaah
Even though my question was about CSS and Design but they kicked me out
Funny part is that they started to ping me one by one :)
 
@KevinMaxwell Hmm, I'm not into ASP.NET and GMD. So can't help you with that :)
 
@loetn no problem, thanks for looking at it and also keeping me in this room :D
 
@KevinMaxwell I can't kick you. I'm a normal user, just like you.
We are plebs
 
@Loetn :D
 
9:59 AM
@scheien i'm in a ranting mode. Everything sucks.
 
In an ASP.Net MVC application, I have a multi section form loading in via AJAX - at present I'm storing all info in the DB in between sections.. anything wrong with this in principal? It seems to work fine but other dev has been mentioning using session variables which just seems a bit messy to me
Like, am I right in thinking using session variables is nearly always not the right way?
 
@AlexH you're using the database as a session storage? That's generally fine, unless it causes performance bottlenecks.
I prefer it that way, really. It makes things stateless, which is good.
*generally good
 
@Squiggle yeah it's fine at the moment.. it's a low volume site, and the info is high value, so I'm being pretty cautious
Ok cool well that's put my mind at ease
 
@AlexH Database-backed session storage is good. Intended short-lived database-stored values that aren't cleaned up because it's not tied to sessions is bad. :P
 
@AlexH if you use the built-in ASP session mechanism you have the option of using a database anyway. msdn.microsoft.com/en-us/library/ms178586.aspx
 
10:07 AM
^ That. Making your own version of it is.. not recommended.
 
@Squiggle I didn't know about that...
@RoelvanUden I'm using EF at the moment between calls to store stuff which is surprisingly low overhead.. like we're talking in the 100s of uses a day worst case so
Guess if it works, it's clean and it's maintainable it's ok?
 
Add 'makes sense' to that and I am in agreement.
Making your own session storage doesn't make sense to me so.. :-P
 
@RoelvanUden no I guess not..
I'll check out the link and see if it's feasible to switch
Probably not given there's 3 weeks left till launch haha
 
0
Q: How to pass value of DataList item to variable in aspx

AnjumI can get dataList item value in radio button like this <input type="radio" name="SectionsRadioGroup" value="<%# Eval("Section") %>" /> <%# Eval("Section") %> Actually, i want the value of "Section" in a variable, like this : <% Dim sectionVariable As String = Eval("Section") %> But i am ...

 
Don't reinvent the wheel.
 
10:22 AM
is It for me @scheien
 
@AlexH what do you use as the key to the data you're storing? Is it a session-based key? or auth-based?
 
@Anjum: no.
 
@Squiggle auth
 
ok @scheien
 
@Anjum: Tried accessing the datasource from codebehind to set the property there?
You cannot use Eval() in a non databound context.
e.g. for databound context <asp:repeater ...><itemtemplate><%# Eval("Property") %></itemtemplate></asp:Repeater>
 
10:27 AM
@AlexH OK, so it's not really session data at all then, because it won't expire. Correct?
 
@Squiggle yeah I guess so, it has to be stored for auditing purposes anyway
 
so in that case, session state isn't the solution because it won't hang around.
 
Makes sense. I don't usually use the session state, I guess maybe I should look at it more but not for this current project at least.
 
10:52 AM
My hobby: Misusing the English language when conversing with non-native speakers.
"Sho' bud, holla when you gone done committed them fixes."
 
non native speaker here, but that was easy
 
 
shaahaaap
 
this should be installed by default
 
@StevenLiekens brillant
 
11:03 AM
@StevenLiekens that's made my day
 
@Squiggle Isn't that just ebonics?
 
almost as useless as this one: channel9.msdn.com/achievements/VisualStudio
 
0
Q: How to apply Google Material Design to ASP.NET Controls (i.e. Checkbox, Button and etc)?

Kevin MaxwellI'm trying to apply the Google Material Design to my ASP.NET web form controls. I can easily apply to HTML controls, but no chance with ASP.NET. Original Page <form id="signinform" runat="server" class="form-validation animated fadeIn"> <div class="container" id="login-block"> <...

 
@KevinMaxwell: What does not work? Are the elements rendered / wrapped wrong?
 
11:18 AM
Help me out with some logic here, if you can. I'm querying some data - "GetClosedCases" - which has a timestamp. I want to return the list of cases grouped into 7 groups. So if I ask for data from the last 7 days, I should get each day's items in each group. If I asked for the last month, I should get (days-in-month / 7) day's worth of items in each group. Clear?
So what's the best and/or easiest way to do this?
Take the StartTime and EndTime, calculate the number of days, divide by 7, and calculate StartTime/EndTime for each group separately, then group by that? That's my first idea, but I'm wondering if there's anything simpler.
Also, it would be weird to display as chart labels. "Group 1 - 01/08/2015 14:03 - 02/08/2015 21:55". Since it's an arbitrary partitioning.
 
Query the items and depending on the setting, use a different 'this is a new group' implementation to dump items into.
 
Why 7?
 
Client/UX choice - the chart that will display the data will show 7 data points.
the bigger the timeframe, the lower the required resolution.
 
aha, I just got tangled into the week thing
:p
 
It can be 5 or 6 or 8 as easily. 7 was chosen because a weekly view is the default.
 
11:21 AM
@AvnerShahar-Kashtan Why not use a chart library that does this all for you?
 
@RoelvanUden Because ideally I'd want to do a lot of the heavy lifting in the back-end code and not return a potentially large dataset to the client - I want it aggregated already.
(I'm only returning item counts for this dashboard, not the item contents themselves)
If my query returns 500 items, I don't want to return 500 timestamps, but just 7 Tuple<string,int>s
(With a yearly timeframe, it can be thousands or tens of thousands of items as well)
Hmm. It's LinqPad time.
 
I love software that just stops working for no reason.
 
11:39 AM
Ok, current idea is to calculate how many milliseconds in each bucket, then run a GroupBy on the data, grouping by (timeStamp - startTime)/7. Should work? Maybe.
No, I'm not calculating the group index right.
Ok, better. the only problem is that it doesn't create empty groups, but that's easy to do manually after the grouping is done.
 
@BenjaminDiele Software never stops working for no reason.
 
@RoelvanUden Sure it must have a reason, but when you restart system A en system B stops working, there's some magic there.
 
@AvnerShahar-Kashtan So I'm just wondering if you can't just cache them?
 
@RoelvanUden Cache what?
 
@AvnerShahar-Kashtan The different levels of data.
Let's say you have year, month, week, day, hour and minute.
Just compute and store things on each level.
Once.
 
11:47 AM
@RoelvanUden Well there's also "Custom Time Frame", unfortunately.
 
Ah. Sucks to be you.
 
Indeed.
But it seems my hack is working.
 
12:08 PM
Cache the whole dataset on first load? (depends how big it is though)
 
@scheien Hello, I have all the required CSS and JS files in my page. When I apply the style to a HTML control it works perfectly but as soon as I apply the style to ASP.NET controls such as (Checkbox or textbox) they don't react on changes.
 
@KevinMaxwell: Are there any differences between the markup that works and the markup that dont work? (asp.net rendered)
 
@scheien you mean inside VS or rendered in Browser?
 
rendered in browser.
 
Browser is all that matters
 
12:14 PM
webforms has its own will, and will break all the rules that it can.
Write ABC, render as THISSHITWONTWORKATALL
 
@scheien well said :D
 
@scheien It changes regularly. It's a constantly updating dashboard.
Right now it calculates everything on each call for each caller. Once the basic logic is sound, I'll have the server routinely calculate it and cache the results, and have clients receive the latest cached values.
Except for the queries that have a user-defined timeframe. :(
 
is Single() in linq returning origin instance in the collection right? it's not returning a clone is it?
 
@scheien it's rendered as this:
<input id="MainContent_RememberMe" type="checkbox" name="ctl00$MainContent$RememberMe">
 
Are you telling Kevin off for using Webforms?
slinks away
 
12:21 PM
@scheien is this what we want?
 
@KevinMaxwell: Can you post both working markup, and the same section as webforms render it?
 
@scheien
Working markup:
<div class="checkbox checkbox-material-grey">
<asp:CheckBox ID="RememberMe" runat="server" cssclass="md-checkbox" />
<asp:Label runat="server" class="c-white normal f-11 m-b-15" AssociatedControlID="RememberMe">Remember me?</asp:Label>
</div>
@scheien
Rendered:

<div class="checkbox checkbox-material-grey">
<span class="md-checkbox"><input id="MainContent_RememberMe" type="checkbox" name="ctl00$MainContent$RememberMe"></span>
<label for="MainContent_RememberMe" class="c-white normal f-11 m-b-15">Remember me?</label>
</div>
 
@tweray No cloning is done for you, no.
 
@KevinMaxwell: You want the asp.net control paragraph rendered as the html control paragraph? ref your question.
the asp.net checkboxes can be tricky with labels, due to the fubar way webforms renders them
 
@scheien What I want is to style my checkbox and other webform controls. I can easily do the Bootstrap or iCheck but this one doesn't work.
@scheien is it maybe the CSS? There are some parts which specifically says: INPUT and etc.
 
12:31 PM
it's the way webforms renders the elements
wrapping them up inside others when not needed to etc
 
@scheien since it's possible with Bootstrap and iCheck, I think they should be a way to adapt to Google Material Design as well.
 
@KevinMaxwell Is there anything specific in the <asp:CheckBox> you need, which you can't get by simply putting a <input type='checkbox' runat='server'> instead?
The WebForms controls are sometimes richer than the basic HTML controls, but in this case I think they're practically identical, and you can be sure that it will remain an <input> in the rendered output.
 
that would probably be best suited, and then do a standard <label> around that
 
@AvnerShahar-Kashtan Yes, because in the code-behind it only requires Server and .NET forms to verify. ASP.NET Identity.
@AvnerShahar-Kashtan I have many times used input and added runat="server" and worked but in this case it should be .NET :(
 
you can access the standard html elements that have the runat=server attribute
need to use an ID aswell
you could go with something like this:
<div class="checkbox checkbox-material-grey">
        <asp:Label ID="Label1" runat="server" CssClass="c-white normal f-11 m-b-15" AssociatedControlID="RememberMe">
            <input type="checkbox" runat="server" id="RememberMe" class="md-checkbox"  />
            Remember me ?
        </asp:Label>
    </div>
 
12:38 PM
@scheien when I use input + ID + runat="server", this comes up:

Parser Error Message: The base class includes the field 'RememberMe', but its type (System.Web.UI.WebControls.CheckBox) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlInputCheckBox).
 
on postback?
or when rendering?
 
yes
on load
 
Works fine here, just tested it.
 
do you have the same base class?
ASP.NET Identity
 
no
just the markup we have discussed
 
12:40 PM
Yes, without the base I would've been able to achieve that goal.
 
You haven't said anything about that in your question, or here in chat?
 
about the Identity?
 
yep
 
I thought that's was not relevant.
 
So your page inherits ApplicationUser?
 
12:43 PM
yes
 
Shouldnt matter, just use some other ID on the checkbox, and then map it on postback
 
I'm also concerned as I'm going forward I will need to use more web form controls.
 
you're in for a treat, because they suck :)
 
I never had issues with Bootstrap and iCheck, why this one?
 
Can't say
 
12:47 PM
I'm still sure it's from CSS or JS.
 
I guess it's just that webforms render into some mumbo jumbo markup
 
for example this is inside the Google CSS:

.checkbox input[type=checkbox] {
opacity: 0;
position: absolute;
margin: 0;
z-index: -1;
width: 0;
height: 0;
overflow: hidden;
left: 0;
pointer-events: none;
}
@scheien but anyway, Thank you
 
np
 

« first day (1753 days earlier)      last day (3189 days later) »