██▓▓▒▒░░ ɔɔ˙ǝɹ0ɔ˙ʍʍʍ ░░▒▒▓▓█

Source Code

Silverlight 4 + Blend 4

by Jose Antonio Bueno on Jun.17, 2010, under Expression Blend, Silverlight, Source Code

http://weblogs.asp.net/blogs/lduveau/WindowsLiveWriter/ExpressionBlendfreetrainings_10F14/expression_blend_f005d908-0287-4a20-95cd-8ff0968205a2.jpgMas vale tarde que nunca, el post pero el dia de hoy Jueves 17 de Junio de 2010 por la tarde a eso de la 06:30 p.m. Centro de Mexico, nos daremos cita en las instalaciones de IDS para dar una pequeña platica de Silverlight 4 y de Microsoft Expression Blend 4, la cual estara siendo abordada por Jonathan Romero con lo referente a  “Uso de Silverlight con el patrón MVVM“, Adrian Mondragon “Blend y su entorno” y un servidor, Jose Antonio Bueno Silverligh 4 su nuevas ventajas“.

Para todos los interesado en asistir, los esperamos con mucho gusto y ganas de aprender.

El lugar:

Av. Insurgentes Sur 1388 Piso 11 salas 3 y 4. Col. Actipan
Benito Juárez Distrito Federal 03230
Mexico

El registro:

https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032454244&Culture=es-MX

Solo faltas tu!,

Leave a Comment more...

Flip text – Como escribir texto de cabeza ( codigo fuente en JavaScript )

by Jose Antonio Bueno on Jul.14, 2009, under JavaScript

En esta ocacion les dejo una forma facil de escribir un texto y ponerlo de cabeza. Esto lo pongo a peticion de varios de los visitantes que me lo solicitaron, disfrutenlo :p

Descargar: text-flip.html

Flip Text – source code
===================


<html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>Text Flip
 </title>
<style type="text/css">
 textarea
 {
  font-family:  "Arial Unicode MS", Batang;
  color:   orange;
  background:  #000;
 }
 body
 {
  color:    #0f0;
  font-family:  tahoma;
  font-size:  10pt;
  background:  #000;
 }
</style>
<script language="JavaScript">

function flipOriginalText()
{
 var strFlipped = flipString(document.flipForm.txtOriginal.value.toLowerCase());
 document.flipForm.txtFlipped.value = strFlipped;
}

function flipString(strText)
{
 var lastPosition = strText.length - 1;
 var strArray = new Array(strText.length)
 for (var i = lastPosition; i >= 0; --i)
 {
  var c = strText.charAt(i)
  var r = flipTable[c]
  strArray[lastPosition - i] = r!=undefined ? r : c
 }
 return strArray.join('')
}

var flipTable =
{
 a : 'u0250',
 b : 'q',
 c : 'u0254', //open o -- from pne
 d : 'p',
 e : 'u01DD',
 f : 'u025F', //from pne
 g : 'u0183',
 h : 'u0265',
 i : 'u0131', //from pne
 j : 'u027E',
 k : 'u029E',
 //l : 'u0283',
 m : 'u026F',
 n : 'u',
 r : 'u0279',
 t : 'u0287',
 v : 'u028C',
 w : 'u028D',
 y : 'u028E',
 '.' : 'u02D9',
 '[' : ']',
 '(' : ')',
 '{' : '}',
 '?' : 'u00BF', //from pne
 '!' : 'u00A1',
 "'" : ',',
 '<' : '>',
 '_' : 'u203E',
 ';' : 'u061B',
 'u203F' : 'u2040',
 'u2045' : 'u2046',
 'u2234' : 'u2235'
}

for (i in flipTable)
{
  flipTable[flipTable[i]] = i
}
</script></head><body>
<h3>Flip text </h3>
<form name="flipForm">
Texto Original:
<br>
 <input value="Voltear texto" onclick="flipOriginalText()" type="button">
 <br>
 <textarea rows="10" cols="70" name="txtOriginal" onkeyup="flipOriginalText()"></textarea>
