•  
  • Uncategorized (30)

Architectural Patterns for Scalability

Categories: Uncategorized
Tags: No Tags
Comments: No Comments
Published on: December 20, 2011

In today’s computing one of the biggest challenge is scalability to deal with high volume traffics, big data and processes.

There are several architectural patterns for scalable distributed system some of which are as follows:

  1. Load Balancers: Load balancing is one of the easiest approach to provide some level of scalability. As well as hardware for load balancing, there are also software for it. In order for a load balancer to be implemented efficiently, units should have a shared nothing architecture. Once placed in front of application servers, load balancers distributes the load evenly across all the servers within the system. There are several load balancing algorithms, the most basic one is round robin. Some of other ones are based on some pattern, load balancing based on weighted graph and so on. Load balancing is a beautiful concept.
  2. Distributed Caching: Distributed Hash tables or caches are used in front of data storage for scaling up reads. Instead of querying data stores each time, querying an in memory caching system speed up applications. Some of the implementations are Memcached, Redis etc. Consistent hashing is used for in the clients. There is no notion of replication.
  3. Distributed Message Queues. Blocking Queue implementation (FIFO delivery) implemented as a network service. Distributed Message Queues are based on Producer/Consumer problem. There are several concepts with producer/consumer other known as publisher/subscriber pattern.  It is fairly easy to scale applications using this pattern.
  4. Gossip and Nature-inspired Architectures. Each node randomly pick and exchange information with follow nodes.
  5. Map Reduce/ Data flows. Scalable pattern to describe and execute Jobs.
  6. Tree of responsibility. Break the problem down recursively and assign to a tree, each parent node delegating work to children nodes.
  7. Stream processing. Process data streams, data that is keeps coming.
  8. Scalable Storages. Ranges from Databases, NoSQL storages, Service Registries, to File systems.

Floyd Cycle Finding Algorithms

Categories: Uncategorized
Tags: No Tags
Comments: No Comments
Published on: December 12, 2011

Floyd cycle finding algorithm is used to find a cycle within a collection, graph, or container. A simple example would help understand better. Given a linked list, detect if it contains a cycle or not. If you use two pointers, one of which will traverse the linked list, two nodes at a time and another pointer that will traverse the linked list one node at a time, eventually they will meet at the cycle.

C#- Implement a Stack with 2 Queue

Categories: Uncategorized
Tags: No Tags
Comments: 1 Comment
Published on: June 10, 2011

You can implement a stack with 2 queues and likewise you can implement a queue using 2 stacks. The idea is very straight forward. First push goes to the original queue. Following pushes triggers two actions, first, you dequeue from the original queue and enqueue them to the a second queue. OK while you are inserting an item to the first queue, you remove everything from first queue, and enqueue them to the second queue. then after inserting the element to the queue, you will dequeue everything from the second queue and enqueue them to the first queue again. and you ll keep the insertion order of the elements.

public class StackWithQueue
        {
            private readonly Queue _queue = new Queue();
            private readonly Queue _secondQueue = new Queue();

            public void Push(T data)
            {

                while(_queue.Count != 0)
                {
                    _secondQueue.Enqueue(_queue.Dequeue());
                }

                _queue.Enqueue(data);

                while(_secondQueue.Count != 0)
                {
                    _queue.Enqueue(_secondQueue.Dequeue());
                }
            }

            public T Pop()
            {
                return _queue.Dequeue();
            }

            public int Count()
            {
                return _queue.Count;
            }
        }

Multi Layer, Multi Player Distributed (Cluster or Grid) Game Architecture

Categories: Uncategorized
Tags: No Tags
Comments: No Comments
Published on: June 10, 2010

Multi Layer, Multi Player Distributed (Cluster or Grid) Game Architecture

Multi player games have been very popular since last couple years. Game companies are doing a good job
on scaling multiplayer games. There are two architectures that supports interactive systems : P2P and Client Server
which in this case is Client Multi Server. Both of the architectures can be used for developing such games.

Using P2P, the players can have a copy of the Virtual World and players which are online at a certain time, and players can
receive other players action and movements from the other players machines, this case is player machines uses IP-Multicast
, drawbacks for this schema is usage of bandwidth, if the players dont have powerful machines they wont be able to join the world,
and IP-Multicast is not well supported.

Using Client Multi server is yet another architecture that can be used for Multi player games, In this model we have
synchronization problem, each player in the same world would need to have the same set of data, and there can be collision,
it would be hard to detect all these, and it would increase the latency etc. In order to avoid this, load balancers can be placed
in front of the game servers, but then the game servers should be synchronized. Moreover these servers should be either very
powerful or there should be several servers that are doing the same job.

Both of the approaches have advantages and disadvantages. It s obvious that the network should be layered and distributed.
A Grid-enabled Multi-server Network Game Architecture paper, indicates
a new approach using gamelets on Grids which is pretty cool. I would use that one.

References :
A Grid-enabled Multi-server Network Game Architecture

http://i.cs.hku.hk/~clwang/papers/Gamelet-submitted-02-24-2004.pdf

Layered Game Architecture

http://bnrg.eecs.berkeley.edu/~randy/Courses/CS294.S02/White2.ppt

Contraposition rule in classical propositional logic

Categories: Uncategorized
Tags: No Tags
Comments: No Comments
Published on: April 24, 2010

