Posts

Showing posts from 2010

Active Directory Lookup Window

%windir%\system32\rundll32.exe dsquery.dll,OpenQueryWindow

Graph# – WPF Graph Layout Framework

Image
Download Graph# Add References to GraphSharp.dll GraphSharp.Controls.dll QuickGraph.dll WPFExtensions.dll This sample shows you how to Visualize Data on the graph Update Graph using notifications Add menu items to graph object Add events to graph object Zoom in/out < Window x : Class = "Samples.TestGraph.Window1" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns : x = "http://schemas.microsoft.com/winfx/2006/xaml" xmlns : graphsharp = "clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls" xmlns : zoom = "clr-namespace:WPFExtensions.Controls;assembly=WPFExtensions" xmlns : local = "clr-namespace:Samples.TestGraph" Title = "Window1" Height = "335" Width = "592" > < Grid > < Grid.Resources > < local : ActiveConverter x : K

Free WPF Docking Library (like in Visual Studio)

Image
AvalonDock http://avalondock.codeplex.com/ Getting Started Tutorial

Python Reference

# import libraries import sys , os ,shutil,glob, string , re ,datetime #===================================== # IO Samples #===================================== # read file line by line f= open ('text.txt','r') for line in f: print string . split (line, '\n')[0] #remove linebreak # read file all at once f= open ('text.txt','r') text = f. read () print (text) #current directory print os .getcwd() #list files/folders in current directory for file in os .listdir( os .getcwd()): print file # print directory structure def printDir( path ,indent): for root, dirs, files in os .walk( path ): for name in dirs: print indent+ name printDir( os . path . join (root, name ),indent+" ") for name in files: print indent+ name printDir( os .getcwd()) #create dir os .mkdir(" Test ") #delete dir os .remove(" Test ") #execute command os .system(" mkdir x ") #exe

C# List sorting

DirectoryInfo dir = new DirectoryInfo(@" C:\temp "); List<FileInfo> files = new List<FileInfo>(dir.GetFiles()); files.Sort((x, y) => DateTime.Compare(x.LastWriteTime,y.LastWriteTime));

WPF Toolkit DataGrid & Chart example

Image
Download WPF Toolkit Create new WPF Project Add References to WPFTookit, WPFTookit.Design (DataGrid) Add Reference to System.Windows.Controls.DataVisualization.Toolkit (Chart) This is XAML < Window x : Class = "WpfDataGrid.Window2" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns : x = "http://schemas.microsoft.com/winfx/2006/xaml" xmlns : toolkit = "http://schemas.microsoft.com/wpf/2008/toolkit" xmlns : charting = "clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" Title = "WPF Toolkit DataGrid &amp; Chart" Height = "357" Width = "590" > < DockPanel LastChildFill = "True" > < toolkit : DataGrid ItemsSource = "{Binding Path=Data}" Height = "118" AutoGenerateColumns