Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

adgonz

@adgonz
About
Posts
23
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Encoding IP addresses
    A adgonz

    Hey, take it easy! I was just posting another horror ;P

    The Weird and The Wonderful sysadmin

  • Encoding IP addresses
    A adgonz

    Easy to fix. You can use the code we use at our company to convert floats between european/american decimals notation:

    Function CAMBIADECIMAL(ByVal NUMERO As String, ByVal TIPO As Integer) As String
        Dim I As Integer
        Dim J As Integer
    
        Dim ss As String
        Dim ss1 As String
        Dim PARTE1 As String
        Dim PARTE2 As String
    
        Select Case TIPO
            Case 1
                ss = NUMERO
                I = ss.IndexOf(".")
    
                If I > 0 Then
                    J = ss.Length - I - 1
                    PARTE1 = ss.Substring(0, I)
                    PARTE2 = ss.Substring(I + 1, J)
                    ss1 = PARTE1 + "," + PARTE2
                    Return (ss1)
                End If
                Return ss
            Case 2
                ss = NUMERO
                I = ss.IndexOf(",")
    
                If I > 0 Then
                    J = ss.Length - I - 1
                    PARTE1 = ss.Substring(0, I)
                    PARTE2 = ss.Substring(I + 1, J)
                    ss1 = PARTE1 + "." + PARTE2
                    Return (ss1)
                End If
                Return ss
        End Select
    End Function
    
    The Weird and The Wonderful sysadmin

  • GIJOTD
    A adgonz

    It's a 'Little Man of the Road' joke?

    The Lounge question

  • Windows 95 - 98?
    A adgonz

    Maybe it works under linux: http://www.sane-project.org/[^]

    The Lounge com question

  • Disable FF "Additional plugins are needed..." banner?
    A adgonz

    about:config plugins.hide_infobar_for_missing_plugin

    The Lounge com adobe tutorial question announcement

  • Differences between vb.net and c#
    A adgonz

    Question:

    PIEBALDconsult wrote:

    != == <> ?

    Answer: != == Not Nullable.Equals(,)

    Clever Code csharp question

  • Differences between vb.net and c#
    A adgonz

    <> is (I used to think it was) to vb.net the same as != to C#

    Clever Code csharp question

  • Differences between vb.net and c#
    A adgonz

    The thing is that vb.net evaluates the comparison to Nothing when one of the operands is Nothing. And something like:

    If Nothing Then

    End If

    Is valid, even if you specify Option Strict On

    Clever Code csharp question

  • Differences between vb.net and c#
    A adgonz

    cjb110 wrote:

    does the situation change if both comparisons are != or <>?

    Sorry, don't understand your question. Can you explain?

    Clever Code csharp question

  • Differences between vb.net and c#
    A adgonz

    Do you think this two pieces of code are the same? C#

        private string f()
        {
            System.Nullable<System.Int32> a = null;
            System.Nullable<System.Int32> b = 7;
            if (a != b)
            {
                return "apple";
            }
            else
            {
                return "orange";
            }
        }
    

    vb.net

    Function f() As String
        Dim a As System.Nullable(Of System.Int32) = Nothing
        Dim b As System.Nullable(Of System.Int32) = 7
        If a <> b Then
            Return "apple"
        Else
            Return "orange"
        End If
    End Function
    
    Clever Code csharp question

  • How to know if a column of type int is Identity using ADO.NET GetSchema()?
    A adgonz

    Thanks! I have just found another way: select COLUMNPROPERTY(OBJECT_ID('Table name'), COLUMN_NAME, 'IsIdentity') as IS_IDENTITY from INFORMATION_SCHEMA.COLUMNS I'd prefer to use GetSchema(), but for now I'm using this.

    Database csharp database sql-server sysadmin tutorial

  • How to know if a column of type int is Identity using ADO.NET GetSchema()?
    A adgonz

    I can't figure it using the data GetSchema() returns. Is there something I don't see? Is there any other way? Thanks! Edit: I'm using SQL Server 2008 and SQLConnection

    Database csharp database sql-server sysadmin tutorial

  • Visual Studio autogenerated code
    A adgonz

    PIEBALDconsult wrote:

    You would delete the auto-generated code anyway wouldn't you? Actually isn't there a file (or files) that contain such things and you can change them there?

    Of course, I can change the code, the same way you would change the code on all the horrors published here. Isn't this forum to publish horrors you find over there? I think this is a reply horror. :laugh:

    The Weird and The Wonderful visual-studio csharp

  • Visual Studio autogenerated code
    A adgonz

    Megidolaon wrote:

    If the user presses multiple directions

    Then multiple events are fired.

    The Weird and The Wonderful visual-studio csharp

  • Visual Studio autogenerated code
    A adgonz

    It's not a big horror, its just funny to see it on Visual Studio. The correct implementation would be:

        private void Form1\_KeyDown(object sender, KeyEventArgs e)
        {
            switch(e.KeyCode)
            {
                case System.Windows.Forms.Keys.Up:
                    // Subir oscilador
                    // Subir
                    break;
                    
                case System.Windows.Forms.Keys.Down:
                    // Bajar oscilador
                    // Bajar
                    break;                
                    
                case System.Windows.Forms.Keys.Left:
                    // Izquierda
                    break;                
                
                case System.Windows.Forms.Keys.Right:
                    // Derecha
                    break;                
                
                case System.Windows.Forms.Keys.Enter:
                    // Entrar
                    break;      
                              
             }
            
        }
    
    The Weird and The Wonderful visual-studio csharp

  • Visual Studio autogenerated code
    A adgonz

    This is the base code vs generates to check for special keys, on a Smart Device project:

        private void Form1\_KeyDown(object sender, KeyEventArgs e)
        {
            if ((e.KeyCode == System.Windows.Forms.Keys.Up))
            {
                // Subir oscilador
                // Subir
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Down))
            {
                // Bajar oscilador
                // Bajar
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Left))
            {
                // Izquierda
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Right))
            {
                // Derecha
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Enter))
            {
                // Entrar
            }
    
        }
    

    A Pocket PC is full of power, so let's check for every possible key.

    The Weird and The Wonderful visual-studio csharp

  • 5 in a 1 to 10 range
    A adgonz

    Ian Shlasko wrote:

    Translation: Post one of the 10's! Heheh

    A 6 or 7 (I'm not sure) is this code is from a function that should never had been called / written, so your better implementation is useless.

    The Weird and The Wonderful

  • 5 in a 1 to 10 range
    A adgonz

    If the worst horror you could find in my company is ranked 10 and a moderate horror is ranked 1, I think I could rank this with 5:

        Dim key As String
        key= "N"
        key= "linatipedi=" + "'" + key+ "'"
        Dim rR As DataRow() = t.Select(key)
        If rR.Length() = 0 Then
            i = 0
        Else
            Try
                For Each r In rR
                    i += 1
                Next r
            Catch
                If i = 0 Then
                    Return True
                Else
                    Return False
                End If
            End Try
        End If
        If i = 0 Then
            Return True
        Else
            Return False
        End If
    
    The Weird and The Wonderful

  • How to detect invalid image in a ImageBrush
    A adgonz

    Hi, this is what I did, but there are still some problems: - The file could exists, but be a invalid image. - The file exists at the moment this code executes, but it is deleted before the Brush needs it (this can happen on my application). Thanks.

    WCF and WF help tutorial question

  • How to detect invalid image in a ImageBrush
    A adgonz

    Hi, Thanks, but it seems that this event is not fired (because of local file?) I also tried DecodeFailed, but neither is fired.

    WCF and WF help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups