13/11/06

Visita Simo 2006

www.solmicro.com: ERP ampliable y configurable. Te dan el código fuente y generadores de código.

26/10/06

BENEDETTI

"POEMAS REVELADOS" (Libro en casa de Dunia)
  • "NO TE SALVES"
    • "NO QUIERAS CON DESGANA"
  • "DEFENSA DE LA ALEGRIA"
    • Casi completo
  • "LA TREGUA"
    • Trabajar de camarero
  • "EL OLVIDO"
    • "EL OLVIDO NO ES VICTORIA"
    • "NO OLVIDA EL QUE FINGE OLVIDO,
      SINO EL QUE PUEDE OLVIDAR"

13/8/06

HTML Base

Tabla con 3 zonas e imágenes de fondo.

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>TODO supply a title</title>
</head>
<body style="margin:0px;padding:0px">

<table style="valign:centered;text-align:center;width:100%;height:100%;border-spacing:0px">
<tr style="height:20%">
<td style="valign:centered;text-align:center;background-image:url('borrame.jpg')">

<h1>Encabezado</h1>
</td>
</tr>
<tr style="height:65%">

<td style="valign:centered;text-align:center;background-image:url('borrame.jpg')">
<p>cuerpo</p>
</td>

</tr>
<tr style="height:15%">
<td style="valign:centered;text-align:center;background-image:url('borrame.jpg')">

<p>pie</p>
</td>
</tr>
</table>
</body>

</html>

3/8/06

¿Qué debe incluir un caso de uso?

Actor Principal
Precondiciones
Postcondiciones
Flujo Básico
Flujos Alternativos
Requisitos especiales
Frecuencia

Web sobre el tema "usecases.org"

23/6/06

Java: Leer una url



try{
java.net.URL url = new java.net.URL("http","www.ya.com",80,"");
java.io.InputStream is = url.openStream();
System.out.println("[ya.com]");
int c;
while ((c = is.read()) != -1){
System.out.write(c);
}
System.out.println("[ya.com fin]");
}catch(Exception e){
e.printStackTrace();
}

5/6/06

Interesante historia acerca de pasar de Windows a Linux

La escribio usuario de barrapunto conocido como "year of the dragon". Es una ida de olla interesante y amena. La conclusión es que utilices programas compatibles Windows y Linux (normalmente software libre) para ir pasando poco a poco hasta que windows no te haga falta.
(para verla pulsar sobre el título del artículo)

Mostrar tablas de un esquema de Oracle


Select * from cat

Nota: Información de catálogo.

25/4/06

Truquillos chorras

Truquillos chorras que te han hecho falta de Operador de Ordenador en Familia
Copiar ficheros
xcopy /e /c /h /r /k /z *.* dest\
Actualizar la hora del equipo a la del dominio
runas /user:familia\Administrador "net time /Domain:Familia /set"
Dir mostrando ocultos
dir /A
Instalar el redistribuible del .net
dotnetfx.exe /q /c:"install.exe /q"

30/3/06

ComboBox en .Net

  
this.cbMunicipio.DropDownStyle = ComboBoxStyle.DropDownList;
this.cbMunicipio.DataSource = Program.dm.ProvinciaMunicipioBindingSource; //BindingSource a mostrar
this.cbMunicipio.DisplayMember = Program.dm.dsOracle.MUNICIPIO.NOMBREColumn.ColumnName; // Campo nombre
this.cbMunicipio.ValueMember = Program.dm.dsOracle.MUNICIPIO.CODIGOColumn.ColumnName; // Campo valor
this.cbMunicipio.DataBindings.Add( // enlace con el campo donde se guarda el valor
new Binding("SelectedValue", // La propiedad de SelectedValue ( no value)
Program.dm.OrganoBindingSource, // Bindingsource de la tabla en la que grabamos el valor
Program.dm.dsOracle.ORGANO.CODIGO_MUNICIPIOColumn.ColumnName // nombre del campo en el que guardamos el valor
));

Conexión con Bd Access

Los 2 parámetros imprescindibles son:
  • Provider=Microsoft.Jet.OLEDB.4.0;

  • Data Source='"+d.FileName+"'"

