« first day (3 days earlier)      last day (4948 days later) » 

4:50 AM
any1 here with media player/codecs knowledge?
 
5:05 AM
@rtpHarry I would a: post that as a question on SO, but b:
let path = .....
select new MediaItem {
    // multiple uses of path
}
 
 
1 hour later…
6:21 AM
Hello
wow, this is cool
cya!
 
 
1 hour later…
7:46 AM
how i can use it
 
@steven Use what?
 
i means this chat room please tell about how i can use it for my programming purpose
 
@stevenspielberg with your keyboard?
 
ok it is like google talk
 
8:12 AM
i have a List<struct> who have some item on them how i can count all who have the a same value as i need to count who all have amount 0;
 
int count = list.Where(item => item.Amount == 0).Count();
 
thanks a lot tim
 
Hey guys...does anyone know how to standardize format of datetime here?
 
what format do you want?
DateTime.ToString supports a variety
 
so that dateTime.ToString() gives 2010-10-14 18:21:10
0
Q: Setting dateTime.ToString() format centrally

MulkiHow do i set the DateTime format centrally so that at any time if I use a dateTime.ToString() in my code I get string in the ISO format(eg:2008-2-19 01:00:00) Edit I am looking for something like this using System.Globalization; using System.Threading; protected void Application_BeginRequest...

the context
 
8:29 AM
pass a CultureInfo and a format into each call to ToString
relying on Thread.CurrentCulture etc. is painful
likewise on DateTime.Parse and related calls
do you use FxCop? There's a rule on there that enforces this
 
nope...dont have fxcop
does it enforce it everywhere
 
it's included with Visual Studio; it's called "Code Analysis"
yes: it looks at your compiled assemblies and checks that you're passing a CultureInfo parameter where it's needed
 
i need DateTime.Now.ToString() to give me in a fixed format
anytime its called
by any developer who's working on my code
FYI...the culture info is being set fine...but date format just doesnt change
 
you need date.tostring("yyyy-dd-mm hh:mm:ss")
 
thats what im doing at the moment
 
8:35 AM
what's wrong with passing the format each time?
 
is there some way i can set the datetime.ToString() default format
cause there might be places i wont do it explicitly
for example if i have a datatable
 
@Mulki right; this is why tools like FxCop are useful
 
and i have a function to convert the whole thing to a json text
 
i thing you need to make a extension method to solve this problem.
 
or apply some coding standards
 
8:38 AM
@Tim: let me take a look at fxcop...not used it before
 
like I say, if you're using VS2008 or later, you'll already have a Code Analysis menu option
 
im on 2010
 
then unit testing too.
 
where is codeAnalysis on 2010?
does it do a complete code analysis
 
what do you mean by complete?
 
8:41 AM
@steven: Yes unit test is really required now...iv not even started on it..the disadvantages of never seeing a test driven asp app before
 
@stevenspielberg +1 for unit testing - you'd find out straight away if you were making a bad ToString call
 
@Tim: Complete as in the entire project's code analysis
hey there are some places where i wont even call it...
for example i have a function which writes anything in a datatable to jsonstring
 
I think by default it analyses all the projects in the solution
if you run FxCop standalone you can pass it a set of DLLs
 
8:56 AM
@TimRobinson I thought that was the only way to run FxCop
I don't think all versions of VS have code analysis, thought it was only included in Ultimate or Team editions
I ran my code through FxCop once, it said "yuck, don't do that again" :)
 
hei anyone der..??
 
9:12 AM
@PiersMyers ah, ok; the tool is still a free download though
@PiersMyers FxCop never congratulates you on your code: it only ever seems to complain
 
Like many validation tools, FxCop and Code Analysis on existing code will create a lot of noise. They are very hard to use retroactively. Far better to start your project with them on and keep up with the warnings. Alternately start with just a single check enabled, and add more checks incrementally.
Also you probably don't need all the checks anyway.
 
9:48 AM
hhhi
 
 
1 hour later…
11:14 AM
@stevenspielberg Please read this: msmvps.com/blogs/jon_skeet/archive/2010/08/29/… and then revise your question. As commentors have noted: it is hard to see what the problem is.
 
@Richard i am not born in English country so i write as well i can.you can find that i already update them
 
