Archive for the ‘Programmierung’ Category.

Programming Interactivity: Unlock the Power of Arduino, Processing, and OpenFrameworks

Habe ein neues Buch zu Arduino & Co: Programming Interactivity: Unlock the Power of Arduino, Processing, and OpenFrameworks von Joshua Noble. Was mir an den über 700 Seiten sehr gut gefällt, ist das Hintergrundwissen, das in das Buch eingeflossen ist. Also nicht nur „Pack den Draht da hin und schließ ihn da an“ sondern auch eine Menge an Zusatzinformationen. Habe die fast 40 Euro nicht bereut.

Hier mal die Kapitelübersicht:

  1. Introducing Interaction Design
  2. Programming Basics
  3. Processing
  4. Arduino
  5. Programming Revisited
  6. openFrameworks
  7. Sound and Audio
  8. Physical Input
  9. Programming Graphics
  10. Bitmaps and Pixels
  11. Physical Feedback
  12. Protocols and Communication
  13. Graphics and OpenGL
  14. Detection and Gestures
  15. Movement and Location
  16. Interfaces and Controls
  17. Spaces and Environments
  18. Further Resources

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Mit Powershell Windows Shares auslesen

Hab ich grad in den Weiten des Netzes gefunden:

Get-ChildItem \\bigboy\share  -recurse | where {$_.PSIsContainer} | Get-Acl | Select-Object Path, Owner -ExpandProperty Access

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

LaTeX und Apache Ant

Apache Ant ist das Build-Tool der Wahl für Java. DokuTransData ( >= Homepage hat mit ant_latex ein Tool veröffentlicht, mit dessen Hilfe man LaTeX in den Build-Prozess integrieren kann.

<?xml version="1.0" encoding="UTF-8"?>
 
<project name="AntLaTeX" default="doLaTeX" basedir=".">
 
    <description>Compiles a LaTeX file.</description>
  <taskdef name="latex"    
   classname="de.dokutransdata.antlatex.LaTeX"  
     classpath="ant_latex.jar"/>
 
    <property name="ltx2.file" value="Antrag071105.tex"/>
 
  <target name="doLaTeX">  
    <latex  
      latexfile="${ltx2.file}"  
      verbose="on"  
      clean="on"  
      pdftex="off"  
      workingDir="${basedir}"  
    />  
  </target>
 
</project>

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Verknüpfungen anlegen mit Powershell

Im Blog von Lee Desmond findet sich ein kurzer Artikel, wie man über die Powershell Verknüpfungen anlegen kann: http://www.leedesmond.com/weblog/?p=60.

Hier ein Beispiel:

$link = $wshshell.CreateShortcut($home\Desktop\Verknuepfung.lnk”)
$link.targetpath = "C:\test.txt"
$link.save()

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Powershell im IT-Handbuch für Fachinformatiker

Im IT-Handbuch für Fachinformatiker aus dem Galileo-Verlag findet sich auch ein Abschnitt zur Powershell, der unter http://openbook.galileocomputing.de/it_handbuch/ fachinformatiker_06_windows_002.htm #mj79f9cdd8da1b64d3ad8122bf8d6e3b9e online verfügbar ist.

Das Buch geht dabei nicht so in die Tiefe, wie spezielle Powershell-Bücher, gibt aber einen recht guten Einstieg, der sicher Lust auf mehr macht.

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

FileOpen und FileSave Dialoge mit Powershell

Da man mit Powershell auch die Windows API ansprechen kann, lässt sich auch ein FileOpen oder FileSave Dialog mit geringem Aufwand erstellen. Ein schönes Beispiel für einen entsprechenden Dialog habe ich unter http://www.peetersonline.nl/index.php/powershell/powershell-open-file-dialog-box/ gefunden.

Das dortige Skript nutzt den FileOpen-Dialog, d.h. die Datei muss vorhanden sein. Mit sehr wenig Aufwand lässt sich auch ein entsprechender Dialog zum Speichern basteln:

# Select-FileDialog Function  #
# Created by Hugo Peeters     #
# http://www.peetersonline.nl #
# modified by Uwe Ziegenhagen for SAVE #
###############################
# Note: store in your profile for easy use
# Example use:
# $file = Select-FileDialog -Title "Select a file" 
# -Directory "D:\scripts" -Filter "Powershell Scripts|(*.ps1)"
 
function Select-FileDialog
{
  param([string]$Title,[string]$Directory,[string]$Filter="All Files (*.*)|*.*")
     [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
# UZ: replaced OpenFileDialog by SaveFileDialog
$objForm = New-Object System.Windows.Forms.SaveFileDialog
$objForm.InitialDirectory = $Directory
$objForm.Filter = $Filter
$objForm.Title = $Title
$Show = $objForm.ShowDialog()
If ($Show -eq "OK"){
                Return $objForm.FileName
}
Else {
      Write-Error "Operation cancelled by user."
      }
}
$file = Select-FileDialog -Title "Select a file" -Directory "C:\" -Filter "All Files |(*.*)"
write-host $file

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Bücher zur Powershell

Ich habe mir ein paar Bücher zur Powershell geholt, die alle recht gut sind:

  • Windows Powershell – Für Administratoren und Power-User von Helma Spona
  • Windows Powershell Crashcurs von Peter Monadjemi
  • Windows Powershell – Konzepte, Praxiseinsatz und Erweiterungen von Holger Schwichtenberg

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Arduino Webserver

Quellcode für einen einfachen Arduino Webserver findet man unter http://arduino.cc/en/Tutorial/WebServer.

Ich werde mal versuchen, die Temperatur eines LM35 auszulesen und als Webseite bereitzustellen. Mit dem Twittern per Arduino klappt es heute nicht, die Connection wird verweigert.

Nachtrag:

Mit dem Webserver-Beispielcode und der getTemperatur() Funktion von Mats Vanselow war der Temperatur-Webserver in fünf Minuten erledigt. Als nächste werde ich einen Webclient zusammenbauen (basierend auf der Ethershield library), der die Temperatur ausliest und an eine PHP-Datenbank schickt. Sollte am Wochenende zu erledigen sein.

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Mit Powershell Outlook Accounts auflisten

Folgendes Skript liest alle Outlook Accounts mit dem Usernamen aus:

$outlook = new-object -com Outlook.Application
$namespace = $outlook.GetNamespace("MAPI")
foreach ($account in $namespace.Accounts) {
Write-Host $account.DisplayName ": " $account.UserName
}

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Mit Powershell E-Mails aus Outlook lesen

Momentan bastel ich noch an einem Skript, das mir E-Mails mit allen Attachments sauber auf die Festplatte speichert. Da mir noch wesentliche Kenntnisse der Outlook Architektur fehlen, ist es nicht ganz einfach. Im Moment scheitere ich noch daran, rekursiv durch alle Ordner durchzugehen und die Anzahl der enthaltenen E-Mails auszugeben. Folgendes Skript macht das nur bis zur zweiten Ebene.

$outlook = new-object -com Outlook.Application
$namespace = $outlook.GetNamespace("MAPI")
$inbox = $outlook.Session.GetDefaultFolder(6)
 
# iterate through folders
foreach ($folder in $namespace.Folders) {
    Write-Host $folder.name, $folder.count
 
foreach ($subfolder in $folder.Folders) {
    Write-Host "  >" $subfolder.name
 
}}

Die Anzahl der E-Mail bekomme ich für die Unterordner raus:

$outlook = new-object -com Outlook.Application
$namespace = $outlook.GetNamespace("MAPI")
 
# iterate through folders
foreach ($folder in $namespace.Folders) {
    Write-Host " " 	$folder.name " enthält " $folder.Items.Count 
 	foreach ($subfolder in $folder.Folders) {
    	Write-Host "   >" 	$subfolder.name " enthält " $subfolder.Items.Count 
}}

Dank Hilfe aus dem Internet habe ich jetzt folgenden funktionierenden Code:

$outlook = new-object -com Outlook.Application
$namespace = $outlook.GetNamespace("MAPI")
$inbox = $outlook.Session.GetDefaultFolder(6)
 
function Get-MailboxFolder($folder)
{   
    "{0}: {1}" -f $folder.name, $folder.items.count
 
    foreach ($f in $folder.folders)     {       
        Get-MailboxFolder $f       
    }   
}
 
# iterate through folders
foreach ($folder in $namespace.Folders) {
   Get-MailboxFolder $folder 
}

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website