<br><br>
Texto volteado:
<br>
 <textarea rows="10" cols="70" name="txtFlipped"></textarea>
</form>
<p style="width: 300px;">
<small>
 Download from - - > <a href="http://www.antoniobs.net">http//www.antoniobs.net</a> <br>
 Original idea - - > <a href="http://pne.livejournal.com/398399.html>http://pne.livejournal.com/398399.html</a></small>
</p>
</body>
</html>

 
Leave a Comment more...

Programas “Hola mundo”

by Jose Antonio Bueno on Jul.13, 2009, under c# .Net, c++

Cuando un programador inicia a prender un nuevo lenguaje de programacion es muy tipico iniciar con el famoso “Hola mundo”, que no es mas que un simple ejemplo de un nuevo programa de computadora en donde aparece la leyenda “Hola mundo”.

 

Y aqui les dejo una pequeña compilacion para los nuevos programadores:

Suerte! :D

 

 dot Net Linq Programmer
    ===================


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JABS.VS2010.win32k
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] helloWorld = { "Hello", "Jose", "Antonio", "Bueno!", "World", "www.antoniobs.net" };

            try
            {
                var helloLinq = from word in helloWorld
                                where word.Length == 5
                                select word;

                foreach (string s in helloLinq)
                    Console.Write(s + " ");
               
            }
            catch (Exception err)
            {
                Console.WriteLine(err.Message);
            }
            finally
            {
                Console.WriteLine("nPress a key to continue...");
                Console.ReadKey();
            }
           
        }
    }
}

 

 

 High School/Jr.High
    ===================


    10 PRINT "HELLO WORLD"
    20 END

    First year in College
    =====================

    program Hello(input, output)
      begin
writeln('Hello World')
      end.

 

Senior year in College
    ======================

    (defun hello
      (print
(cons 'Hello (list 'World))))

 

New professional
================


     #include <stdio.h>
    void main(void)
    {
      char *message[] = {"Hello ", "World"};
      int i;

      for(i = 0; i < 2; ++i)
printf("%s", message[i]);
      printf("n");
    }

 

Seasoned professional
    =====================
 


#include <iostream.h>
    #include <string.h>

    class string
    {
    private:
      int size;
      char *ptr;

    public:
      string() : size(0), ptr(new char('')) {}

      string(const string &amp;amp;amp;s) : size(s.size)
      {
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
      }

      ~string()
      {
delete [] ptr;
      }

      friend ostream &amp;amp;amp;operator <<(ostream &amp;amp;amp;, const string &amp;amp;amp;);
      string &amp;amp;amp;operator=(const char *);
    };

    ostream &amp;amp;amp;operator<<(ostream &amp;amp;amp;stream, const string &amp;amp;amp;s)
    {
      return(stream << s.ptr);
    }

    string &amp;amp;amp;string::operator=(const char *chrs)
    {
      if (this != &amp;amp;amp;chrs)
      {
delete [] ptr;
       size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chrs);
      }
      return(*this);
    }

    int main()
    {
      string str;

      str = "Hello World";
      cout << str << endl;

      return(0);
    }

 

 

  Master Programmer
    =================

