« first day (746 days earlier)      last day (4208 days later) » 

3:00 PM
@tranceporter 2015 right?
 
Hellz Yeah. I am gonna pin it in my calendar right now. And Hitman Absolution.. waiting!
another 20 days
 
hello all
string[] digits = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
var shortDigits = digits.Where((digit, index) => digit.Length < index);
i was not able to understand this linq..
 
Does that compile?
2
 
yes
 
@LewsTherin 1 star for the right question
 
3:11 PM
Oh wait let me check MSDN
 
ok
 
Ok yeah so it will compile
So for each iteration it takes:
"zero",0
"one", 1
"two", 2
etc..
Then it checks if (string.Length < index)
 
Looks like it will grab all the numbers that are shorter than the number itself.
 
All the strings whose length is less than the index
 
five, six, seven, eight, nine.
 
3:14 PM
Yep
 
ok'
 
I need kendall help
why is this a redirect loop?
    If Request.Cookies("EventID") Is Nothing Then
        hidEventID.Value = Request.QueryString("id")
        Dim HttpCookie As New HttpCookie("EventID")
        HttpCookie.Value = Request.QueryString("id")
        HttpCookie.Expires = DateTime.Now.AddDays(30)
        Request.Cookies.Set(HttpCookie)
        Response.Redirect("Attendees.aspx?id=" + Request.QueryString("id"))
    End If
anyone?
This should be setting cookie , it never gets set , and always is nothing
 
@LewsTherin u have any link to understand LINQ formats like above?
 
Random guess: The cookie isn't persisted between redirects.
 
thats my random guess, but why not?
 
3:21 PM
@KendallFrey :O lol
 
@ScottSelby I know next to nothing about cookies. Could it be the cookie is somehow only associated with the page, and redirecting clears it?
 
no
cookies are not connected to page , they are connected to the browser
I think instead of Response.Redirect, im going to try Do Postback , hopefully that is a real keyword
 
try Server.Transfer
if you do want to keep browser history
do not*
 
3:27 PM
@KendallFrey @LewsTherin thanks
 
Ben
You know with Disney owning Lucas, the next Kingdom Hearts game could have Ewoks and Jedi and Sith.
 
3:42 PM
Guys, I am referencing a dll from another soloution, but when I change that code and recompile, in the other soloution it does not get updated, for example if I change a mehtod signature it doesnt detect the change even if I remove and add that dll gain
any ideas?
 
Did you try building the entire solution?
 
Are they both getting compiled and referenced from the same location?
you might be referencing from c:\, and building the output to c:\bin
 
I'm wondering if you added the wrong kind of reference. Did you add it as a project reference, or by browsing to the DLL manually?
 
just the DLL manually
 
Add a project reference instead.
 
3:45 PM
hmmm let me try :P
doesnt matter if the project is another soloution ?!
 
Yes.
They need to be in the same solution.
If you're changing code in two related projects at once, they should be in the same solution.
 
ah then how I am supposed to work on an ongoing dll ..would be nice if it could figure out that the dll is changed
 
Note that one project can be in multiple solutions.
In fact, that is the best way to add references to your DLLs.
 
aha! got the idea
but guess what, I am gonna use my STAR power again :D
 
If you are adding manually, you should add the reference from the output folder of the other project. That way, when you build the other project, the referencing solution should get the updated dll
 
3:51 PM
Manual references lead to all sorts of delightful issues when you change the build configuration.
 
true
 
thanks
 
Posted on the site, but no takers... Anyone any idea? stackoverflow.com/questions/13159753/…
 
4:12 PM
ugh Mandatory Harrassment Training.
wtf
 
I guess someone at some point filed a complaint
 
they do it every year
at least its online
and I can just spam clicking next
 
growing up, my biggest shock was finding out adults still need discipline once in a while
 
Facts: Joe is an important customer of Bill, who is the sales manager at a large manufacturing company. Erin is African-American and she is the receptionist at Bill's company. Joe has been making derogatory comments to Erin about her race when he visits the company on a regular basis. Erin tells Bill that she does not like Joe's conduct.

Question: Can Erin be unlawfully harassed by Joe even though Joe does not work for her employer?
ugh
 
I wonder if anyone ever got that answer wrong
 
