Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: Are there someone for helping me.(Huffman İmage Compression with c#) Pin
Dave Kreskowiak24-Nov-16 8:06
mveDave Kreskowiak24-Nov-16 8:06 
GeneralRe: Are there someone for helping me.(Huffman İmage Compression with c#) Pin
OriginalGriff24-Nov-16 8:22
mveOriginalGriff24-Nov-16 8:22 
QuestionDecimal MEID to hexadecimal Pin
mjawadkhatri23-Nov-16 12:22
mjawadkhatri23-Nov-16 12:22 
AnswerRe: Decimal MEID to hexadecimal Pin
OriginalGriff23-Nov-16 20:52
mveOriginalGriff23-Nov-16 20:52 
GeneralRe: Decimal MEID to hexadecimal Pin
mjawadkhatri26-Nov-16 18:07
mjawadkhatri26-Nov-16 18:07 
GeneralRe: Decimal MEID to hexadecimal Pin
OriginalGriff26-Nov-16 21:26
mveOriginalGriff26-Nov-16 21:26 
AnswerRe: Decimal MEID to hexadecimal Pin
mjawadkhatri26-Nov-16 18:06
mjawadkhatri26-Nov-16 18:06 
QuestionTaking C# to a whole new level of Evil Pin
Foothill23-Nov-16 9:16
professionalFoothill23-Nov-16 9:16 
No language should even be able to do this but it works (complies and runs).
C#
public class BaseClass
{
 public string Value { get; set; }
 public BaseClass(string val) { Value = val; }
}

public class Derived : BaseClass
{
 public Derived(string val)
  : base(new Func<string>(() =>
  {
    if (String.IsNullOrEmpty(val))
    {
      throw new ArgumentNullException("val");
    }
    else
    {
      return val;
    }
   })()){}
}
And the error message when the Derived class constructor is passed a null value is equally confusing:

System.ArgumentNullException: Value cannot be null.
Parameter name: val
at TestingApp.Derived.<>c__DisplayClass0_0.<.ctor>b__0()
at TestingApp.Derived..ctor(String val)
at TestingApp.Program.Main(String[] args)


This looks more like a way to program hard to find errors, deliberate back doors, or the hard-to-trace magic self-destruct method then a useful code addition.

Is there any instance this could be useful other than a hack or workaround?
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016

AnswerRe: Taking C# to a whole new level of Evil Pin
Richard Deeming23-Nov-16 12:04
mveRichard Deeming23-Nov-16 12:04 
QuestionHow to create alert in c# Pin
Member 308047023-Nov-16 1:20
Member 308047023-Nov-16 1:20 
SuggestionRe: How to create alert in c# Pin
Richard MacCutchan23-Nov-16 1:24
mveRichard MacCutchan23-Nov-16 1:24 
AnswerRe: How to create alert in c# Pin
Eddy Vluggen23-Nov-16 1:50
professionalEddy Vluggen23-Nov-16 1:50 
GeneralRe: How to create alert in c# Pin
Gerry Schmitz23-Nov-16 6:43
mveGerry Schmitz23-Nov-16 6:43 
GeneralRe: How to create alert in c# Pin
Eddy Vluggen23-Nov-16 7:52
professionalEddy Vluggen23-Nov-16 7:52 
GeneralRe: How to create alert in c# Pin
Gerry Schmitz23-Nov-16 8:48
mveGerry Schmitz23-Nov-16 8:48 
GeneralRe: How to create alert in c# Pin
Eddy Vluggen23-Nov-16 9:07
professionalEddy Vluggen23-Nov-16 9:07 
AnswerRe: How to create alert in c# Pin
Gerry Schmitz23-Nov-16 9:28
mveGerry Schmitz23-Nov-16 9:28 
QuestionRe: How to create alert in c# Pin
Member 308047023-Nov-16 17:14
Member 308047023-Nov-16 17:14 
AnswerRe: How to create alert in c# Pin
Gerry Schmitz23-Nov-16 17:42
mveGerry Schmitz23-Nov-16 17:42 
AnswerRe: How to create alert in c# Pin
Mycroft Holmes23-Nov-16 13:21
professionalMycroft Holmes23-Nov-16 13:21 
AnswerRe: How to create alert in c# Pin
Pete O'Hanlon23-Nov-16 21:18
mvePete O'Hanlon23-Nov-16 21:18 
GeneralRe: How to create alert in c# Pin
Gerry Schmitz24-Nov-16 6:20
mveGerry Schmitz24-Nov-16 6:20 
GeneralRe: How to create alert in c# Pin
Richard MacCutchan24-Nov-16 6:34
mveRichard MacCutchan24-Nov-16 6:34 
GeneralRe: How to create alert in c# Pin
Gerry Schmitz24-Nov-16 6:51
mveGerry Schmitz24-Nov-16 6:51 
GeneralRe: How to create alert in c# Pin
Richard MacCutchan24-Nov-16 7:38
mveRichard MacCutchan24-Nov-16 7:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.