2007/05/31

send mail / VBA excel

http://www.rondebruin.nl/sendmail.htm

http://www.paulsadowski.com/WSH/cdo.htm

Keith74


#===============================================================
#===============================================================

maybe that helps:


    Sub NeueMail2Outbox()

    Dim ol, olns, p_out As Outlook.MAPIFolder
    Dim neumail As Outlook.MailItem, empfänger

    Set ol = CreateObject("Outlook.Application")
    Set olns = ol.GetNamespace("MAPI")
    Set p_out = olns.GetDefaultFolder(olFolderOutbox)

    neumail = p_out.Items.Add

    With neumail
    .Recipient.Add "Bernd Meier"
    .Subject = "Einladung"
    .Body = "Einladung zum Gartenfest" _
    & vbCr & "Wann? Am 20. Juni 2000" _
    & vbCr & "Wo? Biergarten Zur Linde, München"
    ' For Each empfänger In neumail.Recipients()
    ' empfänger.Resolve
    ' Next
    ' .Send
    End With


gNeandr

#===============================================================
#===============================================================

http://www.paulsadowski.com/WSH/cdo.htm

that page shows how to use MS CDO

- i enabled its reference, and worked fine with the simple example


    Sub Mail1()

    Set objMessage = CreateObject("CDO.Message")
    objMessage.Subject = "Example CDO Message"
    objMessage.From = "toto@toto.com"
    objMessage.To = "tata@tata.com"
    objMessage.TextBody = "This is some sample message text."

    '==This section provides the configuration information for the remote
    SMTP server.
    '==Normally you will only change the server name or IP.

    objMessage.Configuration.Fields.item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

    'Name or IP of Remote SMTP Server
    objMessage.Configuration.Fields.item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
    = "smtp.toto.com"

    'Server port (typically 25)
    objMessage.Configuration.Fields.item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

    objMessage.Configuration.Fields.Update

    '==End remote SMTP server configuration section==

    objMessage.Send

    End Sub



#===============================================================
#===============================================================


http://www.rondebruin.nl/cdo.htm

Norman Jones

2007/05/30

piping text lines / "Here Documents"

Many ways to do this. Here's two:

    prog << EOF
    line 1
    line 2
    ...
    line N
    EOF


or

    (echo "line 1"
    echo "line 2"
    ...
    echo "line N") | prog


The "<< EOF" syntax creates what is usually called a "here is" document.
The shell takes all of the lines up to (but not including) the line that
begins "EOF" (in column 1), writes all those lines to a temporary file,
and then feeds that file as standard input to "prog", just as in your
original example (except that the shell is doing the work for you). When
"prog" has finished executing, the temporary file is deleted. You can
replace "EOF" by any string that does not appear in the input; the "<<" is
the important part.

Another version of it uses the syntax "<<-EOF". The effect of the "-" is
to allow the terminating EOF to be on a line that has leading white space
on it; it is an instruction to ignore any leading white space in the data
(all of the data, not just the EOF line).

It's usually better to use the facilities provided by the shell rather
than writing out the equivalent code using some other technique. Less code
usually leads to fewer bugs and easier maintenance, because it is
hopefully more readable that way. It's probably a bit more efficient to
use the "<< XXX" method, but not by a lot in this instance (unless you're
doing it very many times).

Steve Thompson

#-----------------------------------------------------
#-----------------------------------------------------


    % (echo "juan"; echo "1"; echo "alba") | sort
    1
    alba
    juan

    % sort << XXXX
    > 5
    > 2
    > 5
    > 1
    > b
    > c
    > XXXX
    1
    2
    5
    5
    b
    c


http://www.tdp.org

"Advanced Bash-Scripting Guide"
And check the chapter about "Here Documents".
Michael Heiming

#-----------------------------------------------------
#-----------------------------------------------------


    {
    echo "line 1"
    echo "line 2"
    ...
    echo "line N"

    } | prog


Or:


    printf "%s\n" "line 1" \
    "line 2" ... \
    "line N" | prog


Chris F.A. Johnson

#-----------------------------------------------------
#-----------------------------------------------------

One person already gave an example that uses the "<< EOF" syntax,
but if you really need to group commands' output together into
a pipe, and you have to commands (and not just interpolated strings),
you can do this:


    {
    echo "line 1"
    echo "line 2"
    echo "line 3"
    } | prog


Personally I like this since it is more flexible. You can chain
them:


    { echo 1; echo 2; } | { read x; read y; echo "$x / $y"; } | bc -l


Or nest them:


    {
    echo 1
    {
    echo 2
    echo 3
    } | sed -e 's/$/x/'
    echo 4
    } | sed -e 's/$/y/'


Also, in some cases, a better solution might be to use a function.

- Logan

2007/05/25

Win XP monitor counters


=======

César H

Lo que deseas hacer es posible a través del 'Monitor de sistema' para ello ve a

Inicio -> ejecutar -> perfmon.msc