Here is the contraposition rule in classical propositional logic :

( X -> Y ) = ( ~Y -> ~X)

= Equivalence
-> Implies
~ Not

IT jobs are back.

Categories: Uncategorized
Tags: No Tags
Comments: No Comments
Published on: April 19, 2010

I’ve been constantly getting many job offers. Seems like the IT jobs are back.

Good luck to folks who are hunting for jobs in IT.

TRedD—A database for tandem repeats over the edit distance

Categories: Algorithms, Uncategorized
Tags: No Tags
Comments: No Comments
Published on: April 13, 2010

A tandem repeat is a sequence of two or more approximate copies of a pattern. In DNA, tandem repeats are used for disease diagnosis, mapping studies, and human identity testing.

http://database.oxfordjournals.org/cgi/content/abstract/2010/0/baq003

Contributed to Professor Dina Sokol’s Project and working on this project for the last 2-3 years.

http://tandem.sci.brooklyn.cuny.edu/

Multimodal Sensing

Categories: Uncategorized
Tags: No Tags
Comments: No Comments
Published on: April 11, 2010

Research Seminar: Talk 8

Firat Atagun

April 6, 2010

Today’s talk was given by Professor Zhigang Zhu, which was about multimodal sensing. Multimodal sensing has many applications. Airborne surveillance, under-vehicle inspection, cargo inspection are a few of them. In terms of airborne surveillance, an air plane is equipped with one or more sensors and generate images along with it s flight path. For under vehicle inspection, a set of sensors can be mounted on the ground and when the vehicle passes through, a set of images and will captured and detect if there are any objects which might be malicious or harmful. For cargo inspection, using gamma-ray, the content of the shipment and inside the cargo entity, shipment can be scanned and analyzed.

Professor Zhu described rotation platform for electro optical and infrared sensors which are mounted on top of the platform. Sensors are rotation of the center of the platform instead of rotating optical center of the sensors. A view ray from one sensor can triangulate a point in 3D space using simple geometric calculations and can find out the distance of 3D points. This project aims to generate panoramic and multi-view images that can carry 3D information for detecting and tracking objects. The platform should be calibrated in order for this aim to be possible. It is essential to find the radius, focal length of each sensor, angle between two and many sensors, and building a relationship between sensor images.  After calibrating the platform, given any point in one image, corresponding points can be found in another image. After aligning the images, traditional detection and tracking algorithms can be applied.

Professor Zhu also talked about another project on remote voice detection using Laser Doppler Vibrometry. Traditional microphones have short ranges, which can detect and capture sounds only from a short distance. Vision aided Laser Doppler Vibrometry, long range voice detection can be done using principle of interferometry of the laser. This system is made with Laser Doppler Vibrometry, Pan-Tilt Unit, mirrot, and Pan-Tilt-Zoom camera. The principle is to use the mirror to aim the laser anywhere near the target, preferable a good reflective surface and obtain the voice signal using the principle of interferometry. The camera is used to find a good reflective surface. This system should also be calibrated. In this system, there 4 different coordinate systems, one for each device. Moreover, making sure that there are not too many interfering object between the system and the target in order to capture the voice in better quality. Because, interfering objects might cause low quality output. To get a good signal LDV needs to have a focused signal, since LDV doesn’t know where to focus the beam, the default manufacturer’s setting is to scan all ranges, which is time consuming. However, by getting the depth of a 3D point, the range of the search can be diminished by 10.

Even though this is a great research area that has many application to real life experiments and applications, such as security, medical and so forth, I don’t have much interest in this area.

Page speed and efficiency is also a factor for Google rank

Categories: Uncategorized
Tags: No Tags
Comments: No Comments
Published on: April 9, 2010

According to this article, google search results will be affected by page loading speed, latency etc. While I m not too sure, why google is doing it, i can provide a basic contradiction to such approach as, most of the web sites on a shared hosting environment, would rank lower? so from now on developers also need to take care of page loading speed, etc. while developing an application.

On the other news Apple bans flash apps and games from IPhone apps and games! As much as I dont like Apple products, I dont like their policies and politics either. Adobe was one of the reasons that people (Designers) used to buy apple computers, because of the old Apples hardware support etc. Still many people buy Apple computers for design and development of graphics, videos and music. By banning Adobe Flash from IPhone, and Adobe’s current reaction to this, certainly looks like there will be more arguments and problems between adobe and apple.

Personally, I never had any of the apple products and it s very unlikely that I will get one. I dont like the design and usability. I would go for Unix based OS, but I can always use any flavor of Linux or better use  FreeBSD.

Reading configuration values from App.config or web.config

Categories: Uncategorized
Tags: ,
Comments: No Comments
Published on: April 5, 2010

Get the DefaultCapacity Value from App.config or web.config as string.

string DefaultCapacity = ConfigurationSettings.AppSettings["DefaultCapacity"];

The above code is a deprecated. here is a newer implementation of reading from config file.

string DefaultCapacity = ConfigurationManager.AppSettings.Get(“DefaultCapacity“)

// App.config or web.cofig
<appSettings>
<add key=”DefaultCapacity” value=”1000″ />
</appSettings>

page 1 of 3»

Welcome , today is Tuesday, February 7, 2012

Bad Behavior has blocked 250 access attempts in the last 7 days.