4:20 PM
Happy casual/dress like a weirdo day
@KyleTrauberman Unfortunately yes. People can feel "harassed" by walking down the street and hearing those words from a stranger 2 blocks away
 
yep
this is so easy
 
The fact Joe has been talking to Erin, makes the harassment more real
 
multiple choice
"is this harassment?"
 
now if Joe just said those things in private to others and Erin eves dropepd, well then she'd really have no right
 
all but one choice is no
 
4:22 PM
I hate this harassment crap. Just grow a fricken spine and be done with it
Mark down "No. Erin needs to grow a spine and man up. "
 
@KyleTrauberman Which begs the question if Erin can be lawfully harrased if Joe worked for Bill.
harassed*
 
woohoo
100%
now i'm done with that crap
 
@zneak don't think that's a duplicate. that will give you the runtime version, but not whether you're running under client profile, etc.
 
Hey C#, I need an advice on elegant solution. I'd like to delete elements of the Dictionary<string, Object> while iterating over it. Like:
foreach (Object object in dictionary)
{
// some work with object
dictionary.Remove(object.Id)
}
The best solution I came up to so far is to iterate over a copy of the keys collection using it as keys.
string[] keys = dictionary.Keys.ToArray();
foreach (string key in keys)
{
// some work with object
dictionary.Remove(key);
}
 
@Nanako You cannot change the collection you are iterating over
 
@zneak Would you be interested in a job in Sweden?
(We are hiring)
 
so you will have to create a copy, like you are doing, and delete the items from the copy.
 
@Johan could be awesome, but I'm booked until next Fall lol
 
@tranceporter I know. I guess there is some other way like a for loop through indexes or something like that
 
4:36 PM
Sweden is a place I'd really love to go to
 
7
Q: C# - Change value of dictionary key-value pair while in foreach

