Posts

Showing posts from March, 2013

How to hide generated javascript file in visual studio code

In this post I am going to show you a cool trick in visual studio code. Let's suppose you are writing typescript code in visual studio code and you want to hide generated javascript code.

Create .vscode folder in your folder and then create settings.json file and paste following code

{ "files.exclude": { "node_modules":true, "**/.git": true, "**/.DS_Store": true, "**/*.js.map": true, "**/*.js": {"when": "$(basename).ts"}     } }

Draw Fractal tree in wpf

Image
In this post I will show you how to draw Fractal tree in WPF.Before going to implementation details first go throw this link.

Algorithm:To draw a fractal tree is simple: Draw the trunkAt the end of the trunk, split by some angle and draw two branchesRepeat at the end of each branch until a sufficient level of branching is reached


Create a new WPF application and add following code




<Windowx:Class="HelloWorld.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"Height="350"Width="525">
<Grid>
<ViewboxStretch="Uniform">
<StackPanel>
<StackPanelOrientation="Horizontal"
Margin="5,5,5,0">
<ButtonName="btnStart"Click="btnStart_Click"
Width="50"Content="Start"/>
<TextBlockName="tbLabel"Margin="20,5,0,0"/>
</StackPanel&…

How to draw Sierpinski triangle in WPF

Image
In this post,I will show you how to draw Sierpinski triangle in wpf. Create a new WPF application and add foloowing code in MainWindow.xaml <Windowx:Class="Sierpinski.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="MainWindow"Height="350"Width="525"><Grid><ViewboxStretch="Uniform"><StackPanel><StackPanelOrientation="Horizontal"Margin="5,5,5,0"><ButtonName="btnStart"Click="btnStart_Click"Width="50"Content="Start"/><TextBlockName="tbLabel"Margin="20,5,0,0"/></StackPanel><CanvasName="canvas1"Width="300"Height="300"Margin="5"/></StackPanel></Viewbox></Grid></Window>Open MainWindow.xaml.cs and add following code into itusing System; using S…