[
    uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
    ]
    library LHello
    {
// bring in the master library
importlib("actimp.tlb");
importlib("actexp.tlb");

// bring in my interfaces
#include "pshlo.idl"

[
uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
]
cotype THello
     {
     interface IHello;
     interface IPersistFile;
     };
    };

    [
    exe,
    uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
    ]
    module CHelloLib
    {

// some code related header files
importheader(<windows.h>);
importheader(<ole2.h>);
importheader(<except.hxx>);
importheader("pshlo.h");
importheader("shlo.hxx");
importheader("mycls.hxx");

// needed typelibs
importlib("actimp.tlb");
importlib("actexp.tlb");
importlib("thlo.tlb");

[
uuid(2573F891-CFEE-101A-9A9F-00AA00342820),
aggregatable
]
coclass CHello
     {
     cotype THello;
     };
    };

    #include "ipfix.hxx"

    extern HANDLE hEvent;

    class CHello : public CHelloBase
    {
    public:
IPFIX(CLSID_CHello);

CHello(IUnknown *pUnk);
~CHello();

HRESULT  __stdcall PrintSz(LPWSTR pwszString);

    private:
static int cObjRef;
    };

    #include <windows.h>
    #include <ole2.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include "thlo.h"
    #include "pshlo.h"
    #include "shlo.hxx"
    #include "mycls.hxx"

    int CHello::cObjRef = 0;

    CHello::CHello(IUnknown *pUnk) : CHelloBase(pUnk)
    {
cObjRef++;
return;
    }

    HRESULT  __stdcall  CHello::PrintSz(LPWSTR pwszString)
    {
printf("%wsn", pwszString);
return(ResultFromScode(S_OK));
    }

    CHello::~CHello(void)
    {

    // when the object count goes to zero, stop the server
    cObjRef--;
    if( cObjRef == 0 )
PulseEvent(hEvent);

    return;
    }

    #include <windows.h>
    #include <ole2.h>
    #include "pshlo.h"
    #include "shlo.hxx"
    #include "mycls.hxx"

    HANDLE hEvent;

     int _cdecl main(
    int argc,
    char * argv[]
    ) {
    ULONG ulRef;
    DWORD dwRegistration;
    CHelloCF *pCF = new CHelloCF();

    hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);

    // Initialize the OLE libraries
    CoInitializeEx(NULL, COINIT_MULTITHREADED);

    CoRegisterClassObject(CLSID_CHello, pCF, CLSCTX_LOCAL_SERVER,
REGCLS_MULTIPLEUSE, &amp;amp;amp;dwRegistration);

    // wait on an event to stop
    WaitForSingleObject(hEvent, INFINITE);

    // revoke and release the class object
    CoRevokeClassObject(dwRegistration);
    ulRef = pCF->Release();

    // Tell OLE we are going away.
    CoUninitialize();

    return(0); }

    extern CLSID CLSID_CHello;
    extern UUID LIBID_CHelloLib;

    CLSID CLSID_CHello = { /* 2573F891-CFEE-101A-9A9F-00AA00342820 */
0x2573F891,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
    };

    UUID LIBID_CHelloLib = { /* 2573F890-CFEE-101A-9A9F-00AA00342820 */
0x2573F890,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
    };

    #include <windows.h>
    #include <ole2.h>
    #include <stdlib.h>
    #include <string.h>
    #include <stdio.h>
    #include "pshlo.h"
    #include "shlo.hxx"
    #include "clsid.h"

    int _cdecl main(
    int argc,
    char * argv[]
    ) {
    HRESULT  hRslt;
    IHello        *pHello;
    ULONG  ulCnt;
    IMoniker * pmk;
    WCHAR  wcsT[_MAX_PATH];
    WCHAR  wcsPath[2 * _MAX_PATH];

    // get object path
    wcsPath[0] = '';
    wcsT[0] = '';
    if( argc  1) {
mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);
wcsupr(wcsPath);
}
    else {
fprintf(stderr, "Object path must be specifiedn");
return(1);
}

    // get print string
    if(argc  2)
mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);
    else
wcscpy(wcsT, L"Hello World");

    printf("Linking to object %wsn", wcsPath);
    printf("Text String %wsn", wcsT);

    // Initialize the OLE libraries
    hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED);

    if(SUCCEEDED(hRslt)) {

hRslt = CreateFileMoniker(wcsPath, &amp;amp;amp;pmk);
if(SUCCEEDED(hRslt))
     hRslt = BindMoniker(pmk, 0, IID_IHello, (void **)&amp;amp;amp;pHello);

if(SUCCEEDED(hRslt)) {

     // print a string out
     pHello->PrintSz(wcsT);

     Sleep(2000);
     ulCnt = pHello->Release();
     }
else
     printf("Failure to connect, status: %lx", hRslt);

// Tell OLE we are going away.
CoUninitialize();
}

    return(0);
    }

 

 

 Apprentice Hacker
    ===================


 #!/usr/local/bin/perl
    $msg="Hello, world.n";
    if ($#ARGV >= 0) {
      while(defined($arg=shift(@ARGV))) {
$outfilename = $arg;
open(FILE, ">" . $outfilename) || die "Can't write $arg: $!n";
print (FILE $msg);
close(FILE) || die "Can't close $arg: $!n";
      }
    } else {
      print ($msg);
    }
    1;

 

    Experienced Hacker
    ===================


 #include <stdio.h>
    #define S "Hello, Worldn"
    main(){exit(printf(S) == strlen(S) ? 0 : 1);}
 

 

  Seasoned Hacker
    ===================


 % cc -o a.out ~/src/misc/hw/hw.c
    % a.out

 