JamesI have this code which is being run every frame of a game: foreach (var repeaterAction in conditionTimes.Keys) { if (repeaterAction.Condition() == true) { if (conditionTimes[repeaterAction] == TimeSpan.Zero) { repeaterAction.Action(...

 
unfortunately I only speak French and English (and I have no idea what it would be like to get a work visa to Sweden, although I wouldn't expect it to be too hard)
 
gtg again, horses agian FFFFFFUUUU
 
@Nanako same solution as yours..lol
 
@zneak I would be surprised if visa turned out to be a problem if you have a job
If that was the only problem we could always marry :)
 
4:38 PM
lol
 
@tranceporter I thought maybe C# has some sugar like the Python has. In Python you can iterate over Values and modify the dictionary.
 
if you're still hiring next year I'd certainly consider it
 
If I'd write to a MemoryStream using a BinaryWriter, then use Bitmap.Save on the initial MemoryStream, will it write behind the binarywriter's stuff or overwrite it?
 
Probably overwrite.
 
@Nanako, you can always iterate over ToArray()
 
4:43 PM
Actually, not so sure.
 
(that will make an array of key-value pairs)
 
@zneak ToArray() does the same as CopyTo AFAIK
I've found the ConcurrentDictionary class
 
Dictionary doesn't have a CopyTo, does it?
 
Dictionary.Keys does have
my bad, I used ToArray() :)
 
well I can tell you that there is no way you can iterate over a collection and modify it at the same time in .net, so whatever you want to do you will need at least one additional collection
 
4:46 PM
O RLY?
I've cleared lists by iterating already, though I don't know if I ever did in .NET.
while (!empty)
{
remove(first);
}
 
I'm using dictionaries, not lists
 
@KendallFrey meh
 
Fine. Collection.
 
that's not really iterating over the collection (in the IEnumerable sense of it)
 
AMH
any MVVM silverlight gurur here
 
4:48 PM
@KendallFrey An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.
 
I wonder if repeatedly going to the first item would work...
@tranceporter Guess not :)
 
ConcurrentDictionary<string, Object> dictionary = new ConcurrentDictionary<string, Object>();
dictionary.TryAdd("1", new Object());
dictionary.TryAdd("2", new Object());
dictionary.TryAdd("3", new Object());

foreach (KeyValuePair<string, Object> kv in dictionary)
{
Object o;
dictionary.TryRemove(kv.Key, out o);
}

it works !
 
are you sure that using a ConcurrentDictionary is more elegant than storing the keys to delete in a list?
 
I love C#
 
4:53 PM
But JS is cooler because (![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]
 
Faaaaaaaaaaaack
 
FYI, that expression evaluates to "fail"
 
Less code = more elegant, also It's a multithreaded app so I guess I'll make use of some ConcurrentDictionary magic later
 
Less code != more elegant.
 
@KendallFrey starred
 
4:55 PM
Single letter variable names != FTW
 
elegant code = code with comments/self-explanatory code without voodoo magic
 
@KendallFrey long variabeles != FTW
 
Preferably self-documenting code.
 
I use single-letter vars within methods themself
 
geez guys, I use long and awesome names for my vars and document everything, but It was a snippet to post here
 
4:56 PM
If you have more than 1 comment per 10 lines of code, you're doing it wrong.
 
I have less then 1 comment per 100 lines of code :)
 
@Nanako I wasn't bashing you, just stating my opinion.
 
@KendallFrey we will never agree on that. Doesn't mean i document every for each, but if/else conditions have comments to explain decision making process.
 
@Tgys That is a good thing.
 
@KendallFrey you're right actually
 
4:57 PM
I know right, nobody can understand it besides me (unless a week passed)
I really get sick of threads
I can't get them shut down themselves on a nice way once the window closes >_<
 
The reason for comments is not to explain what happens. That should be obvious from the code. Comments are to describe why the code is written that way.
 
but I thought "less code" means you use the power of the language up to the limits
 
@Tgys Perhaps make them background threads?
 
I used to love threads, now I only love asynchronous task queues
 
stupid laggy internet
 
4:59 PM
It's mainly caused by a Socket's BeginReceive I guess
 
an example of comment ..lol . @Kendall will hate this
public int GetPositionForOfferAndType(long offerID, EItem_Status.OfferTypes offerType, int channelID, int countryID)
{
var offerTypes = offerType.GetFlags();

foreach (var type in offerTypes)
{
// This loop for offerTypes was added so that AllVouchers tab on frontend, would see the top offers
// by offer position, just like Mobile, Printable tabs do. This code was initially equipped to only
// deal with single offerType at a time (which is the case when Mobile or Printable vouchers tab is clicked)
 
I wouldn't even be bothered reading that wall of text
 
@Tgys Then you need the comments
 
I think that comment is in the wrong place.
It looks like it belongs in developer documentation.
 
5:01 PM
I use threads because I can't use TPL within event handlers properly
 
Just name your methods normally, eventually add some XML thingy for VS
 
I write comments about my assumptions when I feel I'm doing something fishy
 
TPL is best for UI updates and actually works in one thread AFAIK
Threads FTW
 
It's Truely a good day when you realize you could re-write a 1+ million line code health care system in JavaScript... ugh
 
Is there any IDE for JS anyway?
 
5:03 PM
I stopped reading when I saw var...
 
@Nanako What do you mean? TPL uses background threads, lots of them.
@Tgys VS?
 
@KendallFrey actually, it syncs with the TargetProcess bug/feature requested, so when someone goes to TFS, and sees the changed code in that file "History", they can read the comment and understand why it was done
 
VS supports JS? lol
 
Yes.
 
Then, I could add it to TFS as part of checkin, put people will read the code more than comments on check-in's
 
5:04 PM
oh well :)
 
@tranceporter I fail all reviews if I don't see comments on checkins. When people are looking for what was checked in, it's easier to read 1-5 lines of comments than massive code chunks
 
@RyanTernier Nothing wrong in using implicit vars, if it can aid refactoring. Depends on personal preference. I don't like red. I avoid looking at red cars on the motorway..lol
 
@RyanTernier Are you referring to commit messages or // these things?
 
@RyanTernier So you are saying that if I fix 6 bugs in a check-in, I add documentation for all of those in the check-in text?
That's mental
 
@tranceporter It reduces maintainability when you have a good # of dev's on a single project.
 
5:06 PM
@KendallFrey can you point me, where the background threads are mentioned, describing how TPL works
 
Only if you ask a specific question.
 
Ideally, I would do one check-in per bug, but that creates a plethora of check-ins and history to wade through, if you feel like backtracking
 
@KendallFrey Both. If I don't see checkin comments, and I don't see // comments for some things it will fial
 
AFAIK Tasks are just scheduled to run within one thread
 
@RyanTernier You are a tough manager indeed.
 
5:07 PM
Fairly sure that tasks run on as many threads as you have tasks
 
@Nanako Only with async/await.
 
@tranceporter Example:
-Fixed Defect 243 by changing the DB COnnector
-Fixed Defect 104 which was in the PErsonLoad class
-Fixed Defect ABC where Chuck NOrris actually died. etc.
 
(or up to some thread pool limit somewhere)
 
@zneak Not necessarily.
They gete queued up on the thread pool.
 
Commit messages on checkins can include fixed bug numbers, and that itself is enough. You can go to your bug tracking system, find the bug info, then see the checkin changeset, and read the comments on the changed code
 
5:08 PM
@KendallFrey We have processes, and everything must be tracable. Every checkin must be traced back to a requirement/feature/defect, otherwise why were you doing work?
 
@RyanTernier -Fixed Defect 104 which was in the PErsonLoad class : What is the point in mentioning PersonLoad class, when you can view the changeset and see that PersonLoad class was modified?
 
Our standard is to have a ticket number and short (<10 word) description in the commit message.
If someone wants details, they can look at the changes.
 
@tranceporter because when I look at 50 commits/checkins in 1 day, I dont' want to hunt through classes to see what was done.
 
What's the best part of a UDP joke? I don't care if you get it or not.
6
 
@RyanTernier If you have to without comments, you're doing it wrong.
 
5:10 PM
@KendallFrey If I have to ...? what?
 
@RyanTernier that's why we have code reviews... I almost always ask for more comments :P
 
@RyanTernier You are looking at it wrong. If you know the bug that was fixed, but is not working correctly, all you need to search for is that bug no in the comments on the checkin.
 
@RyanTernier You should be able to see where code was changed without looking for it.
 
I always write detailed commit messages. A short message describing the goal of the checkin, and details for each of the files
 
@KendallFrey so when you use Task.Start() it fires in another thread?
 
5:11 PM
@Pheonixblade9 Yes, that's where these things are caught. People called it crazy when I implemented these processes last year when I got hired, but our quality increased about 200% since then (customers and internal staff noticed it)
 
In our VCS, it takes <1sec to find the changed code.
@Nanako Yes.
 
@RyanTernier yes, definitely worth the time
 
@tranceporter My team works with SVN, not TFS, so a single checkin cannot automatically link to a Defect like it does in TFS. Because of that I require people to do those comments.
 
"Tasks are potentially executed on threads other than the main thread on multi-core machines." That's a quote from MSDN
@KendallFrey So you can't say it for sure
 
@Pheonixblade9 Sorry, but I just feel that's bloat and repeated stuff. If you are using tools like TargetProcess for project management, you already have feature, user stories and bugs. All you need are those numbers on the source control checkins
 
5:14 PM
@Nanako In theory, a task can run on any thread it wants to. In practice, it's rarely, if ever, that it runs on the UI or a user-created thread.
 
@tranceporter True, then someone can match them up. But when a client is paying $300 / hour for a project manager to get them a list of what was changed, it's a lot easier/chaper/better for the client to get developers to do more detailed notes, than for a PM to spend an hour digging through change logs.
 
@kendallFrey got it
 
@tranceporter we do the numbers on source control checkins, but you still can use the commit messages in the ticket to see exactly what changes the dev made. Documentation is almost never a waste of time
 
@RyanTernier Surely the client would want business notes? So all you do is pick a bunch of delivered user stories, and paste their description is a word file and send it. Why involve the dev?
 
SMH at this poor obfuscation.
 
5:17 PM
@Pheonixblade9 one liners per file changed like "changed the way vouchers were retrieved as per feature #2450" is enough
 
@tranceporter yeah, that's usually plenty. But when I'm writing an entirely new service, I want more details
That's what I usually do though
I don't comment on every line changed "removed unnecessary curly brace"
 
7 means to go
minutes.. damn
see you guys tomm
 
cya
I brought homemade pumpkin cookies into work... I think my coworkers love me :P
 
@Pheonixblade9 Everyone at my office dressed as one of the directors. it's quite funny
 
5:32 PM
@RyanTernier you said that! haha. One of my coworkers dressed as "the dude"
 
Just took a picture of Mugatu
 
@RyanTernier one of our architects has a sore spot for people calling him Mugatu...
 
I expected more people to dress here
I'm kinda disappointed
(not that I'm dressed myself)
 
we have a guy here in a skin tight spandex bodysuit
he's the crash test dummy
facemask and everything
 
5:57 PM
heh. We actually design crash test dummies, among other things
strangely nobody thought of that
 
6:18 PM
Finally figured out why my stupid app didn't shut down: Window.Hide != Window.Close
2
 
Obligatory lol.
 
 
WPF has a Timer class?
 
I think there's a DispatcherTimer, though I don't know why it would be necessary.
 
Tons of uses for that
 
6:37 PM
Still alive, from Long Island, NY.
 
My team lead is looking at our Javascript code base with Resharper. I think he's going to have a stroke or something, judging by the sounds he's making
 
Hello @KendallFrey
Do you know Xdoc in C#?
?
 
What's that?
 
stackoverflow users seriously lack girslfriends ..for the same ans he gets +20 votes and she gets +500 votes..haha
 
Xdocument @KendallFrey
@Pheonixblade9 can u help me?
 
6:44 PM
XDocument is a part of LINQ2XML..it represents the xml document structure
 
Ask the question already.
 
yes @Fake.It.Til.U.Make.It do u know?
 
@Abhishek sure, ask the question
 
@Abhishek We all know what it is. What is your question?
 
6:45 PM
XDocument and XElement are the root of XML hirarchy
hierarchy
 
I have a structure like jsfiddle.net/gAamH
 
XDocument and XElement allows you to access the XML DOM structure..it enables you to access elements,attributes,text,comment
 
I try to seach <loc> for English / Greeke as per condition I try to find <url> node and Add meta information to my page.
I create this for add SEO information dynamic from Xml file
Can u give me Linq query to get nodes?
 
@Abhishek what have you tried?
 
I tried with below Linq.
var q = from c in xmlDoc.Elements("English").Descendants("url")
where c.Descendants("loc").SingleOrDefault().Value.Contains(url)
select new
{
URL = c.Element("loc").Value,
Title = c.Element("title").Value,
Description = c.Element("description").Value,
Keyword1 = c.Element("Keyword1").Value,
Keyword2 = c.Element("Keyword2").Value
};
 
6:50 PM
lol. To keep the SE NYC data center on line (Peer 1), they are having to carry fuel up 18 flights of stairs in buckets because the fuel pump is broken.
 
And set to the Perticular page.
 
I create base page As below..
public class BasePage : System.Web.UI.Page
{}

protected override void OnLoad(EventArgs e)
{
// I wrote Above code here..
string fileName = Server.MapPath("~/Seofile.xml");
xmlDoc = XDocument.Load(fileName);
var q = from c in xmlDoc.Elements("English").Descendants("url")
where c.Descendants("loc").SingleOrDefault().Value.Contains(url)
select new
{
URL = c.Element("loc").Value,
Title = c.Element("title").Value,
Description = c.Element("description").Value,
Keyword1 = c.Element("Keyword1").Value,
 
@Abhishek that where clause doesn't seem to make sense. You look up the descendents of an element called url, then check to see whether any of them contain url. Your document doesn't have nested url elements.
 
means ! How can I find url from Xml..?
@TomW help me to find particular url from xDoc.
 
6:54 PM
say please, next time.
 
ok @TomW thankx
 
what particular url? what are the criteria?
 
xmlDoc.XPathSelectElement("\\English\url").Select(c=>

URL = c.Element("loc").Value,
Title = c.Element("title").Value,
Description = c.Element("description").Value,
Keyword1 = c.Element("Keyword1").Value,
Keyword2 = c.Element("Keyword2").Value
);
you can use Xpath in linq
 
Thanks @Fake.It.Til.U.Make.It Will it works?
 
6:56 PM
@Abhishek it should
 
@Fake.It.Til.U.Make.It wait I send a my code in jsfiddle..
 
> Well JAVA,JAVASCRIPT sucks
Javascript does not suck.
people just don't understand it
and every API MS ever gave us for IE sucked
 
javascript suxxxx
 
cool. I don't know what "suxxxx" means, but I will assume it is some new MSN slang for "fucking awesome, and the most actively developed in language in the world today"
2
 

« first day (746 days earlier)      last day (4208 days later) »