C# IsNumeric Function

October 19, 2016

If you're a fan of the old VB6 days one of the most useful functions was the IsNumeric function. Here is my version in C# and VB.NET (assuming you;re using .NET 4.0+):

C#

public bool IsNumeric(string Value)
{
    // Check for blanks
    if (string.IsNullOrWhiteSpace(Value)) {
        return false;
    }

    // Test for number
    double myNum = 0;
    return Double.TryParse(Value, out myNum);
}

VB.NET

Public Function IsNumeric(Value As String) As Boolean
    ' Check for blanks
    If String.IsNullOrWhiteSpace(Value) Then
        Return False
    End If

    ' Test for number
    Dim myNum As Double = 0
    Return [Double].TryParse(Value, myNum)
End Function

Bonus

You can easily change to validate specfic numeric types by changing the last two lines from Double to something line Int32:

C#

public bool IsInt(string Value)
{
    // Check for blanks
    if (string.IsNullOrWhiteSpace(Value))
    {
        return false;
    }

    // Test for number
    Inst32 myNum = 0;
    return Int32.TryParse(Value, out myNum);
}
Tags  |  C# |  VB.NET  |   |  Administrator

http://www.unl.edu/eskridge/cj394wilkinson.html

October 18, 2016

"Political terrorism": Search for suspects after GOP office firebombed in N.C. http://www.cbsnews.com/news/firebombed-republican-party-office-north-carolina-investigation/

Authorities are investigating after a local Republican Party office in North Carolina was vandalized and set on firein what a state GOP official called an act of “political terrorism.”

A bottle filled with flammable liquid was thrown through the window of the Orange County Republican Party headquarters overnight, damaging the interior before burning out, according to a Sunday news release from the town of Hillsborough. The office was empty and no one was injured.

http://www.unl.edu/eskridge/cj394wilkinson.html

         Characteristics of Political Terrorism
  1. Political terrorism involves an overall, overarching moral philosophy that is used to justify acts of terrorism, while criminal terrorism generally involves personal greed and selfishness. This is a very important point. There is a moral justification for the use of political terrorism, an ends justifies the means notion because we are going to yield a better overall social state. There is no such reasoning in the criminal terrorist.

  2. Political terrorism can involve activities to obtain money, but those dollars are used for political ends. Generally speaking, criminal terrorism has an economic basis.

  3. Political terrorists' targets tend to be almost indiscriminate and unpredictable. Usually no one person is particularly the target, therefore no one is safe. Criminal terrorists targets on the other hand tend to be more logical

    • a bank, an armored car - and the targets tend to be specific people, the bank official, the driver of the car.
  4. Political terrorists desire to create a long term atmosphere of fear, coercion and intimidation in the community. Criminal terrorists want to create a short term fear - scare the banker, get the money and get out of there.

  5. Political terroristic acts tend to be more savage - almost a shotgun philosophy - car bombs, nail bombs, double bombs all resulting in mass murder. The criminal terrorist tends to be more oriented to a specific target. Blow up this bank, hijack this plane.

  6. Neither political terrorism nor criminal terrorism abide by any rules or conventions of war.

  7. Often political terrorists are willing to die for the cause, while seldom do we see criminal terrorists planning on dying.

  8. Political terrorism differs from criminal terrorism in that political terrorism usually involves efforts to influence an audience. Generally speaking, the criminal terrorist does not want a big audience.

Paul Wilkinson, Terrorism and the Liberal State, London: Macmillan, l986. (Wilk.394 h/b)

Tags  |   |  Administrator

My thoughts on the debates last night

September 27, 2016
Cover Image

Ok, I've posted a bunch of other stories so I figure I would post my thoughts. I think Hillary won but just barely. You had so many facts and figures up her ass that she was more an encyclopedia. I still think she had an ear piece. Also the fact she kept pushing her damn book, now on sale at airports. Yeah, she said that in debate.

Then you had Trump looked like fucking Quasimodo because he started hanging on his lecturn after the first half hour. He had some chemistry that first 30 minutes and then his sciatica gave out. That last half hour he just ra out of steam and started mumbling. He should have gotten some Jolt cola filled with ibupropean.

I think Trump is getting a bit of bump out of this but it has to only because 90% of the people turned it off after that first 30 minutes.

Tags  |   |  Administrator

Debate 2016: Trump didn't win, but neither did Hillary

September 27, 2016

Source: The Hill Posted: 9/27/2016 By Paul Rowan Brian

From the epic Lincoln-Douglas debates to … the Trump-Clinton debacle?

It’s a long jump that world-record holder Mike Powell would gawk at. Candidates’ statements jumped around like frenetic Mexican jumping beans with patchy policy content and no real sequential progression.

Both apparently support paid family leave in some capacity, so that's something anyway. Donald Trump stuck to his baseline that politicians like Hillary Clinton are “all talk, no action,” but he didn’t exactly shine, either. Unless politics is purely just about entertainment now and we’re talking hair, in which case both candidates had impressive blond bouffant hairstyles going on.

Read more...

Tags  |   |  Administrator