TY! It was bugging me I couldn't find it! -- Did you know that one already, or is your google-fu simply stronger than mine?
mgkr
Posts
-
Strange Version Numbering -
Strange Version NumberingAspDotNetDev wrote:
I bet there is some software out there that increments version numbers using only prime numbers (bonus points to anybody who finds something like that)
I recall reading about someone actually using the digits of pi as the version numbering system (actual released software system) ie. ver 1 = 3.1 ver 2 = 3.14 ver 3 = 3.141 etc (or something to that effect) Tried googling it to find it, but searching on anything with "pi" in it is near impossible it seems... (too many irrelevant hits)
-
Why Programmers Work At NightAbout 6 months or so ago, as a test ("it might work") we gave everyone 3 (large) LEGO blocks. One green, one yellow, one red (you can guess where this is going) You stack those, and display them on your desk/monitor/whereever - point being, they should be plain in sight, even from across the office. If the red LEGO is on top : It's basically "UNLESS IT'S ON FIRE, I DON'T WANT TO HEAR ABOUT IT" :) If it's yellow : I *am* busy/working - But It's OK'ish to disturb if you really have to (ie. it won't mean I'll lose 30 minutes getting back into the groove) If it's green : I'm currently only engaged in doing misc tasks that have probably been procrastinated anyhow (and that I'd prob rather not be doing) I'm up for anything (Only ever had that one once for an hour or two...). AKA feel free to talk to me / ask questions - or tell about your weekend. This is an incredible simple thing to do at any office - and the amazing thing is (at our office) it bloody works! Even our most talkative/impulse marketing/sales guys/girls will respect it. I've seen them get up and move towards a coder, only to spot the red LEGO and turn around and sit back down again. I've even tried having one of them ignore my red LEGO and start talking to me - For me to simply "pointedly point" at the LEGO stack and they shut up (this has happened only once or twice - in the beginning). Depending on your office, and the people there, YMMV of course. For us, it works surprisingly well. And it's such a simple thing to set up as well (aka. it's worth giving it a shot even if you doubt it'll work - As I did initially...)
-
Video games as artDiscussing whether games are art or not is all well and good. But doing so with reference to a MoMA exhibition who goes to some pain to explain that the games are *not* chosen based on how "art'sy" they are or not, is mis-representing what that particular MoMA exhibition is about in my opinion. Hence my post to try and rectify that - As reading the responses here seems to indicate most didn't get/read/understand that (in my opinion only of course) And thus could be (mis)lead to believe that those games selected are somehow more "art'sy" than those not selected - In which case they'd make fools of themself... Which could be embarrassing...
-
Video games as artI was trying to correct your mis-conception of
Colin Mullikin wrote:
MoMA (The Museum of Modern Art) in New York City has decided that video games are art
No - They have not decided any such thing as such (hence my change of title) What they *have* done is consider games in the context of DESIGN. And I quoted the relevant bit mentioning their selection criteria (as some apparently have missed that bit entirely) - and provided the link once more for those wishing to dig deeper. The games are not selected based on how "artful" they are or not - It's based on their design (with specific definition given by MoMA for what "design" is in this context)
-
Video games as artMoMA wrote:
Are video games art? They sure are, but they are also design, and a design approach is what we chose for this new foray into this universe. The games are selected as outstanding examples of interaction design—a field that MoMA has already explored and collected extensively, and one of the most important and oft-discussed expressions of contemporary design creativity. Our criteria, therefore, emphasize not only the visual quality and aesthetic experience of each game, but also the many other aspects—from the elegance of the code to the design of the player’s behavior—that pertain to interaction design
-
A Blatant Programming QuestionThe "clean" was in ""'s - As it was compared to the misuse of the
out
param. Strictly speaking I agree it's not clean, and one ought to create a new class/struct. But... I also don't like to clutter my code with tiny helper classes with no other functionality than storing a few values, so I can return it from a method call. Pest or cholera... But either way, I still think it's "cleaner" (can we agree on that :cool:) than misusing theout
parameter for this purpose (something I've also done... :-O ) -
A Blatant Programming Question"save you from creating a throwaway class" ^^This Ask yourself how many times you've (mis-)used the
out
param, to have method "return" two values. Sometimes you need two values back, and creating a class/struct for just that one method to be able to return the two values is.. annoying (and clutters the code) Using a Tuple instead is the "clean" way of doing this (and it can be expanded to more than just two objects) -
Colo(u)rful Words#BADA55 My personal fav ;P
-
Cranky Coder's Lorem IpsumCoding colleague of mine (the boss and co-owner even) 3-4 years ago made a placeholder text that ended up getting the Minister of Church involved... We develop a web based servicedesk application, where endusers can report various problems they might have. For each ticket there's two tracks of communication, one internally between the tech people, and of course one between the tech people and the enduser. One type of setup is to send mails to the enduser and/or whoever is responsible for solving the issue. Any change, and a mail is send advising of this. I think you can already guess where this is going... :cool: One of our clients (still ;P ) is the Church Ministry using the servicedesk to support all the priests (and their secretaries and what not) in the country. They one day requested a new mail template, which my colleague sat about implementing, doing a few tests etc. One of the test messages (intended for the internal tech communication track) was "The user is a bloody idiot" (which ironically ofc was true for 95% of the userbase, when it came to anything IT). I guess he saw that it worked, and simply copy pasted the template to the *external* communication track as well (to the endusers), instead of the standard "Dear {insertendusername}" - Your typical brainfart when stressed X| Lo and behold, this was discovered (rather quickly) when a rather upset (female) priest contacted the people actually doing the support, asking for an explanation for that message... Long story short, this particular priest must have been rather well connected (and having plenty of time...) and the "case" got all the way to the Minister of Church, eventually resulting in my colleague (and boss) actually having to write the "nice lady" a personal apology on request of the Minister of Church. So - Be careful what text you use in those innocent placeholder test cases, or you might end up having to deal with a well connected little old lady with too much time on her hands :omg: We naturally tease him with this at any opportune moment this day still, no later than today in fact :laugh:
-
WYSIWIG article editor "refactors" code in pre blocks - When that code contains Generics (.NET)Hehe - I agree actually. I hate the practice myself. While the result is the same, in my case it's actually not a question of being perverted by "textspeaking", as I rarely ever send a text (10-20 a year perhaps), but more an old habit from not quite knowing how to spell a few words (english not being my native language). As I said, I hate the practice myself, so I really try to catch my self - But once in a while you can catch me in slipping one of the following in. ofc - Of course ppl - People (no idea how that one got added to my bad habit list...) def/deffo - Definitely (And I'm sad to say it's not more than maybe 3-4 years ago I learned it's not spelled "definatly"...) Theres probably a couple more, but that's what I can think of at the top of my head. So yeah - I know. And I try :)
-
WYSIWIG article editor "refactors" code in pre blocks - When that code contains Generics (.NET)Thanks for the tip! Hadn't really noticed that toggle. It's on by default - which explains why I was struggling (not understanding) what was going on when sometimes pasting bits and pieces. Seeing as the top of the editor window here has 3 distinct buttons for <,> and & respectively - Wouldn't it be nice with one for "encode selected text" as well :) I mean, if I'm writing stuff, say about html formatting, I'd end up using a lot of <'s and >'s, and having to move to the mouse to click those buttons for each (or writing the escape code by hand) is a tad cumbersome. Just writing normally, and then when done mark up the text, and click that button would be sweet. Not a huge priority I agree - Just a "nice to have". - workaround is of course to just type your text normally, and then ctrl+a/ctrl+x/ctrl+c (with the encode option checked) - Which I just did ;P
-
WYSIWIG article editor "refactors" code in pre blocks - When that code contains Generics (.NET)Aaah - You changed the actual text, not the WYSIWIG editor code - Gotcha :-) (I was wondering how the hell you managed to fix code so quick) Thanks a bunch! --- It remains that the WYSIWIG editor is buggy though (as an FYI) In all the pre blocks I've done, I've not escaped anything by hand at all, I've simply copy/pasted from my code files (this done in HTML view ofc). The editor has then made the syntax highlighting and (partial :-)) escaping on the code. But workaround noted should I run into this again. --- Thanks all for the super speedy responses - That's truly amazing.
-
WYSIWIG article editor "refactors" code in pre blocks - When that code contains Generics (.NET)Holy cow - That was some quick bug fixing. Hats of to you Sir! -- I haven't dared actually submitting - But the pre blocks seems to be escaped correctly now - rather than refactored/mangled :-)
-
WYSIWIG article editor "refactors" code in pre blocks - When that code contains Generics (.NET)I need to escape inside <pre> tags? --- The example you listed is deffo weird - where did you find that one :-) --- EDIT lol - in the first post I could write <pre> without escaping it - But not in my reply - Hence this edit --- Double EDIT (ftw) Think I found what you are referring to - You missed the starting span tag :-)
<span class="code-keyword">></span> where T :
That's perfectly legal - and not of my doing either. It's autogenerated by the site...
modified on Monday, March 14, 2011 11:35 AM
-
WYSIWIG article editor "refactors" code in pre blocks - When that code contains Generics (.NET)As the subject says : WYSIWIG article editor "refactors" code in <pre> blocks - When that code contains Generics (.NET) "Just change to HTML view then". Too late... As the WYSIWIG is the default, and the code will already be altered. I recently posted an article ASP.NET OO SessionWrapper - As an integral part of the objects them self.[^] which contains 3 such codeblocks (containing Generics) On each edit I have to redo those codeblocks. I even added a "note to editors" text warning about this - Not sure if that warning is actually displayed to editors at all.. As one other editor did some edits, and screwed up the code... The other codeblocks are fine - Hence why I'm thinking it's related to the Generics syntax somehow.
-
A matter of style : Switch or ?: [modified]@OriginalGriff Fixed the switch for ya ;P clarity and readability are much more important than saving space on screen. Agreed 100% Which is why I posted - As the ?: was/is very clear to me, and I can at a glance understand what's going on, but I'm well aware it's not a construct used that/as often, so wanted to test the waters with other coders. -debugging nested ternary's is an absolute nightmare -I'll go for Switch because its easy to track errors in that. Good point As this is a *very* simple case I didn't even think of that actually. But it might need to get more complicated as the code evolves. Where I'm using it, it's not very likely though - But those are "famous last words", so point taken and agreed to. -- Thank you all for the feed back - I'll tidy up my code now :cool:
-
A matter of style : Switch or ?: [modified]Suddenly not sure which of the following constructs I should go with... I really like the compactness of B, but a bit unsure how my fellow coders would react to seeing the construct. I can't see how there should be any performance differences (if you know differently - Do tell) A:
int i;
switch (ID) {
case "a":
i = 1;
break;
case "b":
i= 2;
break;
case "c":
i = 3;
break;
default:
i = 0;
break;
}B:
int i;
i = ID == "a" ? 1 :
ID == "b" ? 2 :
ID == "c" ? 3 :
0;What would you use (and why)?
modified on Tuesday, October 20, 2009 6:46 AM
-
Custom ExpressionBuilder + ParseControl. No Joy? [modified]Come now CP... No takers at all?
-
Custom ExpressionBuilder + ParseControl. No Joy? [modified]Using a custom ExpressionBuilder doesnt seem to work with ParseControl (dynamically adding controls, that are using the custom ExpressionBuilder) Works fine with the build-in Resources ExpressionBuilder though. Anyone have a solution/workaround for this? Or even an explanation for why it doesnt work. Example
protected void Page\_Load(object sender, EventArgs e) { string s = (@" <hr /> 1: <asp:Label ID=""Label1"" Text=""<%$ Resources:language, Greeting %>"" runat=""server"" /> <br /> 2: <asp:Label ID=""Label2"" Text=""<%$ IHLPResource:Greeting %>"" runat=""server"" /> <hr /> "); Control ctrl = ParseControl(s); Page.Form.Controls.Add(ctrl); }
1: Gets rendered just fine, while 2: fails (no error, the value just doesnt get rendered) ie. the output is:
1: Hi
2:(2: should say "\\\Output from custom ExpressionBuilder///" - See code below) If I simply add the above to the aspx page, it works fine (ie. my custom ExpressionBuilder is not the cause of failure) -------------------------------------------------------------------------------------------- CODE - For quick copy/paste to test yourself -------------------------------------------------------------------------------------------- DynTest.aspx
<%@ Page Language="C#" AutoEventWireup="true" Codebehind="DynTest.aspx.cs"
Inherits="IHLP2007PoC.DynTest" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>WelcomeLabel Test</title>
</head>
<body>
<form id="form1" runat="server">
<hr />
1: <asp:Label ID="Label1" Text="<%$ Resources:language, Greeting %>" runat="server" />
<br />
2: <asp:Label ID="Label2" Text="<%$ IHLPResource:Greeting %>" runat="server" />
<hr />
</form>
</body>
</html>DynTest.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;using System.Xml;
namespace IHLP20