topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday April 23, 2024, 3:34 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Ruffnekk [ switch to compact view ]

Pages: prev1 2 3 4 5 [6] 7 8 9 10 11 12next
126
In Charlie Calvert's Community Blog there's an interesting interview with Anders Hejlsberg, the lead architect of C#.

In this video interview, Anders Hejlsberg, the chief architect of C#, describes features in the next release of C#, code named Orcas. Anders first describes how LINQ solves the impedance mismatch between the code that lives on a database server and the code we write with standard programming languages such as C# or VB. He then outlines the new capabilities that functional programming will bring to developers.

127
I mailed Chris DeSalvo of www.spacetimemobile.com to thank him for creating MyCalcutor, a freeware scientific calculator for my Pocket PC:

Hello Chris,

I would like to thank you for writing MyCalculator and publishing it for free! I use it very much and it's the best calculator I found :)

Thank you!

John Willemse,
The Netherlands

128
Developer's Corner / Re: Project Euler: Mathematical Challenges
« on: February 09, 2007, 01:37 AM »
I've been a member there a long time (username Ruffnekk) and I managed to solve many already. If you want to learn how to achieve some stuff on your own this site is fantastic! Some seriously difficult problems here! :D

129
Developer's Corner / Re: c++ resources for the VB programmer
« on: February 09, 2007, 01:26 AM »
It has been said before already, but I want to stress it again: forget everything you know about VB if you want to go to C++. The languages are so different that it's best (and almost a requirement) to start from the absolute beginning. On the other hand, Java could be an option. The syntax will be easier for you and you can also create cross-platform applications.

130
Developer's Corner / Re: Advanced C# Programmers?
« on: February 09, 2007, 01:23 AM »
I'll have a look at it also and try to help!

131
Developer's Corner / Top Tips #2: Nullable Numeric Datatypes
« on: February 09, 2007, 01:21 AM »
Top Tips Subject:Nullable Numeric Datatypes
Difficulty:Beginner
Summary:Since the .NET Framework 2.0 (Visual Studio 2005 series) there is a new feature for numeric value types in C# and Visual Basic. You can now declare a value type and have it assigned null or Nothing. This article will explore the nullable value types and show you how to use them.

Before the .NET framework 2.0 you could run into trouble by accidentally assigning a null value (Nothing in Visual Basic) to a value type. For example, a database field could return DbNull when you expect an integer. Microsoft has tried to solve this issue by introducing nullable value types. Let me illustrate shortly what the difference between value types and reference types is:

A value type is a built-in type that occupies an address in memory and stores its value with it. A value type is a fixed length variable that always takes a certain amount of space to be stored. For example, an int or Integer (System.Int32) in the .NET Framework is a 32-bit integer value, therefore using 4 bytes to store its value.

C#:

int a = 8;
int b = a;
b = 4;
Console.Write(a);


This code will print the value 8. Integers a and b are value types, so when we say 'int b = a' that does not mean that they are the same object in memory, it means that the value should be copied from a to b.

A reference type on the other hand is a type that is stored somewhere in memory and contains a pointer to a value. This means that the value is not stored with the variable itself. The reference type has no fixed length and can point to an object that may vary in size during the course of the execution of your code. Any class you create and instantiate is a reference type. This is also why multiple variables in your code can represent the same object in memory; they point to the same object.

C#:

System.IO.FileInfo fInfo = new System.IO.FileInfo("c:\\test.txt");
System.IO.FileInfo fInfo2 = fInfo;
Console.Write(fInfo2.FullName);


This code will print "c:\test.txt". The line 'System.IO.FileInfo fInfo2 = fInfo;' sets fInfo2 to point to the same object as fInfo. Any changes in the object will be reflected in both variables, even though they are stored in different memory locations themselves.

When an object is null or Nothing, it simply means that the pointer of that object does not point anywhere. There is no reference to refer to. Since a value type stores its own value, it could never represent null or Nothing. That is changed now. You can declare a value type nullable and assign null or Nothing to it:

C#:

Nullable<int> myInt;


VB:

Dim myInt As Nullable(Of Integer);


