« first day (745 days earlier)      last day (4186 days later) » 

2:00 PM
You want to remove the extension only if the filename contains a dot?
 
hardcode which extensions you want to remove, a regex can help

var extRegex = New Regex("^(txt|gif|pdf|doc|docx|xls|xlsx)$");
string filename = @"\ACOSTA\thumbs\4011\1212\22.11.jpg";
if extRegex.IsMatch(Path.GetExtension(filename)) {
Path.ChangeExtension(filename, null);
}
 
@Chets -> following codes:
string str = @"\ACOSTA\thumbs\4011\1212\22.11.jpg";
            string str1 = str.Substring(0, str.LastIndexOf("."));
            if (str1.LastIndexOf(".") > str.LastIndexOf(@"\"))
            {
                str = str.Substring(str.LastIndexOf(@"\") + 1, str.LastIndexOf(".") - (str.LastIndexOf(@"\") + 1));
            }
            else
            {
                str = str.Substring(str.LastIndexOf(@"\") + 1);
            }
 
well, lunch time, see ya!
 
string noExt = Path.ChangeExtension(filename, null);
if (Path.HasExtension(noExt))
{
    filename = noExt;
}
@RoyiNamir It does.
 
Hi . How can i FORCE

maxYear = FromDate_DT.AsEnumerable().Select( c=> c["From_Date_Year"].ToInt()).Max()

to fetch data now ! ?
 
2:03 PM
@RoyiNamir Yes.
 
thanks
 
@KendallFrey -> Ur solution is good.
 
Whammo! I replied to a future message!
 
I deleted by mistake
 
Anyone any idea why I cant 'Add Service Reference...' via the context menu in VS2010?
 
2:04 PM
I thought only the ToList() etc....
 
@LeClerq what version of .net are you targetting?
 
The rule of thumb is, if it returns an IEnumerable or an interface inheriting from it, don't expect it to run, otherwise do.
 
It says 'Microsoft Entity Framework June 2011 CTP' in the target framework
 
@LeClerq O.o I've never seen that before
 
I use that since I want true enums in EF and .NET 4.0 doesn't provide this
 
2:07 PM
@KendallFrey ToDictionary() returns a dictionary which does implemen t Ienumerable and it DOES run right away
 
it's known as .net framework '4.1'
 
... an interface inheriting from it ...
Dictionary is a concrete type.
 
@LeClerq oh ok, then its not .net framework stopping you.
 
if it returns
ok
 
@Maverik furthermore I have a couple of projects in this solution, some of them DO provide a 'Add Service Reference...' option
 
2:09 PM
hey , in tsql if I write this "DECLARE @Count int" and the value that I pull from the table is null , will tqsl know to turn null into 0 ?
 
@LeClerq may be VS Project file is missing a relevant GUID that hints VS about Service Reference
you can compare the project files in notepad or something to see the difference in ProjectTypes
(assuming the project types are same according to your knowledge but VS doesn't seem to know that)
 
@Maverik I tried switching to target framework 4.0 for this particular project, and suddenly the menu option appears...
 
just add reference and switch back
i've found 4.1.x updates to be hard to work with in vs designer stuff
i normally do everything in 4.0 and then switch to 4.1.3 (if i need 4.1 functionality)
 
@Grixxly
where you at?
 
@Maverik will try his, thanks
his = this
 
2:15 PM
@LeClerq i actually read this as "this" ;)
mental auto-corrects ftw
>.>
 
it's all context related ;)
But hey it seems to work
although the Service Reference folder disappears if you select June 2011 CTP as target framework :P
Thank god for auto completion
sorry, I stand corrected: this doesn't work after reopening
 
Is there any (fast) way to take a screenshot of a certain screen which actually copies whatever is on the screen? (Graphics.CopyFromScreen isn't what I want, it should copy the cursor, DX contents etc..)
 
I'm guessing not.
At least not in less than 5 lines of code.
 
Well, the operation should be fast, the code may be longer :P
 
I'd be surprised if taking a screenshot was blazing-fast
then again, what do I know about that
are you expecting to make videos from those?
 
2:25 PM
Well, "blazing fast" isn't what I expect obviously, CopyFromScreen isn't that fast either
No, it's a preview of a certain screen
 
look at that little gem I just found lol
Console.WriteLine("You assumed this program had help, sucker...");
System.Threading.Thread.Sleep(1500);
Console.WriteLine("..Fine:");
(help follows)
 
lol :P
who ever uses help :<
 
haha niiiice
 
It looks like you can't get the screen with a cursor already on it. It seems most implementations draw the cursor after the fact.
As for DX, I don't know.
Maybe you can grab the buffer in between the video card and screen?
 
I've heard that most graphics card have at least one sprite tile that OSes use for the cursor
that's kinda neat
or not
 
2:29 PM
@KendallFrey Well, that's somewhat what I want, just no idea where to start and Google didn't offer a lot of help
Thought it'd be very easy to just copy the final display :P
 
Problem is, that final display is probably out of control of Windows.
Especially with DX stuff.
 
So basically request the GFX card to "send" the display or whatever
 
If you could somehow pretend to be an external monitor...
 
lol
 
That would only work on single-monitor setups though.
 
2:32 PM
I don't think that has good results XD
 
I know its not .net but should give you an idea on how to get started
perhaps starting from Managed DX
 
@Maverik I created a separate library project just for this service reference (targeting 4.0), so problem solved
thanks for suggesting the target framework :)
 
@LeClerq lol good plan - i kinda did that too I think in one of my projects :D
np.. it was an annoying problem to figure
 
@Maverik interesting, thanks
 
@LeClerq I've also since started using svcutil to get me a cs directly instead of going through service reference
@Tgys you're welcome
only time i don't use svcutil now is when I want to avoid async variants (for some weird reason svcutil refuses to honor /noasync)
 
2:39 PM
DX SDK is 572 MB, great .. :P
 
My company's website just sent an sms to my phone. I made that happen. feelsgoodman.jpg
 
nice
 
@Billdr SMS is dying so hard
 
@Tgys its actually gone down in size.. it used to be bigger!
 
doesn't matter; got paid.
 
2:42 PM
there was a time when i had to download entire windows platform sdk just to get the dx bit
 
I love when I see English with the phrase "else if"
 
lol :P
@Maverik Poor you
 
imagine gbs of download on a 256kbps link.. not fun man
 
about 2 MB/s now zzzz
 
2:43 PM
yea .. this is about a decade back when i was doing my final year
 
I can't download faster because my disk can't process it fast enough :)
 
:6019115 I don't even know who I'm replying to yet.
 
lol
 
Dang.
 
Nobody.
 
2:44 PM
@Tgys your hdd is having trouble keeping up at 2mbps sustained write? O.o
 
:6019145 test
 
@Maverik Well, it can go to 5 mbps, but really not faster
 
:785745 knock it off, slacker.
 
my D drive at least
my C is much lower :3
 
This isn't working :(
@Billdr You severely misunderstand the chat system.
 
2:46 PM
I misunderstood what you were doing. I have not studied chat at all.
 
Yesterday wanted to move 40 GB of data, took 3 hours
 
I'm replying to future messages.
 
lol
 
I can do it with an edit, watch:
@Chets Testing...
 
@WileyMarques hey thanks it works fine
 
2:47 PM
Even Microsoft uses checkboxes the wrong way. i.imgur.com/6xUmB.png
 
Voila!
 
@Tgys holy cow - what kinda hdd is that?
 
You are magic.
 
I am.
 
@KendallFrey @MRS1367 thanks guys
 
2:47 PM
He confesses! Burn him at the stake!
 
@Maverik I have no idea.
 
lol @ checkboxs -- tick both!
@Tgys on a laptop i'm guessing?
 
No, some huge tower XD
 
@Tgys Bahahahaha
 
Well, I'm getting a new machine soon(tm) with some sexy SSD thingy
 
2:49 PM
@Tgys i cannot recall the last time it took me that long for that much data - not in last decade at least >.<
 
maverick == spoiled
 
well it were tons of small files
 
@Maverik oh svcutil... forgot all about that!
 
No idea why, but transferring 1 huge file over FTP is a lot faster then tons of small ones
 
I like the idea of a separate project more, though ;)
call me 'young and foolish'
 
2:51 PM
"installing DX Runtime"
few years later...
 
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); <--this is bad form, right?
 
Windows decides to swap between a "loading" and "normal" cursor every 500 ms now
 
Having a variable Logger of the class Logger?
 
Your variable has the same name as the class. Blech.
 
@KendallFrey Too Sexy
 
2:51 PM
Microsoft does it all over the place, so it must be good.
 
@LeClerq no no - svcutil generated stuff in a seperate project.. then i can throw some nice candy into mix like adding client side validations :)
 
I'd call the var _Logger
 
the C# name resolution rules make it possible and as far as I know there aren't any issues with doing that
 
That would make more sense. I'm not sure how badly I want to rewrite my leads' code though :/
 
F2?
 
2:53 PM
@zneak Still screwy.
 
@Tgys so I guess you get to do this:
 
lol :P
 
what's so screwy about it?
 
@Maverik Image not found, but I still know exactly what it is.
 
I have to confess I do it all the time
 
2:54 PM
@KendallFrey dang it I forgot about censors!
 
If I have to explain, it's not worth it.
 
Somehow I dislike C++; probably because of the long long compiling times
 
Then don't use Sandcastle :)
 
"Copying file"
Yea that'll take ages here :P
 
@KendallFrey spoiled: yes! but on my gaming rig that's better than my dev machine :D
 
2:56 PM
our team uses a program that generates VC++ projects and it seems that VS2010 won't show me the most up-to-date version of it
 
My gaming rig is my dev machine.
 
is there some cache I need to flush somewhere?
I don't feel like asking my lead
 
10k rpm sata III in raid 0 to give you an idea as far as hdds go
 
I have to press "Rebuild" every time I change a linked file :P
 
@KendallFrey You are doing it correctly.
 
2:56 PM
my gaming rig is my lief! <- no thats not a typo :)
 
I wish my gaming rig was my dev machine lol.
 
I know a shorter way of saying "no thats not a typo"
 
@Tgys VC is supposed to know what needs a recompile in Incremental compiles
 
it doesn't.
 
@Maverik Your gaming rig is a nordic man?
[sic]
 
2:57 PM
well it's mainly Intellisense which enables trollmode
 
@Billdr yes
 
@Billdr hmm now that would be something!
btw guys.. serious question: anybody knows of a way to have MSSQL replicated to MySQL (automatically to keep them in sync) ?
 
Thanks for the status update installer. i.imgur.com/LDIf9.png
 
non-serious answer: Don't try all the stupid migration stuff.
 
@zneak I suspect gremlins in your case. Reboot the pc! (or cycle all the services related to your project, including visual studio)
 
2:59 PM
yeah that's the next thing on my try list
 
Stop ysing mssql?
 
@KendallFrey i know the stupidity involved but there's only so much i can tell the client
 
fkin gremlins
 
derp
 
their "app" is an access MDE that talks to MSSQL but their website is in php that talks to mysql
 
3:00 PM
let's see what reboots give
 
mdb is so old fashioned
 
oh I see.
 
accdb ftw
 
Thanks stupid installer! i.imgur.com/h5Vvz.png
 
the two dbs need to be in sync, but aren't duplicates! (we need to sort of do MSSQL.Select(blah => blah2).CopyTo(MySQL))
 
3:01 PM
no gremlins involved
just some snafu
 
@Maverik If there is no duplicate data, they are in sync by definition.
 
@Tgys hope theres something in eventlog
 
@Maverik More importantly, Natural Selection 2 releases today. Did you take a look at it?
 
screw it maybe something is installed XD
 
@KendallFrey lol no as in db structure is different
 
3:02 PM
What is the deal with .net sources. Is it ok to spread it?
 
Why would you?
 
where does it even install..?
 
@Billdr yea I did, not my type of thing -- too much action :D
 
@JohanLarsson Legally? If you're in the US, I don't think so.
@Maverik rgr that.
 
0
Q: how to combine two keys or more

AMHhi I have a Key variable represent the E charachter I want to add the Ctrl and shift modifier to it I tried Key test = Key.Ctrl | Key.E ; but the result is J not Ctrl E any idea how to achieve that Best regards

The answer to that question is the source for KeyGesture
 
3:03 PM
Technically, I don't think you're allowed to look at obfuscated javascript in the US.
 
Should be legal to post a snippet on SO.
 
HAHAHAHA, fair use you say.
 
Since they can look at it themselves anyway.
 
@KendallFrey That makes sense
 
3:04 PM
@Billdr The question is, at what point does it become obfuscated?
 
Anyone knows where the DX libs install itself?
 
@KendallFrey At the point where someone complains when you look at it.
 
@Tgys Asuume they haven't.
 
it's kinda funny how law is a lazy process
 
@Billdr In that case, all our custom JS was obfuscated.
 
3:05 PM
everything's legal until someone complains
 
@KendallFrey They need only make "an attempt to protect" their IP.
 
@KendallFrey Eh?
 
I cracked my company's encryption by cracking their obfuscated JS. Neither is worth mentioning.
 
Oh I found a directx.log
so useless at usual
10/30/12 15:52:28: infinst: Installed file C:\Windows\system32\XAudio2_0.dll
 
3:10 PM
I got to go and assist with the fkn horses again, they should be between two breads already...
 
3:23 PM
Sweet, I get to make my first singleton today. THIS IS MY EXCITED FACE.
 
I envy you so much right now
this is my envious face
 
This is my face face.
 
this is my 0xFACE
 
our codebase swells of singletons and classes that inherit from like 10 classes
but apparently singletons everywhere is a classic of game development
 
3:27 PM
We've got our share of those too. In fact, that's our entire old code base.
 
when I say "classes that inherit from like 10 classes", I don't mean a class hierarchy of 10 levels, I mean, literally, one class that inherits from 10 base classes
I'm not sure if it's better or worse
 
That's impossible in C#.
 
indeed
 
I hope you mean C++.
 
yes
 
3:32 PM
Did you know that it's possible to create an instance of an interface with the new keyword?
 
it's possible only for COM interfaces afaik
 
Shh. :P
 
it's funny, when I was your age one of my good friends would come up with the same C# trivia in almost the same order you're presenting it
 
Whaddya mean? I just shared one thing.
 
you've talked about unions before
 
3:35 PM
o lol
 
and I thought you were the one that brought up shadowing yesterday but now I remember that it wasn't you
o well
I'm going to share something funny as well
you might know that there was no AccessViolationException before .net 3
any access violation would pass as a NullReferenceException
 
Brutal.
 
any idea why?
 
Microsoft.
 
lol
the reason is that .net never checks that your objects are null before you do stuff with them
the virtual machine just catches the access violation in its SEH exception form, and propagates it as a CLR exception
so NullReferenceException should really just be a special case of an access violation
but before .net 3 they got it upside-down since access violations at non-null addresses aren't frequent in .net programs
now the CLR checks if the access violation occurred at an address lower than like 0x10000, and if yes it throws a NullReferenceException, and otherwise it throws an AccessViolationException
 
3:42 PM
Oh, yeah, I get it.
 
so yeah, the NullReferenceExceptions aren't triggered by explicit checks
 
lol why not just check for 0?
 
because access violations very rarely occur at 0
say you have a field at offset 8 from your class
and you try to access it on a null reference
the access violation will happen at address 8
(because it accesses the beginning of the class + 8 to get the value)
 
C# is special and emits instructions to dereference this in all method prologues so with just C# that would not be an issue, however C++/CX (that's what managed c++ is called now, right?) doesn't
 
3:46 PM
C++ CLI maybe?
 
yeah that one
in fact, in C++, if you use an instance method that doesn't use any member on a null object, it should work correctly
 
That's not managed C++, it's a version of C++ that supports both styles of code.
 
yeah
 
You can do that with extension methods in C#.
 
yes, I do it all the time for events
if you add a Raise method on events you use often, you can forego the null-check-dance
public static void Raise(this PropertyChangedEventHandler handler, string propertyName)
{
	if (handler != null) handler.Raise(new PropertyChangedEventArgs(propertyName));
}

/* snip */

PropertyChanged.Raise("Foo");
 
3:50 PM
I have a integer which can be anything from 0,1,2,3,4,.... infinity

Now I want to check if i is divided by 27 and I want reminder in Integer
 
i % 27
if i % 27== 0, i is divisible by 27
the % gives the remainder of the division
 
What type is it? int doesn't support infinity.
it only goes to ~2 billion
 
I am just giving example
ah I see
 
be careful if either operand is negative, the result sign is likely to not be the one you want
 
well a page can have 27 items on it, I want to calculate number of pages
 
3:52 PM
stringsList.SequenceEqual() -> I want to use case insensitive comparer, anybody knows how can i throw that in as IEqualityComparer<T> argument ?
 
now items can be 0 or can be any number, but I want number of pages in integer
 
@Maverik, uppercase both strings using ToUpperInvariant
 
How can i declare a array of objects
 
object[] foo = new object[count]
 
object[]
 
3:53 PM
well yea thats a work around, but i was wondering if there was a more elegant way of doing it by leveraging the builtin equals of string that has StringComparison as argument
 
@TimeToThine, Math.Ceil(items / 27.0)
it probably uppercases the strings under the hood to do it
 
@Maverik You could, heh, use Zip and Any or All.
@zneak You really think so?
 
wow - I just received four pings from you kendall - is that some voodoo you're working on? :)
 
four?
 
@KendallFrey it might not create objects, but it almost certainly uppercases the characters or do something conceptually equivalent
 
3:55 PM
should be 2
I'm guessing the latter.
 
Phew, Sandy didn't wipe out StackOverflow.
 
Well, considering she didn't hit Oregon...
 
their offices are in new york though
apparently sandy is the diminutive for alexander
 
their datacenter is in NYC
 
But they failed over to Oregon.
 
3:58 PM
chat is hosted in oregon
ahh
 
Even if NYC went down, SO would still be up.
 
I read somewhere that SE was hosted in new york, didn't know they could fail over.
 
@KyleTrauberman It's recent. We literally tested it for the first time last weekend.
 
that's what I thought
 
Sweet
 

« first day (745 days earlier)      last day (4186 days later) »