Alberto's profileAlberto AcostaPhotosBlogLists Tools Help

Blog


    March 06

    Propiedades para flojos (Propiedades Automaticas)

    Microsoft siempre nos ha dicho que debemos usar propiedades (publicas, internas, etc) en vez de variables publicas, por motivos de seguridad, buenas practicas, etc., pero ellos también saben que escribir 50 propiedades en forma normal daba lastima y ganas de dormir así que al final escucharon nuestro llanto y decidieron crear esta nueva sintaxis. En Microsoft este tipo de sintaxis le llaman “syntactic sugar” como yo no lo voy a traducir lo llamare de esta forma si ustedes quieres le llaman ‘asuquita’, si quieren que len de asuquita

    public bool PropiedadFloja { get; set; }

     

    //Comparación
    //Normal implementación
    private bool _variablePrivada;  

    public bool PropiedadPublica  
    {  
     get { return _variablePrivada; }  
     set { _variablePrivada = value; }  
    }  
    //


    //.net 3.5 syntactic sugar
    public bool PropiedadFloja { get; set; }

     

    Aunque no creamos la variable privada .net la crea por nosotros al momento de compilar  

     

    kick it on DotNetKicks.com

    March 05

    No tomes de mas, conoce tus limites

    La norma de muchas oficinas o universidades es que jueves o viernes ( o ambos ) días se deben terminas con un Cervera,  La sociedad de hoy en día te empuja a esto si quieres tener amigos y en muchos casos se toman hasta decisiones de trabajos en estas ocasiones.

     

    Pero todos sabemos los efectos de dependencia que puede crear el alcohol y los males a los cuales conlleva. La Biblia no la prohíbe pero pones barreras de cómo a consumo.

     

    Prov 20:1  nos llama la atención

    “El vino lleva a la insolencia,

       y la bebida embriagante al escándalo;

       ¡nadie bajo sus efectos se comporta sabiamente!”

     Isaías 5:11-12 no previene de las personas que lo único que piensas en es fiestas

    “¡Ay de los que madrugan

       para ir tras bebidas embriagantes,

       que quedan hasta muy tarde

       embriagándose con vino!

     12  En sus banquetes hay vino y arpas,

       liras, tambores y flautas;

       pero no se fijan en los hechos del Señor

       ni tienen en cuenta las obras de sus manos.”

    En conclusión si puedes evitar la bebida, hazlo no sea que pierdas los cabales, mira que las estadísticas policiales están llenas de licor mezclado con sangre.

    February 28

    CTP Orcas de Marzo

    CTP orcas de Marzo (Visual Studio 2007) ya esta en la calle, se puede bajar desde este linq (link), Aqui, solo necesitan Virtual PC 2004 o 2007.

    Entre una de la grandes cosas que trae es la integración de Asp.Net Ajax, Multi - Compilación (Compila para .net 2.0, 3.0 o 3.5 ) y lo mejor es Linq y Linq para SQL (MS ORM)

    February 21

    Pereza


    6
    ¡Anda, perezoso, fíjate en la hormiga!

    ¡Fíjate en lo que hace, y adquiere sabiduría!

    7 No tiene quien la mande,

    ni quien la vigile ni gobierne;

    8 con todo, en el verano almacena provisiones

    y durante la cosecha recoge alimentos.

    9 Perezoso, ¿cuánto tiempo más seguirás acostado?

    ¿Cuándo despertarás de tu sueño?

    10 Un corto sueño, una breve siesta,

    un pequeño descanso, cruzado de brazos...

    11 ¡y te asaltará la pobreza como un bandido, y la escasez como un hombre armado!

    Prov 6:6-11

    February 19

    Insomnio y sus causas?

    Yo no soy medico pero si quieren saber mas acerca del insomnio les recomiendo este articulo que encontré en Wikipedia, pero falta uno de las mas importantes causas y que esta profundamente escondida en algunos de nosotros, este no encuentra precisamente en Wikipedia sino mas bien en el mejor libro que conozco que es la Biblia específicamente en Prov. 4:16 dice que “Los malvados no duermen si no hacen lo malo; pierden el sueño si no hacen que alguien caiga”.

    February 14

    Live Maps "A ojo de pájaro'

    Seriamente yo uso maps.google.co.uk casi todos los días para ver diferentes direcciones pero esta gente se paso..., maps.live.com te permite ver la dirección seleccionada en vista satelital (nada nuevo) pero además en 3D y desde diferentes ángulos o como ello le llaman a ojo de pájaro.


    Vista Norte


    Vista Oeste


    Vista Este

    October 27

    70-536 Aprobado con 965

    Después de dos meses de lectura de un libro de mas mil paginas y completamente plagado de errores (mas de 33 paginas de errata) hoy al fin presente el examen valido para la Certificacion de Microsoft .Net 2.0 (MCTS) e igualmente valido para MCPD.
    Libro:
    Eviten comprarlo si existe algo mas en el mercado.
    July 16

    "Lord Jesus Christ" said Mr White

    "Superman returns" nice movie, as Starwar, Lord of the Ring, Matrix and other Stories/Books/Movies are based in a true story, a Bible fact, something that happened some time ago about a truly superhero Jesus Christ our Saviour, he has not returned yet but he will believe it he will now the question for you is, Are you ready for this moment?
     
     
    June 07

    Using WSE2.0 and MS Soap Toolkit 3.0 to call C# Web Services and send WSA attachment from VB6

    I normally prefer to work with .net or even with the vs2005 betas but you know some one have to the dirty job and in this case was me, the client requirement was to have the option from their actual vb6 desktop application to send file to a web services and that was they got :P, with a lot of paint but it is done and if you are having the same pain just get the idea.

     

    Calling a C# Web Services (That wasn’t a pain)

     

    C# Web Services

    [WebMethod]

    public XmlDocument GetUserlist()

    {

          Some code

          And finally

          Return xmldocument or whatever you want

    }

     

    Start of the pain vb6 Soap toolkit 3.

    Actually that wasn’t such a pain but after three year without work with vb6 upset me a bit.

     

    Dim Selection As IXMLDOMSelection

    Dim oSoapClient As MSSOAPLib30.SoapClient30

    Set oSoapClient = New MSSOAPLib30.SoapClient30

    Dim xmldoc As New DOMDocument30

       

    ' oSoapClient.MSSoapInit("http://localhost/MyWebSer/Obj.asmx?WSDL")

      oSoapClient.MSSoapInit (GetWebURL & "?WSDL")

       

      Set Selection = oSoapClient.GetUserList()

     

    That was easy; just wait to see the way to send the WSA attachment through Soap and compare this with the .net way check this 12min video from Mike Taulty http://www.microsoft.com/uk/msdn/events/nuggets.aspx and you’ll notice way I said “that was a pain”

     

    C# Code

     

    [WebMethod]

    public bool ReceiveFile()

    {

          // Reject any requests which are not valid SOAP requests

          if (RequestSoapContext.Current == null)

    throw new ApplicationException("Only SOAP requests are permitted.");

     

          if (RequestSoapContext.Current.Attachments.Count == 0)

    throw new ApplicationException("No attachments were sent with the message.");

                     

          string TempFileName = Environment.GetEnvironmentVariable("temp")+ "\\" + "temp_" + Context.Timestamp.Ticks +".xml";

     

          StreamReader streamrd = new StreamReader(RequestSoapContext.Current.Attachments[0].Stream);

          FileStream file = new FileStream(TempFileName, FileMode.OpenOrCreate, FileAccess.Write);

          StreamWriter streamwr = new StreamWriter(file);

          streamwr.Write(streamrd.ReadToEnd());

          streamrd.Close();

          streamwr.Close();

          file.Close();

     

    As you just see this method is checking if there are some attachments within the RequestSoapContext and I will try to get it as a stream and convert it as a file and after that you can do whatever you want with that.

     

    Now that is the vb6 code to do the trick and send the file within the Soap Request

     

            Dim Serializer As SoapSerializer30

            Dim Reader As SoapReader30

            Dim Connector As SoapConnector30

            Dim Composer As DimeComposer30

           

            Set Composer = New DimeComposer30

            Set Connector = New HttpConnector30

           

            Connector.Property("EndPointURL") = GetWebURL()

           ‘ That is really important to use the Web Service’s namespace and the name of the method                

            Connector.Property("SoapAction") = "http://MyWebSer/ReceiveFile"

           

            Connector.Connect

            Connector.BeginMessage

           

            Set Serializer = New SoapSerializer30

            Serializer.InitWithComposer Connector.InputStream, Composer

           

            Serializer.StartEnvelope

                Serializer.StartBody

                    Serializer.startElement "ReceiveFile", "http:// MyWebSer/"

                    Serializer.endElement

                Serializer.EndBody

            Serializer.EndEnvelope

           

            Dim lCnt As Long

            Dim Attach As MSSOAPLib30.StringAttachment30

            Set Attach = New MSSOAPLib30.StringAttachment30

            Attach.String = oDoc.xml

            Serializer.AddAttachment Attach

            Set Attach = Nothing

            'Next

           

            Serializer.Finished

           

            Connector.EndMessage

           

            Set Reader = New SoapReader30

            Reader.Load Connector.OutputStream

           

            If Not Reader.Fault Is Nothing Then

               ' MsgBox (Reader.FaultString.Text)

               SendFileToServer = False

            Else

               ' MsgBox (Reader.RpcResult.Text)

               SendFileToServer = True

            End If

     

                Well that the code, as you see I am attaching a serialized file with some xml information to the attachment string and then send it to the server, it is important to use the correct namespaces  and method name in order to work properly, good luck and let know if that work fine

    April 27

    You Have to see that

    Click to see some nice flahs movies http://www.boombastick.net

    What do you think, te arrodillas ante estas cosas

    Apocalipsis 9:20

    Y los otros hombres que no fueron muertos con estas plagas, ni aun así se arrepintieron de las obras de sus manos, ni dejaron de adorar a los demonios, y a las imágenes de oro, de plata, de bronce, de piedra y de madera, las cuales no pueden ver, ni oír, ni andar;

    Revelation 9:20

    And the rest of the men which were not killed by these plagues yet repented not of the works of their hands, that they should not worship devils, and idols of gold, and silver, and brass, and stone, and of wood: which neither can see, nor hear, nor walk: