I just saw the news that SA Developer .Net has a new look website, so I checked it out and its awesome! 🙂
They’re using components from Telligent Systems’ Community Server Forums, which is really cool. Check it out.
I just saw the news that SA Developer .Net has a new look website, so I checked it out and its awesome! 🙂
They’re using components from Telligent Systems’ Community Server Forums, which is really cool. Check it out.
(And no, I’m not talking about the radio show with Carl and Rory – and for those who don’t know what radio show, its called “.Net rocks“)
For the last week or so I’ve been delving into C++ code… with some great joy (like having to read “Writing Secure Code (2nd Ed)“) and many many many trials.
If you’re still using C++, change to C# (assuming you have a choice to move). I’d swap in a heartbeat based simply on the amount of “plumbing” work it would save me, but then I don’t have a choice here – I’m writing code to make some Extended stored procedures.
But seriously, remembering all the new’ed variables you’ve made so that you can delete them, and checking your arrays and pointers, and handles, and all that work to do simple operations like joining two strings, or using collections, or doing file IO, or doing pretty much anything becomes a nightmare when compared to the simplicity of C#. That being said, there’s something geekishly cool about programming in C++ – maybe its the “thrill” of handling such an unwieldy weapon of mass destruction and actually managing to hit the pinprick of a target you’re aiming at without blowing off your own foot in the process.
But regardless of the geek thrill factor involved I’ll be happy when this part of our project is over and I can move back to C#… 🙂
A: When you’re using .Net and boxed value types.
“What?? No, you’re wrong. Its not possible – you must be using the framework incorrectly.”
That’s what I would have said, but I’m not so sure after having to fix our little problem at work this morning.
We have a function that takes 2 object parameters:
public bool myFunction(object left, object right))
Which tries a whole bunch of things and if non of them works, it returns:
left.Equals(right);
The problem is as follows:
Int32 i32 = 1;
Int64 i64 = 1;
bool result = i32 == i64;
System.Diagnostics.Debug.WriteLine(result.ToString());
// outputs TRUE – expected
object o32 = i32;
object o64 = i64;
result = o32 == o64;
System.Diagnostics.Debug.WriteLine(result.ToString());
// outputs FALSE – expected
// This is expected since it would do a reference comparison BUT
result = i32.Equals(i64);
System.Diagnostics.Debug.WriteLine(result.ToString());
// outputs FALSE – not expected
// It does it because i64’s type is not the same as i32’s type
// The same goes for result = i64.Equals(i32).
// And also for result = o32.Equals(o64);
Now the question remains – how on earth do I get this code to work? Currently I’ve written my own IsEqualTo(object left, object right) function which finds out which of the numeric types each object is and casts the left and right parameters to the most suitable types before it does the comparrison so that it works correctly… I’ll upload a ZIP with a sample solution in it that demonstrates the solution, but if you know of a better way to write the code (keeping in mind that it needs to be generic enough to handle any type variables that are passed in), please let me know…
Well, I’ve been busy over the past few days playing with DotNetNuke. I downloaded v2.0.4 on Friday, installed it on my work pc, spent about 30 minutes copying and pasting stuff from my company’s website into DNN and wowed my boss with what it could do. On Monday they released v2.1.1, so I got that down and installed it on my website.
Now I just need to learn how to make a custom component(desktop module), and how to skin it. I HATE “making pretty”. Ok, maybe HATE is a strong word… My graphical abilities are definately not my strongest skill, and for me to spend 5 hours making something that a more skilled person could do better in 5 minutes seems pointless. I know there are some sites out there with “premade” skins, and skins for sale… I went to one last night (DNNSkins) but that’s not only running DNN v1.0.10, but it also seemed to have no skins in its store. (its like its database is blank)… I tried looking at SnowCovered, but its UI kinda sucks, so I haven’t really found much. DIYWebsite (which seems to be an alternative front for Salaro) has a much nicer UI – you actually get to see samples of the site quite quickly so instead of choosing between 5 descriptions, you can choose between 5 looks. I’d love to use TemplateMonster (cool UI and plenty of skins), but they don’t do DNN templates. 🙁
Anyway, I’m gonna keep on looking for sites with cool skins – if anyone knows of any, let me know.
Well, the day was definately more detailed (higher tech level – 200-300) than last year’s dev days which was great. But unfortunately most of what was covered would really suite a small ISV, and not necessarily work in the environment I work in. (Not that my environment is out of the ordinary.) At work, we’re building a large framework for the rest of our developers to use so we don’t really use many of the automated/built in data access wonders of VS.Net.
So let me run through what I got out of the sessions (hrm, I was going to insert a table here, but BlogJet doesn’t have any GUI way to do that, so I’ll have to do it manually):
Opening Keynote: Realizing Your Potential
What I learned for me: Even Microsoft can have hardware problems, so you’d better make sure that you check your presentations and equipment well before you get up to present, run through what the procedure is if something goes wrong, and keep communicating – have a back up plan so that you don’t look quite so stumped, and can gracefully recover without saying “Its a hardware problem” and cutting the talk short.
What I learned for my company: (same as above)
Session 1: Best Practices for Designing and Building Smart Client Applications
What I learned for me: I’d better start reading some of those pattern’s and practices that I keep promising myself to read. They could really help me if I’m doing development myself for “freelance” work.
What I learned for my company: Not much – we use similar things to the “Observer” & “Command” patterns, but they do a lot more in some places and lack a little bit of the functionality in others. Perhaps we could implement the “Command” pattern a bit better… But then I must say that we’ve done all that without reading or knowing about the patterns. (We have a clever guy here that did that work)
Session 2: The Ins and Outs of Secure Data Access
What I learned for me: I need to get me some of that… 🙂 Specifically the DPAPI library.
What I learned for my company: I think this could be useful as we’re serializing (scuze the american spelling, but most developers would look confused if they saw the UK spelling) some objects, which contain connection strings… Of course they didn’t touch on areas of security that we really need, but then I guess if DevDays was to solve every company’s most difficult problems, then they’d be way better attended, would cost an arm and a few legs, and would just generally be entirely impossible to host.
Session 3: Developing Secure Smart Client Applications
What I learned for me: I can’t really remember this session too well. I think Ahmed took it, but I’m a bit stumped as to what he spoke on. (I’ll update this later when I remember)
What I learned for my company: (see above)
Session 4: Deploying and Maintaining Smart Client Applications
What I learned for me: Very cool, and definately a must – I loved the Application Updater component, and was pleased to have the limitations and benefits of the various “code download” deployment methods re-iterated.
What I learned for my company: Some of the Application Updater stuff maybe could be useful, but other than that… nothing.
Closing Keynote: The Future of Microsoft Development Tools
What I learned for me: Oh boy, oh boy do I love Microsoft’s new tools… of course it does leave me wondering how long it will be before trained monkeys will take over our jobs. I think I should go start my own company doing .Net development on Whidbey as soon as it comes out, so that I can get a head start on the rest of the masses. 🙂
What I learned for my company: WOW, geez. So much that will help us, and so much that will just replace a lot of the work we’ve done already.
Overall it was a great day – I got on a Caffeine buzz way too early for any “sane” persion, loved the presentations, can’t wait for the tools coming down the track next year.
And best of all, I got to actually meet one or two of the bloggers… Armand (who probably thinks I’m really rude – I kinda didn’t hear what he was saying to me as I was leaving (in a rush)… so till I see you in person, please accept this apology for my rudeness), Kevin (who I didn’t exactly meet, but who I watched winning too many prizes during the day, and sat on the other end of the table from him at the Blueberry Grill), Simon (who seems to organise most of the SA Developer things, and seems to be one of the “well connected” developers in SA), Thea, Iwan, and a few others who I can’t remember off hand. (Either coz I didn’t link them easily to their blog, or coz I haven’t read too many SA Dev posts from them (maybe coz I haven’t read too many posts on SA Dev recently), or because I simply forgot)
Anyway, it was a cool day on the whole… and for those who are interested, Simon posted this morning to where you can download IssueVision (the app that they worked through in the Smart Client Track, which has some pretty cool components)
I just checked, and the link Simon gave takes you to Barry Gervin’s blog where he says you can download the actual file from Microsoft over here.
Its odd how these things happen, just this morning Charlie was asking me how to migrate a PHP website to ASP.Net, and this afternoon I see a link to MSDN’s ASP.Net Migrating article which has links to the “PHP to ASP.Net Migration Guide“
Ever wanted to know how to make the PC “beep” (the windows 2000 default is the “ding” sound), check out the Windows Forms FAQ. Odd that, I just noticed that its a .ASP page, not a .ASPX – but then I guess its a Windows FORMS FAQ, and not an ASP.Net faq.
For those who don’t have time to look up the solution to the “beep” problem, here are the two solutions from the FAQ:
1.using System.Runtime.InteropServices;
…
[DllImport(“user32.dll”)]
public static extern int MessageBeep(uint n);
private void button2_Click(object sender, System.EventArgs e)
{
MessageBeep(0x0);
}
Reference the VB.NET runtime support and just use the Beep() method.
The method is in:
Microsoft.Visual Basic.NET Runtime
The method is:
Microsoft.VisualBasic.Interaction.Beep();
Microsoft EMEA have a new site – CodeZone, which links to SADeveloper.net. If you go there, check out the Magazine and order a sample. You could win a Motorola MPx 200. (A windows based smart phone) Check out the picture on the right, its a MPx 200. (BTW: It might disappear later because I’ve linked directly to their site, so if they move the file, my link will die.) | ![]() |
Jim Blizzard makes some interesting comments about code access security in .Net relating it to the “superbowl half time event ‘scandal'” where Justin Timberlake & Janet Jackson did a duet, but part way through the event Janet’s top “malfunctioned” (i.e. thats aparently how she described it… but in every day terms her top “fell” off)
Anyway, Jim was making a comment on how in life when people want to do something wrong, they’re not going to ask permission before they do it. In the same way, in computers a malicious program isn’t going to ask you if it can please erase your entire hard drive before it does it. But with the .Net framework’s code access security, the programs are only allowed to do what they’re explicitly given permissions to do. So you don’t have to worry (unless you give all code full trust on your machine)
Check out his blog entry “Breasts and code access security…” for more info.
Ok, so its not really anything valid, but its a nice comment anyway… NASA are using a Java based system to plot out Spirit’s course on Mars and communicate the course of action to Spirit. So Stuart comments about it(found via Rory), saying “No wonder it took the thing twelve days to move eight feet forward!” 🙂