Hi,
I'm looking for C# brain teasers (or VB.NET): a little piece of code
that does something special, or where a little error is. Does anyone
has some of these, or links to sites?
Thanks! 16 2661
On Nov 27, 1:14 pm, Ludwig <lstuyc...@gmail.comwrote:
I'm looking for C# brain teasers (or VB.NET): a little piece of code
that does something special, or where a little error is. Does anyone
has some of these, or links to sites?
Are you after "this doesn't do what you think it does" type things (eg
overloading special cases, or captured variables) or "you should be
able to get this really" questions?
Jon
Hello Ludwig,
Use the MS certification preparation matherials for this.
They are a good source for such kind of teasers
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
LHi,
LI'm looking for C# brain teasers (or VB.NET): a little piece of code
Lthat does something special, or where a little error is. Does anyone
Lhas some of these, or links to sites?
LThanks!
On 27 nov, 15:01, "Jon Skeet [C# MVP]" <sk...@pobox.comwrote:
On Nov 27, 1:14 pm, Ludwig <lstuyc...@gmail.comwrote:
I'm looking for C# brain teasers (or VB.NET): a little piece of code
that does something special, or where a little error is. Does anyone
has some of these, or links to sites?
Are you after "this doesn't do what you think it does" type things (eg
overloading special cases, or captured variables) or "you should be
able to get this really" questions?
Jon
Both :)
On Nov 27, 2:33 pm, Ludwig <lstuyc...@gmail.comwrote:
<snip>
Both :)
Okay. I've a few ideas - I'll post some tonight.
Jon
On 27 nov, 15:41, "Jon Skeet [C# MVP]" <sk...@pobox.comwrote:
On Nov 27, 2:33 pm, Ludwig <lstuyc...@gmail.comwrote:
<snip>
Both :)
Okay. I've a few ideas - I'll post some tonight.
Jon
Thank you! Meanwhile I'm looking into the certification books - I've
to take the exams anyway, so it's a good waste of time ;)
"Ludwig" wrote:
Hi,
I'm looking for C# brain teasers (or VB.NET): a little piece of code
that does something special, or where a little error is. Does anyone
has some of these, or links to sites?
Thanks!
I have a program that finds prime numbers, if you are interested.
"Ludwig" wrote:
Hi,
I'm looking for C# brain teasers (or VB.NET): a little piece of code
that does something special, or where a little error is. Does anyone
has some of these, or links to sites?
Thanks!
There's one here that threw me for a loop late one night: http://groups.google.com/group/micro...4fc9ba3b43ae3b
Other fun ones include some of Joe Duffy's (and Jon Skeet's) examples of
broken double-check locks.
--
Chris Mullins
"Ludwig" <ls*******@gmail.comwrote in message
news:11**********************************@s12g2000 prg.googlegroups.com...
Hi,
I'm looking for C# brain teasers (or VB.NET): a little piece of code
that does something special, or where a little error is. Does anyone
has some of these, or links to sites?
Thanks!
x = x & (x-1)
"Ludwig" <ls*******@gmail.comwrote in message
news:11**********************************@s12g2000 prg.googlegroups.com...
Hi,
I'm looking for C# brain teasers (or VB.NET): a little piece of code
that does something special, or where a little error is. Does anyone
has some of these, or links to sites?
Thanks!
Ludwig wrote:
Hi,
I'm looking for C# brain teasers (or VB.NET): a little piece of code
that does something special, or where a little error is. Does anyone
has some of these, or links to sites?
Special? How about this:
Why does this compile:
public class Program{
public static void Main(string[] args){
TypedReference typedReference = new TypedReference();
}
}
and this not compile:
public class Program{
public static void Main(string[] args){
object typedReference = new TypedReference();
}
}
Alun Harford
On Nov 27, 2:46 pm, Jon Skeet [C# MVP] <sk...@pobox.comwrote:
Here are some to be going on with. I'll add to the list as I remember
them...
http://pobox.com/~skeet/csharp/teasers.html
--
I love #2. I've seen your blog about beforefieldinit before. It
would be plain wrong to ask somebody that question in an interview :)
By the way, you should keep adding to that page periodically or as you
run across a good one.
On Nov 27, 7:14 am, Ludwig <lstuyc...@gmail.comwrote:
Hi,
I'm looking for C# brain teasers (or VB.NET): a little piece of code
that does something special, or where a little error is. Does anyone
has some of these, or links to sites?
Thanks!
This one piqued my interest some time back. http://groups.google.com/group/micro...0965d37f201ddb
Brian Gideon <br*********@yahoo.comwrote:
I love #2. I've seen your blog about beforefieldinit before. It
would be plain wrong to ask somebody that question in an interview :)
Indeed. Unless they were claiming to know absolutely everything about
C#, in which case anything is fair game.
By the way, you should keep adding to that page periodically or as you
run across a good one.
Absolutely - I've been meaning to do something like it for a while.
This thread was a catalyst :)
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
On 27 nov, 22:27, Jon Skeet [C# MVP] <sk...@pobox.comwrote:
Brian Gideon <briangid...@yahoo.comwrote:
I love #2. I've seen your blog about beforefieldinit before. It
would be plain wrong to ask somebody that question in an interview :)
Indeed. Unless they were claiming to know absolutely everything about
C#, in which case anything is fair game.
By the way, you should keep adding to that page periodically or as you
run across a good one.
Absolutely - I've been meaning to do something like it for a while.
This thread was a catalyst :)
--
Jon Skeet - <sk...@pobox.com>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
World class .NET training in the UK:http://iterativetraining.co.uk
Here's another nice one:
Console.WriteLine(1 + 2 + "3");
Console.WriteLine("1" + 2 + 3); This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Etienne Fortin |
last post by:
I would like to share my disappointment of Microsoft with you readers. Be
aware that I'm in no way a Microsoft "basher" and that, in fact, I use their
programming technologies everyday. More...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |