Paul blog

Explaining thoughts and findings is a great way to learn

Browse by Tags

All Tags » c# (RSS)
Perspective camera animation on a cube in WPF 3D
I have started WPF 3D at my work. Actually, i wanted to make roll animation effect using WPF 3D. After some R&D, I came up with roll animation using 2D animation, which I described in my previous blog post. At first, I tried to make roll animation...
Creating a Roll animation effect in WPF
I know one picture can tell what the Roll animation looks like instead of writing many sentences. The animation looks like the following: Opacity masks allow us to make portions of a UIelement or visual either transparent or partially transparent. To...
Wheel Clockwise animation in WPF
This animation is like the Wheel Clockwise, 1 spoke, animation of MS power point. Some people also call this animation as Radial animation. This animation starts from a line, which points from the centre to top middle, and then it rotates 360 degrees...
How to pick numbers at random from a given set of numbers in c#
The Random class defined in the .NET Framework provides functionality to generate pseudo-random number. According to MSDN, the current implementation of the Random class is based on Donald E. Knuth's subtractive random number generator algorithm....
Posted: 08-04-2009 8:40 PM by Razan | with no comments
Filed under: ,
Creating marquee/scrolling text in WPF
A WPF marquee is a scrolling piece of text displayed either horizontally across or vertically down your container. Here i show you how to make a scrolling marquee using Canvas and TextBlock. I will show only left to right in code. However, you can achieve...
Making circle animation in WPF
This animation is like the circle animation of MS power point. You can set any geometry like ellipse geometry to define the visible region of a WPF UIelement type. To make it possible every WPF UIelement type has a clip property and you can set any geometry...
Posted: 08-01-2009 5:29 PM by Razan | with no comments
Filed under: , ,
How can we convert a local path to a UNC path in c#?
Uniform Naming Convention (UNC): According to wiki, UNC specifies a common syntax to describe the location of a network resource, such as a shared file, directory, or printer in Windows OS. In client-server development, we can send a server path to its...
Posted: 07-24-2009 9:27 PM by Razan | with no comments
Filed under: , ,
Testing server whether it is reachable or not in c#
In client server development, we need this feature in many situations including: When client starts before server, it should periodically check whether server is UP or not. As soon as it gets server is up, it will connect with it to do its own business...
Posted: 07-18-2009 1:46 PM by Razan | with no comments
Filed under: , ,
JavaScript VS C# threading model
We were developing an application, which emulates the functionality of a real time device. In this application, we need real time event; we pool the service by a certain time interval and need to send some key presses. Moreover, we have a large number...
A scheduler to process a list of requests by a specific number of threads in c#.
This scheduler is not a time-based scheduler. It schedules the user tasks according to scheduling policy; scheduling policy is First Come First Serve. It performs the following tasks:       It decides which request to execute...
IP address spoofing in c# using P/Invoke
According to Wiki, the term IP (Internet Protocol) address spoofing refers to the creation of IP packets with a forged (spoofed) source IP address with the purpose of concealing the identity of the sender or impersonating another computing system. For...
Posted: 04-24-2009 1:19 PM by Razan | with no comments
Filed under: , ,
Testing whether two IP addresses are in the same network using c#.
IPv4 address has two basic parts:  the network part and the host part. As we know, if network potions of two IPs are same, they are in the same network. By performing and operation between subnet mask and IP address, we can get the network portion...
Posted: 04-22-2009 2:14 PM by Razan | with no comments
Filed under: ,
Finding subnet mask from IP4 address using c#.
IP4 addresses are categorized into 5 classes. For the  first three classes we have predefined subnet mask. So if we can detect the class of an IP address , we can determine the corresponding subnet mask. The address ranges used for each class are...
Posted: 04-22-2009 2:07 PM by Razan | with no comments
Filed under: ,
Some thoughts about how we can make a thread safe class library
What is Thread safety? Thread safety is making sure that shared data (Global/static) of a program is modified by only one thread at a time without any deadlock , starvation , race condition so that program behaves correctly when its methods are called...
Posted: 04-04-2009 1:04 AM by Razan | with no comments
Filed under: ,
How can we get the first IP4 Address of the local machine in c#?
When we write client server or peer to peer application, a frequent task is to find the first IP4 address of local machine. A machine has multiple types of addresses besides IP4 and IP6. For this reason, we will first get the address list of the machine...
Posted: 03-27-2009 9:20 PM by Razan | with no comments
Filed under: ,