Ejemplo completo:
System.Data.OleDb.OleDbConnection con = new OleDbConnection("Provider='Microsoft.JET.OLEDB.4.0';Data source = 'o:\datos\prueba1.mdb'");


Con clave:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:Database Password=MyDbPassword;

Leer autonumricos de Access y Sql Server(Identity)


     OleDbConnection con = new OleDbConnection(CadCon);
     OleDbCommand cmd = OleDbCommand("SELECT @@IDENTITY", con);
     int clave = (int) cmdIdentidad.ExecuteScalar();

Ejemplo de Semáforos con C#

Mutex m = new Mutex();
m.WaitOne();
if (instancia == null){
     instancia = new ClaseUnica();
}
m.Close();

27/3/06

Cadenas en C#

Cadenas en C#

Para que no interprete los caracteres de “\” en una cadena y tener que poner “\\” en las rutas de directorio se puede poner una arroba “@” delante de la cadena y listo.
Ejemplo:
Ruta = “c:\\path\\fichero”
Ruta = @”c:\path\fichero”

Si queremos tener una cadena en la que se valla construyendo una más larga debemos usar el StringBuilder por cuestiones de rendimiento.

22/2/06

Formulario C# con creación de controles a pelo



using System;
using System.Drawing;
using System.Windows.Forms;

namespace pruebas1
{
///
/// Description of EdicionConControles.
///

public partial class EdicionConControles
{
//Controles a los que es necesario acceder desde código del formulario
private TextBox tbAlias;
private TextBox tbNombre;

public void InicializarControles(){
// Panel Datos
FlowLayoutPanel flpDatos = new FlowLayoutPanel();
flpDatos.Parent = this;
flpDatos.Dock = DockStyle.Fill;
flpDatos.BackColor = Color.Cyan; // para ver donde acaba

// Alias
Panel panelAlias = new Panel();
panelAlias.Parent = flpDatos;
panelAlias.BackColor = Color.AliceBlue;

Label labelAlias = new Label();
labelAlias.Parent = panelAlias;
labelAlias.Text = "Alias";
labelAlias.Top = 2;
labelAlias.Left = 2;
labelAlias.Height = 12;

/* definido fuera*/
tbAlias = new TextBox();
tbAlias.Parent = panelAlias;
tbAlias.Left = 2;
tbAlias.Top = 2 + labelAlias.Height + 2;

panelAlias.Height = 2 * 3 + labelAlias.Height + tbAlias.Height;
panelAlias.Width = 2 * 2 + tbAlias.Width;

//nombre
Panel panelNombre = new Panel();
panelNombre.Parent = flpDatos;
panelNombre.BackColor = Color.AliceBlue;

Label labelNombre = new Label();
labelNombre.Parent = panelNombre;
labelNombre.Text = "Nombre";
labelNombre.Top = 2;
labelNombre.Left = 2;
labelNombre.Height = 12;

//Definido fuera
tbNombre = new TextBox();
tbNombre.Parent = panelNombre;
tbNombre.Left = 2;
tbNombre.Top = 2 + labelNombre.Height + 2;

panelNombre.Height = 2 * 3 + labelNombre.Height + tbNombre.Height;
panelNombre.Width = 2 * 2 + tbNombre.Width;

// Panel Botones
FlowLayoutPanel flpBotones = new FlowLayoutPanel();
flpBotones.Parent = this;
flpBotones.Dock = DockStyle.Bottom;
flpBotones.BackColor = Color.Red;// para ver donde acaba
flpBotones.Height = 27; //23 del boton estándar más 4

// botón grabar
Button bGrabar = new Button();
bGrabar.Parent = flpBotones;
bGrabar.Click += new EventHandler(bGrabarClick);
//void bGrabarClick(object sender, System.EventArgs e)
bGrabar.UseVisualStyleBackColor = true;
bGrabar.Text = "Grabar";

// botón salir
Button bSalir = new Button();
bSalir.Parent = flpBotones;
bSalir.Click += new EventHandler(bSalirClick);
//void bGrabarClick(object sender, System.EventArgs e)
bSalir.UseVisualStyleBackColor = true;
bSalir.Text = "Salir";
}

public EdicionConControles()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();

this.InicializarControles();
}

void bGrabarClick(object sender, System.EventArgs e)
{
MessageBox.Show("Botón de grabar");
}

void bSalirClick(object sender, System.EventArgs e)
{
MessageBox.Show("Botón de Salir");
}

}
}