Microsoft has taken this a bit further for C# where you can use the ? type modifier to indicate a nullable value type:

C#:

int? myInt;


The downside of using nullable value types is that you must be careful using them along with non-nullable value types. For example, the next code will fail if the value of x is null:

C#:

public int DoSomething(int? x)
{
    int y = (int)x;
    y++;
    return (y);
}


VB:

  Public Function DoSomething(ByVal x As Nullable(Of Integer)) As Integer
    Dim y As Integer = CType(x, Integer)
    Return y + 1
  End Function


If x in the above function is passed with the value null or Nothing, then y cannot be assigned to it and a InvalidOperationException will be thrown. You can prevent this from happening by first checking if x is null or Nothing by using the HasValue property of a nullable value type:

C#:

public int DoSomething(int? x)
{
    int y;

    if (x.HasValue)
    {
        y = (int)x;
    }
    else
    {
        y = 0;
    }
    y++;

    return (y);
}


VB:

  Public Function DoSomething(ByVal x As Nullable(Of Integer)) As Integer
    Dim y As Integer

    If x.HasValue Then
      y = CType(x, Integer)
    Else
      y = 0
    End If

    Return y + 1
  End Function


Again, in C# Microsoft made it easier by also introducing a new operator ??. You can rewrite the aboce C# code as:


public int DoSomething(int? x)
{
    int y = (x ?? 0);
    y++;
    return (y);
}


The ?? operator first checks if x is null and if it is, it assigns the value 0 to y. If x is not null then the value of x is automatically cast to the type of y and its value copied. Unfortunately none of these extra features are present in VB .NET 2005.

Some things you have to keep in mind using nullable value types:

  • Take precaution when mixing them with non-nullable types.
  • A nullable value type that is declared without a value will have the default value of null or Nothing.
  • If you operate on two nullable value types and one of the values is null, then the result will always be null. For example, adding two int? values by using the + operator will always result in null when one of the values is null.
  • When comparing two nullable types, the result will be a regular bool or Boolean, not a nullable bool or Boolean like in SQL.

This concludes this issue of Top Tips, I hope you found it helpful.

132
Living Room / Re: snap.com search. gimmick or great tool?
« on: February 01, 2007, 03:19 PM »
 :D lmao @ your avatar nudone

133
Developer's Corner / Re: Sorting Algorithms Compared
« on: January 31, 2007, 01:33 PM »
Hmm, I guess I could have posted a reply here instead of making a new topic, sorry :-[

134
Developer's Corner / Free online computer books
« on: January 31, 2007, 01:30 PM »
This is not a spam message  :P

I usually do not even look at sites claiming they have something for free, but the people at http://www.onlinecomputerbooks.com/ really have a great collection of truely free, online readable, books about computers and programming. I've tested about 15 random links and they all worked so far. To me it is a treasure of information and I just had to share it here.

FreeBooks.png

Click the button to reveal a list of topics:

Spoiler

 Free J2EE books
 Free Java books
 Free .NET books
 Free C# books
 Free VB.NET books
 Free ASP.NET books
 Free MS-Office books
 Free Ajax books
 Free XML books
 Free C++ books
 Free C books
 Free Web Design books
 Free PHP books
 Free Python books
 Free Perl books
 Free SQL books
 Free Programming books
 Free Windows books
 Free Linux books
 Free Unix books
 Free FreeBSD books
 Free IT books
 Free Revision Control books
 Free Apache books
 Free Networking books
 Free Software Eng. books
 Free MySQL books
 Free PostgreSQL books
 Free Open Source books
 Free JavaScript books
 Free Security books
 Free Hardware books
 Free e-Learning books
 Free Smalltalk books
 Free Lisp books
 Free Computing books
 Free AI books
 Free J2ME books
 Free Assembly books
 Free Ada books
 Free Game Prog. books


135
Developer's Corner / Sorting Contest
« on: January 31, 2007, 01:20 PM »
I remember this earlier post by KenR about comparing sorting algorithms. I found another site that does the same.

Check out this Sorting Contest. Nice thing is you can click one button to start all sorting routines similtaneously.

Sorting.png


136
Looks nice and seems like its worth the price, but I've been using my own app for this for years ;) Fully customized to my specific needs! :P

137
Macromedia Flash / Re: What is needed?
« on: January 31, 2007, 01:10 AM »
This article gives a nice introduction on how to get started with programming in Flash with open source tools (Eclipse IDE, MTASC compiler and others).

I just installed it myself yesterday. I promised mouser a while ago to post something on the MTASC compiler, so maybe this is the right occassion? :-}