Guru Hacker
    ===================


  % cat
    Hello, world.
    ^D

 

  New Manager
    ===================


    10 PRINT "HELLO WORLD"
    20 END
 

 

    Middle Manager
    ===================


  mail -s "Hello, world." bob@b12
    Bob, could you please write me a program that prints "Hello, world."?
    I need it by tomorrow.
    ^D

 

 

    Senior Manager
    ===================


% zmail jim
    I need a "Hello, world." program by this afternoon.

 

 

Chief Executive
    ===================


  % letter
    letter: Command not found.
    % mail
    To: ^X ^F ^C
    % help mail
    help: Command not found.

    % damn!
    !: Event unrecognized
    % logout

via

Leave a Comment more...

Como guardar multiples datos, con multiples registros en PHP

by Jose Antonio Bueno on Jun.30, 2009, under Php

En esta ocacion les dejo un pequeño script que pretende ayudar a ilustrar de una forma practica la posibilidad de poder actualizar o insertar multiples datos de multiples registros a una base de datos usando php, es decir…

Imaginemos que tenemos una seccion en la cual necesitemos actualizar o insertar los registros de varios usuarios de forma multiple y en la cual podamos actualizar todos los datos incluyendo nombre, password, usuario, contraseña, status de usuario, etc.

code1

Tablas:


/**
* @Author: J Antonio BS
* @Mail:   mail@antoniobs.net
* @Web:    www.antoniobs.net
*/
/*
c0de for MySQL
*/
CREATE TABLE AppUsers (
id_user int(11) NOT NULL  AUTO_INCREMENT PRIMARY KEY,
user_name varchar(32) NOT NULL DEFAULT '',
user_last_name varchar(32) NOT NULL DEFAULT '',
user_mail varchar(32) NOT NULL DEFAULT '',
user_login varchar(16) NOT NULL DEFAULT '',
user_password varchar(16) NOT NULL DEFAULT '',
user_status tinyint(1) NOT NULL DEFAULT '1'
);

/*
c0de for SQL Server
*/
CREATE TABLE AppUsers (
id_user int NOT NULL  PRIMARY KEY IDENTITY(1,1),
user_name varchar(32) NOT NULL ,
user_last_name varchar(32) NOT NULL ,
user_mail varchar(32) NOT NULL ,
user_login varchar(16) NOT NULL ,
user_password varchar(16) NOT NULL ,
user_status bit NOT NULL DEFAULT (1)
);

/*
c0de for PostgreSQL
*/
CREATE TABLE AppUser
(
id_user serial NOT NULL PRIMARY KEY,
user_name character(32),
user_last_name character(32),
user_mail character(32),
user_login character(16),
user_password character(16),
user_status boolean
)

Codigo:


<?
/**
* @Author: J Antonio BS
* @Mail:   mail@antoniobs.net
* @Web:    www.antoniobs.net
*/

if( isset( $_POST["submit"] ) ) // se envio el formulario?

for($x =0 ; $x < 10 ; $x++) // recorremos 10 posibles registros, puedes poner los que necesites
// se recuperan cada uno de los datos del form siempre y cuando se hayan enviado, de lo contrario los omite