25/1/06

¿Qué observar en una vivienda ya construida?

Por lo visto hay que mirar:

  • Estado de las zonas comunes, tanto internas como externas: jardines, fachada, cubierta, portal, ascensor, escaleras.
  • Situación de la vivienda dentro del edificio.
  • Situación del garaje y del trastero dentro del edificio.
  • Distribución de la vivienda.
  • Habitaciones interiores y exteriores.
  • Metros cuadrados útiles y construidos.
  • Superficies de cada hueco y distancia entre tabiques.
  • Situación de pilares, salidas de humo, ventilación y tuberías.
  • Calidad de los materiales de construcción de la vivienda y del edificio.
  • Situación de las tomas de electricidad, luz y TV.
  • Estado de suelos, paredes y techos.
  • Calefacción y agua. Servicios centrales o individuales.
  • Presión del agua en los grifos.
  • Aire acondicionado.
  • Armarios empotrados.
  • Cocina amueblada.
  • Aislamiento térmico.
  • Aislamiento acústico.

18/1/06

Programar para Outlook

static void Main()
{
System.Windows.Forms.Application.Run(new Form1());
}

private void button1_Click(object sender, System.EventArgs e)
{
Outlook.ContactItem ci;
Outlook.Application outlook = new Outlook.ApplicationClass();
ci = outlook.CreateItem(Outlook.OlItemType.olContactItem) as Outlook.ContactItem;
ci.NickName = "NickName";
ci.FullName = "FullName" + System.DateTime.Now.ToLongTimeString();;
ci.JobTitle = "JobTitle";
ci.CompanyName = "CAM Informática";
ci.Save();
}


http://msdn.microsoft.com/office/understanding/outlook/codesamples/default
.aspx?pull=/library/en-us/dno2k3ta/html/odc_ac_olauto.asp





Create a Contact Item in Outlook


This section shows you how to use automation from an Access form to start Outlook and to display a new contact screen for input. You can change just one line of code to make this example apply to a new Outlook appointment,
journal entry, mail message, note, post, or task.


The following sample shows you how to create a form in Access that starts
Outlook from a command button. Then the automation code opens a new
contact screen for input in Outlook. After you add the contact, save, and
close the contact form, the automation code quits Outlook and returns to
the Access form.


To create a contact item in Outlook from an Access form, follow these
steps:
1. Open the sample database Automation.mdb created earlier.
2. Create a form that is not based on any table or query, add a command
button the form, and make the following property assignments:
Form: (save as frmOutlook) - Caption: Add to Outlook Form
Command button -


Name: cmdOutlook


Caption: Start Outlook\


OnClick: [Event Procedure]
3. On the View menu, click Code to open the Visual Basic Editor.
4. On the Tools menu, click References.
5. Click Microsoft Outlook 11.0 Object Library in the Available
References list.
6. Click OK to close the References dialog box.
7. Type or paste the following procedure in the OnClick event of the
command button:


Option Compare Database
Option Explicit
Public Sub cmdOutlook_Click ()
On Error GoTo StartError
Dim objOutlook As Object
Dim objItem As Object
'Create a Microsoft Outlook object.
Set objOutlook = CreateObject("Outlook.Application")
'Create and open a new contact form for input.
Set objItem = objOutlook.CreateItem(olContactItem)
'To create a new appointment, journal entry, email message,
note, post,
'or task, replace olContactItem above with one of the following:
'
' Appointment = olAppointmentItem
'Journal Entry = olJournalItem
'Email Message = olMailItem
' Note = olNoteItem
' Post = olPostItem
' Task = olTaskItem

objItem.Display
'Quit Microsoft Outlook.
Set objOutlook = Nothing

Exit Sub
StartError:
MsgBox "Error: " & Err & " " & Error
Exit Sub
End Sub

8. On the File menu, click Close and Return to Microsoft Access, and
switch the form to Form View.
9. Click Start Outlook. Notice that Outlook displays a new contact
screen.
10. Fill in the contact information for a new contact and click
Save and Close.
11. Start Outlook and click the Contacts in the Navigation pane.
Notice the contact shows up in the list of contacts.