So where is the description of what you have tried and what you expect to get. Writing a (unit) test case would be a good way. While we understand that English can be a barrier, if we don't understand we don't understand. In 15 minutes you have no answers so either the problem is very hard, or we don't understand. ["We" being the collective potential answerers.]
 
 
5 hours later…
4:01 PM
Will the chat just end up being full of people "Answer my question - [Link]"!
 
Rather depends if anyone here brings up a sufficiently interesting area of discussion.
Of course chat's primary reason is either off topic wibble or question specific...
 
How long has this thing been here?
 
days
friday?
 
4:25 PM
anyone familiar with spring.net db:provider?
 
I have a discussion topic/compliant about c#.
I make an interface. I give it a function signature like this:
public interface ILoader
Load(ILoadable loadable);

I make a generic class like this:
public PersonLoader<person> ILoader where person : ILoadable
{
Load(person p){}
}
and I get a compile error!
 
what's the error?
 
does not impliment interface ILoader
 
well, it doesn't
Load(ILoadable loadable); != Load(person p)
 
try defining your interface like: public interface ILoader<T> where T : ILoadable { Load(T loadable); }
 
4:27 PM
bingo
 
but then my interface has to be generic too
the point of the interface is that I don't know T most of the time
 
but you know that it's an ILoadable
isn't that enough?
 
oh, maybe I misread what you suggested
I'll have to try that some
 
you'll want something like this: gist.github.com/634512
 
If you don't want PersonLoader to be generic, you could make Load(ILoader) an explicit interface implementation. (And check that the passed object is really a Person at runtime)
 
4:32 PM
right, but that's somewhat of a code smell
it sounds like you want to define an interface that allows implementors to load strongly typed ILoader objects, while still retaining the ability to do more general things with the object that was loaded (i'm just guessing at the other stuff you want to do)
as such, implementors should be forced to declare the type they are loading, and the ILoadable interface should be complete enough to do whatever more general things you'd need to do
 
my real thought, is that it seems like if I tell a generic class that it requires <T> to match the interface, and my load function requires that interface, the compiler should know better
I ended up having to work around the problem, but I've had it before, and I was wondering if there's a way to make it work for next time
 
i think you are dealing with issues related to co-contravariance with generics
see this for more details
well... not generics because you're not using them
but it seems similar... or maybe not ;)
 
hey fellows.
 
well, now that I think about it... consider this scenario: if you were allowed to do what you purpose would this be valid?
http://gist.github.com/634543
line 5 would be valid according to the definition of ILoader, but not according to the definition of PersonLoader
 
4:54 PM
yeah it's true
I suppose that's probably why it doesn't work
and since the code I'm writing would (in theory, heh) never do that, I didn't see the problem
 
5:54 PM
@Mulki Please refer this link. It contains the information about DataTime formats you are looking for. msdn.microsoft.com/en-us/library/az4se3k1.aspx
 
Hello, did somebody know if they exists some documentation to study .net 4 WCF for microsoft exam ?
Other than MSDN
 
Hey guys, I'm curious if any of you have come across articles regarding dotNetOpenID that you'd recommend. I'm looking to implement Login controls similar to those they use here on Stack Overflow. I've been playing around with the samples, but not entirely sure where to go next.
 
@Josh The current NerdDinner website allows logging in though OpenId; there should be example code for how to do so in that codebase
 
Awesome, thanks akmad. I'll go check that out right now.
 
6:50 PM
@akmad For some reason I was never successful in implementing openid in my website. \
 
@CyrilGupta I haven't used it myself so beyond knowing that the example code exists I won't be much help
 
7:12 PM
@thepaulpage Why not implement ILoadable explicitly?
 
7:47 PM
@stri
ah!
@StriplingWarrior I don't quite understand what you mean
 
8:02 PM
hi all, quick question, does anyone know how to make an application only run on a certain number of processors (cores)? I'm trying to test how my paralell C# app runs on 1,2,3,4 cores
 
you can explicitly implement the interface in PersonLoader via: void ILoader.Load(ILoadable loadable) { ... }
@RodH257 take a look at processor affinity: msdn.microsoft.com/en-us/library/…
 
thanks
 
8:39 PM
@thepaulpage Akmad's answer explains what I mean. However, as he pointed out in his gist link earlier, you would have to determine if you're really implementing ILoader (as in, I could pass a specific PersonLoader any kind of ILoadable object).
 

« first day (3 days earlier)      last day (4948 days later) »