if(isset($_POST["opcStatus" . $x])) // se envio el registro opcStatus1, opcStatus2, ... etc. ?
{
// obtenemos cada uno de los datos
$idUser        =  $_POST[ "idUser".$x ];
$txtNombre     =  $_POST[ "txtNombre".$x ];
$txtApellido=  $_POST[ "txtApellido".$x ];
$txtMail     =  $_POST[ "txtMail".$x ];
$txtUser     =  $_POST[ "txtUser".$x ];
$txtPassword=  $_POST[ "txtPassword".$x ];
$opcStatus     =  $_POST[ "opcStatus".$x ];
// tu cadena correspondiente para la actualizacion de datos.

/*Justo aqui es donde tu colocas el codigo correspondiente a la actualizacion

o a la insercion de los datos a tu base de datos, este script se limita a

proponer la funcionalidad, el resto esta de tu parte. */
echo "UPDATE SET user_name='$txtNombre', user_last_name='$txtApellido',user_mail=' $txtMail', user_login='$txtUser', user_password='$txtPassword', user_status='$opcStatus' WHERE id_usuario='$idUser'<br>";
}
else
echo "Selecciona los datos correspondientes.<br>";
?>
<pre>

Se pretende guardar multiples datos de multiples registros

</pre>

<form method="POST">
Registro 1
<br><br>
Nombre:         <input type="text" name="txtNombre1">
Apellidos:        <input type="text" name="txtApellido1">
Mail:            <input type="text" name="txtMail1">
<br>
Usuario:        <input type="text" name="txtUser1">
Password:        <input type="text" name="txtPassword1">
Status: <select name="opcStatus1">
<option value="1"> Activo </option>
<option value="0"> Inactivo </option>
</select>
<input type="hidden" name="idUser1" value="10">
<hr>
Registro 2
<br><br>
Nombre:         <input type="text" name="txtNombre2">
Apellidos:        <input type="text" name="txtApellido2">
Mail:            <input type="text" name="txtMail2">
<br>
Usuario:        <input type="text" name="txtUser2">
Password:        <input type="text" name="txtPassword2">
Status: <select name="opcStatus2">
<option value="1"> Activo </option>
<option value="0"> Inactivo </option>
</select>
<input type="hidden" name="idUser2" value="5345">
<hr>

Registro 3
<br><br>
Nombre:         <input type="text" name="txtNombre3">
Apellidos:        <input type="text" name="txtApellido3">
Mail:            <input type="text" name="txtMail3">
<br>
Usuario:        <input type="text" name="txtUser3">
Password:        <input type="text" name="txtPassword3">
Status: <select name="opcStatus3">
<option value="1"> Activo </option>
<option value="0"> Inactivo </option>
</select>
<input type="hidden" name="idUser3" value="2334">
<hr>

<input type ="submit" name="submit" value="OK">
</form>

Con fines ilustrativos se colocaron solo 3 registros estaticos , pero esto no necesariamente deberia ser asi, ya que se podria modificar de tal forma que se pudiesen llenar esos registros de forma dinamica con la informacion proveniente de tu DB, colocando cada valor en la etiqueta value=”" correspondiente.

Suerte!

3 Comments more...

Usando SQL Server 2000 en Windows 7

by Jose Antonio Bueno on Jun.28, 2009, under SQL Server, Windows 7

windows7-sql2000Pareciera un poco anticuado el uso de SQL Server 2000, a estas fechas en las que Microsoft tiene disponible todas las ultimas versiones de sus productos de la familia SQL Server como lo son porejemplo SQL Server 2005 o SQL Server 2008, pero por desgracia o por fortuna SQL Server 2000 es parte fundamental en las empresas por lo que se tienen aun sistemas en produccion basados en este gestor de DB, por esta misma razon es indispensable  para uno como desarrollador tenerlo presente instalado y funcionando.

La primera impresion evidente sobre Windows 7 es el problema de compatibilidad, aunque finalmente termina siendo instalada, y con muchas de estas advertencias, y claro que sin olvidar instalar posteriormente el Service Pack 4.

windows7-sqlserver200-administrador-corporativowindows7-sql200-analizer

Aun y con todo esto parece ser que funciona bien, solo abra que esperar su impredecible comportamiento, para poder platicarles los resultados obtenidos :)

14 Comments more...

Walcome to this web site! :)

Visit our friends!

A few highly recommended friends...