y simplemente agregas los contadores que necesitas,
para este caso puedes agregar los contadores:

    [Bytes enviados/s] [Bytes recibidos/s]

asi como también puedes agregar los contadores

    [Paquetes recibidos/s] / [Paquetes enviados/s]

todos del objeto Interfaz de red

luego puedes cambiar la presentación de gráfico por la de informe
y hay tendrás todos los datos que necesitas

=======

On May 23, 12:19 am, Daniel Martín [MVP Windows]
wrote:

> En Windows XP, se mostrará en bytes o paquetes dependiendo de la información
> que le proporcione el controlador de red. Simplemente, si con esos datos
> puede mostrar bytes, los mostrará; en caso contrario, mostrará la cantidad
> de paquetes enviados/recibidos. No hay un valor de Registro o similar para
> cambiar esto, es por diseño.

=======

> requiero conocer la cantidad de bytes transmitidos/recibidos por la
> interfase de red.

> en xp hago:
> strat -> settings -> network connections

> en esa ventana clickeo la interfase que me interesa (XXX) y me sale
> una ventana con el STATUS de XXX, que en tab general aparece la
> actividad que deseo, pero la unidad es PACKETS.

> ahora bien, este paquete cuantos bits, o bytes tiene? en versiones
> anteriores de windos la unidad era bytes, ahora estoy confundido.

2007/05/15

extraction of function prototypes from C source file

http://rpmfind.net/linux/RPM/netwinder/netwinder/RPMS/dm/3.1-15/cproto-4.6-2.armv4l.html

Cproto generates function prototypes and variable declarations from
C source code. Cproto can also convert function definitions between the
old style and the ANSI C style. This conversion will overwrite the
original files, however, so be sure to make a backup copy of your original
files in case something goes wrong. Since cproto uses a Yacc generated
parser, it shouldn't be confused by complex function definitions as much
as other prototype generators) because it uses a Yacc generated parser.

Cproto will be useful for C programmers, so install cproto if you are going
to do any C programming.

http://rpmfind.net/linux/rpm2html/search.php?query=cproto

    rpm -Uvh -vv cproto-4.7c-3.src.rpm

    /usr/src/packages/SOURCES % ll
    1219 Sep 9 2004 cproto-4.6-bison.patch
    267 Sep 9 2004 cproto-4.6-varargs.patch
    1762 Sep 9 2004 cproto-4.6.1-patch
    118592 Jun 25 2004 cproto-4_7c.tgz

    gunzip cproto-4_7c.tgz
    tar -xvf cproto-4_7c.tar
    cd cproto-4_7c
    ./configure
    make


Makefile:
    proto:
      cproto $(SRCS) > ./prototypes_aux.h


#===============================
protoize works for C (except that it changes the parameter types).
cproto also works for C (doesn't change the parameter types).

http://invisible-island.net/cproto/

--
Thomas E. Dickey
http://invisible-island.net


#===============================
William.Deans@gmail.com

I am sure there is a better solution than this, but in case no one
steps forward with one:
---------------------

Greetings,

I don't know the answer to your question but I do know that some IDE's
have a tree view which includes functions prototypes. If your job was
on a medium to large scale you could automate the extraction using
that code. Simply modify the IDE such that it logs the function
prototypes as it adds them to the tree view. Unless you run into some
difficulty, I do not see why this logging code should take longer than
a few minutes to add.

Hope this helps,
William

#================================================
http://www.cs.cmu.edu/cgi-bin/info2www?(gcc.info)C%20Dialect%20Options

Options Controlling C Dialect
=============================
`-aux-info FILENAME'
Output to the given filename prototyped declarations for all
functions declared and/or defined in a translation unit, including
those in header files. This option is silently ignored in any
language other than C.

Besides declarations, the file indicates, in comments, the origin
of each declaration (source file and line), whether the
declaration was implicit, prototyped or unprototyped (`I', `N' for
new or `O' for old, respectively, in the first character after the
line number and the colon), and whether it came from a declaration
or a definition (`C' or `F', respectively, in the following
character). In the case of function definitions, a K&R-style list
of arguments followed by their declarations is also provided,
inside comments, after the declaration.


$(CC) -c $(CFLAGS) -aux-info $<.X -o $@ $<

2007/05/08

windows XP: logon / logout scripts

ok dani, MUCHAS gracias! funciono perfecto
slds

On May 7, 10:40 am, "Dani" wrote:

> Con el editor de politicas puedes lanzar comandos en el inicio / cierre de
> sesion, si es xp pro abrelo

start -> run -> gpedit.msc -> user configuration -> windows settings -> scripts (logon/logoff)

"rhXX" escribió en el mensaje

> > existe algun campo en los registros que me permita introducir la
> > corrida de un programa cuando se cierra el windows?
>
> > es decir el equivalente para el startup de incluirlo en este registro:
>
HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Windows\CurrentVersion\RunOnce