Okay that went well, but I run into one problem: I have to have access to the Macromedia Flash core classes. Any suggestion how I can get this without buying Macromedia Flash?

138
Developer's Corner / Kid's Programming Language
« on: January 30, 2007, 09:17 AM »
You should check out the Kid's Programming Language website. It's a freeware programming language developed for kids. It's similar to BASIC but less linear. It is interesting so many non-kids, that they decided to change the name to Phrogram now. Amazing games and programs can be written with just a few lines of code. Some examples:

KPL-1.png

KPL-2.png

139
Developer's Corner / Re: Great site: Coding4Fun
« on: January 29, 2007, 12:53 AM »
please attach a picture to such posts so we can blog them more easily!

I've edited the original post to include a screenshot ;)

140
Developer's Corner / Great site: Coding4Fun
« on: January 29, 2007, 12:28 AM »
I recently discovered the Coding4Fun section on Microsoft's website. It's a great section where you can choose from a range of topics and view sample code and tutorials, mostly aimed at C# and VB .NET. I specifically like the Gaming topic, where some new technologies like Windows Presentation Foundation and XAML as well as DirectX programming are explained in detail.

Coding4Fun.png

141
N.A.N.Y. Challenge 2007 / Re: Cody Mug for NANY Participants
« on: January 27, 2007, 06:24 PM »
Farmsteader did you poor concrete in the floor to keep that small table standing? ;)

142
Yesterday I heard news about Dutch authorities filing a complaint against Apple because of the iPod and the iTunes music. They say it is unfair for someone to buy music from Apple online and not being able to play it on any other music player than an iPod. They demand that music downloaded from the Apple site is playable on every MP3 music player. They also demand Apple to correct this for every song they ever sold if the customer wants it so.

143
Living Room / Poll: How do you read topics?
« on: January 26, 2007, 05:54 AM »
On every forum I am registered I try set newest messages first, but usually oldest messages first is the default. I'm wondering if I'm the only one using newest messages first :D

144
You could not have put *my thoughts* on screen any better than that Carol. Exactly why I decided Vista is a bit of a hoax.

145
I get the feeling Microsoft is putting too much time into integrating multimedia and eye candy into their OS. I already concluded some weeks ago that it wasn't worth the effort to upgrade now. Looking at this list of 10 reasons to upgrade to Windows Vista I could not be convinced.

Maybe in 2008 when it has matured a bit more I will review my opinion, but for now I'm happy [pun]as can be[/pun] with Windows XP Pro.

146
Developer's Corner / Re: Clash of the languages
« on: January 26, 2007, 01:30 AM »
It's not in the graph, it's in the first table when you open the link.
Ah I see! I didn't bother to follow the link  :-[

147
Macromedia Flash / What is needed?
« on: January 26, 2007, 01:28 AM »
I'd like to get started on Flash programming, but can you advise me on what I would need (software/tools)?

Thanks!

148
Developer's Corner / Re: Clash of the languages
« on: January 26, 2007, 01:24 AM »
Go C#! :)

Frameworks seem to be the way to go. They're just more productive. In a recent DotNetRocks podcast they talked about this issue. Java looks like it's on the decline though.

The Delphi decline isn't a surprise.

I agree on C#. I think it has a good potential and will become increasingly more popular. Actually, last week I decided to take the step from VB to C#.

About Delphi's declination: I don't see Delphi mentioned in the graph?  :huh:

149
LMAO, that *could* be the source of the problem here then  :up:

150
Developer's Corner / Re: Best Programming Beer
« on: January 24, 2007, 04:11 AM »
Born and raised in Holland, I will not drink anything but Heineken :P

Pages: prev1 2 3 4 5 [6] 7 8 9 10 11 12next