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.dllGraphSharp.Controls.dllQuickGraph.dllWPFExtensions.dllThis sample shows you how toVisualize Data on the graphUpdate Graph using notificationsAdd menu items to graph objectAdd events to graph objectZoom in/out<Windowx: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:ActiveConverterx:Key="activeConverter"/><DataTemplateDataType="{x:Type local:SampleVertex}"><BorderBackground="{Binding Path=Active, Converter={StaticResource activeConv…

Free WPF Docking Library (like in Visual Studio)

Image

Python Reference

#import libraries importsys,os,shutil,glob,string,re,datetime #===================================== # IO Samples #===================================== #read file line by line f=open('text.txt','r') for line in f: printstring.split(line, '\n')[0] #remove linebreak #read file all at once f=open('text.txt','r') text = f.read() print(text) #current directory printos.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+nameprintDir(os.getcwd()) #create dir os.mkdir("Test") #delete dir os.remove("Test") #execute command os.system("mkdir x") #execute command line and return a result result = os.popen("ls").read() #wildcard file names print glob…

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 ToolkitCreate new WPF Project Add References to WPFTookit, WPFTookit.Design (DataGrid) Add Reference to System.Windows.Controls.DataVisualization.Toolkit (Chart) This is XAML<Windowx: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"><DockPanelLastChildFill="True"><toolkit:DataGridItemsSource="{Binding Path=Data}"Height="118"AutoGenerateColumns="False"DockPanel.Dock="Top"><toolkit:DataGrid.Columns><toolkit:DataGridTextColumnBinding="{Binding Date}"Hea…